;/*FB_PKG_DELIM*/ __d("PerCustomerDataSharingModel",["WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a>4,l=a&15;r=((r<<4)+i)%t,r=((r<<4)+l)%t}return r}i.default=e}),66); __d("WABidiRangeData",[],(function(t,n,r,o,a,i){"use strict";var e=[65,26,32,26,73,1,11,1,5,1,6,23,24,31,32,449,451,7,21,2,16,5,14,1,130,4,6,2,4,4,5,1,7,1,2,3,4,1,2,20,21,83,84,140,147,166,167,38,40,49,55,-1,46,-1,2,-1,3,-1,3,-1,2,-56,64,-1,3,-1,2,-1,14,-48,82,-3,4,-101,116,-2,9,-2,12,-23,24,-30,57,-91,102,-58,67,-2,6,-3,4,-24,28,-1,10,-1,4,-1,6,-43,46,-119,167,55,56,1,2,4,12,4,5,3,10,10,12,29,30,2,3,8,10,2,4,22,23,7,8,1,4,4,7,4,10,2,4,2,3,1,9,1,5,2,3,3,7,12,14,7,8,2,7,1,2,6,10,2,4,22,23,7,8,2,3,2,3,2,6,3,27,4,5,1,8,10,12,3,4,1,13,1,2,9,10,3,4,22,23,7,8,2,3,5,8,4,12,1,2,2,5,1,16,2,6,11,19,1,9,2,3,8,10,2,4,22,23,7,8,2,3,5,8,2,3,1,7,2,4,2,12,1,5,2,3,3,7,18,29,1,2,6,9,3,4,4,7,2,3,1,2,2,5,2,5,3,6,12,16,2,3,2,5,3,4,3,6,1,7,1,15,13,27,3,4,8,9,3,4,23,24,16,19,1,4,4,23,3,8,2,6,10,17,1,8,2,3,11,12,3,4,23,24,10,11,5,8,8,9,3,4,2,11,2,9,1,2,2,6,10,11,2,17,11,12,3,4,41,43,4,9,3,4,3,4,2,6,14,18,26,28,2,3,18,21,24,25,9,10,1,3,7,15,3,9,8,14,10,12,3,15,48,49,2,14,7,15,13,50,2,3,1,2,5,6,24,25,1,2,10,11,2,11,1,3,5,6,1,10,10,12,4,36,24,26,27,28,1,2,1,6,10,11,36,54,1,6,1,3,5,54,8,9,6,7,13,50,45,49,1,7,1,3,2,4,25,27,4,7,16,20,13,14,2,4,6,7,15,16,40,41,1,6,1,3,377,378,4,6,7,8,1,2,4,6,41,42,4,6,33,34,4,6,7,8,1,2,4,6,15,16,57,58,4,6,67,72,29,32,16,32,86,88,6,9,639,640,26,31,89,96,13,14,4,18,18,21,2,11,18,32,13,14,3,18,52,54,1,8,8,9,2,13,7,8,1,4,10,48,10,16,89,96,5,7,34,35,1,6,70,80,31,35,4,6,3,7,2,3,6,19,40,42,5,16,44,48,26,32,11,48,23,25,2,5,56,57,1,10,1,2,2,10,6,19,10,16,10,16,14,100,48,49,1,6,1,2,5,6,9,13,27,36,9,14,32,36,2,4,1,4,56,57,1,3,3,4,1,4,2,10,48,56,2,7,15,18,60,67,43,45,11,22,1,14,1,8,4,5,6,7,3,5,1,6,192,256,278,280,6,8,38,40,6,8,8,9,1,2,1,2,1,2,31,33,53,54,7,8,1,4,3,4,7,10,4,6,6,10,13,18,3,4,7,24,1,1,-1,98,1,14,1,17,13,114,1,5,1,3,10,11,1,4,5,11,1,2,1,2,1,2,4,5,11,13,4,9,5,9,2,18,41,470,69,95,1,263,78,528,1,340,256,1024,47,48,47,48,133,139,4,7,2,14,38,39,1,6,1,3,56,63,2,17,23,32,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,557,3,28,9,13,2,3,5,7,5,9,86,92,3,4,90,91,4,9,43,44,94,95,48,96,45,48,48,64,28,31,50,65,12,16,167,171,99,101,31,32,6592,6656,20989,20992,1165,1232,317,320,28,48,47,64,30,32,80,82,6,48,102,103,55,57,9,51,13,14,3,4,4,5,25,27,1,9,8,16,52,64,68,78,12,36,13,14,38,46,25,36,2,13,30,36,48,49,2,6,2,4,16,17,11,15,7,8,25,26,41,47,2,4,2,13,3,4,8,9,1,3,10,12,32,33,51,52,1,4,2,4,5,7,1,2,1,25,17,19,8,19,6,8,6,8,6,15,7,8,7,8,58,64,117,118,2,3,4,7,10,16,11172,11184,23,27,49,2101,6766,6768,106,144,7,19,5,10,-1,2,-10,11,-532,534,-144,176,-13,14,-2,114,-143,177,26,32,26,37,89,92,6,8,6,8,6,8,3,38,12,13,26,27,19,20,2,3,15,17,14,48,123,128,1,2,1,5,45,48,9,86,2,67,45,176,29,32,49,96,36,45,30,35,38,48,30,31,37,41,14,56,158,160,10,16,36,40,36,40,40,48,52,63,1,145,311,320,22,32,8,160,-287,288,-225,228,-1,3,-5,9,-40,43,-4,5,-165,167,-82,89,-484,488,-8,18,-294,325,-44,46,-153,164,-175,175,1,2,54,69,7,31,10,28,49,53,2,4,7,18,1,3,25,32,10,19,36,41,1,10,18,26,35,36,3,14,52,61,10,14,2,3,16,17,20,31,18,19,28,31,2,3,1,3,6,72,7,8,1,2,4,5,15,16,11,17,47,48,3,16,10,18,2,3,8,10,2,4,22,23,7,8,2,3,5,8,3,4,4,6,2,4,3,5,1,7,1,6,7,163,56,64,2,5,1,2,21,22,1,2,3,33,51,57,1,2,4,6,1,3,4,12,10,176,50,56,4,6,1,3,27,63,51,59,2,3,1,3,4,15,10,48,43,44,1,2,2,8,1,2,1,8,10,64,27,32,2,6,1,10,16,208,47,56,1,3,1,101,83,95,8,10,1,3,8,9,2,3,30,31,2,6,1,2,4,5,3,12,10,80,8,10,42,50,4,5,4,31,1,7,2,4,40,46,2,6,8,17,1,7,2,5,46,59,1,3,9,38,57,320,9,10,38,52,8,18,29,32,32,57,1,8,1,3,1,76,7,8,2,3,38,59,1,10,10,16,6,7,2,3,37,41,2,3,1,2,1,8,10,320,19,21,4,187,1,16,21,63,923,1025,111,112,5,16,196,2944,1071,1072,9,4048,583,9216,569,576,31,32,10,14,2,98,30,37,1,11,48,55,15,25,10,11,7,8,21,26,19,707,91,192,75,80,56,67,13,77,2,3,1,13,2,16,6136,6144,1238,1280,9,8960,287,336,3,20,4,12,396,2704,107,112,13,16,9,16,10,12,1,3,1,4961,246,256,39,41,62,65,9,25,2,9,30,34,59,306,20,128,25,160,85,86,71,72,2,4,1,3,2,4,4,5,12,13,1,2,7,8,65,66,4,6,8,9,7,8,28,29,4,5,5,6,1,4,7,8,340,342,51,52,57,58,57,58,57,58,57,58,8,60,512,567,4,54,8,9,14,15,7,1659,45,55,7,9,10,14,2,370,44,48,10,1296,-208,215,-109,116,-1445,1447,-270,542,31,32,58,64,61,118,29,42,44,48,9,16,2,3504,42718,42752,4149,4160,222,224,5762,5776,7473,10576,542,2048,4939,786432,65534,65536,65534];i.DATA=e}),66); __d("WABidi",["WABidiRangeData"],(function(t,n,r,o,a,i){"use strict";var e,l;function s(){if(!e){var t=n("WABidiRangeData").DATA,r=t.length/2;e=new Int32Array(r),l=new Int32Array(r);for(var o=0,a=0;o>1;if(e[c]>r)u=c-1|0;else if(e[c+1]>r){u=c;break}else i=c+1|0}var d=l[u],m=e[u]+Math.abs(d)|0;if(r=this.$14(t)},o.$8=function(t){if(!this.$5.has(t)){var e=new(r("WAPriorityQueue"))(function(e){return e.priority});this.$5.set(t,e)}return r("WANullthrows")(this.$5.get(t))},o.$14=function(t){var e=this.$2[t];return e==null?1/0:e},t})();l.default=s}),98); __d("WACrypto",["Promise","WAArrayBufferUtils","WABase64","WABinary","WACryptoAesCbc","WACryptoHmac","WALogger","err"],(function(t,n,r,o,a,i,l){"use strict";var e,s;function u(e,t,n){return o("WACryptoAesCbc").aesCbcEncrypt(e,new Uint8Array(n)).then(function(e){return o("WACryptoHmac").hmacSha256(t,e).then(function(t){return o("WABinary").Binary.build(t,e).readBuffer()})})}function c(t,a,i){return(s||(s=n("Promise"))).resolve(new Uint8Array(i)).then(function(n){var i=o("WABase64").encodeB64(n.subarray(0,32)),l=n.subarray(32);return o("WACryptoHmac").hmacSha256(a,l).then(function(n){var a=o("WABase64").encodeB64(n);if(i!==a)throw o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["crypto:macAndDecrypt HMAC don't match "," vs. ",""])),i,a),r("err")("macAndDecrypt HMAC mismatch");return o("WACryptoAesCbc").aesCbcDecryptSplit(t,l)})})}function d(e,t){var n=e.slice(-t.byteLength);return o("WAArrayBufferUtils").arrayBuffersEqualUNSAFE(n,t)?e.slice(0,e.byteLength-t.byteLength):e}l.encryptAndMac=u,l.macAndDecrypt=c,l.removeEncryptedPadding=d}),98); __d("WACryptoLtHash",["Promise","WACryptoHkdf","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s=2,u=128,c=new ArrayBuffer(u),d=(function(){function t(e){this.salt=e}var r=t.prototype;return r.add=function(r,o){var t=this;return o.reduce((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,n){return t.$1(yield e,n)});return function(t,n){return e.apply(this,arguments)}})(),(e||(e=n("Promise"))).resolve(r))},r.subtract=function(r,o){var t=this;return o.reduce((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,n){return t.$2(yield e,n)});return function(t,n){return e.apply(this,arguments)}})(),(e||(e=n("Promise"))).resolve(r))},r.subtractThenAdd=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield this.subtract(e,n),o=yield this.add(r,t);return{ltHash:o,subtractResult:r}});function t(t,n,r){return e.apply(this,arguments)}return t})(),r.$1=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WACryptoHkdf").extractAndExpand(t,this.salt,u);return this.performPointwiseWithOverflow(e,n,function(e,t){return e+t})});function t(t,n){return e.apply(this,arguments)}return t})(),r.$2=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WACryptoHkdf").extractAndExpand(t,this.salt,u);return this.performPointwiseWithOverflow(e,n,function(e,t){return e-t})});function t(t,n){return e.apply(this,arguments)}return t})(),r.performPointwiseWithOverflow=function(t,n,r){for(var e=new DataView(t),o=new DataView(n),a=new ArrayBuffer(e.byteLength),i=new DataView(a),l=0;l0&&e.$2[0]===i&&e.$2.shift()})},a.cancelAll=function(t){this.$4=t,this.$2=[],this.$3.abort(),this.$3=new AbortController},t})();l.default=s}),98); __d("WAIsMediaKeyReusable",["WATimeUtils"],(function(t,n,r,o,a,i,l){"use strict";var e=2*o("WATimeUtils").DAY_SECONDS;function s(t){var n=Math.floor(Math.random()*o("WATimeUtils").DAY_SECONDS);return t!=null&&o("WATimeUtils").happenedWithin(t,e+n)}l.MMS_MEDIA_KEY_TTL=e,l.isMediaKeyReusable=s}),98); __d("WAMediaCalculateFilehash",["WACryptoDependencies","WACryptoSha256"],(function(t,n,r,o,a,i,l){"use strict";function e(e){return o("WACryptoSha256").sha256Base64(e)}function s(){var e=o("WACryptoDependencies").getCrypto().getRandomValues(new Uint8Array(20)),t=e.buffer;return o("WACryptoSha256").sha256Base64(t)}l.calculateFilehash=e,l.getRandomFilehash=s}),98); __d("WAPlatformEstimate",["WAFPUtils","WAWebWamEnumBrowserEngineName","WAWebWamEnumPlatformName","countWhere"],(function(t,n,r,o,a,i,l){"use strict";function e(){var e,t,n,a,i,l,s;if(o("WAFPUtils").DETECTED_BROWSER_ENGINE!==o("WAWebWamEnumBrowserEngineName").BROWSER_ENGINE_NAME.BLINK)return o("WAWebWamEnumPlatformName").PLATFORM_NAME.UNKNOWN;var u="getVideoPlaybackQuality"in HTMLVideoElement.prototype,c=(e=CSS)==null?void 0:e.supports("color-scheme: initial"),d=(t=CSS)==null?void 0:t.supports("appearance: initial"),m="DisplayNames"in Intl,p=(n=CSS)==null?void 0:n.supports("aspect-ratio: initial"),_=(a=CSS)==null?void 0:a.supports("border-end-end-radius: initial"),f="randomUUID"in crypto,g="downlinkMax"in(((i=navigator.connection)==null?void 0:i.prototype)||{}),h="setAppBadge"in Navigator.prototype,y=function(t){return t in window},C=function(t,n){return t?n:!1},b=(l={},l[o("WAFPUtils").Platforms.ANDROID]=[C(p,y("BarcodeDetector")),C(d,y("ContentIndex")),C(u,y("ContactsManager")),g,C(f,!y("EyeDropper")),C(m,!y("FileSystemWritableFileStream")),C(_,!(y("HID")&&y("HIDDevice"))),C(_,!(y("Serial")&&y("SerialPort"))),!y("SharedWorker"),y("ontouchstart")&&y("TouchEvent"),C(c,!h)],l[o("WAFPUtils").Platforms.CHROME_OS]=[C(p,y("BarcodeDetector")),C(d,!y("ContentIndex")),C(u,!y("ContactsManager")),g,C(f,y("EyeDropper")),C(m,y("FileSystemWritableFileStream")),C(_,y("HID")&&y("HIDDevice")),C(_,y("Serial")&&y("SerialPort")),y("SharedWorker"),C(c,!h)],l[o("WAFPUtils").Platforms.WINDOWS]=[C(p,!y("BarcodeDetector")),C(d,!y("ContentIndex")),C(u,!y("ContactsManager")),!g,C(f,y("EyeDropper")),C(m,y("FileSystemWritableFileStream")),C(_,y("HID")&&y("HIDDevice")),C(_,y("Serial")&&y("SerialPort")),y("SharedWorker"),C(c,h)],l[o("WAFPUtils").Platforms.MAC]=[C(p,y("BarcodeDetector")),C(d,!y("ContentIndex")),C(u,!y("ContactsManager")),!g,C(f,y("EyeDropper")),C(m,y("FileSystemWritableFileStream")),C(_,y("HID")&&y("HIDDevice")),C(_,y("Serial")&&y("SerialPort")),y("SharedWorker"),!(y("ontouchstart")&&y("TouchEvent")),C(c,h)],l[o("WAFPUtils").Platforms.LINUX]=[C(p,!y("BarcodeDetector")),C(d,!y("ContentIndex")),C(u,!y("ContactsManager")),!g,C(f,y("EyeDropper")),C(m,y("FileSystemWritableFileStream")),C(_,y("HID")&&y("HIDDevice")),C(_,y("Serial")&&y("SerialPort")),y("SharedWorker"),!(y("ontouchstart")&&y("TouchEvent")),C(c,!h)],l[o("WAFPUtils").Platforms.UNKNOWN]=[!1],l),v=Object.keys(b).reduce(function(e,t){var n,a=b[(n=o("WAFPUtils").Platforms.cast(t))!=null?n:o("WAFPUtils").Platforms.UNKNOWN],i=+(r("countWhere")(a,function(e){return e})/a.length).toFixed(2);return e[t]=i,e},{}),S=Object.keys(v).reduce(function(e,t){return v[e]>v[t]?e:t});return o("WAFPUtils").castPlatformNameToWamEnum((s=o("WAFPUtils").Platforms.cast(S))!=null?s:o("WAFPUtils").Platforms.UNKNOWN)}l.default=e}),98); __d("WAPromiseProps",["Promise"],(function(t,n,r,o,a,i){"use strict";var e;function l(t){var r=Object.keys(t),o=(e||(e=n("Promise"))).all(r.map(function(e){return t[e]}));function a(e){for(var t={},n=0;n>>0,r=arguments[1],o=r>>0,a=o<0?Math.max(n+o,0):Math.min(o,n),i=arguments[2],l=i===void 0?n:i>>0,s=l<0?Math.max(n+l,0):Math.min(l,n);a>>0;return r===0?32:31-(e(r)/t|0)|0}})(Math.log,Math.LN2));var e=Math.imul,l=ArrayBuffer.isView,s=Math.clz32;_n(d,"CharSequence"),dn(m,"Number"),dn(N,"Char"),_n(w,"Collection"),_n(M,"List",Dn,Dn,[w]),yn(A);function u(){return st(this)}_n(B,"Set",Dn,Dn,[w]),_n(W,"Entry"),_n(q,"Map"),yn(U),dn(G,"Enum"),yn(j),dn(X,"Long",Dn,m),_n(ne,"FunctionAdapter"),dn(mt,"JsSetView",mt,Set),pn(Wn,"Digit"),_n(Vn,"Comparator"),pn(zn,"Unit"),dn(Ba,"AbstractCollection",Dn,Dn,[w]),dn(er,"AbstractMutableCollection",Dn,Ba,[Ba,w]),dn(tr,"IteratorImpl"),dn(nr,"AbstractMutableList",Dn,er,[er,M,w]),dn(rr,"AbstractMutableSet",Dn,er,[er,B,w]),yn(lr),dn(gr,"ArrayList",dr,nr,[nr,M,w]),dn(Rr,"HashSet",Cr,rr,[rr,B,w]),yn(jr),dn(Xr,"Itr"),dn(Yr,"KeysItr",Dn,Xr),dn(Jr,"EntriesItr",Dn,Xr),dn(Zr,"EntryRef",Dn,Dn,[W]);function c(e){var t;e:{var n;if(En(e,w)?n=e.j():n=!1,n){t=!0;break e}for(var r=e.f();r.g();){var o=r.h(),a=o,i;if(a!=null&&En(a,W)?i=this.t3(a):i=!1,!i){t=!1;break e}}t=!0}return t}_n(to,"InternalMap"),dn(eo,"InternalHashMap",Tr,Dn,[to]),pn(uo,"EmptyHolder"),dn(po,"LinkedHashSet",ro,Rr,[Rr,B,w]),dn(yo,"Exception",fo,Error),dn(Ao,"RuntimeException",No,yo),dn(Ro,"IllegalArgumentException",bo,Ao),dn(To,"IllegalStateException",Eo,Ao),dn($o,"UnsupportedOperationException",xo,Ao),dn(Bo,"NoSuchElementException",Oo,Ao),dn(Ho,"IndexOutOfBoundsException",qo,Ao),dn(Qo,"NumberFormatException",zo,Ro),dn(ea,"ConcurrentModificationException",Yo,Ao),dn(ra,"NullPointerException",na,Ao),dn(ia,"NoWhenBranchMatchedException",aa,Ao),dn(ua,"ClassCastException",sa,Ao),dn(_a,"CharacterCodingException",pa,yo),dn(Ca,"StringBuilder",ya,Dn,[d]),dn(Ia,"sam$kotlin_Comparator$0",Dn,Dn,[Vn,ne]),dn(Wa,"IteratorImpl"),yn(qa),dn(Ha,"AbstractList",Dn,Ba,[Ba,M]),yn(Ga),pn(Xa,"EmptyIterator"),pn(Za,"EmptyList",Dn,Dn,[M]),pn(oi,"EmptySet",Dn,Dn,[B]),dn(ui,"EnumEntriesList",Dn,Ha,[M,Ha]);function d(){}function m(){}function p(e){switch(e.length){case 0:return ri();case 1:return Yn(e[0]);default:return f(e,io(e.length))}}function _(e,t){if(!(t>=0)){var n="Requested element count "+t+" is less than zero.";throw So(Ot(n))}if(t===0)return Qa();var r=e.length;if(t>=r)return g(e);if(t===1)return Xn(e[r-1|0]);var o=pr(t),a=r-t|0;if(a1&&t.e(n),a<0||s<=a)ci(t,d,l);else break e}return a>=0&&s>a&&t.e(i),t.e(o),t}function v(e,t){return 0<=t&&t<=(e.length-1|0)?e[t]:null}function S(e,t,n,r,o,a,i){return t=t===Dn?", ":t,n=n===Dn?"":n,r=r===Dn?"":r,o=o===Dn?-1:o,a=a===Dn?"...":a,i=i===Dn?null:i,R(e,ya(),t,n,r,o,a,i).toString()}function R(e,t,n,r,o,a,i,l){n=n===Dn?", ":n,r=r===Dn?"":r,o=o===Dn?"":o,a=a===Dn?-1:a,i=i===Dn?"...":i,l=l===Dn?null:l,t.e(r);var s=0,u=e.f();e:for(;u.g();){var c=u.h();if(s=s+1|0,s>1&&t.e(n),a<0||s<=a)ci(t,c,l);else break e}return a>=0&&s>a&&t.e(i),t.e(o),t}function L(e){for(var t=new Int8Array(e.i()),n=0,r=e.f();r.g();){var o=r.h(),a=n;n=a+1|0,t[a]=o}return t}function E(e,t){return et?t:e}function I(e){return e}function T(e){return e}function D(e,t){return e-t|0}function x(e,t){return e-t|0}function $(e){return e}function P(e){return String.fromCharCode(e)}function N(){}function M(){}function w(){}Yt(A).fromJsSet=function(e){return pt(e)};function A(){}var F;function O(){return F}function B(){}function W(){}function q(){}function U(){}var V;function H(){return V}function G(e,t){this.q_1=e,this.r_1=t}Yt(G).s=function(){return this.q_1},Yt(G).t=function(){return this.r_1},Yt(G).u=function(e){return It(this.r_1,e.r_1)},Yt(G).v=function(e){return this.u(e instanceof G?e:an())},Yt(G).equals=function(e){return this===e},Yt(G).hashCode=function(){return $t(this)},Yt(G).toString=function(){return this.q_1};function z(e){var t=e==null?null:Ot(e);return t==null?"null":t}function j(){K=this,this.w_1=new X(0,-2147483648),this.x_1=new X(-1,2147483647),this.y_1=8,this.z_1=64}var K;function Q(){return K==null&&new j,K}function X(e,t){Q(),m.call(this),this.a1_1=e,this.b1_1=t}Yt(X).c1=function(e){return De(this,e)},Yt(X).v=function(e){return this.c1(e instanceof X?e:an())},Yt(X).toString=function(){return qe(this,10)},Yt(X).equals=function(e){var t;return e instanceof X?t=Ue(this,e):t=!1,t},Yt(X).hashCode=function(){return Ve(this)},Yt(X).valueOf=function(){return We(this)};function Y(e){var t;return e<0?t=-e:t=e,t}function J(e){for(var t=1,n=[],r=0,o=e.length;rt&&(t=i)}return ee(t,n)}function Z(e){var t=e>>5,n=new Int32Array(t+1|0),r=e&31,o=1<>5;if(n>e.length)return!1;var r=t&31,o=1<>>16|0,r=e.b1_1&65535,o=e.a1_1>>>16|0,a=e.a1_1&65535,i=t.b1_1>>>16|0,l=t.b1_1&65535,s=t.a1_1>>>16|0,u=t.a1_1&65535,c=0,d=0,m=0,p=0;return p=p+(a+u|0)|0,m=m+(p>>>16|0)|0,p=p&65535,m=m+(o+s|0)|0,d=d+(m>>>16|0)|0,m=m&65535,d=d+(r+l|0)|0,c=c+(d>>>16|0)|0,d=d&65535,c=c+(n+i|0)|0,c=c&65535,new X(m<<16|p,c<<16|d)}function $e(e,t){return tt(),xe(e,Ke(t))}function Pe(t,n){if(tt(),ze(t))return he();if(ze(n))return he();if(Ue(t,Ee()))return je(n)?Ee():he();if(Ue(n,Ee()))return je(t)?Ee():he();if(Ge(t)){var r;return Ge(n)?r=Pe(Ke(t),Ke(n)):r=Ke(Pe(Ke(t),n)),r}else if(Ge(n))return Ke(Pe(t,Ke(n)));if(Qe(t,Ie())&&Qe(n,Ie()))return Xe(We(t)*We(n));var o=t.b1_1>>>16|0,a=t.b1_1&65535,i=t.a1_1>>>16|0,l=t.a1_1&65535,s=n.b1_1>>>16|0,u=n.b1_1&65535,c=n.a1_1>>>16|0,d=n.a1_1&65535,m=0,p=0,_=0,f=0;return f=f+e(l,d)|0,_=_+(f>>>16|0)|0,f=f&65535,_=_+e(i,d)|0,p=p+(_>>>16|0)|0,_=_&65535,_=_+e(l,c)|0,p=p+(_>>>16|0)|0,_=_&65535,p=p+e(a,d)|0,m=m+(p>>>16|0)|0,p=p&65535,p=p+e(i,c)|0,m=m+(p>>>16|0)|0,p=p&65535,p=p+e(l,u)|0,m=m+(p>>>16|0)|0,p=p&65535,m=m+(((e(o,d)+e(a,c)|0)+e(i,u)|0)+e(l,s)|0)|0,m=m&65535,new X(_<<16|f,m<<16|p)}function Ne(e,t){if(tt(),ze(t))throw ho("division by zero");if(ze(e))return he();if(Ue(e,Ee())){if(Ue(t,Ce())||Ue(t,ve()))return Ee();if(Ue(t,Ee()))return Ce();var n=we(e,1),r=Me(Ne(n,t),1);if(Ue(r,he()))return Ge(t)?Ce():ve();var o=$e(e,Pe(t,r));return xe(r,Ne(o,t))}else if(Ue(t,Ee()))return he();if(Ge(e)){var a;return Ge(t)?a=Ne(Ke(e),Ke(t)):a=Ke(Ne(Ke(e),t)),a}else if(Ge(t))return Ke(Ne(e,Ke(t)));for(var i=he(),l=e;Je(l,t);){for(var s=We(l)/We(t),u=Math.max(1,Math.floor(s)),c=Math.ceil(Math.log(u)/Math.LN2),d=c<=48?1:Math.pow(2,c-48),m=Xe(u),p=Pe(m,t);Ge(p)||Ye(p,l);)u=u-d,m=Xe(u),p=Pe(m,t);ze(m)&&(m=Ce()),i=xe(i,m),l=$e(l,p)}return i}function Me(e,t){tt();var n=t&63;return n===0?e:n<32?new X(e.a1_1<>>(32-n|0)|0)):new X(0,e.a1_1<<(n-32|0))}function we(e,t){tt();var n=t&63;return n===0?e:n<32?new X(e.a1_1>>>n|0|e.b1_1<<(32-n|0),e.b1_1>>n):new X(e.b1_1>>(n-32|0),e.b1_1>=0?0:-1)}function Ae(e,t){return tt(),new X(e.a1_1&t.a1_1,e.b1_1&t.b1_1)}function Fe(e){return tt(),new X(~e.a1_1,~e.b1_1)}function Oe(e){return tt(),bn(e.a1_1)}function Be(e){return tt(),e.a1_1}function We(e){return tt(),e.b1_1*4294967296+Ze(e)}function qe(e,t){if(tt(),ze(e))return"0";if(Ge(e))if(Ue(e,Ee())){var n=He(t),r=Ne(e,n),o=Be($e(Pe(r,n),e)),a=qe(r,t);return a+o.toString(t)}else return"-"+qe(Ke(e),t);for(var i=t===2?31:t<=10?9:t<=21?7:t<=35?6:5,l=Xe(Math.pow(t,i)),s=e,u="";;){var c=Ne(s,l),d=Be($e(s,Pe(c,l))),m=d.toString(t);if(s=c,ze(s))return m+u;for(;m.length=9223372036854776e3)return Re();if(e<0)return Ke(Xe(-e));var t=4294967296,n=e%t|0,r=e/t|0;return new X(n,r)}function Ye(e,t){return tt(),De(e,t)>0}function Je(e,t){return tt(),De(e,t)>=0}function Ze(e){return tt(),e.a1_1>=0?e.a1_1:4294967296+e.a1_1}var et;function tt(){et||(et=!0,ye=He(0),be=He(1),Se=He(-1),Le=new X(-1,2147483647),ke=new X(0,-2147483648),Te=He(16777216))}function nt(e,t){return e.charCodeAt(t)}function rt(e,t){var n=e,r=t;if(n===r)return!0;if(n==null||r==null||!Rn(r)||n.length!=r.length)return!1;var o=0,a=n.length;if(ot)n=1;else if(e===t){var r;if(e!==0)r=0;else{var o=1/e,a;o===1/t?a=0:o<0?a=-1:a=1,r=a}n=r}else e!==e?n=t!==t?0:1:n=-1;return n}function Dt(e,t){return et?1:0}function xt(e,t){return e.v(t)}function $t(e){return Pt(e)}function Pt(e){if(!("kotlinHashCodeValue$"in e)){var t=Nt(),n=new Object;n.value=t,n.enumerable=!1,Object.defineProperty(e,"kotlinHashCodeValue$",n)}return e.kotlinHashCodeValue$}function Nt(){return Math.random()*4294967296|0}function Mt(e){return e=e===Dn?null:e,Object.create(e)}function wt(e,t,n,r,o){return Object.defineProperty(e,t,{configurable:!0,get:n,set:r,enumerable:o})}function At(e,t){if(e==null)return t==null;if(t==null)return!1;if(typeof e=="object"&&typeof e.equals=="function")return e.equals(t);if(e!==e)return t!==t;if(typeof e=="number"&&typeof t=="number"){var n;if(e===t){var r;if(e!==0)r=!0;else{var o=1/e;r=o===1/t}n=r}else n=!1;return n}return e===t}function Ft(e){if(e==null)return 0;var t=typeof e,n;switch(t){case"object":n=typeof e.hashCode=="function"?e.hashCode():Pt(e);break;case"function":n=Pt(e);break;case"number":n=_e(e);break;case"boolean":n=Bt(e);break;case"string":n=Wt(String(e));break;case"bigint":n=qt(e);break;case"symbol":n=Ut(e);break;default:n=(function(){throw new Error("Unexpected typeof `"+t+"`")})();break}return n}function Ot(e){var t;return e==null?t="null":Rn(e)?t="[...]":typeof e.toString!="function"?t=Vt(e):t=e.toString(),t}function Bt(e){return e?1231:1237}function Wt(t){var n=0,r=t.length,o=0,a=r-1|0;if(o<=a)do{var i=o;o=o+1|0;var l=t.charCodeAt(i);n=e(n,31)+l|0}while(i!==a);return n}function qt(t){var n=BigInt(32),r=BigInt(4294967295),o=Y(t),a=0,i;t<0?i=-1:i=1;var l=i;e:for(;;){if(o==0)break e;var s=o&r,u=Number(s);a=e(31,a)+u|0,o=o>>n}return e(a,l)}function Ut(e){var t=Ht(e)?Gt():zt(),n=t.get(e);if(n!==Dn)return n;var r=Nt();return t.set(e,r),r}function Vt(e){return Object.prototype.toString.call(e)}function Ht(e){return(typeof Symbol=="function"?Symbol.keyFor:"@@keyFor")(e)!=Dn}function Gt(){return jt===Dn&&(jt=new Map),jt}function zt(){return Kt===Dn&&(Kt=new WeakMap),Kt}var jt,Kt;function Qt(e){var t="Should be lowered";throw Io(Ot(t))}function Xt(e,t){Error.captureStackTrace!=null?Error.captureStackTrace(e,t):e.stack=new Error().stack}function Yt(e){return e.prototype}function Jt(e,t){var n;if(Zt(e)){var r;if(Zt(t))r=e;else{var o=t==null?null:t.toString();r=o==null?Dn:o}n=r}else n=e==null?Dn:e;return n}function Zt(e){return e===Dn}function en(e,t,n){tn(e,"message",Jt(t,n)),tn(e,"cause",n),tn(e,"name",Object.getPrototypeOf(e).constructor.name)}function tn(e,t,n){Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})}function nn(e){var t;return e==null?rn():t=e,t}function rn(){throw na()}function on(){throw aa()}function an(){throw sa()}function ln(e){throw So(e)}function sn(e,t,n,r,o,a){var i=Dn,l=e==="interface"?un():Dn;return{kind:e,simpleName:t,associatedObjectKey:r,associatedObjects:o,suspendArity:a,$kClass$:i,defaultConstructor:n,iid:l}}function un(){return cn===Dn&&(cn=0),cn=cn+1|0,cn}var cn;function dn(e,t,n,r,o,a,i,l){var s="class";mn(s,e,t,n,r,o,a,i,l)}function mn(e,t,n,r,o,a,i,l,s){o!=null&&(t.prototype=Object.create(o.prototype),t.prototype.constructor=t);var u=sn(e,n,r,l,s,i);if(t.$metadata$=u,a!=null){var c=At(u.iid,Dn)?t.prototype:t;c.$imask$=J(a)}}function pn(e,t,n,r,o,a,i,l){var s="object";mn(s,e,t,n,r,o,a,i,l)}function _n(e,t,n,r,o,a,i,l){var s="interface";mn(s,e,t,n,r,o,a,i,l)}function fn(e,t,n,r){dn(e,"Lambda",Dn,t,n,r,Dn,Dn)}function gn(e,t,n,r){dn(e,"Coroutine",Dn,t,n,r,Dn,Dn)}function hn(e,t,n,r){dn(e,"FunctionReference",Dn,t,n,r,Dn,Dn)}function yn(e,t,n,r){pn(e,"Companion",Dn,t,n,r,Dn,Dn)}function Cn(e){var t=0,n=0,r=e.length-1|0;if(n<=r)do{var o=n;n=n+1|0;var a=t;t=a+e[o].length|0}while(o!==r);var i=e[0],l=new i.constructor(t);i.$type$!=null&&(l.$type$=i.$type$),t=0;var s=0,u=e.length-1|0;if(s<=u)do{var c=s;s=s+1|0;var d=e[c],m=0,p=d.length-1|0;if(m<=p)do{var _=m;m=m+1|0;var f=t;t=f+1|0,l[f]=d[_]}while(_!==p)}while(c!==u);return l}function bn(e){return e<<24>>24}function vn(e){var t;return e instanceof X?t=Be(e):t=Sn(e),t}function Sn(e){var t;return e>2147483647?t=2147483647:e<-2147483648?t=-2147483648:t=e|0,t}function Rn(e){return Ln(e)||l(e)}function Ln(e){return Array.isArray(e)}function En(e,t){return kn(e,t.$metadata$.iid)}function kn(e,t){var n=e.$imask$,r;if(n==null)return!1;r=n;var o=r;return te(o,t)}function In(e){return typeof e=="string"||En(e,d)}function Tn(){return $n(),Dn}var Dn,xn;function $n(){xn||(xn=!0,Dn=void 0)}function Pn(e,t){return rt(e,t)}function Nn(e){return ot(e)}function Mn(e,t,n){return Ua.h1(t,n,e.length),e.slice(t,n)}function wn(e,t){if(!(t>=0)){var n="Invalid new array size: "+t+".";throw So(Ot(n))}return ca(e,new Int8Array(t))}function An(e,t){if(!(t>=0)){var n="Invalid new array size: "+t+".";throw So(Ot(n))}return ca(e,new Int32Array(t))}function Fn(e,t){if(!(t>=0)){var n="Invalid new array size: "+t+".";throw So(Ot(n))}return da(e,t,null)}function On(e){var t=$(e),n=Bn(Un().i1_1,t),r=t-Un().i1_1[n]|0;return r<10?r:-1}function Bn(e,t){for(var n=0,r=e.length-1|0,o=-1,a=0;n<=r;)if(o=(n+r|0)/2|0,a=e[o],t>a)n=o+1|0;else{if(t===a)return o;r=o-1|0}return o-(t=0},Yt(nr).p1=function(e){var t;e:{for(var n=0,r=this.f();r.g();){var o=r.h();if(At(o,e)){t=n;break e}n=n+1|0}t=-1}return t},Yt(nr).equals=function(e){return e===this?!0:e!=null&&En(e,M)?Ua.q1(this,e):!1},Yt(nr).hashCode=function(){return Ua.r1(this)};function rr(){er.call(this)}Yt(rr).equals=function(e){return e===this?!0:e!=null&&En(e,B)?za.s1(this,e):!1},Yt(rr).hashCode=function(){return za.t1(this)};function or(e){if(!(e>=0)){var t="capacity must be non-negative.";throw So(Ot(t))}return Array(e)}function ar(e,t,n){e.fill(null,t,n)}function ir(e,t){return Fn(e,t)}function lr(){sr=this;var e=this,t=pr(0);t.c_1=!0,e.u1_1=t}var sr;function ur(){return sr==null&&new lr,sr}function cr(e){var t=[];return gr.call(e,t),e}function dr(){return cr(Mt(Yt(gr)))}function mr(e,t){var n=[];if(gr.call(t,n),!(e>=0)){var r="Negative initial capacity: "+e;throw So(Ot(r))}return t}function pr(e){return mr(e,Mt(Yt(gr)))}function _r(e,t){return Ua.v1(t,e.i()),t}function fr(e,t){return Ua.w1(t,e.i()),t}function gr(e){ur(),nr.call(this),this.b_1=e,this.c_1=!1}Yt(gr).i=function(){return this.b_1.length},Yt(gr).l=function(e){var t=this.b_1[_r(this,e)];return t==null||t!=null?t:an()},Yt(gr).d=function(e){return this.j1(),this.b_1.push(e),this.n1_1=this.n1_1+1|0,!0},Yt(gr).o1=function(e,t){this.j1(),this.b_1.splice(fr(this,e),0,t),this.n1_1=this.n1_1+1|0},Yt(gr).p1=function(e){return y(this.b_1,e)},Yt(gr).toString=function(){return at(this.b_1)},Yt(gr).x1=function(){return[].slice.call(this.b_1)},Yt(gr).toArray=function(){return this.x1()},Yt(gr).j1=function(){if(this.c_1)throw xo()};function hr(e,t){return rr.call(t),Rr.call(t),t.y1_1=e,t}function yr(e){return hr(Tr(),e),e}function Cr(){return yr(Mt(Yt(Rr)))}function br(e,t,n){return hr(Pr(e,t),n),n}function vr(e,t){return br(e,1,t),t}function Sr(e){return vr(e,Mt(Yt(Rr)))}Yt(Rr).d=function(e){return this.y1_1.z1(e,!0)==null},Yt(Rr).k=function(e){return this.y1_1.a2(e)},Yt(Rr).j=function(){return this.y1_1.i()===0},Yt(Rr).f=function(){return this.y1_1.b2()},Yt(Rr).i=function(){return this.y1_1.i()};function Rr(){}function Lr(t,n){return Gn(e(E(n,1),3))}function Er(e,t){return s(t)+1|0}function kr(e){if(e.m2_1.j2_1!==e.o2_1)throw Zo("The backing map has been modified after this entry was obtained.")}function Ir(e){return Dr(8,e),e}function Tr(){return Ir(Mt(Yt(eo)))}function Dr(e,t){return eo.call(t,or(e),null,new Int32Array(e),new Int32Array(Lr(Kr,e)),2,0),t}function xr(e){return Dr(e,Mt(Yt(eo)))}function $r(e,t,n){if(Dr(e,n),!(t>0)){var r="Non-positive load factor: "+t;throw So(Ot(r))}return n}function Pr(e,t){return $r(e,t,Mt(Yt(eo)))}function Nr(e){return e.c2_1.length}function Mr(e){return e.f2_1.length}function wr(e){e.j2_1=e.j2_1+1|0}function Ar(e,t){Fr(e,t)?qr(e,!0):Or(e,e.h2_1+t|0)}function Fr(e,t){var n=Nr(e)-e.h2_1|0,r=e.h2_1-e.i()|0;return n=t&&r>=(Nr(e)/4|0)}function Or(e,t){if(t<0)throw wo("too many elements");if(t>Nr(e)){var n=Ua.p2(Nr(e),t);e.c2_1=ir(e.c2_1,n);var r=e,o=e.d2_1;r.d2_1=o==null?null:ir(o,n),e.e2_1=An(e.e2_1,n);var a=Lr(Kr,n);a>Mr(e)&&Ur(e,a)}}function Br(e){var t=e.d2_1;if(t!=null)return t;var n=or(Nr(e));return e.d2_1=n,n}function Wr(t,n){return n==null?0:e(Ft(n),-1640531527)>>>t.i2_1|0}function qr(e,t){for(var n=0,r=0,o=e.d2_1;n=0&&(e.c2_1[r]=e.c2_1[n],o!=null&&(o[r]=o[n]),t&&(e.e2_1[r]=a,e.f2_1[a]=r+1|0),r=r+1|0),n=n+1|0}ar(e.c2_1,r,e.h2_1),o==null||ar(o,r,e.h2_1),e.h2_1=r}function Ur(e,t){wr(e),e.h2_1>e.k2_1&&qr(e,!1),e.f2_1=new Int32Array(t),e.i2_1=Er(Kr,t);for(var n=0;n0&&At(e.c2_1[o-1|0],t))return o-1|0;if(r=r-1|0,r<0)return-1;var a=n;n=a-1|0,a===0&&(n=Mr(e)-1|0)}}function Gr(t,n){t.q2();e:for(;;)for(var r=Wr(t,n),o=k(e(t.g2_1,2),Mr(t)/2|0),a=0;;){var i=t.f2_1[r];if(i<=0){if(t.h2_1>=Nr(t)){Ar(t,1);continue e}var l=t.h2_1;t.h2_1=l+1|0;var s=l;return t.c2_1[s]=n,t.e2_1[s]=r,t.f2_1[r]=s+1|0,t.k2_1=t.k2_1+1|0,wr(t),a>t.g2_1&&(t.g2_1=a),s}if(At(t.c2_1[i-1|0],n))return-i|0;if(a=a+1|0,a>o){Ur(t,e(Mr(t),2));continue e}var u=r;r=u-1|0,u===0&&(r=Mr(t)-1|0)}}function zr(e,t){return e.k2_1===t.i()&&e.r2(t.p())}function jr(){this.s2_1=-1640531527,this.t2_1=8,this.u2_1=2,this.v2_1=-1}var Kr;function Qr(){return Kr}function Xr(e){this.w2_1=e,this.x2_1=0,this.y2_1=-1,this.z2_1=this.w2_1.j2_1,this.a3()}Yt(Xr).a3=function(){for(;this.x2_1=this.w2_1.h2_1)throw Oo();var e=this,t=this.x2_1;this.x2_1=t+1|0,e.y2_1=t;var n=this.w2_1.c2_1[this.y2_1];return this.a3(),n};function Jr(e){Xr.call(this,e)}Yt(Jr).h=function(){if(this.b3(),this.x2_1>=this.w2_1.h2_1)throw Oo();var e=this,t=this.x2_1;this.x2_1=t+1|0,e.y2_1=t;var n=new Zr(this.w2_1,this.y2_1);return this.a3(),n},Yt(Jr).k3=function(){if(this.x2_1>=this.w2_1.h2_1)throw Oo();var e=this,t=this.x2_1;this.x2_1=t+1|0,e.y2_1=t;var n=this.w2_1.c2_1[this.y2_1],r=n==null?null:Ft(n),o=r==null?0:r,a=nn(this.w2_1.d2_1)[this.y2_1],i=a==null?null:Ft(a),l=o^(i==null?0:i);return this.a3(),l},Yt(Jr).l3=function(e){if(this.x2_1>=this.w2_1.h2_1)throw Oo();var t=this,n=this.x2_1;this.x2_1=n+1|0,t.y2_1=n;var r=this.w2_1.c2_1[this.y2_1];At(r,this.w2_1)?e.o3("(this Map)"):e.n3(r),e.p3(61);var o=nn(this.w2_1.d2_1)[this.y2_1];At(o,this.w2_1)?e.o3("(this Map)"):e.n3(o),this.a3()};function Zr(e,t){this.m2_1=e,this.n2_1=t,this.o2_1=this.m2_1.j2_1}Yt(Zr).n=function(){return kr(this),this.m2_1.c2_1[this.n2_1]},Yt(Zr).o=function(){return kr(this),nn(this.m2_1.d2_1)[this.n2_1]},Yt(Zr).equals=function(e){var t,n;return e!=null&&En(e,W)?n=At(e.n(),this.n()):n=!1,n?t=At(e.o(),this.o()):t=!1,t},Yt(Zr).hashCode=function(){var e=this.n(),t=e==null?null:Ft(e),n=t==null?0:t,r=this.o(),o=r==null?null:Ft(r);return n^(o==null?0:o)},Yt(Zr).toString=function(){return z(this.n())+"="+z(this.o())};function eo(e,t,n,r,o,a){this.c2_1=e,this.d2_1=t,this.e2_1=n,this.f2_1=r,this.g2_1=o,this.h2_1=a,this.i2_1=Er(Kr,Mr(this)),this.j2_1=0,this.k2_1=0,this.l2_1=!1}Yt(eo).i=function(){return this.k2_1},Yt(eo).q3=function(){this.q2(),this.l2_1=!0},Yt(eo).a2=function(e){return Hr(this,e)>=0},Yt(eo).z1=function(e,t){var n=Gr(this,e),r=Br(this);if(n<0){var o=r[(-n|0)-1|0];return r[(-n|0)-1|0]=t,o}else return r[n]=t,null},Yt(eo).equals=function(e){var t;if(e===this)t=!0;else{var n;e!=null&&En(e,q)?n=zr(this,e):n=!1,t=n}return t},Yt(eo).hashCode=function(){for(var e=0,t=this.r3();t.g();)e=e+t.k3()|0;return e},Yt(eo).toString=function(){var t=ga(2+e(this.k2_1,3)|0);t.o3("{");for(var n=0,r=this.r3();r.g();)n>0&&t.o3(", "),r.l3(t),n=n+1|0;return t.o3("}"),t.toString()},Yt(eo).q2=function(){if(this.l2_1)throw xo()},Yt(eo).s3=function(e){var t=Hr(this,e.n());return t<0?!1:At(nn(this.d2_1)[t],e.o())},Yt(eo).t3=function(e){return this.s3(En(e,W)?e:an())},Yt(eo).b2=function(){return new Yr(this)},Yt(eo).r3=function(){return new Jr(this)};function to(){}function no(e){return yr(e),po.call(e),e}function ro(){return no(Mt(Yt(po)))}function oo(e,t,n){return br(e,t,n),po.call(n),n}function ao(e,t){return oo(e,1,t),t}function io(e){return ao(e,Mt(Yt(po)))}function lo(e,t){return hr(e,t),po.call(t),t}function so(e){return lo(e,Mt(Yt(po)))}function uo(){co=this;var e=this,t=xr(0);t.q3(),e.u3_1=so(t)}var co;function mo(){return co==null&&new uo,co}Yt(po).f1=function(){return this.y1_1.q3(),this.i()>0?this:mo().u3_1};function po(){}function _o(e){return en(e),yo.call(e),e}function fo(){var e=_o(Mt(Yt(yo)));return Xt(e,fo),e}function go(e,t){return en(t,e),yo.call(t),t}function ho(e){var t=go(e,Mt(Yt(yo)));return Xt(t,ho),t}function yo(){Xt(this,yo)}function Co(e){return Po(e),Ro.call(e),e}function bo(){var e=Co(Mt(Yt(Ro)));return Xt(e,bo),e}function vo(e,t){return Mo(e,t),Ro.call(t),t}function So(e){var t=vo(e,Mt(Yt(Ro)));return Xt(t,So),t}function Ro(){Xt(this,Ro)}function Lo(e){return Po(e),To.call(e),e}function Eo(){var e=Lo(Mt(Yt(To)));return Xt(e,Eo),e}function ko(e,t){return Mo(e,t),To.call(t),t}function Io(e){var t=ko(e,Mt(Yt(To)));return Xt(t,Io),t}function To(){Xt(this,To)}function Do(e){return Po(e),$o.call(e),e}function xo(){var e=Do(Mt(Yt($o)));return Xt(e,xo),e}function $o(){Xt(this,$o)}function Po(e){return _o(e),Ao.call(e),e}function No(){var e=Po(Mt(Yt(Ao)));return Xt(e,No),e}function Mo(e,t){return go(e,t),Ao.call(t),t}function wo(e){var t=Mo(e,Mt(Yt(Ao)));return Xt(t,wo),t}function Ao(){Xt(this,Ao)}function Fo(e){return Po(e),Bo.call(e),e}function Oo(){var e=Fo(Mt(Yt(Bo)));return Xt(e,Oo),e}function Bo(){Xt(this,Bo)}function Wo(e){return Po(e),Ho.call(e),e}function qo(){var e=Wo(Mt(Yt(Ho)));return Xt(e,qo),e}function Uo(e,t){return Mo(e,t),Ho.call(t),t}function Vo(e){var t=Uo(e,Mt(Yt(Ho)));return Xt(t,Vo),t}function Ho(){Xt(this,Ho)}function Go(e){return Co(e),Qo.call(e),e}function zo(){var e=Go(Mt(Yt(Qo)));return Xt(e,zo),e}function jo(e,t){return vo(e,t),Qo.call(t),t}function Ko(e){var t=jo(e,Mt(Yt(Qo)));return Xt(t,Ko),t}function Qo(){Xt(this,Qo)}function Xo(e){return Po(e),ea.call(e),e}function Yo(){var e=Xo(Mt(Yt(ea)));return Xt(e,Yo),e}function Jo(e,t){return Mo(e,t),ea.call(t),t}function Zo(e){var t=Jo(e,Mt(Yt(ea)));return Xt(t,Zo),t}function ea(){Xt(this,ea)}function ta(e){return Po(e),ra.call(e),e}function na(){var e=ta(Mt(Yt(ra)));return Xt(e,na),e}function ra(){Xt(this,ra)}function oa(e){return Po(e),ia.call(e),e}function aa(){var e=oa(Mt(Yt(ia)));return Xt(e,aa),e}function ia(){Xt(this,ia)}function la(e){return Po(e),ua.call(e),e}function sa(){var e=la(Mt(Yt(ua)));return Xt(e,sa),e}function ua(){Xt(this,ua)}function ca(e,t){for(var n=e.length,r=t.length,o=0,a=t;oo)for(r.length=t;o1?e:nt(t,0)}function va(e){if(!(2<=e&&e<=36))throw So("radix "+e+" was not in valid range 2..36");return e}function Sa(e){var t=di(e),n;return t==null?mi(e):n=t,n}function Ra(e,t){var n=D(e,48)>=0&&D(e,57)<=0?x(e,48):D(e,65)>=0&&D(e,90)<=0?x(e,65)+10|0:D(e,97)>=0&&D(e,122)<=0?x(e,97)+10|0:D(e,128)<0?-1:D(e,65313)>=0&&D(e,65338)<=0?x(e,65313)+10|0:D(e,65345)>=0&&D(e,65370)<=0?x(e,65345)+10|0:On(e);return n>=t?-1:n}var La;function Ea(e,t,n){if(n=n===Dn?!1:n,xa(),n){var r=e.length,o=t.length,a=Math.min(r,o);if(a===0)return r-o|0;var i=0;if(i=0&&r<=t.length&&n<=r)){var a="Failed requirement.";throw So(Ot(a))}for(var i=new Int8Array(e(r-n|0,3)),l=0,s=n;s>6|192);var _=l;l=_+1|0,i[_]=bn(d&63|128)}else if(d<55296||d>=57344){var f=l;l=f+1|0,i[f]=bn(d>>12|224);var g=l;l=g+1|0,i[g]=bn(d>>6&63|128);var h=l;l=h+1|0,i[h]=bn(d&63|128)}else{var y=Ma(t,d,s,r,o);if(y<=0){var C=l;l=C+1|0,i[C]=$a()[0];var b=l;l=b+1|0,i[b]=$a()[1];var v=l;l=v+1|0,i[v]=$a()[2]}else{var S=l;l=S+1|0,i[S]=bn(y>>18|240);var R=l;l=R+1|0,i[R]=bn(y>>12&63|128);var L=l;l=L+1|0,i[L]=bn(y>>6&63|128);var E=l;l=E+1|0,i[E]=bn(y&63|128),s=s+1|0}}}return i.length===l?i:wn(i,l)}function Ma(e,t,n,r,o){if(Fa(),!(55296<=t&&t<=56319)||n>=r)return wa(0,n,o);var a=nt(e,n),i=$(a);return 56320<=i&&i<=57343?65536+((t&1023)<<10)|0|i&1023:wa(0,n,o)}function wa(e,t,n){if(Fa(),n)throw new _a("Malformed sequence starting at "+(t-1|0));return-e|0}var Aa;function Fa(){Aa||(Aa=!0,Pa=new Int8Array([-17,-65,-67]))}function Oa(e){return function(t){return t===e?"(this Collection)":z(t)}}function Ba(){}Yt(Ba).k=function(e){var t;e:{var n;if(En(this,w)?n=this.j():n=!1,n){t=!1;break e}for(var r=this.f();r.g();){var o=r.h();if(At(o,e)){t=!0;break e}}t=!1}return t},Yt(Ba).m=function(e){var t;e:{var n;if(En(e,w)?n=e.j():n=!1,n){t=!0;break e}for(var r=e.f();r.g();){var o=r.h();if(!this.k(o)){t=!1;break e}}t=!0}return t},Yt(Ba).j=function(){return this.i()===0},Yt(Ba).toString=function(){return S(this,", ","[","]",Dn,Dn,Oa(this))},Yt(Ba).toArray=function(){return Qn(this)};function Wa(e){this.a4_1=e,this.z3_1=0}Yt(Wa).g=function(){return this.z3_1=t)throw Vo("index: "+e+", size: "+t)},Yt(qa).w1=function(e,t){if(e<0||e>t)throw Vo("index: "+e+", size: "+t)},Yt(qa).h1=function(e,t,n){if(e<0||t>n)throw Vo("fromIndex: "+e+", toIndex: "+t+", size: "+n);if(e>t)throw So("fromIndex: "+e+" > toIndex: "+t)},Yt(qa).p2=function(e,t){var n=e+(e>>1)|0;return(n-t|0)<0&&(n=t),(n-2147483639|0)>0&&(n=t>2147483639?2147483647:2147483639),n},Yt(qa).r1=function(t){for(var n=1,r=t.f();r.g();){var o=r.h(),a=e(31,n),i=o==null?null:Ft(o);n=a+(i==null?0:i)|0}return n},Yt(qa).q1=function(e,t){if(e.i()!==t.i())return!1;for(var n=t.f(),r=e.f();r.g();){var o=r.h(),a=n.h();if(!At(o,a))return!1}return!0};var Ua;function Va(){return Ua}function Ha(){Ba.call(this)}Yt(Ha).f=function(){return new Wa(this)},Yt(Ha).equals=function(e){return e===this?!0:e!=null&&En(e,M)?Ua.q1(this,e):!1},Yt(Ha).hashCode=function(){return Ua.r1(this)};function Ga(){}Yt(Ga).t1=function(e){for(var t=0,n=e.f();n.g();){var r=n.h(),o=t,a=r==null?null:Ft(r);t=o+(a==null?0:a)|0}return t},Yt(Ga).s1=function(e,t){return e.i()!==t.i()?!1:e.m(t)};var za;function ja(){return za}function Ka(e){if(e.j())return[];for(var t=e.i(),n=Array(t),r=e.f(),o=0;r.g();){var a=o;o=a+1|0,n[a]=r.h()}return n}function Qa(){return ti()}function Xa(){}Yt(Xa).g=function(){return!1},Yt(Xa).h=function(){throw Oo()};var Ya;function Ja(){return Ya}function Za(){ei=this,this.b4_1=new X(-1478467534,-1720727600)}Yt(Za).equals=function(e){var t;return e!=null&&En(e,M)?t=e.j():t=!1,t},Yt(Za).hashCode=function(){return 1},Yt(Za).toString=function(){return"[]"},Yt(Za).i=function(){return 0},Yt(Za).j=function(){return!0},Yt(Za).f=function(){return Ya};var ei;function ti(){return ei==null&&new Za,ei}function ni(e){return p(e)}function ri(){return ii()}function oi(){ai=this,this.c4_1=new X(1993859828,793161749)}Yt(oi).equals=function(e){var t;return e!=null&&En(e,B)?t=e.j():t=!1,t},Yt(oi).hashCode=function(){return 0},Yt(oi).toString=function(){return"[]"},Yt(oi).i=function(){return 0},Yt(oi).j=function(){return!0},Yt(oi).d4=function(e){return!1},Yt(oi).k=function(e){return!1;var t},Yt(oi).e4=function(e){return e.j()},Yt(oi).m=function(e){return this.e4(e)},Yt(oi).f=function(){return Ya};var ai;function ii(){return ai==null&&new oi,ai}function li(e){return f(e,Sr(e.length))}function si(e){return new ui(e)}function ui(e){Ha.call(this),this.f4_1=e}Yt(ui).i=function(){return this.f4_1.length},Yt(ui).l=function(e){return Ua.v1(e,this.f4_1.length),this.f4_1[e]},Yt(ui).g4=function(e){if(e===null)return!1;var t=v(this.f4_1,e.r_1);return t===e},Yt(ui).k=function(e){return e instanceof G?this.g4(e instanceof G?e:an()):!1};function ci(e,t,n){n!=null?e.e(n(t)):t==null||In(t)?e.e(t):t instanceof N?e.p3(t.h4_1):e.e(Ot(t))}function di(e){return pi(e,10)}function mi(e){throw Ko("Invalid number format: '"+e+"'")}function pi(e,t){va(t);var n=e.length;if(n===0)return null;var r,o,a,i=nt(e,0);if(D(i,48)<0){if(n===1)return null;if(r=1,i===45)o=!0,a=new X(0,-2147483648);else if(i===43)o=!1,a=new X(1,-2147483648);else return null}else r=0,o=!1,a=new X(1,-2147483648);var l=new X(1,-2147483648),s=Ne(l,He(36)),u=s,c=new X(0,0),d=r;if(d32)i=o("kotlin-kotlin-stdlib").toByteArray3caw0hip00os(o("kotlin-kotlin-stdlib").takeLast725nefakqsdr(r,32));else{var l=new Int8Array(32),s=32-r.length|0,u=r.length,c=r;o("kotlin-kotlin-stdlib").arrayCopytctsywo3h7gj(c,l,s,0,u),i=l}return B.call(a,e,t,n,r,i),a}function w(e,t,n,r){return M(e,t,n,r,o("kotlin-kotlin-stdlib").objectCreate1ve4bgxiu4x98(o("kotlin-kotlin-stdlib").protoOf180f3jzyo7rfj(B)))}function A(){this.v4_1=32}var F;function O(){return F}function B(e,t,n,r,o){this.keyId=e,this.indexHash=t,this.operation=n,this.indexAndValueCipherText=r,this.mutationMac=o}e.protoOf180f3jzyo7rfj(B).w4=function(){return this.keyId},e.protoOf180f3jzyo7rfj(B).x4=function(){return this.indexHash},e.protoOf180f3jzyo7rfj(B).y4=function(){return this.operation},e.protoOf180f3jzyo7rfj(B).z4=function(){return this.indexAndValueCipherText},e.protoOf180f3jzyo7rfj(B).a5=function(){return this.mutationMac};function W(e,t,n,r,o,a){this.index=e,this.version=t,this.keyId=n,this.operation=r,this.value=o,this.mutationMac=a}e.protoOf180f3jzyo7rfj(W).b5=function(){return this.index},e.protoOf180f3jzyo7rfj(W).c5=function(){return this.version},e.protoOf180f3jzyo7rfj(W).w4=function(){return this.keyId},e.protoOf180f3jzyo7rfj(W).y4=function(){return this.operation},e.protoOf180f3jzyo7rfj(W).o=function(){return this.value},e.protoOf180f3jzyo7rfj(W).a5=function(){return this.mutationMac};function q(e,t){this.keyId=e,this.keyData=t}e.protoOf180f3jzyo7rfj(q).w4=function(){return this.keyId},e.protoOf180f3jzyo7rfj(q).d5=function(){return this.keyData};function U(e){this.bytes=e}e.protoOf180f3jzyo7rfj(U).e5=function(){return this.bytes},e.protoOf180f3jzyo7rfj(U).equals=function(e){var t;return e instanceof U?t=o("kotlin-kotlin-stdlib").contentEquals1cdp6c846cfdi(e.bytes,this.bytes):t=!1,t},e.protoOf180f3jzyo7rfj(U).hashCode=function(){return o("kotlin-kotlin-stdlib").contentHashCode25jw6rgkgywwr(this.bytes)};var V,H;function G(){return[X(),Y()]}function z(e){switch(e){case"Set":return X();case"Remove":return Y();default:K(),o("kotlin-kotlin-stdlib").THROW_IAE23kobfj9wdoxr("No enum constant com.whatsapp.kmp.syncd.syncdengine.cryptomanager.KmpSyncdCryptoMutationOperation."+e);break}}var j;function K(){if(j)return o("kotlin-kotlin-stdlib").Unit_instance1fbcbse1fwigr;j=!0,V=new Q("Set",0,1),H=new Q("Remove",1,2)}function Q(e,t,n){o("kotlin-kotlin-stdlib").Enum3alwj03lh1n41.call(this,e,t),this.h5_1=n}e.protoOf180f3jzyo7rfj(Q).asBytes=function(){return new Int8Array([this.h5_1])};function X(){return K(),V}function Y(){return K(),H}function J(){}function Z(){}function ee(){}function te(){}function ne(){this.i5_1="Data mac corrupt",this.j5_1="Index hash corrupt"}e.protoOf180f3jzyo7rfj(ne).k5=function(){return this.i5_1},e.protoOf180f3jzyo7rfj(ne).l5=function(){return this.j5_1};var re;function oe(){return re}function ae(e,t){e=e===o("kotlin-kotlin-stdlib").VOID3gxj6tk5isa35?null:e,t=t===o("kotlin-kotlin-stdlib").VOID3gxj6tk5isa35?null:t,o("kotlin-kotlin-stdlib").Exception_init_$Init$7nmtst2tre47(this),o("kotlin-kotlin-stdlib").captureStack1fzi4aczwc4hg(this,ae),this.m5_1=e,this.n5_1=t,delete this.message,delete this.cause}e.protoOf180f3jzyo7rfj(ae).v3=function(){return this.m5_1},e.protoOf180f3jzyo7rfj(ae).w3=function(){return this.n5_1};function ie(e){o("kotlin-kotlin-stdlib").Exception_init_$Init$7nmtst2tre47(this),o("kotlin-kotlin-stdlib").captureStack1fzi4aczwc4hg(this,ie),this.o5_1=e,delete this.cause}e.protoOf180f3jzyo7rfj(ie).w3=function(){return this.o5_1};function le(e,t,n){t=t===o("kotlin-kotlin-stdlib").VOID3gxj6tk5isa35?"MalformedMutationException with reason="+e.toString():t,n=n===o("kotlin-kotlin-stdlib").VOID3gxj6tk5isa35?null:n,o("kotlin-kotlin-stdlib").Exception_init_$Init$7nmtst2tre47(this),o("kotlin-kotlin-stdlib").captureStack1fzi4aczwc4hg(this,le),this.reason=e,this.p5_1=t,this.q5_1=n,delete this.message,delete this.cause}e.protoOf180f3jzyo7rfj(le).r5=function(){return this.reason},e.protoOf180f3jzyo7rfj(le).v3=function(){return this.p5_1},e.protoOf180f3jzyo7rfj(le).w3=function(){return this.q5_1};var se,ue,ce,de,me,pe;function _e(){}e.protoOf180f3jzyo7rfj(_e).s5=function(e){var t=Ce(),n;e:{for(var r=t.f();r.g();){var a=r.h();if(a.code===e){n=a;break e}}n=null}var i=n,l;if(i==null)throw o("kotlin-kotlin-stdlib").IllegalArgumentException_init_$Create$3ewkh27kzt8z8("Unknown mutation exception reason: "+e);return l=i,l};var fe;function ge(){return fe}function he(){return[Ee(),ke(),Ie(),Te(),De(),xe()]}function ye(e){switch(e){case"UNPARSABLE":return Ee();case"MISSING_INDEX":return ke();case"MISSING_VALUE":return Ie();case"MISSING_VERSION":return Te();case"INVALID_INDEX_FORMAT":return De();case"MISSING_ACTION_TIMESTAMP":return xe();default:Se(),o("kotlin-kotlin-stdlib").THROW_IAE23kobfj9wdoxr("No enum constant com.whatsapp.kmp.syncd.syncdengine.exception.KmpSyncdMutationExceptionReason."+e);break}}function Ce(){return Re==null&&(Re=o("kotlin-kotlin-stdlib").enumEntries20mr21zbe3az4(he())),Re}function be(e){return fe.s5(e)}var ve;function Se(){if(ve)return o("kotlin-kotlin-stdlib").Unit_instance1fbcbse1fwigr;ve=!0,se=new Le("UNPARSABLE",0,0),ue=new Le("MISSING_INDEX",1,1),ce=new Le("MISSING_VALUE",2,2),de=new Le("MISSING_VERSION",3,3),me=new Le("INVALID_INDEX_FORMAT",4,4),pe=new Le("MISSING_ACTION_TIMESTAMP",5,7)}var Re;function Le(e,t,n){o("kotlin-kotlin-stdlib").Enum3alwj03lh1n41.call(this,e,t),this.code=n}e.protoOf180f3jzyo7rfj(Le).v5=function(){return this.code};function Ee(){return Se(),se}function ke(){return Se(),ue}function Ie(){return Se(),ce}function Te(){return Se(),de}function De(){return Se(),me}function xe(){return Se(),pe}function $e(){this.w5_1="Cipher text too short"}e.protoOf180f3jzyo7rfj($e).x5=function(){return this.w5_1};var Pe;function Ne(){return Pe}function Me(e){o("kotlin-kotlin-stdlib").Exception_init_$Init$7nmtst2tre47(this),o("kotlin-kotlin-stdlib").captureStack1fzi4aczwc4hg(this,Me),this.y5_1=e,delete this.message}e.protoOf180f3jzyo7rfj(Me).v3=function(){return this.y5_1};var we,Ae;function Fe(){return[Qe(),Xe()]}function Oe(e){switch(e){case"ENCRYPT":return Qe();case"DECRYPT":return Xe();default:We(),o("kotlin-kotlin-stdlib").THROW_IAE23kobfj9wdoxr("No enum constant com.whatsapp.kmp.syncd.syncdengine.utils.primitives.OpMode."+e);break}}var Be;function We(){if(Be)return o("kotlin-kotlin-stdlib").Unit_instance1fbcbse1fwigr;Be=!0,we=new qe("ENCRYPT",0),Ae=new qe("DECRYPT",1)}function qe(e,t){o("kotlin-kotlin-stdlib").Enum3alwj03lh1n41.call(this,e,t)}var Ue,Ve;function He(){return[Ye(),Je()]}function Ge(e){switch(e){case"HMAC_SHA_256":return Ye();case"HMAC_SHA_512":return Je();default:je(),o("kotlin-kotlin-stdlib").THROW_IAE23kobfj9wdoxr("No enum constant com.whatsapp.kmp.syncd.syncdengine.utils.primitives.MacAlgo."+e);break}}var ze;function je(){if(ze)return o("kotlin-kotlin-stdlib").Unit_instance1fbcbse1fwigr;ze=!0,Ue=new Ke("HMAC_SHA_256",0),Ve=new Ke("HMAC_SHA_512",1)}function Ke(e,t){o("kotlin-kotlin-stdlib").Enum3alwj03lh1n41.call(this,e,t)}function Qe(){return We(),we}function Xe(){return We(),Ae}function Ye(){return je(),Ue}function Je(){return je(),Ve}function Ze(e){this.d6_1=e}e.protoOf180f3jzyo7rfj(Ze).getForInternal=function(e){return this.d6_1.getForInternal(e)};function et(e){this.e6_1=e}e.protoOf180f3jzyo7rfj(et).createCipherText=function(e,t,n,r){return this.e6_1.createCipherText(e,t,n,r)},e.protoOf180f3jzyo7rfj(et).mac=function(e,t,n){return this.e6_1.mac(e,t,n)},e.protoOf180f3jzyo7rfj(et).generateRandomBytes=function(e){return this.e6_1.generateRandomBytes(e)},e.protoOf180f3jzyo7rfj(et).bytesToHexString=function(e){return this.e6_1.bytesToHexString(e)};function tt(e){this.f6_1=e}e.protoOf180f3jzyo7rfj(tt).createInternal=function(e,t,n,r){return this.f6_1.createInternal(e,t,n,r)};function nt(e){this.g6_1=e}e.protoOf180f3jzyo7rfj(nt).encodeMutationDataToSyncdActionData=function(e,t){return this.g6_1.encodeMutationDataToSyncdActionData(e,t)};function rt(e){return function(t){return e(t).toPromise()}}function ot(e){return e}function at(e){this.h6_1=e}e.protoOf180f3jzyo7rfj(at).i6=function(e){var t=this.h6_1.then(e);return new at(t)},e.protoOf180f3jzyo7rfj(at).j6=function(e){var t=this.h6_1.then(rt(e)),n=ot,r=t.then(n);return new at(r)},e.protoOf180f3jzyo7rfj(at).toPromise=function(){return this.h6_1};function it(){}var lt;function st(){return lt}function ut(e){this.keyData=e}e.protoOf180f3jzyo7rfj(ut).d5=function(){return this.keyData};function ct(e,t){return mt.call(t),t.k6_1=o("kotlin-kotlin-stdlib").toLongkk4waq8msp1k(e),t}function dt(e){return ct(e,o("kotlin-kotlin-stdlib").objectCreate1ve4bgxiu4x98(o("kotlin-kotlin-stdlib").protoOf180f3jzyo7rfj(mt)))}e.protoOf180f3jzyo7rfj(mt).o=function(){return this.k6_1},e.protoOf180f3jzyo7rfj(mt).toDecimalString=function(){return this.k6_1.toString()};function mt(){}e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(E),"name",e.protoOf180f3jzyo7rfj(E).s),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(E),"ordinal",e.protoOf180f3jzyo7rfj(E).t),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(Q),"name",e.protoOf180f3jzyo7rfj(Q).s),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(Q),"ordinal",e.protoOf180f3jzyo7rfj(Q).t),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(ae),"message",function(){return this.v3()}),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(ae),"cause",function(){return this.w3()}),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(ie),"cause",function(){return this.w3()}),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(le),"message",function(){return this.v3()}),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(le),"cause",function(){return this.w3()}),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(Le),"name",e.protoOf180f3jzyo7rfj(Le).s),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(Le),"ordinal",e.protoOf180f3jzyo7rfj(Le).t),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(Me),"message",function(){return this.v3()}),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(qe),"name",e.protoOf180f3jzyo7rfj(qe).s),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(qe),"ordinal",e.protoOf180f3jzyo7rfj(qe).t),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(Ke),"name",e.protoOf180f3jzyo7rfj(Ke).s),e.defineProp3ur6h3slcvq4x(e.protoOf180f3jzyo7rfj(Ke),"ordinal",e.protoOf180f3jzyo7rfj(Ke).t),e.protoOf180f3jzyo7rfj(Ze).getFor=s,e.protoOf180f3jzyo7rfj(tt).create=u,F=new A,re=new ne,fe=new _e,Pe=new $e,lt=new it,E.values=y,E.valueOf=C,E.fromString=b,e.defineProp3ur6h3slcvq4x(E,"Regular",k,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(E,"RegularLow",I,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(E,"RegularHigh",T,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(E,"CriticalBlock",D,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(E,"CriticalUnblockLow",x,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(E,"ALL_COLLECTIONS",v,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(E,"ALL_CRITICAL_COLLECTIONS",S,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(E,"Companion",h,e.VOID3gxj6tk5isa35,!0),B.createAndCalculateMutationMac=w,e.defineProp3ur6h3slcvq4x(B,"Companion",O,e.VOID3gxj6tk5isa35,!0),Q.values=G,Q.valueOf=z,e.defineProp3ur6h3slcvq4x(Q,"Set",X,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(Q,"Remove",Y,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(ae,"Companion",oe,e.VOID3gxj6tk5isa35,!0),Le.values=he,Le.valueOf=ye,Le.fromInt=be,e.defineProp3ur6h3slcvq4x(Le,"UNPARSABLE",Ee,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(Le,"MISSING_INDEX",ke,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(Le,"MISSING_VALUE",Ie,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(Le,"MISSING_VERSION",Te,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(Le,"INVALID_INDEX_FORMAT",De,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(Le,"MISSING_ACTION_TIMESTAMP",xe,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(Le,"Companion",ge,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(Me,"Companion",Ne,e.VOID3gxj6tk5isa35,!0),qe.values=Fe,qe.valueOf=Oe,e.defineProp3ur6h3slcvq4x(qe,"ENCRYPT",Qe,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(qe,"DECRYPT",Xe,e.VOID3gxj6tk5isa35,!0),Ke.values=He,Ke.valueOf=Ge,e.defineProp3ur6h3slcvq4x(Ke,"HMAC_SHA_256",Ye,e.VOID3gxj6tk5isa35,!0),e.defineProp3ur6h3slcvq4x(Ke,"HMAC_SHA_512",Je,e.VOID3gxj6tk5isa35,!0),mt.fromDecimalString=dt,l.KmpSyncdCollectionName=E,l.KmpSyncdCryptoActionData=P,l.KmpSyncdCryptoDerivedKeys=N,l.KmpSyncdCryptoEncryptedData=B,l.KmpSyncdCryptoMutationData=W,l.KmpSyncdCryptoMutationKey=q,l.KmpSyncdCryptoMutationKeyId=U,l.KmpSyncdCryptoMutationOperation=Q,l.KmpSyncdCipherException=ae,l.KmpSyncdKeyException=ie,l.KmpSyncdMutationException=le,l.KmpSyncdMutationExceptionReason=Le,l.KmpSyncdParseException=Me,l.OpMode=qe,l.MacAlgo=Ke,l.JsKmpDerivedSyncdKeysProviderImpl=Ze,l.JsKmpSyncdCryptoProviderImpl=et,l.JsKmpSyncdMutationDataFactoryImpl=tt,l.JsKmpSyncdProtobufProviderImpl=nt,l.KmpResult=at,l.KmpSyncdCryptoMutationKeyData=ut,l.KmpLong=mt,l.KmpSyncdCryptoEncryptedData2qzy9qni0hrm2=B,l.KmpSyncdCipherException1yr5ole70ur3d=ae,l.KmpSyncdParseException1owflwptcaobs=Me,l.MacAlgo_HMAC_SHA_256_getInstance3mchsdvnjagj8=Ye,l.MacAlgo_HMAC_SHA_512_getInstances0w60r7tu8vg=Je,l.OpMode_DECRYPT_getInstance1ub7qnw77sd5o=Xe,l.OpMode_ENCRYPT_getInstance1dfeme89me53k=Qe}),98); __d("wa-kmp-syncd-engine",["kotlin-kotlin-stdlib","wa-kmp-syncd-engine-interfaces"],(function(t,n,r,o,a,i,l){var e;(e=o("kotlin-kotlin-stdlib")).initMetadataForCompanion1wyw17z38v6ac(d),e.initMetadataForClassbxx6q50dy2s7(E,"KmpSyncdEncryptionManager"),e.initMetadataForClassbxx6q50dy2s7(k,"KmpSyncdMutationDataWithPlaintext");function s(e){var t;return new Int8Array([(t=o("kotlin-kotlin-stdlib")).convertToByte1epqhkuyxuz5a(t.bitwiseAnd2g7wmsfd45l12(t.shiftRight2cr6y79ufiihy(e,56),new t.Long2qws0ah9gnpki(255,0))),t.convertToByte1epqhkuyxuz5a(t.bitwiseAnd2g7wmsfd45l12(t.shiftRight2cr6y79ufiihy(e,48),new t.Long2qws0ah9gnpki(255,0))),t.convertToByte1epqhkuyxuz5a(t.bitwiseAnd2g7wmsfd45l12(t.shiftRight2cr6y79ufiihy(e,40),new t.Long2qws0ah9gnpki(255,0))),t.convertToByte1epqhkuyxuz5a(t.bitwiseAnd2g7wmsfd45l12(t.shiftRight2cr6y79ufiihy(e,32),new t.Long2qws0ah9gnpki(255,0))),t.convertToByte1epqhkuyxuz5a(t.bitwiseAnd2g7wmsfd45l12(t.shiftRight2cr6y79ufiihy(e,24),new t.Long2qws0ah9gnpki(255,0))),t.convertToByte1epqhkuyxuz5a(t.bitwiseAnd2g7wmsfd45l12(t.shiftRight2cr6y79ufiihy(e,16),new t.Long2qws0ah9gnpki(255,0))),t.convertToByte1epqhkuyxuz5a(t.bitwiseAnd2g7wmsfd45l12(t.shiftRight2cr6y79ufiihy(e,8),new t.Long2qws0ah9gnpki(255,0))),t.convertToByte1epqhkuyxuz5a(t.bitwiseAnd2g7wmsfd45l12(e,new t.Long2qws0ah9gnpki(255,0)))])}function u(e,t,n,r,a){var i,l=t.bytes,u=(i=o("kotlin-kotlin-stdlib")).primitiveArrayConcatwxgknw08pmlb([n,l]),c=s(i.fromInt1lka3ktyu79a4(u.length)),d=o("wa-kmp-syncd-engine-interfaces").MacAlgo_HMAC_SHA_512_getInstances0w60r7tu8vg(),m=i.primitiveArrayConcatwxgknw08pmlb([u,a]),p=i.primitiveArrayConcatwxgknw08pmlb([m,c]),_=e.n6_1.mac(d,p,r);return _.i6(L)}function c(e,t,n){var r=(0-t|0)-n|0,o=Math.max(0,r);return e.n6_1.generateRandomBytes(o)}function d(){this.p6_1=16,this.q6_1=0,this.r6_1=32}e.protoOf180f3jzyo7rfj(d).s6=function(){throw o("kotlin-kotlin-stdlib").RuntimeException_init_$Create$17ncyu0a6xfek("This is a test crash from KMP - WASyncDEngine")};var m;function p(){return m}function _(e,t,n){return function(r){return new(o("wa-kmp-syncd-engine-interfaces")).KmpSyncdCryptoEncryptedData2qzy9qni0hrm2(e.keyId,r,t.operation,n,o("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(n,n.length-32|0,n.length))}}function f(e,t,n,r,a,i){return function(l){var s=e,u=o("kotlin-kotlin-stdlib").primitiveArrayConcatwxgknw08pmlb([s,l]),c=t.n6_1.mac(o("wa-kmp-syncd-engine-interfaces").MacAlgo_HMAC_SHA_256_getInstance3mchsdvnjagj8(),n,r.indexKey);return c.i6(_(a,i,u))}}function g(e,t,n,r,a,i){return function(l){var s=e,c=o("kotlin-kotlin-stdlib").primitiveArrayConcatwxgknw08pmlb([s,l]),d=u(t,n.keyId,r.operation.asBytes(),a.valueMacKey,c);return d.j6(f(c,t,i,a,n,r))}}function h(e,t,n){return function(r){var a=o("kotlin-kotlin-stdlib").encodeToByteArray1onwao0uakjfh(e.index),i=e.value,l;i==null?l=new Int8Array([]):l=i;var s=l,u=t.n6_1.generateRandomBytes(16),d=c(t,a.length,s.length),m=t.o6_1.encodeMutationDataToSyncdActionData(e,d).toByteArray(),p=t.n6_1.createCipherText(o("wa-kmp-syncd-engine-interfaces").OpMode_ENCRYPT_getInstance1dfeme89me53k(),u,m,r.valueEncryptionKey);return p.j6(g(u,t,n,e,r,a))}}function y(e,t,n){return function(r){var a;if(!o("kotlin-kotlin-stdlib").contentEquals1cdp6c846cfdi(e.indexHash,r))throw new(o("wa-kmp-syncd-engine-interfaces")).KmpSyncdCipherException1yr5ole70ur3d("Index hash corrupt");return new k(t,n)}}function C(e,t,n){return function(r){var a=e.m6_1.create(t.keyId,t.operation,r,t.mutationMac),i=e.n6_1.mac(o("wa-kmp-syncd-engine-interfaces").MacAlgo_HMAC_SHA_256_getInstance3mchsdvnjagj8(),o("kotlin-kotlin-stdlib").encodeToByteArray1onwao0uakjfh(a.index),n.indexKey);return i.i6(y(t,a,r))}}function b(e,t,n,r,a,i){return function(l){var s;if(!o("kotlin-kotlin-stdlib").contentEquals1cdp6c846cfdi(e,l))throw new(o("wa-kmp-syncd-engine-interfaces")).KmpSyncdCipherException1yr5ole70ur3d("Data mac corrupt");var u=t.n6_1.createCipherText(o("wa-kmp-syncd-engine-interfaces").OpMode_DECRYPT_getInstance1ub7qnw77sd5o(),n,r,a.valueEncryptionKey);return u.j6(C(t,i,a))}}function v(e,t,n,r,a,i){return function(l){var s=e,c=t,d=o("kotlin-kotlin-stdlib").primitiveArrayConcatwxgknw08pmlb([s,c]),m=n.operation.asBytes(),p=u(r,a.keyId,m,l.valueMacKey,d);return p.j6(b(i,r,e,t,l,n))}}function S(e,t,n,r){return function(a){var i=o("wa-kmp-syncd-engine-interfaces").MacAlgo_HMAC_SHA_256_getInstance3mchsdvnjagj8(),l=t,u=s(n.k6_1),c=o("kotlin-kotlin-stdlib").primitiveArrayConcatwxgknw08pmlb([l,u]),d=o("kotlin-kotlin-stdlib").encodeToByteArray1onwao0uakjfh(r),m=o("kotlin-kotlin-stdlib").primitiveArrayConcatwxgknw08pmlb([c,d]);return e.n6_1.mac(i,m,a.snapshotMacKey)}}function R(e,t,n,r,a){return function(i){var l,u=o("wa-kmp-syncd-engine-interfaces").MacAlgo_HMAC_SHA_256_getInstance3mchsdvnjagj8(),c=t,d=n,m=(l=o("kotlin-kotlin-stdlib")).primitiveArrayConcatwxgknw08pmlb([c,d]),p=s(r.k6_1),_=l.primitiveArrayConcatwxgknw08pmlb([m,p]),f=l.encodeToByteArray1onwao0uakjfh(a),g=l.primitiveArrayConcatwxgknw08pmlb([_,f]);return e.n6_1.mac(u,g,i.patchMacKey)}}function L(e){return o("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(e,0,32)}function E(e,t,n,r){this.l6_1=e,this.m6_1=t,this.n6_1=n,this.o6_1=r}e.protoOf180f3jzyo7rfj(E).encrypt=function(e,t){var n=this.l6_1.getFor(e.keyData);return n.j6(h(t,this,e))},e.protoOf180f3jzyo7rfj(E).decrypt=function(e,t){var n=t.indexAndValueCipherText;if(n.length<48)throw new(o("wa-kmp-syncd-engine-interfaces")).KmpSyncdParseException1owflwptcaobs("Cipher text too short");var r=[o("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(n,0,16),o("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(n,16,n.length-32|0),o("kotlin-kotlin-stdlib").copyOfRange3alro60z4hhf8(n,n.length-32|0,n.length)],a=r[0],i=r[1],l=r[2],s=this.l6_1.getFor(e.keyData);return s.j6(v(a,i,t,this,e,l))},e.protoOf180f3jzyo7rfj(E).calculateSnapshotMac=function(e,t,n,r){var o=this.l6_1.getFor(r);return o.j6(S(this,n,t,e))},e.protoOf180f3jzyo7rfj(E).calculatePatchMac=function(e,t,n,r,o){var a=this.l6_1.getFor(n);return a.j6(R(this,o,r,t,e))};function k(e,t){this.mutation=e,this.plaintext=t}e.protoOf180f3jzyo7rfj(k).t6=function(){return this.mutation},e.protoOf180f3jzyo7rfj(k).u6=function(){return this.plaintext},m=new d,e.defineProp3ur6h3slcvq4x(E,"Companion",p,e.VOID3gxj6tk5isa35,!0),l.KmpSyncdEncryptionManager=E,l.KmpSyncdMutationDataWithPlaintext=k}),98); __d("wa-kmp-syncd-engine-api",["kotlin-kotlin-stdlib","wa-kmp-syncd-engine","wa-kmp-syncd-engine-interfaces"],(function(t,n,r,o,a,i){var e,l=importNamespace("wa-kmp-syncd-engine").KmpSyncdEncryptionManager,s=importNamespace("wa-kmp-syncd-engine").KmpSyncdMutationDataWithPlaintext,u=(e=importNamespace("wa-kmp-syncd-engine-interfaces")).JsKmpDerivedSyncdKeysProviderImpl,c=e.JsKmpSyncdCryptoProviderImpl,d=e.JsKmpSyncdMutationDataFactoryImpl,m=e.JsKmpSyncdProtobufProviderImpl,p=e.KmpLong,_=e.KmpResult,f=e.KmpSyncdCipherException,g=e.KmpSyncdCollectionName,h=e.KmpSyncdCryptoActionData,y=e.KmpSyncdCryptoDerivedKeys,C=e.KmpSyncdCryptoEncryptedData,b=e.KmpSyncdCryptoMutationData,v=e.KmpSyncdCryptoMutationKey,S=e.KmpSyncdCryptoMutationKeyData,R=e.KmpSyncdCryptoMutationKeyId,L=e.KmpSyncdCryptoMutationOperation,E=e.KmpSyncdKeyException,k=e.KmpSyncdMutationException,I=e.KmpSyncdMutationExceptionReason,T=e.KmpSyncdParseException,D=e.MacAlgo,x=e.OpMode,$=importNamespace("kotlin-kotlin-stdlib").KtSet;i.KmpSyncdEncryptionManager=l,i.KmpSyncdMutationDataWithPlaintext=s,i.JsKmpDerivedSyncdKeysProviderImpl=u,i.JsKmpSyncdCryptoProviderImpl=c,i.JsKmpSyncdMutationDataFactoryImpl=d,i.JsKmpSyncdProtobufProviderImpl=m,i.KmpLong=p,i.KmpResult=_,i.KmpSyncdCipherException=f,i.KmpSyncdCollectionName=g,i.KmpSyncdCryptoActionData=h,i.KmpSyncdCryptoDerivedKeys=y,i.KmpSyncdCryptoEncryptedData=C,i.KmpSyncdCryptoMutationData=b,i.KmpSyncdCryptoMutationKey=v,i.KmpSyncdCryptoMutationKeyData=S,i.KmpSyncdCryptoMutationKeyId=R,i.KmpSyncdCryptoMutationOperation=L,i.KmpSyncdKeyException=E,i.KmpSyncdMutationException=k,i.KmpSyncdMutationExceptionReason=I,i.KmpSyncdParseException=T,i.MacAlgo=D,i.OpMode=x,i.KtSet=$}),66); __d("WASyncdKmpConversion",["WAArrayBufferUtils","WASyncdKeyTypes","WAWebProtobufSyncAction.pb","WAWebProtobufsServerSync.pb","WAWebSyncdCryptoConst","WAWebSyncdDecode","WAWebSyncdRequestEncode","WAWebSyncdValidateSyncActionProtobuf","decodeProtobuf","encodeProtobuf","wa-kmp-syncd-engine-api"],(function(t,n,r,o,a,i,l){"use strict";function e(e){return new(o("wa-kmp-syncd-engine-api")).KmpSyncdCryptoMutationKeyId(new Int8Array(o("WASyncdKeyTypes").fromSyncKeyId(e)))}function s(e){return new(o("wa-kmp-syncd-engine-api")).KmpSyncdCryptoMutationKeyData(new Int8Array(o("WASyncdKeyTypes").fromSyncKeyData(e)))}function u(e){return e===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET?o("wa-kmp-syncd-engine-api").KmpSyncdCryptoMutationOperation.Set:e===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE?o("wa-kmp-syncd-engine-api").KmpSyncdCryptoMutationOperation.Remove:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}function c(t,n){return new(o("wa-kmp-syncd-engine-api")).KmpSyncdCryptoMutationKey(e(t),s(n))}function d(t,n){var r=n.action,a=n.binarySyncAction,i=n.index,l=n.operation,s=n.version;return new(o("wa-kmp-syncd-engine-api")).KmpSyncdCryptoMutationData(i,s,e(t),u(l),new Int8Array(a),null)}function m(e,t,n,a){var i=o("WAWebSyncdDecode").decodeSyncActionData(null,n.buffer),l=r("WAWebSyncdValidateSyncActionProtobuf").validateSyncActionDataProtobuf(null,i),s=l.version,u=l.value,c=o("WAArrayBufferUtils").arrayBufferToString(l.index);return new(o("wa-kmp-syncd-engine-api")).KmpSyncdCryptoMutationData(c,s,e,t,u?new Int8Array(o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,u).readBuffer()):null,a)}function p(t,n,r){var a=new Int8Array(r.index.blob),i=new Int8Array(r.value.blob),l=i.slice(-o("WAWebSyncdCryptoConst").MAC_LENGTH);return new(o("wa-kmp-syncd-engine-api")).KmpSyncdCryptoEncryptedData(e(t),a,u(n),i,l)}function _(e,t){var n;return new(o("wa-kmp-syncd-engine-api")).KmpSyncdCryptoActionData(new Int8Array(o("WAWebSyncdRequestEncode").encodeSyncActionData({index:o("WAArrayBufferUtils").stringToArrayBuffer(e.index),value:o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,(n=e.value)==null?void 0:n.buffer),padding:t.buffer,version:e.version})))}l.toKmpSyncdMutationKeyData=s,l.toKmpSyncdMutationKey=c,l.toKmpSyncdMutationDataForEncryption=d,l.toKmpSyncdMutationDataForDecryption=m,l.toKmpSyncdEncryptedData=p,l.toKmpSyncdActionData=_}),98); __d("WAWebKmpSyncdCryptoProvider",["WACryptoAesCbc","WACryptoDependencies","WACryptoHmac","asyncToGeneratorRuntime","err","wa-kmp-syncd-engine-api"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t,n){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a=yield o("WACryptoAesCbc").aesCbcEncrypt(n,t,e);if(e.length!==16)throw r("err")("IV must be 16 bytes");var i=a.slice(e.length);return new Int8Array(i)}),s.apply(this,arguments)}function u(e,t,n){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield o("WACryptoAesCbc").aesCbcDecrypt(n,e,t);return new Int8Array(r)}),c.apply(this,arguments)}function d(t,n,a,i){switch(t){case o("wa-kmp-syncd-engine-api").OpMode.ENCRYPT:return new(o("wa-kmp-syncd-engine-api")).KmpResult(e(n,a,i));case o("wa-kmp-syncd-engine-api").OpMode.DECRYPT:return new(o("wa-kmp-syncd-engine-api")).KmpResult(u(n,a,i));default:throw r("err")("Invalid mode: "+t.name+")")}}function m(e,t,n){var r=e===o("wa-kmp-syncd-engine-api").MacAlgo.HMAC_SHA_256?o("WACryptoHmac").hmacSha256:o("WACryptoHmac").hmacSha512;return new(o("wa-kmp-syncd-engine-api")).KmpResult(r(n,t).then(function(e){return new Int8Array(e)}))}function p(e){var t=new Int8Array(e);return o("WACryptoDependencies").getCrypto().getRandomValues(t)}var _=Array.from({length:256},function(e,t){return t.toString(16).padStart(2,"0")});function f(e){for(var t="",n=0;ne&&(yield o("WAWebAccountLinkingAPI").ping(),yield o("WAWebAccountLinkingAPI").fetchServiceData())}),s.apply(this,arguments)}l.scheduledWaffleJobs=e}),98); __d("WAWebMenuBarStyles",[],(function(t,n,r,o,a,i,l){var e={menu:{display:"x78zum5",alignItems:"x6s0dn4",boxSizing:"x1afcbsf",$$css:!0},menuDefault:{color:"x14ug900",$$css:!0},menuStrong:{color:"xhslqc4",$$css:!0},menuInverse:{color:"x17t9dm2",$$css:!0},menuNavBar:{height:"x5yr21d",alignItems:"x1cy8zhl",$$css:!0},menuGapSingle:{columnGap:"x1s70e7g",$$css:!0},btnThemeForceSize:{height:"xxk0z11",width:"xvy4d1p",display:"x78zum5",justifyContent:"xl56j7k",alignItems:"x6s0dn4",$$css:!0},item:{position:"x1n2onr6",flex:"x1okw0bk",height:"x5yr21d",borderStartStartRadius:"x1c9tyrk",borderStartEndRadius:"xeusxvb",borderEndEndRadius:"x1pahc9y",borderEndStartRadius:"x1ertn4p",transition:"xlkovuz",":active_transition":"x16j0l1c",$$css:!0},itemButton:{display:"x78zum5",alignItems:"x6s0dn4",boxSizing:"x1afcbsf",color:"x1heor9g",borderStartStartRadius:"x1fmog5m",borderStartEndRadius:"xu25z0z",borderEndEndRadius:"x140muxe",borderEndStartRadius:"xo1y3bh",$$css:!0},itemSelected:{backgroundColor:"x4wrhlh",$$css:!0},itemActive:{backgroundColor:"x4wrhlh",$$css:!0},itemActiveStateNotDisabled:{":active_backgroundColor":"x11xlx4c",$$css:!0},itemShowHoverBg:{":hover_backgroundColor":"x17gydlx",$$css:!0},itemDisabled:{opacity:"xyd83as",$$css:!0},itemDisabledRoleBtn:{cursor:"xt0e3qv",$$css:!0},itemThemeNavBar:{maxHeight:"x18wx58x",maxWidth:"xo92w5m",$$css:!0},itemChild:{display:"x78zum5",alignItems:"x1cy8zhl",$$css:!0},itemThemeMediaEditor:{"@media screen and (max-width: 850px)_paddingTop":"x1f9lq3s","@media screen and (max-width: 850px)_paddingInlineEnd":"xazzkgq","@media screen and (max-width: 850px)_paddingBottom":"xslj4r9","@media screen and (max-width: 850px)_paddingInlineStart":"x1fia4fy","@media screen and (max-width: 850px)_marginLeft":"x17qx6bn","@media screen and (max-width: 850px)_marginInlineStart":null,"@media screen and (max-width: 850px)_marginInlineEnd":null,$$css:!0}};l.default=e}),98); __d("WAWebUimUieMenu.react",["WANullthrows","WAWebCmd","react","useWAWebUIM"],(function(t,n,r,o,a,i,l){var e=["ref"],s,u=s||(s=o("react")),c=s,d=c.useEffect,m=c.useImperativeHandle,p=c.useRef;function _(t){var n=t.ref,a=babelHelpers.objectWithoutPropertiesLoose(t,e),i=a.contextMenu,l=r("useWAWebUIM")(),s=p(null);d(function(){return o("WAWebCmd").Cmd.openContextMenu({menuOptions:i,uim:r("WANullthrows")(l)},function(e){s.current=e}),function(){o("WAWebCmd").Cmd.closeContextMenu(l)}},[]);var u=function(){return s.current};return m(n,function(){return{getElement:u}}),null}_.displayName=_.name+" [from "+i.id+"]",l.default=_}),98); __d("WAWebMenuBar.react",["cx","WAWebClassnames","WAWebMenuBarStyles","WAWebPopoverContext.react","WAWebTooltip.react","WAWebUISpacing","WAWebUimUie.react","WAWebUimUieMenu.react","WAWebVelocityTransitionGroup","WDSFocusStateStyles","react","stylex","useMergeRefs","useWAWebStaticButtonA11y"],(function(t,n,r,o,a,i,l,s){var e=["ref"],u,c,d,m=d||(d=o("react")),p=u||(u=r("react")),_=m.createContext,f=m.useContext,g=m.useEffect,h=m.useMemo,y=m.useRef,C=m.useState,b={buttonMargin:{marginInlineStart:"x150mmf0",$$css:!0}};function v(e){return p.jsx(r("WAWebVelocityTransitionGroup"),babelHelpers.extends({},e,{xstyle:[r("WAWebMenuBarStyles").itemChild,e.xstyle]}))}v.displayName=v.name+" [from "+i.id+"]";var S=_({});function R(e){var t=e.children,n=e.gap,o=e.theme,a=(c||(c=r("stylex")))(r("WAWebMenuBarStyles").menu,o==null&&r("WAWebMenuBarStyles").menuDefault,o==="strong"&&r("WAWebMenuBarStyles").menuStrong,o==="inverse"&&r("WAWebMenuBarStyles").menuInverse,o==="nav-bar"&&r("WAWebMenuBarStyles").menuNavBar,n==="single"&&r("WAWebMenuBarStyles").menuGapSingle),i=h(function(){return o?{theme:o}:{}},[o]);return p.jsx(S.Provider,{value:i,children:p.jsx("div",{className:a,children:t})})}R.displayName=R.name+" [from "+i.id+"]";var L=-10;function E(t){var n=t.ref,a=babelHelpers.objectWithoutPropertiesLoose(t,e),i=a.buttonStyle,l=a.disabled,s=l===void 0?!1:l,u=a.dropdownMenu,d=a.icon,m=a.onTransitionEnd,_=a.onTransitionStart,h=a.selected,R=a.showHoverTooltip,E=R===void 0?!1:R,k=a.testid,I=a.text,T=a.theme,D=a.title,x=a.transitionName,$=x===void 0?"dropdown":x,P=a.vertical,N=a.xstyle,M=f(S),w=M.theme,A=C(!1),F=A[0],O=A[1],B=function(){if(_==null||_(),u!=null){var e,t=u.offsetX;t==null&&(t=L),O(!0),Q(babelHelpers.extends({},u,{anchor:(e=u.anchor)!=null?e:z.current,offsetX:t})),a.onOpen==null||a.onOpen()}},W=function(t){m==null||m(),O(!1),Q(null),a.onClose==null||a.onClose(t)},q=function(t){a.onClick&&a.onClick(t),!(t==null||t.isDefaultPrevented())&&(t.preventDefault(),F||B())},U=r("useWAWebStaticButtonA11y")(q,{disabled:s}),V=U[0],H=U[1],G=o("WAWebClassnames").classnamesConvertMeToStylexPlease("_ajv7",(c||(c=r("stylex")))([r("WAWebMenuBarStyles").item,b.buttonMargin],N,h===!0&&r("WAWebMenuBarStyles").itemSelected,F===!0&&r("WAWebMenuBarStyles").itemActive,s!==!0&&r("WAWebMenuBarStyles").itemActiveStateNotDisabled,s!==!0&&r("WAWebMenuBarStyles").itemShowHoverBg,P===!0&&[o("WAWebUISpacing").uiMargin.start0,o("WAWebUISpacing").uiMargin.top10],s===!0&&r("WAWebMenuBarStyles").itemDisabled,s===!0&&H.role==="button"&&r("WAWebMenuBarStyles").itemDisabledRoleBtn,w==="nav-bar"&&r("WAWebMenuBarStyles").itemThemeNavBar,w==="media-editor"&&r("WAWebMenuBarStyles").itemThemeMediaEditor)),z=y(null),j=C(null),K=j[0],Q=j[1],X=r("useMergeRefs")(V,z);return g(function(){u&&F===!0&&B()},[]),p.jsxs("div",{ref:n,className:G,"data-testid":void 0,children:[p.jsxs("button",babelHelpers.extends({"aria-expanded":F},H,c.props(r("WAWebMenuBarStyles").itemButton,o("WAWebUISpacing").uiPadding.all8,i,T==="force-size"&&r("WAWebMenuBarStyles").btnThemeForceSize,o("WDSFocusStateStyles").WDSFocusStateStyles.genericFocus),{"data-tab":s?void 0:a.tabOrder,title:E?"":D,"aria-label":D,ref:X,children:[d,I!=null&&I!==""&&p.jsx("span",babelHelpers.extends({},(c||(c=r("stylex"))).props(o("WAWebUISpacing").uiMargin.all3),{children:I}))]})),K!=null&&p.jsx(v,{transitionName:$,children:p.jsx(o("WAWebUimUie.react").UIE,{displayName:"MenuBarMenuItem",escapable:!0,popable:!0,dismissOnWindowResize:!0,requestDismiss:W,children:p.jsx(r("WAWebUimUieMenu.react"),{contextMenu:K})})}),E&&p.jsx(o("WAWebPopoverContext.react").WAWebPopoverController,{targetRef:z,popover:p.jsx(o("WAWebTooltip.react").WAWebHoverTooltip,{targetRef:"context",alignment:o("WAWebTooltip.react").PopoverAlignment.Center,position:o("WAWebTooltip.react").PopoverPosition.End,openingDelay:350,children:D})})]})}E.displayName=E.name+" [from "+i.id+"]",l.MenuBarVelocityTransitionGroup=v,l.MenuBar=R,l.MENU_BAR_ITEM_DROPDOWN_OFFSET=L,l.MenuBarItem=E}),98); __d("WDSMenuBarItem.react",["WAWebMenuBar.react","WAWebUimUie.react","WAWebUimUieMenu.react","WDSButton.react","WDSTooltip.react","deferredLoadComponent","react","requireDeferred","stylex","useMergeRefs","useWAWebABPropConfigValue"],(function(t,n,r,o,a,i,l){var e=["ref"],s=["ref"],u=["dropdownMenu","menuEnableUim","menuIsContainer","onClose","onOpen","transitionName","wdsMenuToRender"],c,d,m,p=m||(m=o("react")),_=c||(c=r("react")),f=p.useImperativeHandle,g=p.useRef,h=p.useState,y=r("deferredLoadComponent")(r("requireDeferred")("WDSMenuBarItemWithWDSMenu.react").__setRef("WDSMenuBarItem.react"));function C(t){var n=t.ref,a=babelHelpers.objectWithoutPropertiesLoose(t,e),i=a.buttonSize,l=i===void 0?"medium":i,s=a.buttonType,u=s===void 0?"default":s,c=a.buttonVariant,m=c===void 0?"borderless":c,p=a.disabled,y=p===void 0?!1:p,C=a.dropdownMenu,b=a.icon,v=a.imperativeRef,S=a.keyboardShortcutAction,R=a.label,L=a.marginInlineXstyle,E=a.onClick,k=a.onClose,I=a.onOpen,T=a.tabOrder,D=a.testid,x=a.title,$=a.transitionName,P=$===void 0?"dropdown":$,N=h(!1),M=N[0],w=N[1],A=g(null),F=r("useMergeRefs")(n,A),O=h(null),B=O[0],W=O[1],q=o("useWAWebABPropConfigValue").useABPropConfigValue("wds_web_tooltip")&&!y,U=function(){if(C!=null){var e,t,n,r=C.offsetX;r==null&&(r=o("WAWebMenuBar.react").MENU_BAR_ITEM_DROPDOWN_OFFSET),w(!0),W(babelHelpers.extends({},C,{anchor:(e=(t=(n=C.anchorRef)==null?void 0:n.current)!=null?t:C.anchor)!=null?e:A.current,offsetX:r})),I==null||I()}},V=function(t){w(!1),W(null),k==null||k(t)},H=function(t){E&&E(t),!(t==null||t.isDefaultPrevented())&&(t.preventDefault(),M||U())};f(v,function(){return{open:function(){U()}}});var G=_.jsxs(_.Fragment,{children:[_.jsx(r("WDSButton.react"),{type:u,variant:m,size:l,directional:!0,Icon:b,label:R,"aria-label":x,"aria-haspopup":C?"menu":void 0,"aria-expanded":M,onPress:H,ref:F,disabled:y,testid:void 0,tabOrder:T}),B!=null&&_.jsx(o("WAWebMenuBar.react").MenuBarVelocityTransitionGroup,{transitionName:P,children:_.jsx(o("WAWebUimUie.react").UIE,{displayName:"MenuBarMenuItem",escapable:!0,popable:!0,dismissOnWindowResize:!0,requestDismiss:V,children:_.jsx(r("WAWebUimUieMenu.react"),{contextMenu:B})})})]});return q?_.jsx("div",babelHelpers.extends({},(d||(d=r("stylex"))).props(L),{children:_.jsx(r("WDSTooltip.react"),{label:x,shortcut:S,disabled:M,children:G})})):_.jsx("div",babelHelpers.extends({},(d||(d=r("stylex"))).props(L),{title:x,children:G}))}C.displayName=C.name+" [from "+i.id+"]";function b(e){var t=e.ref,n=babelHelpers.objectWithoutPropertiesLoose(e,s),r=n.dropdownMenu,o=n.menuEnableUim,a=n.menuIsContainer,i=n.onClose,l=n.onOpen,c=n.transitionName,d=n.wdsMenuToRender,m=babelHelpers.objectWithoutPropertiesLoose(n,u);return d!=null?_.jsx(y,babelHelpers.extends({ref:t},m,{wdsMenuToRender:d,menuEnableUim:o,menuIsContainer:a})):_.jsx(C,babelHelpers.extends({ref:t},n))}b.displayName=b.name+" [from "+i.id+"]",l.default=b}),98); __d("WDSShortcut.react",["UserAgent","WALogger","WDSText.react","react","stylex"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c=u||(u=o("react")),d={container:{display:"x1rg5ohu",backgroundColor:"x4wrhlh",borderStartStartRadius:"x1i5p2am",borderStartEndRadius:"x1whfx0g",borderEndEndRadius:"xr2y4jy",borderEndStartRadius:"x1ihp6rs",$$css:!0},containerInverse:{backgroundColor:"xjbqb8w",$$css:!0},applyMacFont:{fontFamily:"x1ntu5ad",$$css:!0},macLetterSpacing:{letterSpacing:"xl5zsmt",$$css:!0},padding:function(t){return[{paddingInlineStart:t!=null?"xnvo3vl":t,paddingInlineEnd:t!=null?"x120eax6":t,$$css:!0},{"--x-paddingInlineStart":(function(e){return typeof e=="number"?e+"px":e!=null?e:void 0})(t),"--x-paddingInlineEnd":(function(e){return typeof e=="number"?e+"px":e!=null?e:void 0})(t)}]},noBreak:{wordBreak:"xdnwjd9",$$css:!0}},m=r("UserAgent").isPlatform("Mac OS X")?"macWeb":"windowsWeb";function p(t){var n,a=t.modifiers,i=t.shortcutKeys,l=t.inverse,u=l===void 0?!1:l,p=t.platform,_=p===void 0?m:p;if(_!=="macWeb"&&_!=="windowsWeb"){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[WDSShortcut] Unsupported platform"]))).tags("wds").devConsole(t).sendLogs("wds-shortcut-unsupported-platform");return}var f=(n=a==null?void 0:a.map(function(e){return(function(e){if(Array.isArray(e)&&e.length===2&&e[0]==="Super"&&e[1]==="macWeb")return"\u2318";if(Array.isArray(e)&&e.length===2&&e[0]==="Super"&&e[1]==="windowsWeb")return"Win";if(Array.isArray(e)&&e.length===2&&e[0]==="Option"&&e[1]==="macWeb")return"\u2325";if(Array.isArray(e)&&e.length===2&&e[0]==="Option"&&e[1]==="windowsWeb")return"Alt";if(Array.isArray(e)&&e.length===2&&e[0]==="Shift"&&e[1]==="macWeb")return"\u21E7";if(Array.isArray(e)&&e.length===2&&e[0]==="Shift"&&e[1]==="windowsWeb")return"Shift";if(Array.isArray(e)&&e.length===2&&e[0]==="Control"&&e[1]==="macWeb")return"\u2303";if(Array.isArray(e)&&e.length===2&&e[0]==="Control"&&e[1]==="windowsWeb")return"Ctrl";throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})([e,_])}))!=null?n:[],g=[].concat(f,i).map(function(e,t){return _==="windowsWeb"&&t!==0?"+"+e:e}),h=u?"none":"4px";return c.jsx("div",babelHelpers.extends({},(s||(s=r("stylex"))).props(d.padding(h),u?d.containerInverse:d.container,_==="macWeb"&&d.applyMacFont),{children:c.jsx(r("WDSText.react"),{type:"Body3",colorName:u?"contentDisabled":"contentDeemphasized",platform:_,dir:"auto",xstyle:[d.noBreak,_==="macWeb"&&d.macLetterSpacing],children:g})}))}p.displayName=p.name+" [from "+i.id+"]",l.default=p}),98); __d("WDSTooltip.react",["BaseTooltip.react","CometPlaceholder.react","WAWebKeyboardShortcuts","WDSShortcut.react","WDSText.react","deferredLoadComponent","react","requireDeferredForDisplay"],(function(t,n,r,o,a,i,l){"use strict";var e=["delayTooltipMs","label","ownerAnchorRef","shortcut"],s,u=s||(s=o("react")),c=r("deferredLoadComponent")(r("requireDeferredForDisplay")("WDSTooltipConfig.react").__setRef("WDSTooltip.react")),d={textLineCap:{overflowX:"x6ikm8r",overflowY:"x10wlt62",textOverflow:"xlyipyv",display:"x104kibb",WebkitBoxOrient:"x1ua5tub",WebkitLineClamp:"xnajbk2",$$css:!0}};function m(e){return u.jsx(r("CometPlaceholder.react"),{name:"WDSTooltip",fallback:null,children:u.jsx(c,babelHelpers.extends({},e))})}m.displayName=m.name+" [from "+i.id+"]";function p(t){var n=t.delayTooltipMs,a=n===void 0?400:n,i=t.label,l=t.ownerAnchorRef,s=t.shortcut,c=babelHelpers.objectWithoutPropertiesLoose(t,e),p,_;return s!=null&&(typeof s=="object"?_=s:_=o("WAWebKeyboardShortcuts").getWDSShortcuts(s)),_!=null?p=u.jsxs("div",{className:"xowaa7l xmzvs34 xf159sx x1iorvi4 xjkvuk6 x78zum5 xfex06f x6s0dn4",children:[u.jsx(r("WDSText.react"),{type:"Body3",colorName:"contentInverse",xstyle:d.textLineCap,children:i}),u.jsx(r("WDSShortcut.react"),babelHelpers.extends({},_,{inverse:!0}))]}):p=u.jsx("div",{className:"xowaa7l xmzvs34 xf159sx x1iorvi4 xjkvuk6 x78zum5 xfex06f x6s0dn4",children:u.jsx(r("WDSText.react"),{type:"Body3",colorName:"contentInverse",children:i})}),u.jsx(r("BaseTooltip.react"),babelHelpers.extends({},c,{anchorRef:l,tooltip:p,tooltipImpl:m,delayTooltipMs:a,hideDelayMs:0}))}p.displayName=p.name+" [from "+i.id+"]",l.default=p}),98); __d("WAWebAddonSendMsgData",["WALogger","WAWebAck","WAWebAddonConstants","WAWebAddonCrossWindowUtils","WAWebAddonEncryptAddonMsgData","WAWebAddonInfraError","WAWebAddonPluginProcessor","WAWebAddonProcessMsgs","WAWebAddonProcessMsgsUtils","WAWebAddonRetryRequestUtils","WAWebAddonSelectUtils","WAWebAddonUpdateDataUtils","WAWebHandleMsgError","WAWebMsgType","WAWebReferentialMsgKey","WAWebSendMsgJob","WAWebSendMsgTypes","WAWebUserPrefsMeUser","WAWebWid","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(e,t){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WAWebAddonEncryptAddonMsgData").createDualEncryptionHelper(e,t),r=n?yield n.decrypt():e,a=o("WAWebAddonSelectUtils").getAddonTableMode(e);yield o("WAWebAddonUpdateDataUtils").updateAddonsInTableMode({processMode:o("WAWebAddonConstants").AddonProcessMode.SetAck,tableMode:a},{add:[r]})}),m.apply(this,arguments)}var p=function(t){var e=t.id,n=e.remote;return e.fromMe&&o("WAWebUserPrefsMeUser").isMePrimary(n)?o("WAWebAck").ACK.READ:o("WAWebAck").ACK.SENT},_=new Set([o("WAWebAddonConstants").AddonProcessMode.Send,o("WAWebAddonConstants").AddonProcessMode.SendRetry,o("WAWebAddonConstants").AddonProcessMode.SendRevoke]),f=new Set([o("WAWebMsgType").MSG_TYPE.REACTION,o("WAWebMsgType").MSG_TYPE.REACTION_ENC]);function g(e){return f.has(e.type)?!0:new Set(["reaction","poll_update","comment","event_response"]).has(e.type)}function h(e,t){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var a=o("WAWebAddonConstants").AddonProcessMode.Send;t.kind===o("WAWebMsgType").MsgKind.ProtocolAddonRevoke&&(a=o("WAWebAddonConstants").AddonProcessMode.SendRevoke),t.ack===o("WAWebAck").ACK.FAILED&&(a=o("WAWebAddonConstants").AddonProcessMode.SendRetry);var i;try{var l;if(!_.has(a))throw new(o("WAWebAddonInfraError")).AddonInfraError(o("WAWebAddonInfraError").AddonInfraErrorCode.UnexpectedError);var m=o("WAWebAddonProcessMsgsUtils").getParentMsgKey(t);if(g(t))i=yield o("WAWebAddonProcessMsgs").processOutgoingMsgOptimisticUpdate(a,t);else{var f;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[addon-infra]: sending "," (",") addon, id: ",", parent: ",", isParentLid: ",""])),o("WAWebAddonCrossWindowUtils").getAddonProcessorType(t),t.type,t.id.id,m.id,(f=m.participant)==null?void 0:f.isLid());var h=yield o("WAWebAddonProcessMsgsUtils").queryAddonParentMsgs([t],a),y=h[0],C=h[1];if(i={encryptedMsgData:C[0],decryptedMsgData:C[0],parent:o("WAWebAddonSelectUtils").createAddonParentSelector(y).getForAddon(C[0])},a===o("WAWebAddonConstants").AddonProcessMode.SendRetry&&t.type===o("WAWebMsgType").MSG_TYPE.COMMENT){var b=o("WAWebAddonPluginProcessor").getAddonProcessor(i.decryptedMsgData);b.convert.toDualEncryptedMsgData!=null&&(i.encryptedMsgData=yield b.convert.toDualEncryptedMsgData(i.decryptedMsgData,i.parent))}(a===o("WAWebAddonConstants").AddonProcessMode.Send||a===o("WAWebAddonConstants").AddonProcessMode.SendRetry)&&(yield o("WAWebAddonProcessMsgs").processOutgoingMsg(a,i.encryptedMsgData,y,n))}yield o("WAWebAddonRetryRequestUtils").storeSelfMessageTypeRow(i.decryptedMsgData);var v=i.parent.broadcastId!=null&&r("WAWebWid").isWid(i.parent.broadcastId)&&!!((l=i.parent.broadcastId)!=null&&l.isBroadcastList());if(v){var S=o("WAWebReferentialMsgKey").getReferentialMsgKey(i.parent);i.encryptedMsgData=o("WAWebAddonProcessMsgsUtils").updateMsgParentKeyValue(i.encryptedMsgData,S)}var R=yield o("WAWebSendMsgJob").encryptAndSendMsg({type:o("WAWebSendMsgTypes").SendMessageRecordType.Addon,data:i.encryptedMsgData},n),L=R.count,E=R.error,k=R.t;if(v&&(i.encryptedMsgData=o("WAWebAddonProcessMsgsUtils").updateMsgParentKeyValue(i.encryptedMsgData,i.parent.id)),E!=null)throw new(o("WAWebHandleMsgError")).MessageSentAckError(E);return yield d(babelHelpers.extends({},i.decryptedMsgData,{ack:p(i.encryptedMsgData)}),i.parent),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[addon-infra]: sent "," addon, id: ",""])),i.decryptedMsgData.type,i.decryptedMsgData.id.id),{t:parseInt(k,10),count:L}}catch(e){throw i==null?(o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["sendAddonMsgData: failure, parent msg "," for addon "," is not found"])),o("WAWebAddonProcessMsgsUtils").getParentMsgKey(t),t.id.toString()).tags("messaging","addons").sendLogs("sendAddonMsgData: undefined parent"),e):(yield d(babelHelpers.extends({},i.decryptedMsgData,{ack:o("WAWebAck").ACK.FAILED}),i.parent),o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["sendAddonMsgData: failure, msg: ",""])),t.id.toString()),e)}}),y.apply(this,arguments)}l.isOptimisticAddonSendSupported=g,l.sendAddonProcess=h}),98); __d("WAWebPonyfillsFetch",["WAWebHttpExtendedFetch"],(function(t,n,r,o,a,i,l){var e=function(){},s="fetch"in self?self.fetch:u;function u(t,n){return n===void 0&&(n={}),o("WAWebHttpExtendedFetch").sharedFetch(t,babelHelpers.extends({},n,{onProgress:e}))}l.default=s}),98); __d("WAWebXControllerFetchUtils",["URI","WALogger","WAWebPonyfillsFetch","asyncToGeneratorRuntime","getAsyncHeaders","getAsyncParams"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=t.method,o=t.additionalHeaders,a=o===void 0?{}:o,i=new(s||(s=r("URI")))(e),l=r("getAsyncParams")(n),u=r("getAsyncHeaders")(i),c=new URLSearchParams;Object.entries(l).forEach(function(e){var t=e[0],n=e[1];n!=null&&c.append(t,n.toString())});var d=babelHelpers.extends({},u,a,{"Content-Type":"application/x-www-form-urlencoded"});return yield r("WAWebPonyfillsFetch")(e,{method:n,headers:d,body:c})}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){try{var n=yield t.text(),r=n.replace(/^for\s*\(\s*;;\s*\)\s*;\s*/,"");return JSON.parse(r)}catch(t){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Failed to parse JSON response: ",""])),t),null}}),m.apply(this,arguments)}l.fetchFromXController=u,l.extractJsonFromResponse=d}),98); __d("WAXWhatsAppWebAuthControllerRouteBuilder",["jsRouteBuilder"],(function(t,n,r,o,a,i,l){var e=r("jsRouteBuilder")("/auth/token/",Object.freeze({}),void 0),s=e;l.default=s}),98); __d("WAXWhatsAppWebValidateTokenControllerRouteBuilder",["jsRouteBuilder"],(function(t,n,r,o,a,i,l){var e=r("jsRouteBuilder")("/auth/validate-token/",Object.freeze({}),void 0),s=e;l.default=s}),98); __d("WAWebViewerContextAuthUtils",["CurrentUser","Promise","WABase64","WABinary","WACryptoAesGcm","WACryptoHkdfSync","WALogger","WAWebABProps","WAWebAdvSignatureApi","WAWebODS","WAWebUserPrefsInfoStore","WAWebXControllerFetchUtils","WAXWhatsAppWebAuthControllerRouteBuilder","WAXWhatsAppWebValidateTokenControllerRouteBuilder","asyncToGeneratorRuntime","gkx","justknobx","nullthrows"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v=!1;function S(){return!r("gkx")("26258")&&!r("gkx")("26256")&&r("justknobx")._("4457")}function R(){return S()&&o("WAWebABProps").getABPropConfigValue("wa_web_canonical_ent_web_reg_recovery_enabled")}function L(){v=!0}function E(){v&&(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[reload] maybeReloadBeforeLogin"]))),self.location.reload())}function k(e){return I.apply(this,arguments)}function I(){return I=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){try{var t=x(e),n=t.data,a=t.iv,i=t.tag,l=yield o("WAWebUserPrefsInfoStore").waNoiseInfo.get(),s=r("nullthrows")(l).staticKeyPair.pubKey,u=yield o("WAWebAdvSignatureApi").getADVSecretKey(),d=D(new Uint8Array(o("WABase64").decodeB64(u)),new Uint8Array(s)),m=$(n,i);return yield o("WACryptoAesGcm").gcmDecrypt(d,a,m)}catch(e){return o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Error while decrypting nonce: ",""])),e),null}}),I.apply(this,arguments)}function T(e){try{var t=new TextDecoder("utf-8").decode(e),n=JSON.parse(t),r=n.fbid,a=n.nonce,i=n.timestamp;return a==null||r==null?(o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Nonce payload missing required fields"]))),null):{nonce:a,fbid:r,timestamp:i}}catch(e){return o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Error while parsing nonce payload: ",""])),e).sendLogs("vc-auth-error"),null}}function D(e,t){return o("WACryptoHkdfSync").hkdf(e,t,o("WABinary").Binary.build("Canonical Ent Companion Nonce Encrypt").readByteArrayView(),32)}function x(e){var t=e.encryptedKeyElementValue,n=e.nonceElementValue,r=e.authTagElementValue,o=e.encryptedDataElementValue;return{key:t,iv:n,tag:r,data:o}}function $(e,t){var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function P(e){return N.apply(this,arguments)}function N(){return N=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Exchanging nonce for token"])));var t=e.deviceId,n=e.nonce,a=e.userId,i=r("WAXWhatsAppWebAuthControllerRouteBuilder").buildUri({nonce:n,user_id:a,device_id:t});try{var l,s=yield o("WAWebXControllerFetchUtils").fetchFromXController(i.toString(),{method:"POST"});if(!s.ok)return o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Failed to exchange nonce: HTTP ",""])),s.status),!1;var u=yield o("WAWebXControllerFetchUtils").extractJsonFromResponse(s);if(u==null||((l=u.payload)==null?void 0:l.status)!=="success"){var c,f;return o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Failed to exchange nonce: ",""])),(c=u==null||(f=u.payload)==null?void 0:f.status)!=null?c:"invalid response").sendLogs("vc-auth-error",{sampling:.01}),!1}return!0}catch(e){return o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Failed to exchange nonce: ",""])),e).sendLogs("vc-auth-error",{sampling:.01}),!1}}),N.apply(this,arguments)}var M=5e3;function w(e){return A.apply(this,arguments)}function A(){return A=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return new(b||(b=n("Promise")))(function(t){var n=window.setTimeout(function(){o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] exchangeNonceForToken timed out after ","ms"])),M).sendLogs("vc-auth-error"),t(!1)},M);P(e).then(function(e){window.clearTimeout(n),t(e)}).catch(function(){window.clearTimeout(n),t(!1)})})}),A.apply(this,arguments)}function F(){return O.apply(this,arguments)}function O(){return O=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Validating canonical ent token"])));var e=r("WAXWhatsAppWebValidateTokenControllerRouteBuilder").buildUri({}).toString().concat("?__a=1");try{var t,n=yield window.fetch(e,{headers:{"Content-Type":"application/json"}});if(!n.ok)return o("WALogger").ERROR(h||(h=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Token validation request failed: HTTP ",""])),n.status),!1;var a=yield o("WAWebXControllerFetchUtils").extractJsonFromResponse(n);return a==null||((t=a.payload)==null?void 0:t.valid)!==!0?(o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Token is invalid or expired"]))),!1):!0}catch(e){return o("WALogger").ERROR(C||(C=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Token validation failed: ",""])),e).sendLogs("vc-auth-error"),!1}}),O.apply(this,arguments)}function B(){return r("CurrentUser").isLoggedIn()}function W(){return q.apply(this,arguments)}function q(){return q=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){r("WAWebODS").incr("web.app.page_load"),B()&&r("WAWebODS").incr("web.app.page_load.authenticated"),r("gkx")("26258")||r("WAWebODS").incr("web.app.page_load.intern")}),q.apply(this,arguments)}l.isViewerContextAuthEnabled=S,l.isViewerContextAuthRecoveryEnabled=R,l.setViewerContextReady=L,l.maybeReloadBeforeLogin=E,l.decryptNonce=k,l.parseNoncePayload=T,l.exchangeNonceForToken=P,l.exchangeNonceForTokenWithTimeout=w,l.validateCanonicalEntToken=F,l.isCurrentUserLoggedIn=B,l.logPageLoadAuthStatus=W}),98); __d("WAWebCompanionRegUtils",["WALogger","WAShiftTimer","WATimeUtils","WAWebAdvSignatureApi","WAWebAppTracker","WAWebBackendEventBus","WAWebLogoutReasonConstants","WAWebSocketLogoutJob","WAWebSocketModel","WAWebUserPrefsIsLoggedIn","WAWebViewerContextAuthUtils","WAWebWamDeviceLinkReporter","WAWebWamEnumMdLinkDeviceCompanionStage","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c=!1,d=!1,m=1e3,p=6e4*3;function _(){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["logout due to initial history sync timeout"]))),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.CriticalSync),o("WAWebSocketLogoutJob").socketLogout(o("WAWebLogoutReasonConstants").LogoutReason.HistorySyncTimeout)}function f(){c=!1,d=!1}function g(){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){c||d||(yield o("WAWebWamDeviceLinkReporter").setDeviceLinkPairStage(o("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE.FIRST_CONNECT),c=!0,yield o("WAWebAdvSignatureApi").clearADVSecretKey(),o("WAWebUserPrefsIsLoggedIn").setIsConnectedAsRegistered(!0),o("WAWebViewerContextAuthUtils").maybeReloadBeforeLogin())}),h.apply(this,arguments)}function y(){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){c||d||(d=!0,yield o("WAWebSocketModel").Socket.clearCredentialsAndStoredData(),yield o("WAWebAdvSignatureApi").clearADVSecretKey())}),C.apply(this,arguments)}function b(){new(o("WAShiftTimer")).ShiftTimer(function(){y()}).onOrAfter(m)}var v;function S(){v==null&&(v=self.setTimeout(_,p),o("WAWebBackendEventBus").BackendEventBus.onInitialChatHistorySynced(function(){self.clearTimeout(v)}))}function R(){var e=o("WATimeUtils").unixTimeMs();o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync][reg] begin device pairing latency measurement"]))),o("WAWebBackendEventBus").BackendEventBus.onCriticalSyncDone(function(){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[history sync][reg] main screen unblocked in ","ms"])),o("WATimeUtils").unixTimeMs()-e)})}l.resetCompanionReg=f,l.startLogin=g,l.startLogout=y,l.logoutAfterValidationFail=b,l.startInitialHistorySyncTimeout=S,l.initDevicePairingLatencyMeasurement=R}),98); __d("WAWebInitBotGatingHelpers",["WALogger","WAWebBackendApi","WAWebBackendEventBus","WAWebBotGating","WAWebInitializeBots","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var t=yield o("WAWebBackendApi").frontendSendAndReceive("getLanguage",void 0);o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[bot] initialized bot gating language cache with: ",""])),t),o("WAWebBotGating").setBonsaiUserLanguage(t)}catch(e){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[bot] failed to initialize bot gating language cache, bot features may not work correctly"])))}o("WAWebBackendEventBus").BackendEventBus.onAbPropsUpdate(function(){o("WAWebInitializeBots").initializeBots()}),o("WAWebBackendEventBus").BackendEventBus.onAbPropsLoaded(function(){o("WAWebInitializeBots").initializeBots()})}),c.apply(this,arguments)}l.initBotGatingHelpers=u}),98); __d("WAWebAdvStoredTimestampExpiredWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({AdvStoredTimestampExpired:[3036,{advExpireTimeInHours:[1,o("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{AdvStoredTimestampExpired:[]});l.AdvStoredTimestampExpiredWamEvent=e}),98); __d("WAWebAdvDeviceInfoCheckJob",["Promise","WAJids","WALogger","WATimeUtils","WAWebABProps","WAWebAdvStoredTimestampExpiredWamEvent","WAWebApiDeviceList","WAWebApiPendingDeviceSync","WAWebApiTasksScheduledTime","WAWebCurrentUser","WAWebIdentityUpdateDeviceTableApi","WAWebLastADVCheckTimeApi","WAWebLogoutReasonConstants","WAWebSocketLogoutJob","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=25*o("WATimeUtils").HOUR_SECONDS,m=(function(){function e(e){this.advToSystemBridge=e}var t=e.prototype;return t.run=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this.advToSystemBridge,n=yield t.getUsersForExpiration(e),r=n.usersCloseToExpiration,o=n.usersExpired;t.removeCompanions(o),t.sendADVStoredTimestampExpiredEvents(o,e);var a=Array.from(o.keys()).concat(Array.from(r.keys())).filter(function(e){return!t.canRemoveUserDevices(e)});return t.sendOrQueueDeviceUsyncQuery(a).catch(function(e){}),t.recordLocalTimestamp()});function t(t){return e.apply(this,arguments)}return t})(),e})(),p=(function(){function t(){}var r=t.prototype;return r.getNumDaysKeyIndexListExpiration=function(){return o("WAWebABProps").getABPropConfigValue("num_days_key_index_list_expiration")},r.getNumDaysBeforeDeviceExpiryCheck=function(){return o("WAWebABProps").getABPropConfigValue("num_days_before_device_expiry_check")},r.getUsersForExpiration=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this,n=yield o("WAWebApiDeviceList").getAllDeviceLists(),r=yield o("WAWebLastADVCheckTimeApi").getLastADVDeviceInfoCheckTime(),a=this.getNumDaysKeyIndexListExpiration()*o("WATimeUtils").DAY_SECONDS,i=new Map,l=new Map;return n.forEach(function(n){n.deleted||b(n)||(v(e,a,n,r)?i.set(o("WAWebWidFactory").createUserWidOrThrow(n.id),n):S(e,a-t.getNumDaysBeforeDeviceExpiryCheck()*o("WATimeUtils").DAY_SECONDS,n)&&l.set(o("WAWebWidFactory").createUserWidOrThrow(n.id),n))}),{usersExpired:i,usersCloseToExpiration:l}});function t(t){return e.apply(this,arguments)}return t})(),r.sendADVStoredTimestampExpiredEvents=function(t,n){var e=this;t.forEach(function(t){var r=n-(t.timestamp+e.getNumDaysKeyIndexListExpiration()*o("WATimeUtils").DAY_SECONDS);if(!(r<0)){var a=Math.round(r/o("WATimeUtils").HOUR_SECONDS);new(o("WAWebAdvStoredTimestampExpiredWamEvent")).AdvStoredTimestampExpiredWamEvent({advExpireTimeInHours:a}).commit()}})},r.sendOrQueueDeviceUsyncQuery=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return yield o("WAWebApiPendingDeviceSync").addUserToPendingDeviceSync(e.map(function(e){return e.toString()})),o("WAWebApiPendingDeviceSync").doPendingDeviceSync()});function t(t){return e.apply(this,arguments)}return t})(),r.canRemoveUserDevices=function(t){return!1},r.removeCompanions=function(r){var t=Array.from(r.entries()),a=t.some(function(e){var t=e[0],n=e[1];return t.user===o("WAWebUserPrefsMeUser").getMePnUserOrThrow().user});return a&&o("WAWebABProps").getABPropConfigValue("web_adv_logout_on_self_device_list_expired")?(o("WAWebCurrentUser").isEmployee()?o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Logging out due to own expired device"]))).sendLogs("web-own-device-list-expired"):o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Logging out due to own expired device"]))),o("WAWebSocketLogoutJob").socketLogout(o("WAWebLogoutReasonConstants").LogoutReason.InvalidAdvStatus),(c||(c=n("Promise"))).resolve()):(c||(c=n("Promise"))).all(Array.from(r.entries(),function(e){var t=e[0],n=e[1];return o("WAWebIdentityUpdateDeviceTableApi").clearDeviceRecord(t,n.devices)}))},r.recordLocalTimestamp=function(){return(c||(c=n("Promise"))).resolve()},t})(),_="advDeviceInfoCheck",f;function g(){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){f!=null&&(self.clearTimeout(f),f=null);var e=o("WATimeUtils").unixTimeWithoutClockSkewCorrection(),t=yield o("WAWebLastADVCheckTimeApi").getLastADVDeviceInfoCheckTime(),r=0,a=function(){return(c||(c=n("Promise"))).resolve()};t!=null&&(r=Math.max(o("WATimeUtils").DAY_SECONDS-(e-t),0),a=function(){return C()}),f=self.setTimeout(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield a()}catch(e){o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["error running the adv device check job"]))).tags("automated-device-verification")}f=null;var e=o("WATimeUtils").unixTimeWithoutClockSkewCorrection();o("WAWebLastADVCheckTimeApi").setLastADVDeviceInfoCheckTime(e),o("WAWebApiTasksScheduledTime").updateTaskScheduledTime(_,o("WATimeUtils").castToUnixTime(e)),g()}),r*1e3)}),h.apply(this,arguments)}var y;function C(){return y==null&&(y=new m(new p)),y.run(o("WATimeUtils").unixTimeWithoutClockSkewCorrection())}function b(e){return e.devices.length===1&&e.devices[0].id===o("WAJids").DEFAULT_DEVICE_ID}function v(e,t,n,r){return e-n.timestamp>=t?!0:n.expectedTsUpdateTs!=null?e-n.expectedTsUpdateTs>=d&&n.expectedTsLastDeviceJobTs!==r:!1}function S(e,t,n){return e-n.timestamp>=t?!0:n.expectedTs!=null?n.expectedTs>n.timestamp:!1}l.AdvToSystemBridgeImpl=p,l.scheduleAdvDeviceInfoCheck=g,l.runAdvDeviceInfoCheck=C}),98); __d("WAWebBackgroundSyncAction",["WALogger","WATimeUtils","WAWebABProps","WAWebPushNotificationsGatingUtils","WAWebPwaDocumentMetadataUtils","WAWebSetWorkerLocalStorage","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g="background-sync";function h(e){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){t===void 0&&(t=!1);try{var n,a;if(!o("WAWebPushNotificationsGatingUtils").canSupportPeriodicBackgroundSync()||!o("WAWebPwaDocumentMetadataUtils").isCurrentWebSessionInsidePwa())return;var i=yield(n=window.navigator.serviceWorker)==null?void 0:n.ready;if(!("periodicSync"in(i!=null?i:[])))return;var l=i==null?void 0:i.periodicSync;if(!l)return;var h=yield l.getTags==null?void 0:l.getTags();if(!h)return;var y=yield(a=window.navigator.permissions)==null||a.query==null?void 0:a.query({name:"background-sync"});if((y==null?void 0:y.state)!=="granted")return;var C=o("WAWebABProps").getABPropConfigValue("web_pwa_background_sync");if(!t&&C)if(yield o("WAWebSetWorkerLocalStorage").setWorkerLocalStorage(),h.includes(g))o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync is already registered"])));else{o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Start pwa background sync registration"]))),yield l.register==null?void 0:l.register(g,{minInterval:o("WAWebABProps").getABPropConfigValue("web_pwa_background_sync_min_interval_hours")*o("WATimeUtils").HOUR_MILLISECONDS});var b=yield l.getTags==null?void 0:l.getTags();b!=null&&b.includes!=null&&b.includes(g)?o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync registered successfully"]))):o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync failed to register"])))}else if(h.includes(g)){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Start pwa background sync unregistration"]))),yield l.unregister==null?void 0:l.unregister(g);var v=yield l.getTags==null?void 0:l.getTags();v!=null&&v.includes!=null&&v.includes(g)?o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync failed to unregister"]))):o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync unregistered successfully"])))}else o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["pwa background sync is already unregistered"])))}catch(e){var S=r("getErrorSafe")(e);o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["pwa-background-sync-registration-update-failure: ",""])),S.stack).sendLogs("pwa-background-sync-registration-update-failure")}}),y.apply(this,arguments)}l.updatePeriodicBackgroundSyncRegistration=h}),98); __d("WAWebUserPrefsCartLidMigration",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(t,n,r,o,a,i,l){function e(e){r("WAWebUserPrefsStore").set(o("WAWebUserPrefsKeys").UserPrefs.CartDbLidMigrationComplete,e)}function s(){return r("WAWebUserPrefsStore").get(o("WAWebUserPrefsKeys").UserPrefs.CartDbLidMigrationComplete)===!0}l.setCartLidMigrationValue=e,l.isCartLidMigrationComplete=s}),98); __d("WAWebCartDbLidMigration",["WALogger","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebModelStorageUtils","WAWebUserPrefsCartLidMigration","WAWebWidFactory","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){var e,s,u,c,d;function m(){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!(!o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||o("WAWebUserPrefsCartLidMigration").isCartLidMigrationComplete()))try{yield o("WAWebModelStorageUtils").getStorage().lock(["cart"],(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t[0];o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["cartDbLidMigration: start migration"])));var a=yield n.all(),i=[],l=r("compactMap")(a,function(e){var t=e.id,n=o("WAWebWidFactory").createUserWidOrThrow(t);if(n.isLid())return null;var r=o("WAWebLidMigrationUtils").toPn(n),a=o("WAWebLidMigrationUtils").toLid(n);return a==null||(r==null?void 0:r.user)==null?null:(e.id=a.toString(),i.push(t.toString()),{id:a.toString(),message:e.message,total:e.total,currency:e.currency,itemCount:e.itemCount,products:e.products})});if(l.length===0){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["cartDbLidMigration: end migration with no records"]))),o("WAWebUserPrefsCartLidMigration").setCartLidMigrationValue(!0);return}o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["cartDbLidMigration: updated records: ",""])),l.length),yield n.bulkCreateOrReplace(l),yield n.bulkRemove(i),o("WAWebUserPrefsCartLidMigration").setCartLidMigrationValue(!0),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["cartDbLidMigration: migration success"])))});return function(e){return t.apply(this,arguments)}})())}catch(e){o("WAWebUserPrefsCartLidMigration").setCartLidMigrationValue(!1),o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[LID] Failed to migrate cart db : ",""])),e).sendLogs("lid-cart-migration")}}),p.apply(this,arguments)}l.migrateCartDbLid=m}),98); __d("WAWebUserPrefsFavoritesLidMigration",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(t,n,r,o,a,i,l){function e(){r("WAWebUserPrefsStore").set(o("WAWebUserPrefsKeys").UserPrefs.FavoritesLidTableMigrationComplete,!0)}function s(){return r("WAWebUserPrefsStore").get(o("WAWebUserPrefsKeys").UserPrefs.FavoritesLidTableMigrationComplete)===!0}l.setFavoritesMigrationAsComplete=e,l.isFavoritesMigrationComplete=s}),98); __d("WAWebDBFavoriteDatabaseMigrationToLid",["WALogger","WAWebApiContact","WAWebLid1X1MigrationGating","WAWebModelStorageUtils","WAWebUserPrefsFavoritesLidMigration","WAWebWidFactory","asyncToGeneratorRuntime","err","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L;function E(){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: migration already complete"])));return}if(!o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: 1-1 threads are not migrated to lid"]))).sendLogs("migrateFavoritesDatabaseToLid-1-1-not-migrated");return}var t=!1;yield o("WAWebModelStorageUtils").getStorage().lock(["favorite","chat"],(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n=e[0],a=e[1],i=n,l=a;try{o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: start migration"])));var s=yield i.all(),L=[],E=new Set;if(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: loaded "," favorites"])),s.length),s.forEach(function(e){var t=e.id,n=o("WAWebWidFactory").createWid(t);if(n.isRegularUser()){if(n.isLid()){E.add(t);return}L.push(e)}}),L.length===0){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: no favorites to migrate"]))),t=!0;return}o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: found "," favorites to migrate"])),L.length);var k=L.map(function(e){return e.id}),I=yield l.bulkGet(k),T=0,D=0,x=0,$=[],P=[];L.forEach(function(e,t){var n=null,r=I[t];if(r!=null?n=r.accountLid:T++,n==null){var a;if(n=(a=o("WAWebApiContact").getCurrentLid(o("WAWebWidFactory").createUserWidOrThrow(k[t])))==null?void 0:a.toString(),n==null){r!=null&&D++;return}}if(E.has(n)){x++,$.push(e.id);return}$.push(e.id),P.push(babelHelpers.extends({},e,{id:n}))}),o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: not found chat rows: ",""])),T),o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: deduped favourites: ",""])),x),D>0&&o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: not found account lids: ",""])),D).sendLogs("migrateFavoritesDatabaseToLid-not-found-account-lids"),yield i.bulkRemove($);var N=(yield i.bulkGet(P.map(function(e){return e.id}))).filter(Boolean);if(N.length>0){var M=N.filter(function(e){return E.has(e.id)});o("WALogger").ERROR(g||(g=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: existing favorites that are not expected to be in the database: ",". In Lid set: ",""])),N.length,M.length).sendLogs("migrateFavoritesDatabaseToLid-existing-favorites");var w=new Set(N.map(function(e){return e.id}));P=P.filter(function(e){return!w.has(e.id)})}else o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: no existing favorites that are not expected to be in the database"])));var A=new Map(P.map(function(e){return[e.id,e]}));A.size!==P.length?(o("WALogger").ERROR(y||(y=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: duplicate favorites in favoritesToAdd array: ",""])),P.length-A.size).sendLogs("migrateFavoritesDatabaseToLid-duplicate-favorites"),P=Array.from(A.values())):o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: no duplicate favorites in favoritesToAdd array"]))),o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: adding "," favorites"])),P.length),yield i.bulkCreate(P);var F=yield i.count();if(o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: all favorites after migration: ",""])),F),F!==s.length-x)throw o("WALogger").ERROR(S||(S=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: all favorites after migration: "," does not match all favorites: "," minus deduped ",""])),F,s.length,x).sendLogs("migrateFavoritesDatabaseToLid-all-favorites-after-migration-mismatch"),r("err")("migrateFavoritesDatabaseToLid: mismatch after migration");t=D===0}catch(e){var O=r("getErrorSafe")(e);throw o("WALogger").ERROR(R||(R=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: migration error: ",""])),O.message).sendLogs("migrateFavoritesDatabaseToLid-error"),O}});return function(t){return e.apply(this,arguments)}})()),t&&(o("WALogger").LOG(L||(L=babelHelpers.taggedTemplateLiteralLoose(["migrateFavoritesDatabaseToLid: migration complete, success"]))),o("WAWebUserPrefsFavoritesLidMigration").setFavoritesMigrationAsComplete())}),k.apply(this,arguments)}l.migrateFavoritesDatabaseToLid=E}),98); __d("WAWebDBLabelAssociationDatabaseMigrationToLid",["WALogger","WAWebApiContact","WAWebLid1X1MigrationGating","WAWebModelStorageUtils","WAWebSchemaLabelAssociation","WAWebUserPrefsLabelAssociationsLidMigration","WAWebWidFactory","asyncToGeneratorRuntime","err","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C;function b(){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebUserPrefsLabelAssociationsLidMigration").isLabelAssociationsMigrationComplete()){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: migration already complete"])));return}if(!o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: 1-1 threads are not migrated to lid"]))).sendLogs("migrateLabelAssociationsDatabaseToLid-1-1-not-migrated");return}var t=!1;yield o("WAWebModelStorageUtils").getStorage().lock(["label-association","chat"],(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n=e[0],a=e[1],i=n,l=a;try{o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: start migration"])));var s=yield i.all(),C=[],b=new Set;if(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: loaded "," associations"])),s.length),s.forEach(function(e){var t=e.associationId,n=e.type;if(n===o("WAWebSchemaLabelAssociation").LabelAssociationType.Jid){var r=o("WAWebWidFactory").createWid(t);if(r.isRegularUser()){if(r.isLid()){b.add(t);return}C.push(e)}}}),C.length===0){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: no associations to migrate"]))),t=!0;return}o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: found "," associations to migrate"])),C.length);var v=C.map(function(e){return e.associationId}),S=yield l.bulkGet(v),R=0,L=0,E=0,k=[],I=[];C.forEach(function(e,t){var n=null,r=S[t];if(r!=null?n=r.accountLid:R++,n==null){var a;if(n=(a=o("WAWebApiContact").getCurrentLid(o("WAWebWidFactory").createUserWidOrThrow(v[t])))==null?void 0:a.toString(),n==null){r!=null&&L++;return}}if(b.has(n)){E++,k.push(o("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey(e));return}k.push(o("WAWebSchemaLabelAssociation").createLabelAssociationPrimaryKey(e)),I.push(babelHelpers.extends({},e,{associationId:n}))}),o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: not found chat rows: ",""])),R),o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: deduped associations: ",""])),E),L>0&&o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: not found account lids: ",""])),L).sendLogs("migrateLabelAssociationsDatabaseToLid-not-found-account-lids"),yield i.bulkRemove(k),yield i.bulkCreate(I);var T=yield i.count();if(o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: all associations after migration: ",""])),T),T!==s.length-E)throw o("WALogger").ERROR(h||(h=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: all associations after migration: "," does not match all LabelAssociations: "," minus deduped ",""])),T,s.length,E).sendLogs("migrateLabelAssociationsDatabaseToLid-all-associations-after-migration-mismatch"),r("err")("migrateLabelAssociationsDatabaseToLid: mismatch after migration");t=L===0}catch(e){throw o("WALogger").ERROR(y||(y=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: migration error: ",""])),r("getErrorSafe")(e).message).sendLogs("migrateLabelAssociationsDatabaseToLid-error"),r("getErrorSafe")(e)}});return function(t){return e.apply(this,arguments)}})()),t&&(o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["migrateLabelAssociationsDatabaseToLid: migration complete, success"]))),o("WAWebUserPrefsLabelAssociationsLidMigration").setLabelAssociationsMigrationAsComplete())}),v.apply(this,arguments)}l.migrateLabelAssociationsDatabaseToLid=b}),98); __d("WAWebDBPnhThreadMigrationToGeneralLid",["Promise","WALogger","WAWebBackendApi","WAWebContactSystemMsg","WAWebHandleSingleMsg","WAWebLid1X1MigrationGating","WAWebLidAwareContactsDB","WAWebModelStorageUtils","WAWebMsgType","WAWebPrivacyGatingUtils","WAWebSchemaChat","WAWebUserPrefsPhoneNumberHidingThreadPromotionMigration","WAWebUsernameTypes","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k;function I(e){return o("WAWebContactSystemMsg").genNotificationMsg(e,{type:"notification_template",kind:o("WAWebMsgType").MsgKind.NotificationTemplate,subtype:"pnh_thread_promotion",templateParams:[]})}function T(e){return D.apply(this,arguments)}function D(){return D=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=yield t.allPrimaryKeys();o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: loaded "," chat ids"])),n.length);var a=n.filter(function(e){return r("WAWebWid").isStringLid(e)});o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: found "," LID chat ids"])),a.length);var i=yield t.anyOf(["id"],a,{shouldDecrypt:!1});return i.filter(function(e){return e.lidOriginType===o("WAWebUsernameTypes").LidOriginType.PNH_CTWA})}),D.apply(this,arguments)}function x(){return $.apply(this,arguments)}function $(){return $=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!o("WAWebPrivacyGatingUtils").isPhoneNumberHidingThreadPromotionToGeneralLidEnabled()){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: feature not enabled"])));return}var e=o("WAWebUserPrefsPhoneNumberHidingThreadPromotionMigration").getPhoneNumberHidingThreadPromotionMigrationState();if(e==="migrated"){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: migration already complete"])));return}if(!o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: 1-1 threads are not migrated to lid"]))).sendLogs("migratePhoneNumberHidingThreadsToGeneralLid-1-1-not-migrated");return}e!=="migration_started"&&o("WAWebUserPrefsPhoneNumberHidingThreadPromotionMigration").setPhoneNumberHidingThreadPromotionMigrationState("migration_started");var t=!1,a=[],i=[];if(yield o("WAWebModelStorageUtils").getStorage().lock(["chat","contact"],(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n=e[0],l=e[1],s=n;try{o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: start migration"])));var u=yield T(s);if(u.length===0){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: no chats found with CTWA lidOriginType"]))),t=!0;return}o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: found "," chats to migrate from CTWA to GENERAL"])),u.length);var c=u.map(function(e){return{id:e.id,lidOriginType:o("WAWebUsernameTypes").LidOriginType.GENERAL}});yield s.bulkMergeOnly(c),o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: successfully updated "," chats from CTWA to GENERAL"])),c.length),a=u.map(function(e){return e.id}),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: checking shareOwnPn status for "," affected chats"])),a.length);var d=yield r("WAWebLidAwareContactsDB").bulkGet(a);i=a.filter(function(e,t){var n=d[t];return(n==null?void 0:n.shareOwnPn)!==!0}),o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: filtered to "," chats where shareOwnPn is not true"])),i.length),t=!0}catch(e){throw o("WALogger").ERROR(y||(y=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: migration error: ",""])),String(e)).sendLogs("migratePhoneNumberHidingThreadsToGeneralLid-error"),e}});return function(t){return e.apply(this,arguments)}})()),t){if(a.length>0){o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: propagating lid origin type changes to frontend for "," chats"])),a.length);var l=a.map(function(e){return{id:o("WAWebWidFactory").createWid(e),lidOriginType:o("WAWebUsernameTypes").LidOriginType.GENERAL}});o("WAWebBackendApi").frontendFireAndForget("chatCollectionUpdate",{updates:l}),o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: frontend propagation complete"])))}if(i.length>0){o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: generating system messages for "," chats where shareOwnPn is not true"])),i.length);var s=i.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){try{var t=o("WAWebWidFactory").createWid(e),n=I(t);yield o("WAWebHandleSingleMsg").handleSingleMsg({chatId:t,newMsg:n,handleSingleMsgOrigin:"generatePhnThreadPromotionMessage"})}catch(t){o("WALogger").ERROR(S||(S=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: failed to generate system message for chat ",": ",""])),e,String(t)).sendLogs("migratePhoneNumberHidingThreadsToGeneralLid-system-msg-error")}});return function(t){return e.apply(this,arguments)}})());yield(k||(k=n("Promise"))).all(s),o("WALogger").LOG(R||(R=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: system message generation complete"])))}var D=yield T(o("WAWebSchemaChat").getChatTable());D.length===0?(o("WALogger").LOG(L||(L=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: migration complete, success"]))),o("WAWebUserPrefsPhoneNumberHidingThreadPromotionMigration").setPhoneNumberHidingThreadPromotionMigrationState("migrated")):o("WALogger").WARN(E||(E=babelHelpers.taggedTemplateLiteralLoose(["migratePhoneNumberHidingThreadsToGeneralLid: migration complete, but some chats still need to be updated"])))}}),$.apply(this,arguments)}l.migratePhoneNumberHidingThreadsToGeneralLid=x}),98); __d("WAWebEventsWaitForMain",["WAResolvable"],(function(t,n,r,o,a,i,l){var e=new(o("WAResolvable")).Resolvable;function s(){return e.promise}function u(){e.resolve()}l.waitForMain=s,l.resolveMainLoaded=u}),98); __d("WAWebFtsClientMessageIdResolver",["WAWebDBMessageSerialization","WAWebSchemaMessage"],(function(t,n,r,o,a,i,l){function e(e){var t=e.map(function(e){return+e.id}),n=new Map(e.map(function(e){return[+e.id,e]}));return o("WAWebSchemaMessage").getMessageTable().anyOf(["rowId"],t).then(function(e){var t=[];e.forEach(function(e){var r=o("WAWebDBMessageSerialization").messageFromDbRow(e),a=n.get(r.rowId);a!=null&&a.id===String(r.rowId)&&a.timestamp===r.t&&a.chatId===r.id.remote.toString()&&(t.push(r),n.delete(r.rowId))});var r=Array.from(n.keys(),function(e){return String(e)});return t.sort(function(e,t){return t.t-e.t}),{resolved:t,unresolved:r}})}l.resolveMsgIds=e}),98); __d("WAWebFtsGenRequestId",[],(function(t,n,r,o,a,i){var e=0;function l(){return e++}i.default=l}),66); __d("WAWebBrokerMainConnect",["WAWebBrokerConnectionManager","WAWebBrokerProtocolHandshake","WAWebInvocationDispatcher","WAWebInvocationHandler"],(function(t,n,r,o,a,i,l){function e(e){var t=new MessageChannel,n=t.port1,a=t.port2;r("WAWebInvocationHandler").respondTo(n),r("WAWebBrokerConnectionManager").init(),r("WAWebInvocationDispatcher").setConnectionManager(r("WAWebBrokerConnectionManager")),r("WAWebBrokerConnectionManager").connectVia(n),e.postMessage(o("WAWebBrokerProtocolHandshake").buildHandshakePayload(a),[a])}l.default=e}),98); __d("WAWebFtsWorkerAdapter",["WANullthrows","WAWebBrokerMainConnect","WAWebFtsWorkerResource","WorkerBundleResource"],(function(t,n,r,o,a,i,l){var e=null,s=(function(){function e(){this.worker=null}var t=e.prototype;return t.initialize=function(t,n){this.worker=o("WorkerBundleResource").createDedicatedWebWorker(r("WAWebFtsWorkerResource")),r("WANullthrows")(this.worker).onmessage=function(e){t(e.data.message)},r("WANullthrows")(this.worker).onerror=n,r("WAWebBrokerMainConnect")(this)},t.postMessage=function(t,n){var e={type:"message",message:t};r("WANullthrows")(this.worker).postMessage(e,n)},t.terminate=function(){r("WANullthrows")(this.worker).terminate()},e})();function u(t,n){return e||(e=new s,e.initialize(t,n)),e}l.getFtsWorker=u}),98); __d("WAWebFtsClient",["Promise","WALogger","WANullthrows","WAWebEnvironment","WAWebFtsClientMessageIdResolver","WAWebFtsGenRequestId","WAWebFtsWorkerAdapter","asyncToGeneratorRuntime","cr:1274","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=(e=n("cr:1274"))!=null?e:{},m=d.FtsSQLiteClient,p=(function(){function e(){this.$2=new Map}var t=e.prototype;return t.initialize=function(){var e=this;if(!this.$1){var t=function(n){e.$3(n)},n=function(n){return e.$4(n)},r=o("WAWebFtsWorkerAdapter").getFtsWorker(t,n);this.$1=r}},t.$4=function(t){o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[fts][client] worker error: ",""])),t)},t.$3=function(t){var e=t.reqId,n=this.$2.get(e);n&&(t.error?(o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[fts][client] worker completed job "," with error"])),n.command.operation),n.reject(r("err")("FTS worker error"))):n.resolve(t.result),this.$5(e))},t.startIndexer=function(){return this.$6({operation:"start-indexer"})},t.indexFull=function(t){return this.$6({operation:"run"})},t.index=function(){return this.$6({operation:"consume"})},t.purge=function(t){return this.$6({operation:"purge",ids:t})},t.purgeRange=function(t){return this.$6(babelHelpers.extends({operation:"purge-range"},t))},t.reInit=function(){return this.$6({operation:"re-init"})},t.initExternalStorage=function(){return(c||(c=n("Promise"))).resolve()},t.destroyExternalStorage=function(){return(c||(c=n("Promise"))).resolve()},t.clearInitializationPromises=function(){return this.$6({operation:"clear-init"})},t.search=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield this.$6({operation:"find",query:e,queryOptions:t});return this.$7(n)});function t(t,n){return e.apply(this,arguments)}return t})(),t.$7=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(Array.isArray(e)||typeof e=="boolean")return{canceled:!1,eof:!0,status:404,messages:[]};var t=yield o("WAWebFtsClientMessageIdResolver").resolveMsgIds(e.messages),n=t.resolved,r=t.unresolved,a=e.eof,i=e.status;return r.length>0&&this.purge(r),{canceled:!1,eof:a,status:i,messages:n}});function t(t){return e.apply(this,arguments)}return t})(),t.$6=function(t){var e=this;this.initialize();var o=r("WAWebFtsGenRequestId")();return new(c||(c=n("Promise")))(function(n,r){var a={command:t,reqId:o};e.$2.set(o,{resolve:n,reject:r,command:t}),e.$8(a)}).finally(function(){e.$5(o)})},t.$5=function(t){this.$2.delete(t)},t.$8=function(t){r("WANullthrows")(this.$1).postMessage(t)},e})(),_=m!=null&&r("WAWebEnvironment").isWindows?new m:new p;l.ftsClient=_}),98); __d("WAWebHistorySyncProgress",["Promise","WALogger","WAWebBackendApi","WAWebBackendEventBus","WAWebProtobufsHistorySync.pb","WAWebUserPrefsHistorySync","WAWebUserPrefsTypes","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=120,m=3,p=[o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.RECEIVED,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.NOTIFICATION_STORED,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADING],_=null;function f(){_!=null&&self.clearTimeout(_)}function g(){f(),_=self.setTimeout(function(){R(!0)},d*1e3)}var h=0;function y(e){h=e?0:h+1,h===0&&g(),R(h>=3)}function C(){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var t=yield(c||(c=n("Promise"))).all([v(),o("WAWebUserPrefsHistorySync").getHistorySyncStatus()]),r=t[0],a=t[1],i=(a==null?void 0:a.recentCompleted)!==!0;o("WAWebBackendApi").frontendFireAndForget("setHistorySyncProgress",{incomplete:i}),r!=null&&o("WAWebBackendApi").frontendFireAndForget("setHistorySyncProgress",{progress:r})}catch(t){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["updateProgressModel: error computing progress"])))}}),b.apply(this,arguments)}function v(){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebUserPrefsHistorySync").getChunkCountForEndOfRecentHistorySync();if(!(e===0&&(e=yield o("WAWebUserPrefsHistorySync").getEstimatedChunkCountForEndOfRecentHistorySync(),e===0))){var t=yield o("WAWebUserPrefsHistorySync").getLastHistorySyncedChunk();if(t!=null){var n=t.split("_").map(function(e){return parseInt(e,10)}),r=n[0],a=n[1];if(r===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT){var i=Math.floor(a/e*100);return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] computeProgress: compute progress when the last processed history sync chunk is completed"]))),Math.min(100,i)}}return L(e)}}),S.apply(this,arguments)}function R(e){o("WAWebBackendApi").frontendFireAndForget("setHistorySyncPaused",{paused:e})}function L(e){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=(t=yield o("WAWebUserPrefsHistorySync").getRecentSyncSingleChunkStatus())==null?void 0:t[1];if(n==null||p.includes(n))return null;o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[history sync] computeProgress: compute progress when the first history sync chunk is downloaded"])));var r=Math.floor(1/e/m*100);return Math.min(100,r)}),E.apply(this,arguments)}o("WAWebBackendEventBus").BackendEventBus.onCriticalSyncDone(function(){g()}),o("WAWebBackendEventBus").BackendEventBus.onRecentChatHistorySynced(function(){f(),R(!1),o("WAWebBackendApi").frontendFireAndForget("setHistorySyncProgress",{progress:100,incomplete:!1})}),l.handleChunkProgress=y,l.updateHistorySyncProgressModel=C}),98); __d("WAWebInboxFiltersGatingUtils",["WAWebABProps","WAWebMobilePlatforms","WAWebPrimaryFeatures"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebMobilePlatforms").isSMB()?o("WAWebABProps").getABPropConfigValue("inbox_filters_smb_enabled"):!0}function s(){return e()&&o("WAWebPrimaryFeatures").primaryFeatureEnabled("primary_favorites_sync_support")}function u(){return o("WAWebMobilePlatforms").isSMB()&&o("WAWebABProps").getABPropConfigValue("inbox_filters_smb_enabled")&&o("WAWebABProps").getABPropConfigValue("inbox_filters_custom_smb_enabled")}l.inboxFiltersEnabled=e,l.inboxFavoritesEnabled=s,l.inboxCustomFiltersEnabled=u}),98); __d("WAWebJestE2ELogUtils",["gkx"],(function(t,n,r,o,a,i,l){function e(e){r("gkx")("26256")}l.maybeLogToJestE2eJSConsole=e}),98); __d("WAWebLid1x1MigrationManager",["Promise","WALogger","WAWebLid1X1MigrationGating","WAWebLid1X1ThreadAccountMigrations","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m=(function(){function t(){this.$1=[]}var r=t.prototype;return r.addDependentMigrationTask=function(n){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[Lid1x1ThreadMigrationManager] task registered"]))),this.$1.push(n)},r.executeMigrationIfNeeded=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebLid1X1ThreadAccountMigrations").shouldMigrateNow()&&!o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&(yield o("WAWebLid1X1ThreadAccountMigrations").migrate1x1Chats()),this.$1.length===0){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Lid1x1ThreadMigrationManager: no dependant migration tasks"])));return}var e=o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();try{e&&(yield(d||(d=n("Promise"))).all(this.$1.map(function(e){return e()})),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[Lid1x1ThreadMigrationManager] executed "," tasks"])),this.$1.length))}catch(e){o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[Lid1x1ThreadMigrationManager] executeMigrationTasks err: ",""])),e)}});function t(){return e.apply(this,arguments)}return t})(),t})(),p=new m;l.ThreadMigrationManager=p}),98); __d("WAWebLid1x1MigrationTimeoutUtils",["WALogger","WASyncdConst","WATimeUtils","WAWebABProps","WAWebLid1X1MigrationGating","WAWebLid1X1ThreadAccountMigrations","WAWebLid1X1ThreadAccountMigrations.flow","WAWebProtobufSyncAction.pb","WAWebSyncdDb","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","decodeProtobuf"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m=[o("WAWebLid1X1ThreadAccountMigrations.flow").LidThreadMigrationStatus.COMPLETE,o("WAWebLid1X1ThreadAccountMigrations.flow").LidThreadMigrationStatus.IN_PROGRESS,o("WAWebLid1X1ThreadAccountMigrations.flow").LidThreadMigrationStatus.READY];function p(){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e,t='["'+o("WASyncdConst").Actions.DeviceCapabilities+'","'+o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow().user+':0@s.whatsapp.net"]',n=yield o("WAWebSyncdDb").getSyncAction(t);if((n==null?void 0:n.binarySyncData)==null)return null;var r=(e=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,n.binarySyncData).value)==null||(e=e.deviceCapabilities)==null||(e=e.lidMigration)==null?void 0:e.chatDbMigrationTimestamp;return r==null?null:o("WATimeUtils").castLongIntToUnixTime(r)}),_.apply(this,arguments)}function f(){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] check logout for missing peer msg"])));var t=o("WAWebABProps").getABPropConfigValue("lid_one_on_one_migration_peer_sync_timeout_in_seconds");if(t===0)return{shouldScheduleTimeout:!1};if(o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated())return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] already migrated"]))),{shouldScheduleTimeout:!1};var n=o("WAWebLid1X1ThreadAccountMigrations").getLidThreadMigrationStatus().state;if(m.includes(n))return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] already got peer mapping"]))),{shouldScheduleTimeout:!1};var r=yield p();if(r==null)return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] primary did not migrate"]))),{shouldScheduleTimeout:!1};var a=o("WATimeUtils").unixTime(),i=o("WATimeUtils").timeoutForAt(a,r,t),l=i/1e3;return o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] logout in ","s delay="," primaryT="," localT="," state=",""])),l,t,r,a,n),{shouldScheduleTimeout:!0,timeoutUntilLogout:i}}),g.apply(this,arguments)}l.PEER_MAPPING_RECEIVED_STATUSES=m,l.getPrimaryMigrationTime=p,l.shouldScheduleTimeoutForMissingPeerMessage=f}),98); __d("WAWebLid1x1MigrationTimeout",["WAAsyncSleep","WALogger","WAWebEventsWaitForOfflineDeliveryEnd","WAWebLid11MigrationLifecycleWamEvent","WAWebLid1X1MigrationGating","WAWebLid1x1MigrationTimeoutUtils","WAWebLogoutReasonConstants","WAWebSocketLogoutJob","WAWebUserPrefsIndexedDBStorage","WAWebWamEnumMigrationStageEnum","WAWebWamEnumStageFailureReasonEnum","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_=null;function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(_!=null){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] already scheduled logout. is offline: ",""])),o("WAWebEventsWaitForOfflineDeliveryEnd").isOfflineDeliveryEnd());return}o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] check timeout src="," offline=",""])),t,o("WAWebEventsWaitForOfflineDeliveryEnd").isOfflineDeliveryEnd());var r=yield o("WAWebLid1x1MigrationTimeoutUtils").shouldScheduleTimeoutForMissingPeerMessage(),a=r.shouldScheduleTimeout,i=r.timeoutUntilLogout;a&&(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] setting logout timeout. is offline: ",""])),o("WAWebEventsWaitForOfflineDeliveryEnd").isOfflineDeliveryEnd()),_=self.setTimeout(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] running logout check. is offline: ",""])),o("WAWebEventsWaitForOfflineDeliveryEnd").isOfflineDeliveryEnd());var e=yield o("WAWebLid1x1MigrationTimeoutUtils").shouldScheduleTimeoutForMissingPeerMessage(),t=e.shouldScheduleTimeout;o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] should logout in second check: ",". is offline: ",""])),t,o("WAWebEventsWaitForOfflineDeliveryEnd").isOfflineDeliveryEnd()),t&&(o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.hasStateDiscrepancy()?yield C():yield h())}),i))}),g.apply(this,arguments)}function h(){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] logout: no peer mappings received"]))).sendLogs("lid-migration-did-not-receive-mapping"),yield o("WAAsyncSleep").asyncSleep(5e3),o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[lid][timeout] will logout. is offline: ",""])),o("WAWebEventsWaitForOfflineDeliveryEnd").isOfflineDeliveryEnd()),yield new(o("WAWebLid11MigrationLifecycleWamEvent")).Lid11MigrationLifecycleWamEvent({migrationStage:o("WAWebWamEnumMigrationStageEnum").MIGRATION_STAGE_ENUM.COMPANION_LOCAL_MIGRATION_FAILED,stageFailureReason:o("WAWebWamEnumStageFailureReasonEnum").STAGE_FAILURE_REASON_ENUM.COMPANION_TIMEOUT_BASED_ON_DEVICE_CAPABILITY,isLocally1x1MigratedFromDb:o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()}).commitAndWaitForFlush(!0);var e=yield o("WAWebLid1x1MigrationTimeoutUtils").shouldScheduleTimeoutForMissingPeerMessage(),t=e.shouldScheduleTimeout;t&&(yield o("WAWebSocketLogoutJob").socketLogout(o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationPeerMappingsNotReceived))}),y.apply(this,arguments)}function C(){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAAsyncSleep").asyncSleep(5e3),yield new(o("WAWebLid11MigrationLifecycleWamEvent")).Lid11MigrationLifecycleWamEvent({migrationStage:o("WAWebWamEnumMigrationStageEnum").MIGRATION_STAGE_ENUM.COMPANION_LOCAL_MIGRATION_FAILED,stageFailureReason:o("WAWebWamEnumStageFailureReasonEnum").STAGE_FAILURE_REASON_ENUM.COMPANION_UNSUPPORTED_VERSION,isLocally1x1MigratedFromDb:o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get("WAIsAccountLidFieldMigrated")===!0,peerMappingBytesLength:-1}).commitAndWaitForFlush(!0);var e=yield o("WAWebLid1x1MigrationTimeoutUtils").shouldScheduleTimeoutForMissingPeerMessage(),t=e.shouldScheduleTimeout;t&&(yield o("WAWebSocketLogoutJob").socketLogout(o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationStateDiscrepancy))}),b.apply(this,arguments)}l.scheduleLogoutIfNeeded=f}),98); __d("WAWebLogoutReason",["WAWebLogoutReasonConstants"],(function(t,n,r,o,a,i,l){var e=null,s=null;function u(e){return e===o("WAWebLogoutReasonConstants").LogoutReason.WebFailAddChat||e===o("WAWebLogoutReasonConstants").LogoutReason.WebFailEncSalt||e===o("WAWebLogoutReasonConstants").LogoutReason.WebFailOfflineResume||e===o("WAWebLogoutReasonConstants").LogoutReason.WebFailStorageInitialization?o("WAWebLogoutReasonConstants").LOGOUT_REASON_CODE.CLIENT_FATAL:e===o("WAWebLogoutReasonConstants").LogoutReason.SyncdFailure||e===o("WAWebLogoutReasonConstants").LogoutReason.SyncdErrorDuringBootstrap||e===o("WAWebLogoutReasonConstants").LogoutReason.AccountSyncError||e===o("WAWebLogoutReasonConstants").LogoutReason.SyncdTimeout||e===o("WAWebLogoutReasonConstants").LogoutReason.CriticalSyncTimeout?o("WAWebLogoutReasonConstants").LOGOUT_REASON_CODE.SYNC_FAIL:e===o("WAWebLogoutReasonConstants").LogoutReason.HistorySyncTimeout?o("WAWebLogoutReasonConstants").LOGOUT_REASON_CODE.INITIAL_HISTORY_SYNC_TIMEOUT:e===o("WAWebLogoutReasonConstants").LogoutReason.AccountLocked?o("WAWebLogoutReasonConstants").LOGOUT_REASON_CODE.ACCOUNT_LOCKED:e===o("WAWebLogoutReasonConstants").LogoutReason.UserInitiated||e===o("WAWebLogoutReasonConstants").LogoutReason.InvalidAdvStatus||e===o("WAWebLogoutReasonConstants").LogoutReason.AccountSyncTimeout||e===o("WAWebLogoutReasonConstants").LogoutReason.MDOptOut||e===o("WAWebLogoutReasonConstants").LogoutReason.UnknownCompanion||e===o("WAWebLogoutReasonConstants").LogoutReason.ClientVersionOutdated||e===o("WAWebLogoutReasonConstants").LogoutReason.StorageQuotaExceeded||e===o("WAWebLogoutReasonConstants").LogoutReason.PrimaryIdentityKeyChange||e===o("WAWebLogoutReasonConstants").LogoutReason.MissingEncSalt||e===o("WAWebLogoutReasonConstants").LogoutReason.MissingScreenLockSalt||e===o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationSplitThreadMismatch||e===o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationNoLidAvailiable||e===o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationPrimaryMappingsObsolete||e===o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationPeerMappingsNotReceived||e===o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationStateDiscrepancy||e===o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationPeerMappingsMalformed||e===o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationFailedToParseMapping||e===o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationCompanionIncompatibleKillswitch||e===o("WAWebLogoutReasonConstants").LogoutReason.LidMigrationOneOnOneThreadMigrationInternalError||e===o("WAWebLogoutReasonConstants").LogoutReason.LidBlocklistPnWhenMigrated||e===o("WAWebLogoutReasonConstants").LogoutReason.LidBlocklistChatDbUnmigrated||e===o("WAWebLogoutReasonConstants").LogoutReason.CacheStorageOpenFailed?null:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}function c(t){e=t}function d(e){s=e}function m(){return e}function p(){return s}l.getErrorCodeFromLogoutReason=u,l.setPrevLogoutReasonCode=c,l.setPrevCustomLogoutMessage=d,l.getPrevLogoutReasonCode=m,l.getPrevCustomLogoutMessage=p}),98); __d("WAWebMediaHost",["WAWebMmsMediaTypes"],(function(t,n,r,o,a,i,l){var e=new Set(o("WAWebMmsMediaTypes").MEDIA_TYPE_VALUES),s=Object.freeze({PRIMARY:"primary",FALLBACK:"fallback"}),u=(function(){function e(t){this.hostname=t.hostname,this.ips=t.ips||[],this.type=t.type,this.class=t.class;var n=c(t.rules),r=n.downloadBuckets,o=n.supportedDownloadTypes,a=n.supportedUploadTypes;this.downloadBuckets=r,this.$1=o,this.$2=a,this.fallback=t.fallback!=null?new e(babelHelpers.extends({},t,t.fallback,{type:"fallback",fallback:void 0})):null}var t=e.prototype;return t.equals=function(t){return this.hostname===(t==null?void 0:t.hostname)},t.isFallback=function(){return this.type===s.FALLBACK},t.supportsDownloadMediaType=function(t){return this.$1.has(d(t))},t.supportsUploadMediaType=function(t){return this.$2.has(m(t))},t.setSelectedBucket=function(t){this.selectedBucket=t},e})();function c(t){var n=t||[],r,o,a;for(var i of n){if(i.download){r=r!=null?r:new Set;for(var l of i.download)r.add(l)}if(i.upload){o=o!=null?o:new Set;for(var s of i.upload)o.add(s)}i.downloadBuckets&&(a=i.downloadBuckets.map(function(e){return parseInt(e,10)}))}return{supportedDownloadTypes:r!=null?r:e,supportedUploadTypes:o!=null?o:e,downloadBuckets:a}}function d(e){return e==="ptv"||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTV?o("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO:e}function m(e){return e==="ptv"?o("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO:e==="product-catalog-image"?o("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT:e}l.HOST_TYPE=s,l.MediaHost=u}),98); __d("WAWebMediaHostsErrors",["WACustomError"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(t){var n;return n=e.call(this,t!=null?t:"")||this,n.name="NoMediaHostsError",n}return babelHelpers.inheritsLoose(t,e),t})(o("WACustomError").CustomError);l.NoMediaHostsError=e}),98); __d("WAWebMediaHostsRouteSelection",["WABase64Modulo","WAWebABProps"],(function(t,n,r,o,a,i,l){var e={DOWNLOAD:"DOWNLOAD",UPLOAD:"UPLOAD"};function s(t){var n=t.encFilehash,a=t.hosts,i=t.maxBuckets,l=t.operation,s=t.type;if(!a.length)return{selectedHost:null,fallbackHost:null};var c;if(l===e.DOWNLOAD){var d,m=o("WAWebABProps").getABPropConfigValue("mms_vcache_aggregation_enabled"),p;n==null?p=0:m&&i!=null&&(p=r("WABase64Modulo")(n,i)+100);var _=u(a),f=p==null?null:_.get(p),g=_.get(0);f!=null&&f.supportsDownloadMediaType(s)?c=f:g!=null&&g.supportsDownloadMediaType(s)&&(c=g),(d=c)==null||d.setSelectedBucket(p)}var h=a.find(function(e){return e.isFallback()});return c=c!=null?c:a.find(function(t){return l===e.UPLOAD?t.supportsUploadMediaType(s):t.supportsDownloadMediaType(s)}),{selectedHost:c!=null?c:null,fallbackHost:h!=null?h:null}}function u(e){var t=new Map;return e.forEach(function(e){var n;(n=e.downloadBuckets)==null||n.forEach(function(n){t.set(n,e)})}),t}l.OPERATIONS=e,l.routeSelection=s}),98); __d("WAWebQueryMediaConnsJob",["WADeprecatedSendIq","WALogger","WAMediaConnParser","WAPromiseRaceAbort","WATimeUtils","WAWap","WAWebBackendErrors","compactMap","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p;function _(e){return(function(e){if(e==="kyc-id"||e==="novi-image"||e==="novi-video"||e==="thumbnail-gif"||e==="xma-image")return null;if(e==="image"||e==="sticker"||e==="ptt"||e==="audio"||e==="document"||e==="video"||e==="gif"||e==="ppic"||e==="md-app-state"||e==="md-msg-hist"||e==="template"||e==="thumbnail-image"||e==="thumbnail-video"||e==="thumbnail-document"||e==="thumbnail-link"||e==="payment-bg-image"||e==="biz-cover-photo"||e==="preview"||e==="newsletter-music-artwork"||e==="newsletter-audio"||e==="newsletter-document"||e==="newsletter-image"||e==="newsletter-gif"||e==="newsletter-ptt"||e==="newsletter-sticker"||e==="newsletter-sticker-pack"||e==="newsletter-thumbnail-link"||e==="newsletter-video"||e==="newsletter-ptv"||e==="sticker-pack"||e==="thumbnail-sticker-pack"||e==="music-artwork"||e==="group-history"||e==="ads-image"||e==="ads-video"||e==="ptv"){var t=e;return t}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})(e)}function f(e){return{hostname:e.domain,class:e.class,ips:[{ip4:e.ip4,ip6:e.ip6}]}}function g(e){var t=function(t){var e=[],n=r("compactMap")(t.downloadable,_);n.length>0&&e.push({download:n});var o=r("compactMap")(t.uploadable,_);o.length>0&&e.push({upload:o});var a=t.downloadBuckets.map(function(e){return e.toString()});return a!=null&&a.length>0&&e.push({downloadBuckets:a}),e};return{hosts:e.hosts.map(function(e){return babelHelpers.extends({},f(e),{fallback:e.fallback!=null?f(e.fallback):void 0,type:e.isFallback?"fallback":"primary",rules:t(e)})}),auth:e.authToken,authTTL:e.authTokenExpiryTs,ttl:e.routesExpiryTs,maxBuckets:e.maxBuckets}}function h(t){var n,a=new Date,i=o("WATimeUtils").unixTime(),l=(n=o("WAWap")).wap("iq",{to:n.S_WHATSAPP_NET,xmlns:"w:m",type:"set",id:n.generateId()},n.wap("media_conn",null)),_=o("WADeprecatedSendIq").deprecatedSendIq(l,o("WAMediaConnParser").mediaConnParser).then(function(t){if(t.success){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConn: got "," hosts"])),t.result.hosts.length);var n=g(t.result),l=n.auth,_=n.authTTL,f=n.hosts,h=n.maxBuckets,y=n.ttl;if(!l||y==null||!f||f.length===0)throw o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConnections: auth exists ",""])),String(!!l)),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConnections: ttl exists ",""])),String(!!y)),o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConnections: hosts exists ",""])),String(!!f)),f&&o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["backend:queryMediaConnections: hosts.length ",""])),f.length),o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).sendLogs("backend:queryMediaConnections unexpected mediaConn"),r("err")("Invalid mediaConn");return{queryStartTime:a,auth:l,hosts:f,ttl:y-i,maxBuckets:h,authTTL:_-i}}else throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["response: "," ",""])),t.errorCode,t.errorText).sendLogs("backend:queryMediaConn: fail"),t.errorCode===507?new(o("WAWebBackendErrors")).E507(t.errorText,t.errorBackoff):new(o("WAWebBackendErrors")).ServerStatusCodeError(t.errorCode,t.errorText)});return r("WAPromiseRaceAbort")(_,t)}l.mapParsedMediaConn=g,l.queryMediaConn=h}),98); __d("WAWebQueryMediaConnsBridge",["WABackoffDelay","WAPromiseBackoffs","WAWebBackendErrors","WAWebQueryMediaConnsJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=1e3,s=900*1e3,u=o("WAPromiseBackoffs").createTimer({algo:{type:"fibonacci",first:0,second:1},max:s,jitter:.25});function c(t){return o("WABackoffDelay").backoff({delay:function(n){var t=n.taskDuration,r=e*u();return Math.max(r-t,0)},signal:t},(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n=o("WAWebQueryMediaConnsJob").queryMediaConn(t);try{var r=yield n,a=r.authTTL,i=r.ttl;return a*=1e3,i*=1e3,babelHelpers.extends({},r,{authTTL:a,ttl:i})}catch(t){if(t instanceof o("WAWebBackendErrors").E507)throw t;if(t instanceof o("WAWebBackendErrors").ServerStatusCodeError&&t.status>=500)return e(t);throw t}});return function(t){return e.apply(this,arguments)}})())}l.sendQueryMediaConn=c}),98); __d("WAWebMediaHosts",["Promise","WAAbortError","WALogger","WAMemoizeConcurrent","WAWebBackendErrors","WAWebMediaHost","WAWebMediaHostsErrors","WAWebMediaHostsRouteSelection","WAWebNormalizeStack","WAWebQueryMediaConnsBridge","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","isEmptyObject"],(function(t,n,r,o,a,i,l){var e=["forceRefresh"],s=["message","name","stack"],u,c,d,m,p,_,f=(function(){function t(){var e=this;this._locked=!1,this._fetch=r("WAMemoizeConcurrent")(function(){return"all"},(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var r=t.signal;try{var a=yield o("WAWebQueryMediaConnsBridge").sendQueryMediaConn(r);e._data=e._createMediaConnData(a),o("WAWebUserPrefsMultiDevice").setMms4Conn(a),e._err=null}catch(t){var i=t;if(i instanceof o("WAWebBackendErrors").E507){var l;e._data=e._previousData,e._previousData=null,e._locked=!0,self.setTimeout(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield e._refreshIfStale({signal:r}),e._locked=!1}),(l=i.backoff)!=null?l:void 0);return}if(e._data=null,e._err=i,i.name===o("WAAbortError").ABORT_ERROR){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["mediaHosts.sendQueryMediaConn aborted"])));return}o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["mediaHosts.sendQueryMediaConn error: ",""])),h(i)).verbose(),o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).sendLogs("Error fetching mms hosts")}});return function(e){return t.apply(this,arguments)}})()),this._reset()}var a=t.prototype;return a.forceRefresh=function(t){if(this._locked)return(_||(_=n("Promise"))).resolve(!1);var e={signal:t,forceRefresh:!0};return this._refreshIfStale(e)},a.getCachedHostsInfo=function(t){var e=this;if(!this._locked){var r={signal:t.signal||new AbortController().signal,forceRefresh:!1};self.setTimeout(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield e._refreshIfStale(r),e._locked=!1}),0)}return this._getPreferredHostsInfo(t)},a.maybeLoadMediaConnFromStorage=function(){var e=o("WAWebUserPrefsMultiDevice").getMms4Conn();if(e!=null)try{this._data=this._createMediaConnData(e)}catch(e){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["Failed to init media conn from storage: ",""])),e).sendLogs("media-conn-failed-to-load")}},a.getHostsInfo=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.directPath,n=e.encFilehash,r=e.forceRefresh,o=r===void 0?!1:r,a=e.operation,i=e.signal,l=e.type;if(!this._locked){var s={signal:i||new AbortController().signal,forceRefresh:o};yield this._refreshIfStale(s)}return this._getPreferredHostsInfo({directPath:t,encFilehash:n,operation:a,type:l})});function t(t){return e.apply(this,arguments)}return t})(),a.getHostsInfoByBucket=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.forceRefresh,n=t===void 0?!1:t,r=e.preferredBuckets,a=e.signal;if(!this._locked){var i={signal:a||new AbortController().signal,forceRefresh:n};yield this._refreshIfStale(i)}if(!this._data)throw new(o("WAWebMediaHostsErrors")).NoMediaHostsError("no fetched data");var l=this._data,s=l.auth,u=l.hosts;if(!u.length)throw new(o("WAWebMediaHostsErrors")).NoMediaHostsError("no selected host");var c=new Map(r.map(function(e){return[e,null]}));u.forEach(function(e){var t,n=(t=e.downloadBuckets)==null?void 0:t.find(function(e){return c.has(e)});n!=null&&c.set(n,e)});var d,m;for(var p of c.values())if(p!=null){if(!d)d=p;else if(!m){m=p;break}}if(!d&&!m?(d=u[0],m=u[1]):m||(m=u[0]),!d)throw new(o("WAWebMediaHostsErrors")).NoMediaHostsError("no selected host");return{auth:s,selectedHost:d,fallbackHost:m}});function t(t){return e.apply(this,arguments)}return t})(),a._createMediaConnData=function(t){var e=new Date(t.queryStartTime);return{auth:t.auth,authExpirationTime:new Date(e.getTime()+t.authTTL),authTTL:t.authTTL,hosts:t.hosts.map(function(e){return new(o("WAWebMediaHost")).MediaHost(e)}),hostsRefreshTime:new Date(e.getTime()+t.ttl),queryStartTime:e,maxBuckets:t.maxBuckets}},a._isExpiredOrMissing=function(){if(!this._data)return!0;var e=this._data;return new Date>=e.authExpirationTime},a._getPreferredHostsInfo=function(t){if(!this._data)throw new(o("WAWebMediaHostsErrors")).NoMediaHostsError("no fetched data");var e=t.encFilehash,n=t.operation,r=t.type,a=this._data,i=a.auth,l=a.hosts,s=a.maxBuckets,u=o("WAWebMediaHostsRouteSelection").routeSelection({encFilehash:e,hosts:l,operation:n,type:r,maxBuckets:s}),c=u.fallbackHost,d=u.selectedHost;if(!d)throw new(o("WAWebMediaHostsErrors")).NoMediaHostsError("no selected host");return{auth:i,selectedHost:d,fallbackHost:c}},a._needsRefresh=function(){if(!this._data)return!0;var e=this._data;if(new Date>=e.hostsRefreshTime)return!0;var t=e.authTTL,n=e.queryStartTime,r=Math.floor(t*.8),o=new Date(n.getTime()+r);return new Date>=o},a._refreshIfStale=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.forceRefresh,r=babelHelpers.objectWithoutPropertiesLoose(t,e);return this._isExpiredOrMissing()||n?(this._reset(),yield this._fetch(r),!0):(this._needsRefresh()&&this._fetch(r).catch(function(){o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[media-hosts] failed to refresh and fetch"]))).sendLogs("media-hosts-failed-to-refresh-and-fetch",{sampling:.01})}),!1)});function r(e){return t.apply(this,arguments)}return r})(),a._reset=function(){this._previousData=this._data,this._data=null,this._err=null},t})(),g=new f;function h(e){var t=e.message,n=e.name,a=e.stack,i=babelHelpers.objectWithoutPropertiesLoose(e,s),l=o("WAWebNormalizeStack").normalizeStack(e),u=l.slice(l.indexOf("\n")+1),c=r("isEmptyObject")(i)?"":" "+JSON.stringify(i,function(e,t){return e&&typeof t=="object"?String(t):t});return(e.name||"Error")+": "+e.message+c+"\n"+u}l.mediaHosts=g}),98); __d("WAWebQplAbpropsConfigValueProvider",["WAWebABProps"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebABProps").getABPropConfigValue("qpl_enabled")}function s(){return o("WAWebABProps").getABPropConfigValue("qpl_upload_delay")*60}function u(){return o("WAWebABProps").getABPropConfigValue("qpl_sampling_as_string")}function c(){return o("WAWebABProps").getABPropConfigValue("qpl_initial_upload_delay")*60}l.isQplEnabled=e,l.getUploadIntervalInSeconds=s,l.getEventSampling=u,l.getInitialUploadDelayInSeconds=c}),98); __d("WAWebQplConfig",["WALogger","WAQplConfigTypes","WAWebQplHealthLogger","WAWebQplQuickPerformanceLoggerModule","getErrorSafe","gkx"],(function(t,n,r,o,a,i,l){var e,s={sampleRate:0,samplingMethod:o("WAQplConfigTypes").QplSampleMethod.EVENT_BASED_SAMPLING},u={sampleRate:1,samplingMethod:o("WAQplConfigTypes").QplSampleMethod.EVENT_BASED_SAMPLING},c,d,m;function p(){return m.isQplEnabled()}function _(){return m.getUploadIntervalInSeconds()}function f(){return m.getInitialUploadDelayInSeconds()}function g(e){if(r("gkx")("26256"))return u;var t=o("WAWebQplQuickPerformanceLoggerModule").convertMarkerIdOrEvent(e),n=c.get(t);return n||s}function h(){try{var e=m.getEventSampling();e.indexOf("json:")===0&&(e=e.slice(5));var t=JSON.parse(e),n=t.sampling;n.forEach(function(e){var t=e[0],n=e[1],r=Math.max(e[2],0);c.set(t,{sampleRate:r,samplingMethod:n})})}catch(e){o("WAWebQplHealthLogger").errorParsingConfig(r("getErrorSafe")(e).message)}}function y(t,n){return n===void 0&&(n=!1),!d||n===!0?(c=new Map,m=t,h(),d={isQplEnabled:p,uploadInterval:_,getEventDetails:g,uploadDelay:f}):o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["QPL Config has already been initialized"]))).tags("qpl"),d}l.config=y}),98); __d("WAWebQplInitMd",["Promise","WALogger","WAQplNetwork","WAQplUploader","WAWebApiQplEvents","WAWebBoolFunc","WAWebQplAbpropsConfigValueProvider","WAWebQplConfig","WAWebQplHealthLogger","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebQplStorageApi","WAWebQplValuesConfig","WAWebWaUlCookieUtils","WAWebXHR","gkx"],(function(t,n,r,o,a,i,l){var e,s,u,c={post:r("WAWebXHR").post};function d(){o("WAQplNetwork").defaultQplNetwork({restInterface:c,isDev:0,qplAccessToken:o("WAWebQplValuesConfig").qplConfigs.accessToken,qplAppId:o("WAWebQplValuesConfig").qplConfigs.appId,qplEndpoint:o("WAWebQplValuesConfig").qplConfigs.endpoint,waul_cookie:o("WAWebWaUlCookieUtils").getWaUlCookieIfLoggedOut()});var t=o("WAWebQplConfig").config(o("WAWebQplAbpropsConfigValueProvider"));if(t.isQplEnabled()){if(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["QPL is being initialized"]))),r("gkx")("26256")){var a=new URLSearchParams(window.location.search).get("e2etestname");o("WAQplUploader").start({sendEvents:function(t){t.forEach(function(e){a!=null&&(e.annotations?e.annotations.e2etestname=a:e.annotations={e2etestname:a})});var e=window.__je2e_recordQPLMarker;return e!=null&&typeof e=="function"&&t.forEach(e),o("WAQplNetwork").defaultQplNetwork().sendEventsOverNetwork(t)},isQplEnabled:o("WAWebBoolFunc").returnTrue,intervalInSeconds:t.uploadInterval(),startDelayInSeconds:t.uploadDelay()},{storageApi:new(o("WAWebQplStorageApi")).QplStorageApi,healthLogger:o("WAWebQplHealthLogger")})}else o("WAQplUploader").start({isQplEnabled:t.isQplEnabled,sendEvents:function(t){return o("WAQplNetwork").defaultQplNetwork().sendEventsOverNetwork(t)},intervalInSeconds:t.uploadInterval(),startDelayInSeconds:t.uploadDelay()},{storageApi:new(o("WAWebQplStorageApi")).QplStorageApi,healthLogger:o("WAWebQplHealthLogger")});o("WAWebQplQuickPerformanceLoggerModule").QPL.init(function(e,t){return o("WAWebApiQplEvents").add([e]),(u||(u=n("Promise"))).resolve()},t.getEventDetails,t.isQplEnabled)}else o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["QPL is disabled, throwing Killswitch, will clear database"]))),o("WAWebQplQuickPerformanceLoggerModule").QPL.throwKillswitch(!0),o("WAWebQplQuickPerformanceLoggerModule").QPL.clearStorage()}l.startQPL=d}),98); __d("WAWebApiBlocklist",["WAWebBoolFunc","WAWebModelStorageUtils","WAWebSchemaBlocklist","WAWebWidFactory"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebSchemaBlocklist").getBlocklistTable().all().then(function(e){var t=e.map(function(e){return o("WAWebWidFactory").createUserWidOrThrow(e.id)});return t})}function s(e){var t=e.map(function(e){return{id:e.toString()}});return o("WAWebModelStorageUtils").getStorage().lock(["blocklist"],function(e){var n=e[0];return n.clear().then(function(){return n.bulkCreate(t).then(o("WAWebBoolFunc").returnTrue)})})}l.getBlocklist=e,l.updateBlocklist=s}),98); __d("WAWebBlocklistMigration",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(t,n,r,o,a,i,l){"use strict";function e(){return r("WAWebUserPrefsStore").get(o("WAWebUserPrefsKeys").UserPrefs.BlocklistMigrated)===!0}function s(){r("WAWebUserPrefsStore").set(o("WAWebUserPrefsKeys").UserPrefs.BlocklistMigrated,!0)}function u(){r("WAWebUserPrefsStore").set(o("WAWebUserPrefsKeys").UserPrefs.BlocklistMigrated,!1)}l.isBlocklistMigrated=e,l.setBlocklistMigrated=s,l.setBlocklistUnmigrated=u}),98); __d("WAWebWamEnumCrashlogType",[],(function(t,n,r,o,a,i){var e=Object.freeze({UNKNOWN:0,ZERO_EVENT_EXPECTED:1,TRACKING:2});i.CRASHLOG_TYPE=e}),66); __d("WAWebCriticalEventWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCrashApplicationState","WAWebWamEnumCrashlogType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({CriticalEvent:[1684,{context:[2,e.TYPES.STRING],crashApplicationState:[8,o("WAWebWamEnumCrashApplicationState").CRASH_APPLICATION_STATE],crashlogType:[6,o("WAWebWamEnumCrashlogType").CRASHLOG_TYPE],debug:[3,e.TYPES.STRING],extraDebug:[7,e.TYPES.STRING],mobileBuildId:[5,e.TYPES.STRING],name:[1,e.TYPES.STRING],storageAvailSizeWithCache:[9,e.TYPES.INTEGER]},[1,1,1],"regular"]},{CriticalEvent:[]});l.CriticalEventWamEvent=s}),98); __d("WAWebGetBlocklistJob",["WALogger","WASmaxBlocklistsGetBlockListRPC","WAWebJidToWid","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(t,n){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["fetchBlocklist failed: code "," text ",""])),t,n).sendLogs("getBlocklist")}function c(){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebUserPrefsMultiDevice").getBlocklistHash(),t=babelHelpers.extends({},e!=null&&{itemArgs:{itemDhash:e}}),n=yield o("WASmaxBlocklistsGetBlockListRPC").sendGetBlockListRPC(t);switch(n.name){case"GetBlockListResponseInternalServerError":{var r=n.value.errorServerErrors.value,a=r.code,i=r.text;return u(Number(a),i),{errorCode:Number(a),errorText:i}}case"GetBlockListResponseInvalidRequest":{var l=n.value.errorGetBlocklistErrors.value,c=l.code,d=l.text;return u(Number(c),d),{errorCode:Number(c),errorText:d}}case"GetBlockListResponseSuccessWithMatch":return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["fetchBlocklist: GetBlockListResponseSuccessWithMatch ",""])),n.value.type),{type:"match"};case"GetBlockListResponseSuccessWithMismatch":{var m=n.value.listDhash,_=n.value.listItem.map(function(e){var t;return{wid:o("WAWebJidToWid").userJidToUserWid(e.jid),displayName:(t=e.displayNameMixin)==null?void 0:t.displayName}});return{type:"mismatch",dhash:m,list:{items:_,addressingMode:"pn"}}}default:{n.name;var f=n.value.listDhash,g=n.value.listItem.map(function(e){var t=e.jid,n=o("WAWebJidToWid").lidUserJidToUserLid(t);return babelHelpers.extends({},p(e.blocklistIds),{active:e.active==="true",lid:n})});return{type:"mismatch",dhash:f,list:{items:g,addressingMode:"lid"}}}}}),d.apply(this,arguments)}function m(e){return e.addressingMode==="pn"?e.items.map(function(e){return e.wid}):e.items.map(function(e){return e.lid})}function p(e){e:{var t=e;if((typeof t=="object"&&t!==null||typeof t=="function")&&t.name==="Username"&&"value"in t){var n=t.value;return{username:n.username}}if((typeof t=="object"&&t!==null||typeof t=="function")&&t.name==="DisplayName"&&"value"in t){var r=t.value;return{displayName:r.displayName}}if((typeof t=="object"&&t!==null||typeof t=="function")&&t.name==="PnJid"&&"value"in t){var a=t.value;return{pn:o("WAWebJidToWid").userJidToUserWid(a.pnJid)}}if((typeof t=="object"&&t!==null||typeof t=="function")&&t.name==="UnknownIdentifier"&&"value"in t)return null;throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+t)}}l.getBlocklist=c,l.extractWids=m}),98); __d("WAWebQueryBlockListJob",["WAArrayUtils","WAAsyncSleep","WALogger","WASmaxPsaChatBlockGetRPC","WAWebApiBlocklist","WAWebBackendApi","WAWebBlocklistMigration","WAWebCriticalEventWamEvent","WAWebDBCreateLidPnMappings","WAWebGetBlocklistJob","WAWebLid1X1MigrationGating","WAWebLid1X1ThreadAccountMigrations","WAWebLid1x1MigrationTimeoutUtils","WAWebLidAwareContactsDB","WAWebLogoutReasonConstants","WAWebSetUsernameJob","WAWebSocketLogoutJob","WAWebUpdateLidMetadataJob","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsMultiDevice","WAWebWid","asyncToGeneratorRuntime","compactMap","partitionArray"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f;function g(e){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[blocklist] fetch blocklist reason: ",""])),t),t==="post-migration"&&(yield o("WAWebUserPrefsMultiDevice").setBlocklistHash(null),yield o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.remove("WAReceivedBlocklistMigrationBefore1x1Migration"));var n=yield o("WAWebGetBlocklistJob").getBlocklist();if(n.errorCode!=null)return n;if(n.type==="mismatch"){var a=o("WAWebBlocklistMigration").isBlocklistMigrated(),i=n.list;o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[blocklist] updating blocklist with "," contact(s)"])),i.items.length),yield o("WAWebUserPrefsMultiDevice").setBlocklistHash(n.dhash);var l=o("WAWebGetBlocklistJob").extractWids(i);if(yield o("WAWebApiBlocklist").updateBlocklist(l),o("WAWebBackendApi").frontendFireAndForget("replaceBlocklist",{wids:l}),i.addressingMode==="pn"){a&&(yield I("LidBlocklistUnexpectedPnBlocklist"),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[blocklist] received a pn-based blocklist on a migrated device, unmigrating it"]))),o("WAWebBlocklistMigration").setBlocklistUnmigrated());var m=r("compactMap")(i.items,function(e){var t=e.displayName,n=e.wid;if(t==null||!n.isLid())return null;var r={};return t!=null&&(r.displayNameLID=t),{lid:n,data:r}});yield o("WAWebUpdateLidMetadataJob").updateLidMetadataJob(m)}else i.addressingMode,o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()?a||(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[blocklist] received a lid-based blocklist, marking the device as migrated"]))),o("WAWebBlocklistMigration").setBlocklistMigrated()):yield T(),yield b(i.items)}else o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[blocklist] no change in blocklist, skip update"])));return n}),h.apply(this,arguments)}function y(){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WASmaxPsaChatBlockGetRPC").sendChatBlockGetRPC(),t;e:{var n=e;if((typeof n=="object"&&n!==null||typeof n=="function")&&n.name==="ChatBlockGetResponseServerError"&&(typeof n.value=="object"&&n.value!==null||typeof n.value=="function")&&(typeof n.value.errorChatBlockError=="object"&&n.value.errorChatBlockError!==null||typeof n.value.errorChatBlockError=="function")&&(typeof n.value.errorChatBlockError.value=="object"&&n.value.errorChatBlockError.value!==null||typeof n.value.errorChatBlockError.value=="function")&&"code"in n.value.errorChatBlockError.value&&"text"in n.value.errorChatBlockError.value){var r=n.value.errorChatBlockError.value.code,a=n.value.errorChatBlockError.value.text;o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["getBlockingStatusForPSAUser: server response with ",", ",""])),r,a),t={errorCode:Number(r),errorText:a};break e}if((typeof n=="object"&&n!==null||typeof n=="function")&&n.name==="ChatBlockGetResponseSuccess"&&(typeof n.value=="object"&&n.value!==null||typeof n.value=="function")&&"blockingStatus"in n.value){var i=n.value.blockingStatus;t=i==="blocked";break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+n)}return t}),C.apply(this,arguments)}function b(e){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=[],n=[];for(var r of e)r.pn!=null&&t.push(r),(r.username!=null||r.displayName!=null)&&n.push(r);yield S(t),yield L(n)}),v.apply(this,arguments)}function S(e){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAArrayUtils").groupBy(e,function(e){return e.pn.toString()}),n=[],a=[];for(var i of t.values()){var l=r("partitionArray")(i,function(e){return e.active}),s=l[0],u=l[1],c=u.sort(function(e,t){return r("WAWebWid").compare(e.lid,t.lid)}).reverse();n.push.apply(n,k(c)),s.length>1&&o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[blocklist] multiple active LIDs for the same PN"]))).sendLogs("blocklist-multiple-active-lids"),a.push.apply(a,k(s))}yield o("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:n,flushImmediately:!1,identityChangeHandlingEnabled:!1,learningSource:"blocklist-inactive"}),yield o("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:a,flushImmediately:!1,identityChangeHandlingEnabled:!1,learningSource:"blocklist-active"}),yield o("WAWebDBCreateLidPnMappings").flushLidPnMappingsToDb()}),R.apply(this,arguments)}function L(e){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){for(var t=[],n=[],a=yield r("WAWebLidAwareContactsDB").bulkGet(e.map(function(e){return e.lid.toString()})),i=0;i0&&e.find(function(e){return e.actionState===o("WASyncdConst").SyncActionState.Success})!=null});function t(){return e.apply(this,arguments)}return t})(),t.setSyncDCriticalDataSyncCompleted=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this.$7!=null&&(yield new(o("WAWebMdBootstrapDataAppliedWamEvent")).MdBootstrapDataAppliedWamEvent({mdBootstrapPayloadType:o("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE.CRITICAL,mdBootstrapSource:o("WAWebWamEnumMdBootstrapSource").MD_BOOTSTRAP_SOURCE.APP_STATE,mdSessionId:yield o("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId(),mdTimestamp:o("WATimeUtils").unixTimeMs()}).commitAndWaitForFlush(!0))});function t(){return e.apply(this,arguments)}return t})(),t.getCriticalSyncDebugSummary=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(yield this.isCriticalDataSynced())return"-------\nAll critical data synced\n-------\n\n";var e=yield o("WAWebUserPrefsHistorySync").getHistorySyncStatus();return"-------\n Initial history sync complete: "+(e?"true":this.$1.initialChatHistory.toString())+"\n Initial msgs: "+this.$2.initialChatHistoryTotalMsg+", initial chats: "+this.$2.initialChatHistoryTotalChats+"\n Receipt sync complete: "+this.$1.readReceipts.toString()+" \n "+("Critical collection sync complete: "+this.$1.syncdCritical.toString()+" \n-------\n")});function t(){return e.apply(this,arguments)}return t})(),t.isCriticalDataSynced=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return this.$6=this.$6||(yield o("WAWebUserPrefsAppStateSync").getAllCriticalDataSynced()),this.$6});function t(){return e.apply(this,arguments)}return t})(),t.syncCriticalData=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=this;r("WAWebBrokerGlobalAppState").initOrUpdateTracking(o("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.INITIAL_PAIRING),o("WALogger").LOG(k||(k=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] need to sync critical data: true"])));var t=yield this.getCriticalSyncDebugSummary();o("WALogger").LOG(I||(I=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap][history sync] ",""])),t),o("WALogger").LOG(T||(T=babelHelpers.taggedTemplateLiteralLoose(["[bootstrap] syncing my device list"]))).tags("history-sync");var a=o("WAWebSyncDeviceAdvDeviceListJob").syncMyDeviceListJob(),i=new(ne||(ne=n("Promise")))(function(t,n){o("WAWebAccountSyncJob").updatePrivacySettings().then(function(){return e.setReadReceiptsSynced()}).then(t).catch(n)}).catch(function(e){o("WALogger").ERROR(D||(D=babelHelpers.taggedTemplateLiteralLoose(["failed to sync privacy settings ",""])),e.stack).verbose().sendLogs("failed to update privacy settings from privacy request to server"),o("WAWebJestE2ELogUtils").maybeLogToJestE2eJSConsole("failed to sync privacy settings, logging out"),o("WAWebSocketLogoutJob").socketLogout(o("WAWebLogoutReasonConstants").LogoutReason.AccountSyncError)});this.$15(),this.$3=le.InProcess;var l=a.then(function(){return o("WAWebSyncd").markCollectionsForSync([o("WASyncdConst").CollectionName.CriticalBlock,o("WASyncdConst").CollectionName.CriticalUnblockLow])}).then(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){e.$1.syncdCritical||(yield e.$16())&&(yield e.setSyncDCriticalSynced(),yield e.setSyncDCriticalDataSyncCompleted())})),s=yield o("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete();s===!0&&(yield this.setInitialChatHistorySynced());var u=o("WAWebAccountSyncJob").updateDefaultDisappearingMode().catch(function(e){o("WALogger").ERROR(x||(x=babelHelpers.taggedTemplateLiteralLoose(["failed to sync default disappearing mode ",""])),e.stack).verbose().sendLogs("failed initial sync of default disappearing mode")});yield ne.all([i,l,u])});function t(){return e.apply(this,arguments)}return t})(),t.$17=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!o("WAWebBackendEventBus").BackendEventBus.isMainStreamReadyMd){o("WALogger").LOG($||($=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] Skip processLoop, until main is loaded"]))).tags("history-sync");return}var e=yield o("WAWebApiHistorySyncNotification").fetchNextHistorySyncChunkForProcessing();if(!e){o("WALogger").LOG(P||(P=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] no chunk found"]))).tags("history-sync");return}if(o("WALogger").LOG(N||(N=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] processLoop picked up chunk"]))),e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&e.chunkOrder!=null){var t=e.msgKey;o("WAWebApiHistorySyncNotification").recentSyncChunkHandlingTriedCount[t]!=null?(o("WAWebApiHistorySyncNotification").recentSyncChunkHandlingTriedCount[t]++,o("WAWebApiHistorySyncNotification").recentSyncChunkHandlingTriedCount[t]>ce&&o("WALogger").ERROR(M||(M=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] recent sync chunk handling retry limit reached"]))).sendLogs("history-sync-recent-sync-chunk-handling-retry-limit")):o("WAWebApiHistorySyncNotification").recentSyncChunkHandlingTriedCount[t]=1}e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT?yield o("WAWebHandleWorkerCompatibleRecentSyncChunk").handleWorkerCompatibleRecentSyncChunk(e):yield o("WAWebHandleHistorySyncChunk").handleHistorySyncChunk(e)});function t(){return e.apply(this,arguments)}return t})(),t.$18=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(w||(w=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] job starts"])));try{yield o("WAWebDbEncryptionKey").DbEncKeyStore.waitForFinalDbMsgEncKey(),yield this.$17()}catch(e){o("WALogger").ERROR(A||(A=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] _progressiveHistorySyncRun failed with ",", stack: ",""])),e==null?void 0:e.message,e==null?void 0:e.stack)}o("WALogger").LOG(F||(F=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] finish main flow"])));var e=yield o("WAWebUserPrefsHistorySync").getHistorySyncStatus();if((e==null?void 0:e.recentCompleted)===!0){var t=!0;o("WALogger").LOG(O||(O=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] recent sync finishes, check remaining on demand sync notifications"])));var n=yield o("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed","syncType"],[0,o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND],{shouldDecrypt:!1});if(n.length>0?(t=!1,this.continueProgressiveHistorySyncProcessingV2(o("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.LastProcessedNotification)):o("WALogger").LOG(B||(B=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as no on demand notifications"]))),o("WAWebClientFeatureFlags").isFeatureEnabled("debug_1_year_history_sync")){o("WALogger").LOG(W||(W=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] recent sync finishes, check remaining full sync notifications"])));var r=yield o("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed","syncType"],[0,o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL],{shouldDecrypt:!1});r.length>0?(t=!1,this.continueProgressiveHistorySyncProcessingV2(o("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.LastProcessedNotification)):o("WALogger").LOG(q||(q=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as no on full sync notifications"])))}t&&o("WAWebMetricsAttributionActions").stopAllHistorySyncAttributionTracking();return}o("WALogger").LOG(U||(U=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] recent sync is incompleted, check remaining recent sync notifications"])));var a=yield o("WAWebHistorySyncNotificationUtils").getUnprocessedRecentSyncNotifications();if(a.length===0){o("WALogger").LOG(V||(V=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as no recent notifications"])));return}var i=a[0].chunkOrder;if(i==null){o("WALogger").LOG(H||(H=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as first recent notification doesn't have chunk order"])));return}var l=yield o("WAWebUserPrefsHistorySync").getLastHistoryRecentSyncedChunk();if(o("WALogger").LOG(G||(G=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] next unprocessed recent notification has chunk order: ",", last chunk order: ",""])),i,l==null?void 0:l.chunkOrder),l!=null&&l.chunkOrder+1!==i&&i!==1){o("WALogger").LOG(z||(z=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as no recent notifications with correct chunk order"])));return}if((l==null?void 0:l.chunkOrder)===this.$8&&i===this.$9){this.$10||(this.$10=!0,o("WALogger").ERROR(j||(j=babelHelpers.taggedTemplateLiteralLoose(["[history sync] loop detected, unexpected last chunk order"]))).sendLogs("history-sync-unexpected-chunk-order",{sampling:.01})),yield o("WAAsyncSleep").asyncSleep(5e3);return}if(this.$8=l==null?void 0:l.chunkOrder,this.$9=i,o("WAWebApiHistorySyncNotification").recentSyncChunkHandlingTriedCount[a[0].msgKey]>ce){o("WALogger").LOG(K||(K=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] skip scheduling the next run as recent notification with order "," fails too many times"])),i);return}o("WALogger").LOG(Q||(Q=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] init next run"]))),this.continueProgressiveHistorySyncProcessingV2(o("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.LastProcessedNotification)});function t(){return e.apply(this,arguments)}return t})(),t.continueProgressiveHistorySyncProcessingV2=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this;if(!this.$6&&this.$1.initialChatHistory!==!0)return o("WALogger").LOG(X||(X=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] Skip job scheduling as initial chat sync is incomplete"]))),(ne||(ne=n("Promise"))).resolve();if(e===o("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.BackendStart){var r=yield o("WAWebUserPrefsHistorySync").getHistorySyncStatus();if((r==null?void 0:r.recentCompleted)===!0)return o("WALogger").LOG(Y||(Y=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] Skip job scheduling as recent sync is complete when starting backend"]))),(ne||(ne=n("Promise"))).resolve()}return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("continueProgressiveHistorySyncProcessingV2",(function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n){return o("WALogger").LOG(J||(J=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] job is scheduled, source: ",""])),e),t.$18()});return function(e){return r.apply(this,arguments)}})(),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.HISTORY_SYNC,maxTimeoutMs:12e4}).waitUntilCompleted().catch(function(e){o("WALogger").ERROR(Z||(Z=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] error while running job: ",""])),e)})});function t(t){return e.apply(this,arguments)}return t})(),t.getIsHistorySyncRunning=function(){var e=o("WAWebJobOrchestrator").getInstance(),t=e.getSnapshot(o("WAJobOrchestratorTypes").JOB_PRIORITY.HISTORY_SYNC);return t!=null&&t.continueProgressiveHistorySyncProcessingV2!=null?t.continueProgressiveHistorySyncProcessingV2>0:!1},e})(),me=new de;o("WAWebBackendEventBus").BackendEventBus.onInitialChatHistorySynced(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.CriticalSync),yield me.setInitialChatHistorySynced()})),o("WAWebBackendEventBus").BackendEventBus.onLogout(function(){me.initState()}),o("WAWebBackendEventBus").BackendEventBus.onRecentChatHistorySynced(function(){var e=o("WAWebJobOrchestrator").getInstance();o("WALogger").LOG(ee||(ee=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] clearing bucket queue for type ",""])),o("WAJobOrchestratorTypes").JOB_PRIORITY.HISTORY_SYNC),e.clearQueueByPriority(o("WAJobOrchestratorTypes").JOB_PRIORITY.HISTORY_SYNC)}),o("WAWebBackendEventBus").BackendEventBus.onFullChatHistorySynced(function(){var e=o("WAWebJobOrchestrator").getInstance();o("WALogger").LOG(te||(te=babelHelpers.taggedTemplateLiteralLoose(["[history sync][continueProgressiveHistorySyncProcessingV2] clearing bucket queue for type ",""])),o("WAJobOrchestratorTypes").JOB_PRIORITY.HISTORY_SYNC),e.clearQueueByPriority(o("WAJobOrchestratorTypes").JOB_PRIORITY.HISTORY_SYNC)});var pe=me;l.default=pe}),98); __d("WAWebBizCreateOrderJobMutation.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XWACheckoutPlaceOrderResponseSuccess",kind:"LinkedField",name:"xwa_checkout_place_order",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACheckoutPlaceOrderResponseSuccessOrder",kind:"LinkedField",name:"order",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"order_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"token",storageKey:null},{alias:null,args:null,concreteType:"XWACheckoutPlaceOrderResponseSuccessPrice",kind:"LinkedField",name:"price",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"subtotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"price_status",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizCreateOrderJobMutation",selections:t,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizCreateOrderJobMutation",selections:t},params:{id:"24718218934518019",metadata:{},name:"WAWebBizCreateOrderJobMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebBizCreateOrderJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebBizCreateOrderJobMutation.graphql","WAWebBizGatingUtils","WAWebCommsWapMd","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=new(r("WADeprecatedWapParser"))("createOrderResponse",function(e){e.assertTag("iq"),e.assertFromServer();var t=e.child("order"),n=t.attrString("id"),r=t.attrString("token"),o=t.maybeChild("price"),a={},i=o==null?void 0:o.maybeChild("subtotal");i&&(a.subtotal=i.contentString());var l=o==null?void 0:o.maybeChild("total");l&&(a.total=l.contentString());var s=o==null?void 0:o.maybeChild("currency");s&&(a.currency=s.contentString());var u=o==null?void 0:o.maybeChild("price_status");return u&&(a.price_status=u.contentString()),{id:n,token:r,price:a}});function u(e){var t,n=e.priceAmount1000!=null?o("WAWap").wap("price",null,e.priceAmount1000.toString()):void 0,r=e.currency?o("WAWap").wap("currency",null,e.currency):void 0,a=e.variantProperties?o("WAWap").wap("variant_info",null,o("WAWap").wap("properties",null,(t=e.variantProperties)==null?void 0:t.map(function(e){var t=e.name,n=e.value;return o("WAWap").wap("property",{name:o("WAWap").MAYBE_CUSTOM_STRING(t!=null?t:""),value:o("WAWap").MAYBE_CUSTOM_STRING(n!=null?n:"")})}))):void 0;return o("WAWap").wap("product",null,o("WAWap").wap("id",null,e.id),o("WAWap").wap("name",null,e.name),n,r,o("WAWap").wap("quantity",null,e.quantity.toString()),a)}var c=e!==void 0?e:e=n("WAWebBizCreateOrderJobMutation.graphql");function d(e,t,n){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){n===void 0&&(n=null);var a=t.map(function(e){var t={id:e.id,name:e.name,quantity:e.quantity};return e.currency!=null&&(t.currency=e.currency),e.priceAmount1000!=null&&(t.price=String(e.priceAmount1000)),e.variantProperties!=null&&e.variantProperties.length>0&&(t.variant_info={properties:{properties:e.variantProperties.map(function(e){var t=e.name,n=e.value;return{nameAttr:t!=null?t:"",valueAttr:n!=null?n:""}})}}),t}),i={order:{jid:e.toJid(),products:a}};return n!=null&&(i.order.direct_connection_encrypted_info=n),r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAWebRelayClient").commitMutation(c,{input:i},{environmentType:"whatsapp_catalog"})}).then(function(e){var t,n,r,a,i,l,s,u=e==null||(t=e.xwa_checkout_place_order)==null?void 0:t.order;if(u==null||u.order_id==null)throw new(o("WAWebBackendErrors")).ServerStatusCodeError(500);var c={};return((n=u.price)==null?void 0:n.subtotal)!=null&&(c.subtotal=String(u.price.subtotal)),((r=u.price)==null?void 0:r.total)!=null&&(c.total=String(u.price.total)),((a=u.price)==null?void 0:a.currency)!=null&&(c.currency=u.price.currency),((i=u.price)==null?void 0:i.price_status)!=null&&(c.price_status=u.price.price_status),{id:(l=u.order_id)!=null?l:"",token:(s=u.token)!=null?s:"",price:c}}).catch(function(e){throw e instanceof o("WAWebGraphQLServerError").GraphQLServerError?new(o("WAWebBackendErrors")).ServerStatusCodeError(500):e})}),m.apply(this,arguments)}function p(e,t,n){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(n===void 0&&(n=null),o("WAWebBizGatingUtils").graphQLForPlaceOrderEnabled())return d(e,t,n);var a=o("WAWap").wap("iq",{to:o("WAWap").S_WHATSAPP_NET,smax_id:o("WAWap").SMAX_ID(r("WAWapDeprecatedSmaxID").CreateOrder),xmlns:"fb:thrift_iq",id:o("WAWap").generateId(),type:"set"},o("WAWap").wap("order",{op:o("WAWap").CUSTOM_STRING("create"),biz_jid:o("WAWebCommsWapMd").USER_JID(e)},t.map(function(e){return u(e)}).concat(n!=null?o("WAWap").wap("direct_connection_encrypted_info",null,n):[]))),i=yield o("WADeprecatedSendIq").deprecatedSendIq(a,s);if(i.success)return i.result;throw i.errorCode===451?new(o("WAWebBackendErrors")).E451:new(o("WAWebBackendErrors")).ServerStatusCodeError(i.errorCode)}),_.apply(this,arguments)}l.createOrderResponse=s,l.createOrderMD=p}),98); __d("WAWebBizLogQplEvents",["WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule"],(function(t,n,r,o,a,i,l){function e(e){o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CART_VIEW,e)}function s(e){o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PROFILE_CATS_VIEW,e)}function u(e){o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PROFILE_SAVE,e)}function c(e){o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_VIEW,e)}function d(e){o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PLM_DETAILS_VIEW,e)}function m(e){o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_ORDER_CREATE,e)}function p(e){o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_ORDER_VIEW,e)}l.qplPointCartView=e,l.qplPointProfileCatsView=s,l.qplPointProfileSave=u,l.qplPointProductView=c,l.qplPointPLMDetailsView=d,l.qplPointOrderCreate=m,l.qplPointOrderView=p}),98); __d("WAWebBizQueryOrderJobQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"request"}],t=[{kind:"Variable",name:"request",variableName:"request"}],n={alias:null,args:null,kind:"ScalarField",name:"creation_time_stamp",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},l={alias:null,args:null,concreteType:"XWACatalogProductVariantInfo",kind:"LinkedField",name:"variant_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:[o,{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null},s={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:[r,{alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null}],storageKey:null}],storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"quantity",storageKey:null},c={alias:null,args:null,concreteType:"XWACheckoutPriceDetails",kind:"LinkedField",name:"price_details",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"subtotal",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizQueryOrderJobQuery",selections:[{alias:null,args:t,concreteType:"XWACheckoutGetOrderInfoResponseSuccess",kind:"LinkedField",name:"xwa_checkout_get_order_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACheckoutGetOrderInfoResponseSuccessOrder",kind:"LinkedField",name:"order",plural:!1,selections:[n,{alias:null,args:null,concreteType:"XWACatalogProduct",kind:"LinkedField",name:"products",plural:!0,selections:[{kind:"RequiredField",field:r,action:"THROW"},{kind:"RequiredField",field:o,action:"THROW"},a,i,l,s,u],storageKey:null},c],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizQueryOrderJobQuery",selections:[{alias:null,args:t,concreteType:"XWACheckoutGetOrderInfoResponseSuccess",kind:"LinkedField",name:"xwa_checkout_get_order_info",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACheckoutGetOrderInfoResponseSuccessOrder",kind:"LinkedField",name:"order",plural:!1,selections:[n,{alias:null,args:null,concreteType:"XWACatalogProduct",kind:"LinkedField",name:"products",plural:!0,selections:[r,o,a,i,l,s,u],storageKey:null},c],storageKey:null}],storageKey:null}]},params:{id:"27500063212935409",metadata:{},name:"WAWebBizQueryOrderJobQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebBizQueryOrderJob",["Promise","WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebBizGatingUtils","WAWebBizQueryOrderJobQuery.graphql","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c=e!==void 0?e:e=n("WAWebBizQueryOrderJobQuery.graphql"),d=new(r("WADeprecatedWapParser"))("queryOrderResponse",function(e){e.assertTag("iq"),e.assertFromServer();var t=e.child("order"),n=t.hasAttr("creation_ts")?t.attrTime("creation_ts"):null,r=t.maybeChild("price"),o=r==null?void 0:r.maybeChild("subtotal"),a=o?parseInt(o.contentString(),10):null,i=r==null?void 0:r.maybeChild("currency"),l=i?i.contentString():null,s=r==null?void 0:r.maybeChild("tax"),u=s?parseInt(s.contentString(),10):null,c=r==null?void 0:r.maybeChild("total"),d=c?parseInt(c.contentString(),10):null,m=[];return t.forEachChildWithTag("product",function(e){var t=e.child("id"),n=t.contentString(),r=e.child("name"),o=r.contentString(),a=e.maybeChild("price"),i=a?parseInt(a.contentString(),10):null,l=e.maybeChild("quantity"),s=l?parseInt(l.contentString(),10):null,u=e.maybeChild("variant_info"),c=u?u.maybeChild("properties"):null,d=[];c==null||c.forEachChildWithTag("property",function(e){var t=e.attrString("name"),n=e.attrString("value");t!=null&&n!=null&&d.push([t,n])});var p=e.maybeChild("currency"),_=p?p.contentString():null,f=null,g=null,h=e.maybeChild("image");if(h!=null){var y=h.maybeChild("url");g=y&&y.hasContent()?y.contentString():null;var C=h.maybeChild("id");f=C&&C.hasContent()?C.contentString():null}m.push({id:n,price:i,thumbnailId:f,thumbnailUrl:g,currency:_,name:o,quantity:s,properties:d})}),{currency:l,createdAt:n,products:m,subtotal:a,total:d,tax:u}});function m(e,t,n,r,o){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a,i){return i===void 0&&(i=null),o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions()?(u||(u=n("Promise"))).reject(new(o("WAWebBackendErrors")).E451):o("WAWebBizGatingUtils").graphQLForGetOrderInfoEnabled()?_(e,t,r,a,i):g(e,t,r,a,i)}),p.apply(this,arguments)}function _(e,t,n,r,o){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a,i){i===void 0&&(i=null);try{var l,u,d,m,p;yield r("WAWebNetworkStatus").waitIfOffline();var _=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),f=yield o("WAWebRelayClient").fetchQuery(c,{request:{order:{jid:_.toString(),token:{sensitive_string_value:a},id:e,image_dimensions:{height:n,width:t},direct_connection_encrypted_info:i}}},{environmentType:"whatsapp_catalog"});if((f==null||(l=f.xwa_checkout_get_order_info)==null?void 0:l.order)==null)throw new(o("WAWebBackendErrors")).ServerStatusCodeError(500);var g=f.xwa_checkout_get_order_info.order,h=((u=g.products)!=null?u:[]).map(function(e){var t,n,r,o=[];return(t=e.variant_info)==null||(t=t.variant_properties)==null||t.forEach(function(e){e.name!=null&&e.value!=null&&o.push([e.name,e.value])}),{id:e.id,name:e.name,price:e.price!=null?parseInt(e.price,10):null,currency:e.currency,quantity:e.quantity!=null?parseInt(e.quantity,10):null,thumbnailId:(n=e.media)==null||(n=n.images)==null||(n=n.at(0))==null?void 0:n.id,thumbnailUrl:(r=e.media)==null||(r=r.images)==null||(r=r.at(0))==null?void 0:r.request_image_url,properties:o}});return{createdAt:g.creation_time_stamp!=null?Number(g.creation_time_stamp):null,currency:(d=g.price_details)==null?void 0:d.currency,subtotal:((m=g.price_details)==null?void 0:m.subtotal)!=null?parseInt(g.price_details.subtotal,10):null,tax:null,total:((p=g.price_details)==null?void 0:p.total)!=null?parseInt(g.price_details.total,10):null,products:h}}catch(e){if(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["WAWebBizQueryOrderJob: GraphQL queryOrder failed"]))),e instanceof o("WAWebGraphQLServerError").GraphQLServerError){var y,C=(y=e.source.errors[0])==null?void 0:y.code;throw C===451?new(o("WAWebBackendErrors")).E451:new(o("WAWebBackendErrors")).ServerStatusCodeError(C!=null?C:500)}throw e}}),f.apply(this,arguments)}function g(e,t,n,r,o){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a,i){i===void 0&&(i=null);var l=o("WAWap").wap("iq",{to:o("WAWap").S_WHATSAPP_NET,smax_id:o("WAWap").SMAX_ID(r("WAWapDeprecatedSmaxID").QueryOrder),xmlns:"fb:thrift_iq",id:o("WAWap").generateId(),type:"get"},o("WAWap").wap("order",{op:o("WAWap").CUSTOM_STRING("get"),id:o("WAWap").CUSTOM_STRING(e)},o("WAWap").wap("image_dimensions",null,o("WAWap").wap("width",null,t.toString()),o("WAWap").wap("height",null,n.toString())),o("WAWap").wap("token",null,a),i!=null?o("WAWap").wap("direct_connection_encrypted_info",null,i):null)),s=yield o("WADeprecatedSendIq").deprecatedSendIq(l,d);if(s.success)return s.result;throw s.errorCode===451?new(o("WAWebBackendErrors")).E451:new(o("WAWebBackendErrors")).ServerStatusCodeError(s.errorCode)}),h.apply(this,arguments)}l.queryOrderResponse=d,l.queryOrder=m}),98); __d("WAWebBizOrderBridge",["Promise","WAWebBackendErrors","WAWebBizCreateOrderJob","WAWebBizGatingUtils","WAWebBizLogQplEvents","WAWebBizQueryOrderJob","WAWebBusinessDirectConnectionBridge"],(function(t,n,r,o,a,i,l){var e;function s(t,r,a,i,l){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())return(e||(e=n("Promise"))).reject(new(o("WAWebBackendErrors")).E451);o("WAWebBizLogQplEvents").qplPointOrderView("datasource_start");var s=o("WAWebBusinessDirectConnectionBridge").attemptWithDirectConnectionRetry(t,function(e){return o("WAWebBizQueryOrderJob").queryOrder(r,a,i,l,e)});return s.then(function(e){return o("WAWebBizLogQplEvents").qplPointOrderView("datasource_end"),e})}function u(t,r){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())return(e||(e=n("Promise"))).reject(new(o("WAWebBackendErrors")).E451);o("WAWebBizLogQplEvents").qplPointOrderCreate("datasource_start");var a=o("WAWebBusinessDirectConnectionBridge").attemptWithOrderDirectConnectionRetry(t,function(e){return o("WAWebBizCreateOrderJob").createOrderMD(t,r,e)});return a.then(function(e){return o("WAWebBizLogQplEvents").qplPointOrderCreate("datasource_end"),e})}l.queryOrder=s,l.createOrder=u}),98); __d("WAWebBizCatalogManagementAddProductMutation_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="24249359867999500"}),null); __d("WAWebBizCatalogManagementAddProductMutation.graphql",["WAWebBizCatalogManagementAddProductMutation_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{kind:"Variable",name:"request",variableName:"input"}],r={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},d=[l,c],m=[{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},r,o,{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:[o,a,i],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[o,{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},l,s,{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},s,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},u,{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},u],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:[r,{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:d,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:[l,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[c,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[o,{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},a,i],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:d,storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementAddProductMutation",selections:[{alias:null,args:t,concreteType:"XFBWhatsAppCatalogProductMutationResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_add_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:m,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizCatalogManagementAddProductMutation",selections:[{alias:null,args:t,concreteType:"XFBWhatsAppCatalogProductMutationResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_add_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:m,storageKey:null}],storageKey:null}]},params:{id:n("WAWebBizCatalogManagementAddProductMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementAddProductMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebBizCatalogManagementAddProduct",["Promise","WALogger","WAWebBizCatalogManagementAddProductMutation.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m={type:"error"},p=e!==void 0?e:e=n("WAWebBizCatalogManagementAddProductMutation.graphql");function _(e){return o("WAWebBizGatingUtils").graphQLForAddProductEnabled()?f(e).then(function(e){return e.type==="success"?(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["addProduct: success"]))),e):(e.type,o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(['addProduct: failed as "','"'])),e.type),e)}):(d||(d=n("Promise"))).resolve({type:"not-enabled"})}function f(e){return o("WAWebFetchAdAccountToken").fetchToken().then(function(t){return t.type==="success"?g(t.token,e).then(function(e){return e.type!=="success"&&e.type==="auth-failure"?o("WAWebFetchAdAccountToken").markTokenAsInvalid():e.type,e}):(t.type,t)})}function g(e,t){var n;return r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAWebRelayClient").commitMutation(p,{input:t},{environmentType:"facebook",accessToken:e,getInlineDataReader:function(t){n=t}})}).then(function(e){var t;if(e==null)return m;var r=(t=e.xfb_whatsapp_catalog_add_product)==null?void 0:t.product;if(r==null)return m;var a=o("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL(n(o("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,r));return{type:"success",productResult:a}}).catch(function(e){return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["addProductWithToken: failed with error"]))),o("WAWebFetchAdAccountToken").hasGraphQLAuthError(e)?{type:"auth-failure"}:e instanceof o("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:e}:m})}l.addProduct=_}),98); __d("WAWebCommonParsersCustomErrors",["WADeprecatedWapParser"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("parseErrorFields",function(e){var t=[];return e.forEachChildWithTag("field",function(e){var n=e.maybeAttrString("detail");t.push({name:e.attrString("name"),reason:e.attrString("reason"),detail:n})}),t});l.parseErrorFields=e}),98); __d("WAWebBizCatalogAddProductJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementAddProduct","WAWebBizCatalogManagementParseProductGraphql","WAWebBizCatalogParseProduct","WAWebBizGatingUtils","WAWebCommonParsersCustomErrors","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("addProductResponse",function(e){e.assertTag("iq"),e.assertFromServer();var t=e.child("product_catalog_add"),n=t.child("product");return o("WAWebBizCatalogParseProduct").parseProductNode(n)});function s(e,t,n){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r){var a,i=(a=o("WAWap")).wap("iq",{id:a.generateId(),to:a.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},a.wap("product_catalog_add",{v:"1"},o("WAWebBizCatalogParseProduct").productModelToNode(t),a.wap("width",null,n.toString()),a.wap("height",null,r.toString()))),l=yield o("WADeprecatedSendIq").deprecatedSendIqErrorParser(i,e,o("WAWebCommonParsersCustomErrors").parseErrorFields);if(l.success)return l.result;throw l.errorCode===451?new(o("WAWebBackendErrors")).E451:l.customError!=null?new(o("WAWebBackendErrors")).CatalogEditServerError(l.errorCode,l.customError):new(o("WAWebBackendErrors")).ServerStatusCodeError(l.errorCode)}),u.apply(this,arguments)}function c(e,t,n){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a=o("WAWebUserPrefsMeUser").getMaybeMePnUser();if(a==null)throw r("err")("addProductGraphQL: meUser is null");var i=yield o("WAWebBizCatalogManagementAddProduct").addProduct({product:{biz_jid:a.toJid(),width:t,height:n,product_info:o("WAWebBizCatalogManagementParseProductGraphql").productModelToGraphQLInput(e)}});if(i.type==="success")return i.productResult;if(i.type==="graphql-error")o("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(i.error);else{if(i.type==="recovery-required")return s(e,t,n);i.type}throw r("err")("addProductGraphQL: error handling flow not implemented for "+JSON.stringify(i))}),d.apply(this,arguments)}function m(e,t,n){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(o("WAWebBackendErrors")).E451;return o("WAWebBizGatingUtils").graphQLForAddProductEnabled()?c(e,t,n):s(e,t,n)}),p.apply(this,arguments)}l.addProductResponse=e,l.addProductMD=m}),98); __d("WAWebBizCatalogManagementAppealProductMutation_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="29276343172013990"}),null); __d("WAWebBizCatalogManagementAppealProductMutation.graphql",["WAWebBizCatalogManagementAppealProductMutation_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogAppealProductResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_appeal_product",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementAppealProductMutation",selections:t,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizCatalogManagementAppealProductMutation",selections:t},params:{id:n("WAWebBizCatalogManagementAppealProductMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementAppealProductMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebBizCatalogManagementAppealProduct",["Promise","WALogger","WAWebBizCatalogManagementAppealProductMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m={type:"error"},p=e!==void 0?e:e=n("WAWebBizCatalogManagementAppealProductMutation.graphql");function _(e){return o("WAWebBizGatingUtils").graphQLForAppealProductEnabled()?f(e).then(function(e){return e.type==="success"?(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["appealProduct: success"]))),e):(e.type,o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(['appealProduct: failed as "','"'])),e.type),e)}):(d||(d=n("Promise"))).resolve({type:"not-enabled"})}function f(e){return o("WAWebFetchAdAccountToken").fetchToken().then(function(t){return t.type==="success"?g(t.token,e).then(function(e){return e.type!=="success"&&e.type==="auth-failure"?o("WAWebFetchAdAccountToken").markTokenAsInvalid():e.type,e}):(t.type,t)})}function g(e,t){return r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAWebRelayClient").commitMutation(p,{input:t},{environmentType:"facebook",accessToken:e})}).then(function(e){if(e==null)return m;var t=e.xfb_whatsapp_catalog_appeal_product;return(t==null?void 0:t.success)==null?m:{type:"success",result:t.success}}).catch(function(e){return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["appealProductWithToken: failed with error"]))),o("WAWebFetchAdAccountToken").hasGraphQLAuthError(e)?{type:"auth-failure"}:e instanceof o("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:e}:m})}l.appealProduct=_}),98); __d("WAWebBizCatalogAppealProductJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementAppealProduct","WAWebBizGatingUtils","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("appealProductResponse",function(e){e.assertTag("iq"),e.assertFromServer();var t=e.child("response"),n=t.child("success");return n.contentString()==="true"});function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var r,a=(r=o("WAWap")).wap("iq",{id:r.generateId(),to:r.S_WHATSAPP_NET,type:"set",xmlns:"fb:thrift_iq"},r.wap("request",{type:"appeal_product"},r.wap("reason",null,n),r.wap("id",null,t))),i=yield o("WADeprecatedSendIq").deprecatedSendIq(a,e);if(i.success)return i.result;throw i.errorCode===451?new(o("WAWebBackendErrors")).E451:new(o("WAWebBackendErrors")).ServerStatusCodeError(i.errorCode)}),u.apply(this,arguments)}function c(e,t){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WAWebUserPrefsMeUser").getMaybeMePnUser();if(n==null)throw r("err")("appealProductGraphQL: meUser is null");var a=yield o("WAWebBizCatalogManagementAppealProduct").appealProduct({jid:n.toJid(),product_id:e,reason:t});if(a.type==="success")return a.result;if(a.type==="graphql-error")o("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(a.error);else{if(a.type==="recovery-required")return s(e,t);a.type}throw r("err")("appealProductGraphQL: error handling flow not implemented for "+JSON.stringify(a))}),d.apply(this,arguments)}function m(e,t){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(o("WAWebBackendErrors")).E451;return o("WAWebBizGatingUtils").graphQLForAppealProductEnabled()?c(e,t):s(e,t)}),p.apply(this,arguments)}l.appealProductMD=m}),98); __d("WAWebBizCatalogManagementDeleteProductMutation_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="9376108569185474"}),null); __d("WAWebBizCatalogManagementDeleteProductMutation.graphql",["WAWebBizCatalogManagementDeleteProductMutation_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogDeleteProductResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_delete_product",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"deleted_count",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementDeleteProductMutation",selections:t,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizCatalogManagementDeleteProductMutation",selections:t},params:{id:n("WAWebBizCatalogManagementDeleteProductMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementDeleteProductMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebBizCatalogManagementDeleteProduct",["Promise","WALogger","WAWebBizCatalogManagementDeleteProductMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m={type:"error"},p=e!==void 0?e:e=n("WAWebBizCatalogManagementDeleteProductMutation.graphql");function _(e){return o("WAWebBizGatingUtils").graphQLForDeleteProductEnabled()?f(e).then(function(e){return e.type==="success"?(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["deleteProduct: success"]))),e):(e.type,o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(['deleteProduct: failed as "','"'])),e.type),e)}):(d||(d=n("Promise"))).resolve({type:"not-enabled"})}function f(e){return o("WAWebFetchAdAccountToken").fetchToken().then(function(t){return t.type==="success"?g(t.token,e).then(function(e){return e.type!=="success"&&e.type==="auth-failure"?o("WAWebFetchAdAccountToken").markTokenAsInvalid():e.type,e}):(t.type,t)})}function g(e,t){return r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAWebRelayClient").commitMutation(p,{input:t},{environmentType:"facebook",accessToken:e})}).then(function(e){var t;if(e==null)return m;var n=(t=e.xfb_whatsapp_catalog_delete_product)==null?void 0:t.deleted_count;return n==null?m:{type:"success",deleteResult:{deletedCount:n}}}).catch(function(e){return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["deleteProductWithToken: failed with error"]))),o("WAWebFetchAdAccountToken").hasGraphQLAuthError(e)?{type:"auth-failure"}:e instanceof o("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:e}:m})}l.deleteProduct=_}),98); __d("WAWebBizCatalogDeleteProductsJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementDeleteProduct","WAWebBizGatingUtils","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("productDeleteResponse",function(e){e.assertTag("iq"),e.assertFromServer();var t=e.child("product_catalog_delete"),n=t.attrInt("deleted_count");return{deletedCount:n}});function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n,r=(n=o("WAWap")).wap("iq",{id:n.generateId(),to:n.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},n.wap("product_catalog_delete",{v:"1"},t.map(function(e){return o("WAWap").wap("product",null,o("WAWap").wap("id",null,e))}))),a=yield o("WADeprecatedSendIq").deprecatedSendIq(r,e);if(a.success)return a.result;throw a.errorCode===451?new(o("WAWebBackendErrors")).E451:new(o("WAWebBackendErrors")).ServerStatusCodeError(a.errorCode)}),u.apply(this,arguments)}function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebUserPrefsMeUser").getMaybeMePnUser();if(t==null)throw r("err")("deleteProductsGraphQL: meUser is null");var n=yield o("WAWebBizCatalogManagementDeleteProduct").deleteProduct({biz_jid:t.toJid(),product_ids:e});if(n.type==="success")return n.deleteResult;if(n.type==="graphql-error")o("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(n.error);else{if(n.type==="recovery-required")return s(e);n.type}throw r("err")("deleteProductsGraphQL: error handling flow not implemented for "+JSON.stringify(n))}),d.apply(this,arguments)}function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(o("WAWebBackendErrors")).E451;return o("WAWebBizGatingUtils").graphQLForDeleteProductEnabled()?c(e):s(e)}),p.apply(this,arguments)}l.deleteProductsMD=m}),98); __d("WAWebBizCatalogManagementEditProductMutation_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="9889773371084956"}),null); __d("WAWebBizCatalogManagementEditProductMutation.graphql",["WAWebBizCatalogManagementEditProductMutation_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{kind:"Variable",name:"request",variableName:"input"}],r={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},d=[l,c],m=[{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},r,o,{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:[o,a,i],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[o,{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},l,s,{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},s,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},u,{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},u],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:[r,{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:d,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:[l,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[c,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[o,{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},a,i],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:d,storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementEditProductMutation",selections:[{alias:null,args:t,concreteType:"XFBWhatsAppCatalogProductMutationResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_edit_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:m,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizCatalogManagementEditProductMutation",selections:[{alias:null,args:t,concreteType:"XFBWhatsAppCatalogProductMutationResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_edit_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:m,storageKey:null}],storageKey:null}]},params:{id:n("WAWebBizCatalogManagementEditProductMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementEditProductMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebBizCatalogManagementEditProduct",["Promise","WALogger","WAWebBizCatalogManagementEditProductMutation.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m={type:"error"},p=e!==void 0?e:e=n("WAWebBizCatalogManagementEditProductMutation.graphql");function _(e){return o("WAWebBizGatingUtils").graphQLForEditProductEnabled()?f(e).then(function(e){return e.type==="success"?(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["editProduct: success"]))),e):(e.type,o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(['editProduct: failed as "','"'])),e.type),e)}):(d||(d=n("Promise"))).resolve({type:"not-enabled"})}function f(e){return o("WAWebFetchAdAccountToken").fetchToken().then(function(t){return t.type==="success"?g(t.token,e).then(function(e){return e.type!=="success"&&e.type==="auth-failure"?o("WAWebFetchAdAccountToken").markTokenAsInvalid():e.type,e}):(t.type,t)})}function g(e,t){var n;return r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAWebRelayClient").commitMutation(p,{input:t},{environmentType:"facebook",accessToken:e,getInlineDataReader:function(t){n=t}})}).then(function(e){var t;if(e==null)return m;var r=(t=e.xfb_whatsapp_catalog_edit_product)==null?void 0:t.product;if(r==null)return m;var a=o("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL(n(o("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,r));return{type:"success",productResult:a}}).catch(function(e){return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["editProductWithToken: failed with error"]))),o("WAWebFetchAdAccountToken").hasGraphQLAuthError(e)?{type:"auth-failure"}:e instanceof o("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:e}:m})}l.editProduct=_}),98); __d("WAWebBizCatalogEditProductJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementEditProduct","WAWebBizCatalogManagementParseProductGraphql","WAWebBizCatalogParseProduct","WAWebBizGatingUtils","WAWebCommonParsersCustomErrors","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("editProductResponse",function(e){e.assertTag("iq"),e.assertFromServer();var t=e.child("product_catalog_edit"),n=t.child("product");return o("WAWebBizCatalogParseProduct").parseProductNode(n)});function s(e,t,n){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r){var a,i=(a=o("WAWap")).wap("iq",{id:a.generateId(),to:a.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},a.wap("product_catalog_edit",{v:"1"},o("WAWebBizCatalogParseProduct").productModelToNode(t),a.wap("width",null,n.toString()),a.wap("height",null,r.toString()))),l=yield o("WADeprecatedSendIq").deprecatedSendIqErrorParser(i,e,o("WAWebCommonParsersCustomErrors").parseErrorFields);if(l.success)return l.result;throw l.errorCode===451?new(o("WAWebBackendErrors")).E451:l.customError?new(o("WAWebBackendErrors")).CatalogEditServerError(l.errorCode,l.customError):new(o("WAWebBackendErrors")).ServerStatusCodeError(l.errorCode)}),u.apply(this,arguments)}function c(e,t,n){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a=o("WAWebUserPrefsMeUser").getMaybeMePnUser();if(a==null)throw r("err")("editProductGraphQL: meUser is null");var i=yield o("WAWebBizCatalogManagementEditProduct").editProduct({product:{biz_jid:a.toJid(),product_id:e.id.toString(),width:t,height:n,product_info:o("WAWebBizCatalogManagementParseProductGraphql").productModelToGraphQLInput(e)}});if(i.type==="success")return i.productResult;if(i.type==="graphql-error")o("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(i.error);else{if(i.type==="recovery-required")return s(e,t,n);i.type}throw r("err")("editProductGraphQL: error handling flow not implemented for "+JSON.stringify(i))}),d.apply(this,arguments)}function m(e,t,n){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(o("WAWebBackendErrors")).E451;return o("WAWebBizGatingUtils").graphQLForEditProductEnabled()?c(e,t,n):s(e,t,n)}),p.apply(this,arguments)}l.default=m}),98); __d("WAWebBizCatalogManagementUpdateProductVisibilityMutation_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="9665162096898581"}),null); __d("WAWebBizCatalogManagementUpdateProductVisibilityMutation.graphql",["WAWebBizCatalogManagementUpdateProductVisibilityMutation_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogProductVisibilityUpdateResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_product_visibility_update",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementUpdateProductVisibilityMutation",selections:t,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizCatalogManagementUpdateProductVisibilityMutation",selections:t},params:{id:n("WAWebBizCatalogManagementUpdateProductVisibilityMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementUpdateProductVisibilityMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebBizCatalogManagementUpdateProductVisibility",["Promise","WALogger","WAWebBizCatalogManagementUpdateProductVisibilityMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m={type:"error"},p=e!==void 0?e:e=n("WAWebBizCatalogManagementUpdateProductVisibilityMutation.graphql");function _(e){return o("WAWebBizGatingUtils").graphQLForUpdateProductVisibilityEnabled()?f(e).then(function(e){return e.type==="success"?(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["updateProductVisibility: success"]))),e):(e.type,o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(['updateProductVisibility: failed as "','"'])),e.type),e)}):(d||(d=n("Promise"))).resolve({type:"not-enabled"})}function f(e){return o("WAWebFetchAdAccountToken").fetchToken().then(function(t){return t.type==="success"?g(t.token,e).then(function(e){return e.type!=="success"&&e.type==="auth-failure"?o("WAWebFetchAdAccountToken").markTokenAsInvalid():e.type,e}):(t.type,t)})}function g(e,t){return r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAWebRelayClient").commitMutation(p,{input:t},{environmentType:"facebook",accessToken:e})}).then(function(e){if(e==null)return m;var t=e.xfb_whatsapp_catalog_product_visibility_update;return t==null||(t==null?void 0:t.success)==null?m:{type:"success",result:t.success}}).catch(function(e){return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["updateProductVisibilityWithToken: failed with error"]))),o("WAWebFetchAdAccountToken").hasGraphQLAuthError(e)?{type:"auth-failure"}:e instanceof o("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:e}:m})}l.updateProductVisibility=_}),98); __d("WAWebBizCatalogProductVisibilitySetJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","WAWebBizCatalogManagementUpdateProductVisibility","WAWebBizGatingUtils","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("visibilitySetResponse",function(e){e.assertTag("iq"),e.assertFromServer()});function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var a,i=(a=o("WAWap")).wap("iq",{to:a.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog",smax_id:a.SMAX_ID(r("WAWapDeprecatedSmaxID").SetCatalogVisibility),id:a.generateId()},a.wap("product_visibility_update",{v:"1"},a.wap("product",{is_hidden:n?"true":"false"},o("WAWap").wap("id",null,t)))),l=yield o("WADeprecatedSendIq").deprecatedSendIq(i,e);if(l.success)return l.result;throw l.errorCode===451?new(o("WAWebBackendErrors")).E451:new(o("WAWebBackendErrors")).ServerStatusCodeError(l.errorCode)}),u.apply(this,arguments)}function c(e){throw r("err")("updateProductVisibilityGraphQL: error handling flow not implemented for "+JSON.stringify(e))}function d(e,t){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WAWebUserPrefsMeUser").getMaybeMePnUser();if(n==null)throw r("err")("updateProductVisibilityGraphQL: meUser is null");var a=yield o("WAWebBizCatalogManagementUpdateProductVisibility").updateProductVisibility({jid:n.toJid(),products:[{product_id:e,is_hidden:t}]});if(a.type==="success")return a.result===!0?void 0:c(a);if(a.type==="graphql-error")o("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(a.error);else return a.type==="recovery-required"?s(e,t):(a.type,c(a))}),m.apply(this,arguments)}function p(e,t){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(o("WAWebBackendErrors")).E451;return o("WAWebBizGatingUtils").graphQLForUpdateProductVisibilityEnabled()?d(e,t):s(e,t)}),_.apply(this,arguments)}l.default=p}),98); __d("WAWebBizCatalogManagementCreateCatalogMutation_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="29232780583035464"}),null); __d("WAWebBizCatalogManagementCreateCatalogMutation.graphql",["WAWebBizCatalogManagementCreateCatalogMutation_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"input"}],concreteType:"XFBWhatsAppCatalogCreateResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_create",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"success",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementCreateCatalogMutation",selections:t,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizCatalogManagementCreateCatalogMutation",selections:t},params:{id:n("WAWebBizCatalogManagementCreateCatalogMutation_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementCreateCatalogMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebBizCatalogManagementCreateCatalog",["Promise","WALogger","WAWebBizCatalogManagementCreateCatalogMutation.graphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m={type:"error"},p=e!==void 0?e:e=n("WAWebBizCatalogManagementCreateCatalogMutation.graphql");function _(e){return o("WAWebBizGatingUtils").graphQLForCreateProductCatalogEnabled()?f(e).then(function(e){return e.type==="success"?(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["createCatalog: success"]))),e):(e.type,o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(['createCatalog: failed as "','"'])),e.type),e)}):(d||(d=n("Promise"))).resolve({type:"not-enabled"})}function f(e){return o("WAWebFetchAdAccountToken").fetchToken().then(function(t){return t.type==="success"?g(t.token,e).then(function(e){return e.type!=="success"&&e.type==="auth-failure"?o("WAWebFetchAdAccountToken").markTokenAsInvalid():e.type,e}):(t.type,t)})}function g(e,t){return r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAWebRelayClient").commitMutation(p,{input:t},{environmentType:"facebook",accessToken:e})}).then(function(e){var t;if(e==null)return m;var n=(t=e.xfb_whatsapp_catalog_create)==null?void 0:t.success;return n==null?m:{type:"success",createResult:n}}).catch(function(e){return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["createCatalogWithToken: failed with error"]))),o("WAWebFetchAdAccountToken").hasGraphQLAuthError(e)?{type:"auth-failure"}:e instanceof o("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:e}:m})}l.createCatalog=_}),98); __d("WAWebBizCreateProductCatalogJob",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebBackendErrors","WAWebBizCatalogManagementCreateCatalog","WAWebBizGatingUtils","WAWebMaybeThrowCatalogErrors","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s=new(r("WADeprecatedWapParser"))("productCatalogCreateResponse",function(e){e.assertTag("iq"),e.assertFromServer(),e.child("product_catalog_create")});function u(){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e,t=(e=o("WAWap")).wap("iq",{id:e.generateId(),to:e.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},e.wap("product_catalog_create",{version:"1"})),n=yield o("WADeprecatedSendIq").deprecatedSendIq(t,s);if(n.success)return n.result;throw n.errorCode===451?new(o("WAWebBackendErrors")).E451:new(o("WAWebBackendErrors")).ServerStatusCodeError(n.errorCode)}),c.apply(this,arguments)}function d(){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=o("WAWebUserPrefsMeUser").getMaybeMePnUser();if(t==null)throw r("err")("createProductCatalogGraphQL: meUser is null");var n=yield o("WAWebBizCatalogManagementCreateCatalog").createCatalog({product_catalog:{biz_jid:t.toJid()},platform:"WEB"});if(n.type!=="success")return n.type==="graphql-error"?o("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(n.error):n.type,o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["createProductCatalogGraphQL: error handling flow not implemented for ",""])),JSON.stringify(n)),u()}),m.apply(this,arguments)}function p(){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(o("WAWebBackendErrors")).E451;return o("WAWebBizGatingUtils").graphQLForCreateProductCatalogEnabled()?d():u()}),_.apply(this,arguments)}l.productCatalogCreateResponse=s,l.createProductCatalog=p}),98); __d("WAWebBizCatalogManagementFetchCatalogQuery_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="9957894520961099"}),null); __d("WAWebBizCatalogManagementFetchCatalogQuery.graphql",["WAWebBizCatalogManagementFetchCatalogQuery_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"request"}],t=[{kind:"Variable",name:"request",variableName:"request"}],r={alias:null,args:null,kind:"ScalarField",name:"catalog_type",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"catalog_id",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"catalog_name",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},_=[c,p],f=[{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},i,l,{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:[l,s,u],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[l,{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},c,d,{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},d,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},m,{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},m],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:[i,{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:_,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:[c,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[p,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[l,{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},s,u],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:_,storageKey:null}],storageKey:null}],g={alias:null,args:null,concreteType:"XFBWhatsAppCatalogPagingInfo",kind:"LinkedField",name:"paging",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"before",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"after",storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementFetchCatalogQuery",selections:[{alias:null,args:t,concreteType:"XFBWhatsAppCatalogGetResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogGetResponseProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[r,o,a,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:f,args:null,argumentDefinitions:[]}],storageKey:null},g],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizCatalogManagementFetchCatalogQuery",selections:[{alias:null,args:t,concreteType:"XFBWhatsAppCatalogGetResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogGetResponseProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[r,o,a,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"products",plural:!0,selections:f,storageKey:null},g],storageKey:null}],storageKey:null}]},params:{id:n("WAWebBizCatalogManagementFetchCatalogQuery_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementFetchCatalogQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebBizCatalogManagementFetchCatalog",["Promise","WALogger","WAWebBizCatalogManagementFetchCatalogQuery.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m={type:"error"},p=e!==void 0?e:e=n("WAWebBizCatalogManagementFetchCatalogQuery.graphql");function _(e){return o("WAWebBizGatingUtils").graphQLForGetProductCatalogEnabled()?f(e).then(function(e){return e.type==="success"?(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["fetchCatalog: success"]))),e):(e.type,o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(['fetchCatalog: failed as "','"'])),e.type),e)}):(d||(d=n("Promise"))).resolve({type:"not-enabled"})}function f(e){return o("WAWebFetchAdAccountToken").fetchToken().then(function(t){return t.type==="success"?g(t.token,e).then(function(e){return e.type!=="success"&&e.type==="auth-failure"?o("WAWebFetchAdAccountToken").markTokenAsInvalid():e.type,e}):(t.type,t)})}function g(e,t){var n;return r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAWebRelayClient").fetchQuery(p,{request:t},{environmentType:"facebook",accessToken:e,getInlineDataReader:function(t){n=t}})}).then(function(e){var t,r,a;if(e==null)return m;var i=(t=e.xfb_whatsapp_catalog)==null?void 0:t.product_catalog;if(i==null)return m;var l=i.paging,s=i.products,u=(r=l==null?void 0:l.before)!=null?r:"",c=(a=l==null?void 0:l.after)!=null?a:"",d=s.map(function(e){return n(o("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,e)}).map(o("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL);return{type:"success",catalog:{data:d,catalog_id:i.catalog_id,catalog_name:i.catalog_name,catalog_type:i.catalog_type,paging:{cursors:{before:u,after:c}}}}}).catch(function(e){return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["fetchCatalogWithToken: failed with error"]))),o("WAWebFetchAdAccountToken").hasGraphQLAuthError(e)?{type:"auth-failure"}:e instanceof o("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:e}:m})}l.fetchCatalog=_}),98); __d("WAWebQueryCatalogQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"request"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},s=[n,l],u=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_product_catalog",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogGetResponseSuccessProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogProduct",kind:"LinkedField",name:"products",plural:!0,selections:[t,{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},n,r,{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},o,{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:[o,{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:[t,a,i],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[t,{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:[r,{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:s,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:[n,{alias:null,args:null,concreteType:"XWACatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[l,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[t,{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},a,i],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:s,storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogPaging",kind:"LinkedField",name:"paging",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"before",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"after",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebQueryCatalogQuery",selections:u,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebQueryCatalogQuery",selections:u},params:{id:"9916553288394782",metadata:{},name:"WAWebQueryCatalogQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebQueryCatalog",["WALogger","WAWebBackendErrors","WAWebBizCatalogManagementFetchCatalog","WAWebBizGatingUtils","WAWebBizParseProductGraphql","WAWebCatalogEventLogger","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebQueryCatalogQuery.graphql","WAWebRelayClient","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(o("WAWebBackendErrors")).E451;try{var r,a,i,l=t.afterCursor,u=t.allowShopSource,c=t.catalogWid,d=t.checkmarkCollectionId,m=t.directConnectionEncryptedInfo,p=t.height,_=t.limit,f=t.variantInfoFields,g=t.variantThumbnailHeight,h=t.variantThumbnailWidth,y=t.width,C=yield o("WAWebRelayClient").fetchQuery(e!==void 0?e:e=n("WAWebQueryCatalogQuery.graphql"),{request:{product_catalog:{jid:c.toString(),allow_shop_source:u?"ALLOWSHOPSOURCE_TRUE":"ALLOWSHOPSOURCE_FALSE",width:String(y),height:String(p),direct_connection_encrypted_info:m,limit:String(_),after:l,catalog_session_id:d,variant_info_fields:f,variant_thumbnail_height:g!=null?String(g):null,variant_thumbnail_width:h!=null?String(h):null}}},{eventLogger:o("WAWebCatalogEventLogger").createCatalogEventLogger(o("WAWebCatalogEventLogger").GRAPHQL_CATALOG_ENDPOINT.GET_CATALOG)}),b=C==null||(r=C.xwa_product_catalog_get_product_catalog)==null?void 0:r.product_catalog;if(b==null)return{data:[],catalog_id:null,catalog_name:null,catalog_type:null,paging:{cursors:{after:"",before:""}}};var v=b.paging,S=b.products;return{data:S.map(o("WAWebBizParseProductGraphql").parseProductGraphQL),catalog_id:null,catalog_name:null,catalog_type:null,paging:{cursors:{before:(a=v==null?void 0:v.before)!=null?a:"",after:(i=v==null?void 0:v.after)!=null?i:""}}}}catch(e){throw e instanceof o("WAWebGraphQLServerError").GraphQLServerError&&o("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(e),o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["GraphQL: Failed fetching xwa_product_catalog_get_product_catalog query."]))),new(o("WAWebBackendErrors")).CatalogUnknownError}});return function(n){return t.apply(this,arguments)}})(),d=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.afterCursor,n=e.allowShopSource,r=e.catalogWid,a=e.checkmarkCollectionId,i=e.directConnectionEncryptedInfo,l=i===void 0?null:i,s=e.height,c=e.limit,d=e.variantInfoFields,m=e.variantThumbnailHeight,p=e.variantThumbnailWidth,_=e.width;if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(o("WAWebBackendErrors")).E451;var f=yield o("WAWebBizCatalogManagementFetchCatalog").fetchCatalog({product_catalog:{jid:r.toJid(),after:t,limit:String(c),width:String(_),height:String(s),belongs_to:{collection_id:a},allow_shop_source:n,direct_connection_encrypted_info:l,variant_info_fields:d,variant_thumbnail_height:m!=null?String(m):null,variant_thumbnail_width:p!=null?String(p):null},platform:"WEB"});if(f.type==="success")return f.catalog;throw f.type==="graphql-error"?o("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(f.error,o("WAWebMaybeThrowCatalogErrors").ErrorSourceForCatalogQuery.GET_PRODUCT_CATALOG_OWNER_GRAPHQL):f.type,f.type==="recovery-required"&&o("WAWebBizGatingUtils").catalogTokenRecoveryEnabled()?new(o("WAWebBackendErrors")).AdAccountRecoveryRequiredError(f.emailMask):f.type==="incorrect-nonce"&&o("WAWebBizGatingUtils").catalogTokenRecoveryEnabled()?new(o("WAWebBackendErrors")).CatalogIncorrectNonceError:(o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["queryCatalogGraphQLByOwner: error handling flow not implemented for ",""])),JSON.stringify(f)),new(o("WAWebBackendErrors")).CatalogUnknownError)});return function(n){return e.apply(this,arguments)}})(),m=function(t){var e=o("WAWebUserPrefsMeUser").getMaybeMePnUser();return e!=null&&e.equals(t.catalogWid)?d(t):c(t)},p=m;l.default=p}),98); __d("WAWebQueryCatalogHasCategoriesQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"request"}],t=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetCategoriesResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_categories",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogGetCategoriesResponseSuccessCategoryWithSubCategories",kind:"LinkedField",name:"categories",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebQueryCatalogHasCategoriesQuery",selections:t,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebQueryCatalogHasCategoriesQuery",selections:t},params:{id:"9759957480718978",metadata:{},name:"WAWebQueryCatalogHasCategoriesQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebQueryCatalogHasCategories",["errorCode","WALogger","WAWebCatalogEventLogger","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebQueryCatalogHasCategoriesQuery.graphql","WAWebRelayClient","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){var e,u,c=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var r=t.catalogWid,a=t.directConnectionEncryptedInfo,i=t.imageDimensions,l=i===void 0?{width:100,height:100}:i,s=t.sessionId;try{var c,d=yield o("WAWebRelayClient").fetchQuery(e!==void 0?e:e=n("WAWebQueryCatalogHasCategoriesQuery.graphql"),{request:{categories:{biz_jid:r.toString(),direct_connection_encrypted_info:a,image_dimensions:l,catalog_session_id:s}}},{eventLogger:o("WAWebCatalogEventLogger").createCatalogEventLogger(o("WAWebCatalogEventLogger").GRAPHQL_CATALOG_ENDPOINT.GET_CATEGORIES)});return!!(!(d==null||(c=d.xwa_product_catalog_get_categories)==null)&&c.categories.length)}catch(e){if(e instanceof o("WAWebGraphQLServerError").GraphQLServerError){var m=e.source.errors||[],p=m[0];if((p==null?void 0:p.code)===2498052)return!1;o("WAWebMaybeThrowCatalogErrors").maybeThrowLocalErrorForCatalogQuery(e)}return o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["GraphQL: Failed fetching xwa_product_catalog_get_categories query."]))),!1}});return function(n){return t.apply(this,arguments)}})();l.queryCatalogHasCategories=c}),98); __d("WAWebBizCatalogManagementFetchProductQuery_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="24529100180014015"}),null); __d("WAWebBizCatalogManagementFetchProductQuery.graphql",["WAWebBizCatalogManagementFetchProductQuery_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"request"}],t=[{kind:"Variable",name:"request",variableName:"request"}],r={alias:null,args:null,kind:"ScalarField",name:"catalog_id",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"catalog_type",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},p=[u,m],_=[{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},a,i,{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:[i,l,s],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[i,{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},u,c,{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},c,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null}],storageKey:null},d,{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},d],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:[a,{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:p,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:[u,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[m,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[i,{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},l,s],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XFBWhatsAppCatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:p,storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizCatalogManagementFetchProductQuery",selections:[{alias:null,args:t,concreteType:"XFBWhatsAppCatalogGetProductResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogGetProductResponseProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[r,o,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebBizCatalogManagementParseProductGraphql_product",selections:_,args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizCatalogManagementFetchProductQuery",selections:[{alias:null,args:t,concreteType:"XFBWhatsAppCatalogGetProductResponse",kind:"LinkedField",name:"xfb_whatsapp_catalog_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBWhatsAppCatalogGetProductResponseProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[r,o,{alias:null,args:null,concreteType:"XFBWhatsAppCatalogProductInfo",kind:"LinkedField",name:"product",plural:!1,selections:_,storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:n("WAWebBizCatalogManagementFetchProductQuery_facebookRelayOperation"),metadata:{},name:"WAWebBizCatalogManagementFetchProductQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebBizCatalogManagementFetchProduct",["Promise","WALogger","WAWebBizCatalogManagementFetchProductQuery.graphql","WAWebBizCatalogManagementParseProductGraphql","WAWebBizGatingUtils","WAWebFetchAdAccountToken","WAWebGraphQLServerError","WAWebNetworkStatus","WAWebRelayClient"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m={type:"error"},p=e!==void 0?e:e=n("WAWebBizCatalogManagementFetchProductQuery.graphql");function _(e){return o("WAWebBizGatingUtils").graphQLForGetProductEnabled()?f(e).then(function(e){return e.type==="success"?(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["fetchProduct: success"]))),e):(e.type,o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(['fetchProduct: failed as "','"'])),e.type),e)}):(d||(d=n("Promise"))).resolve({type:"not-enabled"})}function f(e){return o("WAWebFetchAdAccountToken").fetchToken().then(function(t){return t.type==="success"?g(t.token,e).then(function(e){return e.type!=="success"&&e.type==="auth-failure"?o("WAWebFetchAdAccountToken").markTokenAsInvalid():e.type,e}):(t.type,t)})}function g(e,t){var n;return r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAWebRelayClient").fetchQuery(p,{request:t},{environmentType:"facebook",accessToken:e,getInlineDataReader:function(t){n=t}})}).then(function(e){var t,r,a;if(e==null)return m;var i=(t=e.xfb_whatsapp_catalog_product)==null||(t=t.product_catalog)==null?void 0:t.product;if(i==null)return m;var l=o("WAWebBizCatalogManagementParseProductGraphql").parseProductGraphQL(n(o("WAWebBizCatalogManagementParseProductGraphql").PARSE_PRODUCT_FRAGMENT,i));return{type:"success",productResult:{data:l,catalog_id:(r=e.xfb_whatsapp_catalog_product)==null||(r=r.product_catalog)==null?void 0:r.catalog_id,catalog_type:(a=e.xfb_whatsapp_catalog_product)==null||(a=a.product_catalog)==null?void 0:a.catalog_type}}}).catch(function(e){return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["fetchProductWithToken: failed with error"]))),o("WAWebFetchAdAccountToken").hasGraphQLAuthError(e)?{type:"auth-failure"}:e instanceof o("WAWebGraphQLServerError").GraphQLServerError?{type:"graphql-error",error:e}:m})}l.fetchProduct=_}),98); __d("WAWebQueryCatalogProductQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"request"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},s=[n,l],u=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetProductResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogGetProductResponseSuccessProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogProduct",kind:"LinkedField",name:"product",plural:!1,selections:[t,{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},n,r,{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},o,{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:[o,{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:[t,a,i],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaVideo",kind:"LinkedField",name:"videos",plural:!0,selections:[t,{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:[r,{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:s,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:[n,{alias:null,args:null,concreteType:"XWACatalogVariantTypeOption",kind:"LinkedField",name:"options",plural:!0,selections:[l,{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"thumbnail_media",plural:!1,selections:[t,{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},a,i],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogVariantProperties",kind:"LinkedField",name:"variant_properties",plural:!0,selections:s,storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebQueryCatalogProductQuery",selections:u,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebQueryCatalogProductQuery",selections:u},params:{id:"9647868451963105",metadata:{},name:"WAWebQueryCatalogProductQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebQueryCatalogProduct",["errorCode","WALogger","WANullthrows","WAWebBackendErrors","WAWebBizCatalogManagementFetchProduct","WAWebBizGatingUtils","WAWebBizParseProductGraphql","WAWebCatalogEventLogger","WAWebGraphQLServerError","WAWebMaybeThrowCatalogErrors","WAWebQueryCatalogProductQuery.graphql","WAWebRelayClient","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){var e,u,c,d=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebBizGatingUtils").commerceFeaturesDisabledBySanctions())throw new(o("WAWebBackendErrors")).E451;for(var t=arguments.length,a=new Array(t),i=0;i=a&&r!=null&&n-r0){var n=t.result;return o("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview(n),o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").deleteChatFromInitialSyncBoundary(e),yield o("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(o("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(e.toString(),n)),t}return t});return function(e){return t.apply(this,arguments)}})())}l.deleteFromStorage=u,l.sendConversationDelete=S}),98); __d("WAWebChatFindBridge",["WAWebApiHydrateWidsUtil","WAWebSchemaChat","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebSchemaChat").getChatTable().get(e,!1);return t?o("WAWebApiHydrateWidsUtil").hydrateWids(t):null}),s.apply(this,arguments)}l.findLocal=e}),98); __d("WAWebChatGetExistingBridge",["WAWebChatCollection","WAWebChatFindBridge","WAWebNewsletterCollection","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebChatCollection").ChatCollection.get(e);if(t&&!t.stale)return t;var n=e.isNewsletter();if(n){var a=r("WAWebNewsletterCollection").get(e);if(a!=null&&!a.stale)return r("WAWebNewsletterCollection").get(e)}var i=yield o("WAWebChatFindBridge").findLocal(e.toString());return i?n?r("WAWebNewsletterCollection").gadd(i):o("WAWebChatCollection").ChatCollection.gadd(i):null}),s.apply(this,arguments)}l.getExisting=e}),98); __d("WAWebChatMuteBridge",["WAWebMuteChatSync","WAWebSyncdCoreApi","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t,n,r){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a){var i=yield r("WAWebMuteChatSync").generateMuteMutation(e,t,a),l={muteExpiration:t};a!=null&&(l.mentionAllMuteExpiration=a);var s=o("WAWebSyncdCoreApi").lockForSync(["chat"],[i],function(t){var n=t[0];return n.merge(e.toString(),l)}).then(function(){return{status:200}});return s}),s.apply(this,arguments)}l.sendConversationMute=e}),98); __d("WAWebSyncdWamAppState",["WAShiftTimer","WAWebMdAppStateSyncDailyWamEvent"],(function(t,n,r,o,a,i,l){"use strict";var e=d(),s=new(o("WAShiftTimer")).ShiftTimer(p),u=1e3*60*5;function c(){s.isScheduled()&&s.forceRunNow()}function d(){return{mutationCount:0,invalidActionCount:0,unsupportedActionCount:0,keyRotationRemoveCount:0,storedMutationCount:0,uploadConflictCount:0,unsetActionCount:0,missingKeyCount:0}}function m(){e=d()}function p(){var t=new(o("WAWebMdAppStateSyncDailyWamEvent")).MdAppStateSyncDailyWamEvent;e.mutationCount>0&&(t.mutationCount=e.mutationCount),e.invalidActionCount>0&&(t.invalidActionCount=e.invalidActionCount),e.unsupportedActionCount>0&&(t.unsupportedActionCount=e.unsupportedActionCount),e.keyRotationRemoveCount>0&&(t.keyRotationRemoveCount=e.keyRotationRemoveCount),e.storedMutationCount>0&&(t.storedMutationCount=e.storedMutationCount),e.uploadConflictCount>0&&(t.uploadConflictCount=e.uploadConflictCount),e.unsetActionCount>0&&(t.unsetActionCount=e.unsetActionCount),e.missingKeyCount>0&&(t.missingKeyCount=e.missingKeyCount),m(),t.commit()}function _(){s.onOrBefore(u)}function f(t){t!==0&&(e.mutationCount+=t,_())}function g(t){e.invalidActionCount=t,_()}function h(t){e.unsupportedActionCount=t,_()}function y(t){t!==0&&(e.keyRotationRemoveCount+=t,_())}function C(t){e.storedMutationCount=t,_()}function b(){e.uploadConflictCount++,_()}function v(t){t!==0&&(e.unsetActionCount+=t,_())}function S(t){e.missingKeyCount=t,_()}l.forceCommitAppState=c,l.clear=m,l.addMutationCount=f,l.setInvalidActionCount=g,l.setUnsupportedActionCount=h,l.addKeyRotationRemoveCount=y,l.setStoredMutationCount=C,l.incConflict=b,l.addUnsetActionCount=v,l.setMissingKeyCount=S}),98); __d("WAWebChatPinBridge",["WAWebPinChatSync","WAWebSyncdCoreApi","WAWebSyncdWamAppState","asyncToGeneratorRuntime","cr:12384"],(function(t,n,r,o,a,i,l){function e(e,t,n,r){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){var a=t!==0,i=yield o("WAWebPinChatSync").PinChatSync.getMutationsForPin(r,a,e);return a||o("WAWebSyncdWamAppState").addUnsetActionCount(1),o("WAWebSyncdCoreApi").lockForSync(["chat"],i,function(n){var r=n[0];return r.merge(e.toString(),{pin:t})}).then(function(){return{status:200}})}),s.apply(this,arguments)}function u(){return o("WAWebPinChatSync").PinChatSync.getLocalChatPins().then(function(e){return e.length})}function c(){return o("WAWebPinChatSync").PinChatSync.getLocalNewsletterPins().then(function(e){return e.length})}function d(e){return e.isNewsletter()?c():u()}function m(e){return e.isNewsletter()?o("WAWebPinChatSync").MAX_PINNED_NEWSLETTERS:n("cr:12384")!=null&&n("cr:12384").isAuraPinnedChatsBenefitActive()?o("WAWebPinChatSync").MAX_PINNED_CHATS_AURA:o("WAWebPinChatSync").MAX_PINNED_CHATS}function p(e){return e.isNewsletter()?o("WAWebPinChatSync").PinChatSync.unpinAllNewsletters():o("WAWebPinChatSync").PinChatSync.unpinAllChats()}l.setPin=e,l.getNumNewslettersPinned=c,l.getNumConversationsPinned=d,l.getPinLimit=m,l.unpinAllConversations=p}),98); __d("WAWebChatSeenBridge",["WALogger","WATimeUtils","WAWebApiActiveMessageRanges","WAWebApiChat","WAWebMarkChatAsReadSync","WAWebMessageRangeUtils","WAWebMiscErrors","WAWebSchemaChat","WAWebSendReadReceiptJob","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t,n,r){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a){var i=o("WATimeUtils").unixTimeMs();if(n===-1){var l=yield r("WAWebMarkChatAsReadSync").getMarkChatAsReadMutation(i,!0,e.id),s=e.id.toString();return o("WAWebMessageRangeUtils").lockForMessageRangeSync([],[l],function(){return o("WAWebApiActiveMessageRanges").addActiveMessageRange(e.id.toString(),"markChatAsRead",l.binarySyncAction)}),yield o("WAWebApiChat").updateChatForMarkAsReadSync(s),{fullyReadThreadIds:[]}}return yield o("WAWebSendReadReceiptJob").markChatRead(e,t,a)}),c.apply(this,arguments)}function d(e,t){var n=o("WATimeUtils").unixTimeMs();return r("WAWebMarkChatAsReadSync").getMarkChatAsReadMutation(n,!1,e).then(function(t){return o("WAWebMessageRangeUtils").lockForMessageRangeSync([],[t],function(){return o("WAWebApiActiveMessageRanges").addActiveMessageRange(e.toString(),"markChatAsRead",t.binarySyncAction)})})}function m(t,n){return o("WAWebSchemaChat").getChatTable().merge(t.toString(),{unreadCount:n,unreadDividerOffset:0}).catch(function(t){throw t instanceof o("WAWebMiscErrors").DbOnLogoutAbort?t:(o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["update chat table failed"]))).verbose().sendLogs("update chat table failed when mark conversation seen"),r("err")("update chat table failed"))})}function p(e){return o("WAWebSchemaChat").getChatTable().merge(e.toString(),{unreadCount:-1,unreadDividerOffset:0}).catch(function(e){throw e instanceof o("WAWebMiscErrors").DbOnLogoutAbort?e:(o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["update chat table failed"]))).verbose().sendLogs("update chat table failed when mark conversation as unseen"),r("err")("update chat table failed"))})}l.sendConversationSeen=u,l.sendConversationUnseen=d,l.markConversationSeen=m,l.markConversationUnseen=p}),98); __d("WAWebChatSendStarMsgsBridge",["WALogger","WAWebDBProcessMessage","WAWebStarMessageSync","WAWebSyncdCoreApi","WAWebSyncdWamAppState","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t,n){return d(t,n)}function c(e,t){return d(e,!1)}function d(e,t){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){n||o("WAWebSyncdWamAppState").addUnsetActionCount(t.length);var a=yield r("WAWebStarMessageSync").getStarMessageMutations(t.map(function(e){return e.id}),n);return o("WAWebSyncdCoreApi").lockForSync(["message","message-association"],a,function(){return n?o("WAWebDBProcessMessage").starMessages(t.map(function(e){return e.id.toString()})).catch(function(t){throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["star messages failed"]))).verbose().sendLogs("star messages failed"),r("err")("star messages failed")}):o("WAWebDBProcessMessage").unstarMessages(t.map(function(e){return e.id.toString()})).catch(function(e){throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["unstar messages failed"]))).verbose().sendLogs("unstar messages failed"),r("err")("unstar messages failed")})})}),m.apply(this,arguments)}l.sendStarMsgs=u,l.sendUnstarAll=c}),98); __d("WAWebDBBulkPersistProfilePic",["WABatcher","WAWebSchemaProfilePicThumb","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=o("WABatcher").batch({delayMs:3e3},(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return yield u(e),[]});return function(t){return e.apply(this,arguments)}})());function s(t){return e(t)}function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=Array.from(e.reduce(function(e,t){return e.set(t.id,t),e},new Map).values());yield o("WAWebSchemaProfilePicThumb").getProfilePicThumbTable().bulkCreateOrMerge(t)}),c.apply(this,arguments)}l.persistProfilePicBatched=s,l.bulkPersistProfilePicChanges=u}),98); __d("WAWebGroupGetProfilePicsJob",["WALogger","WASmaxGroupsGetGroupProfilePicturesRPC","WAWebBackendErrors","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=Object.freeze({IMAGE:"image",PREVIEW:"preview"}),u=Object.freeze({BLOB:"blob",URL:"url"});function c(e,t,n){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=n.subgroupHintId,a=n.type,i=a===void 0?s.PREVIEW:a,l=n.query,c=l===void 0?u.URL:l,d={profilePictureTypeMixinArgs:{pictureType:i},profilePictureQueryMixinArgs:{pictureQuery:c}},p=e.map(function(e){var t=e.groupId,n=e.isParentGroup,r=n===void 0?!1:n,a=e.photoId,i=r?{parentGroup:{anyParentGroupJid:o("WAWebWidToJid").widToGroupJid(t)}}:{subGroup:{anySubGroupJid:o("WAWebWidToJid").widToGroupJid(t)}};return babelHelpers.extends({parentOrSubGroupMixinGroupArgs:i,profilePictureIdMixinArgs:a!=null?{pictureId:a}:void 0},d)}),_=yield o("WASmaxGroupsGetGroupProfilePicturesRPC").sendGetGroupProfilePicturesRPC({pictureArgs:p,subGroupHintMixinArgs:r?{anyLinkedGroupsMembershipHint:o("WAWebWidToJid").widToGroupJid(r)}:void 0,baseGetGroupOrServerMixinGroupArgs:{baseGetGroup:{iqTo:o("WAWebWidToJid").widToGroupJid(t)}}});e:{var f=_;if((typeof f=="object"&&f!==null||typeof f=="function")&&f.name==="GetGroupProfilePicturesResponseSuccessGroupPictures"&&"value"in f){var g=f.value,h=g.picturesPicture.map(function(e){var t;switch(e.parentOrSubGroupMixinGroup.name==="SubGroup"?t=o("WAWebWidFactory").createWid(e.parentOrSubGroupMixinGroup.value.subGroupJid):t=o("WAWebWidFactory").createWid(e.parentOrSubGroupMixinGroup.value.parentGroupJid),e.getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup.name){case"GetGroupProfilePicturesSuccessProfilePictureResponse":{var n,r,a=e.getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup.value;return{id:t,tag:a.id,eurl:(n=a.profilePictureUrlOrBlobResponseMixinGroup)==null?void 0:n.value.url,directPath:(r=a.profilePictureUrlOrBlobResponseMixinGroup)==null?void 0:r.value.directPath,type:a.type,updatePicture:!0}}case"GetGroupProfilePicturesPartialProfilePictureResponse":{var i,l=!1;return((i=e.getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup.value.pictureDidNotChangeOrPictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup)==null?void 0:i.name)==="PictureNotFound"&&(l=!0),{id:t,tag:null,eurl:null,directPath:null,type:null,updatePicture:l}}}});return h}if((typeof f=="object"&&f!==null||typeof f=="function")&&f.name==="GetGroupProfilePicturesResponseClientError"&&"value"in f){var y=f.value,C=y.errorGetGroupProfilePictureClientErrors.value.code,b=y.errorGetGroupProfilePictureClientErrors.value.text;return m(C,b)}if((typeof f=="object"&&f!==null||typeof f=="function")&&f.name==="GetGroupProfilePicturesResponseServerError"&&"value"in f){var v=f.value,S=v.errorServerErrors.value.code,R=v.errorServerErrors.value.text;return m(S,R)}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+f)}}),d.apply(this,arguments)}function m(t,n){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getGroupProfilePics failed: ",":",""])),t,n).tags("non-sad").sendLogs("pictures-error",{sampling:.01}),Promise.reject(new(o("WAWebBackendErrors")).ServerStatusCodeError(Number(t),n))}l.ProfilePicsTypeEnum=s,l.ProfilePicsQueryEnum=u,l.getProfilePics=c}),98); __d("WAWebFetchCommunityProfilePicAction",["Promise","WAWebGroupGetProfilePicsJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t,n){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r,a){var i,l,s,u,c,d={id:t},m={groupId:t,photoId:a!=null?String(a):null,isParentGroup:t.equals(r)},p=yield(e||(e=n("Promise"))).all([o("WAWebGroupGetProfilePicsJob").getProfilePics([m],r,{type:o("WAWebGroupGetProfilePicsJob").ProfilePicsTypeEnum.IMAGE}),o("WAWebGroupGetProfilePicsJob").getProfilePics([m],r,{type:o("WAWebGroupGetProfilePicsJob").ProfilePicsTypeEnum.PREVIEW})]),_=p[0],f=p[1];return!f[0]||!f[0].updatePicture||!_[0]||!_[0].updatePicture?d:babelHelpers.extends({},d,{eurl:(i=_[0].eurl)!=null?i:void 0,fullDirectPath:(l=_[0].directPath)!=null?l:void 0,previewEurl:(s=f[0].eurl)!=null?s:void 0,previewDirectPath:(u=f[0].directPath)!=null?u:void 0,tag:(c=_[0].tag)!=null?c:void 0,timestamp:Date.now(),eurlStale:!1,stale:!1})}),u.apply(this,arguments)}l.fetchCommunityProfilePic=s}),98); __d("WAWebSendProfilePictureJob",["Promise","WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","WAWebCommsWapMd","WAWebWid","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=new(r("WADeprecatedWapParser"))("photoResponseParser",function(e){if(e.assertAttr("type","result"),e.hasChild("picture")){var t=e.child("picture");return{id:t.attrInt("id")}}return{id:null}});function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a){var i=yield o("WADeprecatedSendIq").deprecatedSendIq(o("WAWap").wap("iq",{to:o("WAWap").S_WHATSAPP_NET,target:r("WAWebWid").isGroup(t)?o("WAWebCommsWapMd").CHAT_JID(t):o("WAWap").DROP_ATTR,type:"set",xmlns:"w:profile:picture",id:o("WAWap").generateId()},a?o("WAWap").wap("picture",{type:"image"},a):null),s);return i.success?{id:i.result.id}:(e||(e=n("Promise"))).reject(new(o("WAWebBackendErrors")).ServerStatusCodeError(i.errorCode,i.errorText))}),c.apply(this,arguments)}l.default=u}),98); __d("WAWebContactProfilePicThumbBridge",["Promise","WABase64","WALogger","WAWebBackendErrors","WAWebChangeProfilePicThumb","WAWebDBBulkPersistProfilePic","WAWebFetchCommunityProfilePicAction","WAWebFetchNewsletterProfilePicAction","WAWebGetProfilePicJob","WAWebProfilePicConstants","WAWebSendProfilePictureJob","WAWebURLUtils","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p;function _(e){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=r("WAWebSendProfilePictureJob")(e,null).then(function(){return{status:200}}),n=yield t;return o("WAWebChangeProfilePicThumb").changeProfilePicThumb(e,o("WAWebProfilePicConstants").ProfilePicCommand.Remove),n}),f.apply(this,arguments)}function g(e,t,n){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a){var i=r("WAWebURLUtils").parseDataURL(a).data,l=o("WABase64").decodeB64(i),s=r("WAWebSendProfilePictureJob")(e,l).then(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield o("WAWebGetProfilePicJob").getProfilePic(e,{preview:!1});return{tag:t.tag,eurl:t.eurl,fullDirectPath:t.directPath,filehash:t.filehash,status:200}})),u=yield s;return o("WAWebChangeProfilePicThumb").changeProfilePicThumb(e,o("WAWebProfilePicConstants").ProfilePicCommand.Set),u}),h.apply(this,arguments)}function y(e,t){var n,r,o,a,i,l;return{id:e.toString(),eurl:(n=t==null?void 0:t.eurl)!=null?n:null,previewEurl:(r=t==null?void 0:t.previewEurl)!=null?r:null,tag:(o=t==null?void 0:t.tag)!=null?o:null,previewDirectPath:(a=t==null?void 0:t.previewDirectPath)!=null?a:null,fullDirectPath:(i=t==null?void 0:t.fullDirectPath)!=null?i:null,filehash:(l=t==null?void 0:t.filehash)!=null?l:null,timestamp:Date.now()}}function C(e,t){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=y(e,t);yield o("WAWebDBBulkPersistProfilePic").persistProfilePicBatched(n)}),b.apply(this,arguments)}function v(e,t){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a=(p||(p=n("Promise"))).all([o("WAWebGetProfilePicJob").getProfilePic(e,babelHelpers.extends({},t,{preview:!1})),o("WAWebGetProfilePicJob").getProfilePic(e,babelHelpers.extends({},t,{preview:!0}))]).then(function(e){var t,n=e[0],r=e[1],o={eurl:n.eurl,tag:n.tag,previewEurl:r.eurl,previewDirectPath:r.directPath,fullDirectPath:n.directPath},a=(t=r.filehash)!=null?t:n.filehash;return a!=null&&(o.filehash=a),o});try{var i=yield a;C(e,i).catch(function(e){o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["persistProfilePicToDB failed with error ",""])),e.message)}),E(e,i.eurl)}catch(t){E(e),R(e,r("getErrorSafe")(t)).catch(function(e){o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicFind:Catch persistProfilePicToDB failed with error ",""])),e.message)})}return a}),S.apply(this,arguments)}function R(e,t){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(t instanceof o("WAWebBackendErrors").ServerStatusCodeError){var n=t.status;n===500||n===501||n===503?o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["profilePicFind failed with serverCode: ",""])),n):n===404?yield C(e):n===401&&!e.isGroup()&&(yield C(e))}}),L.apply(this,arguments)}function E(e,t){e.equals(o("WAWebUserPrefsMeUser").getMaybeMePnUser())&&o("WAWebUserPrefsMultiDevice").setCachedProfilePicEURL(t!=null?t:"")}function k(t){return(p||(p=n("Promise"))).all(t.map((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){try{var n=yield v(t.id);return{id:t.id,eurl:n.eurl,tag:n.tag,previewEurl:n.previewEurl,previewDirectPath:n.previewDirectPath,fullDirectPath:n.fullDirectPath,filehash:n.filehash,stale:!1,eurlStale:!1,timestamp:Date.now()}}catch(n){if(n instanceof o("WAWebBackendErrors").ServerStatusCodeError)switch(n.status){case 401:case 404:return{tag:"",id:t.id,stale:!1,eurlStale:!1,timestamp:Date.now()};default:return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumb:resyncPictures error - ",", ",""])),n.status,n.message),{id:t.id,stale:!1,eurlStale:!1,timestamp:Date.now()}}throw n}});return function(e){return t.apply(this,arguments)}})()))}function I(e,t,n,r){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a){try{if(e.isNewsletter()){var i=yield o("WAWebFetchNewsletterProfilePicAction").fetchNewsletterProfilePic(o("WAWebWidFactory").asNewsletterWidOrThrow(e));return C(e,i).catch(function(e){o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["persistProfilePicToDB failed with error ",""])),e.message)}),i}if(t!=null){var l=yield o("WAWebFetchCommunityProfilePicAction").fetchCommunityProfilePic(e,t);return C(e,l).catch(function(e){o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["persistProfilePicToDB failed with error ",""])),e.message)}),l}var s=yield v(e,{tcToken:r,commonGid:a}),u=babelHelpers.extends({},s,{id:e,timestamp:Date.now(),eurlStale:!1,stale:!1});return u}catch(t){if(t instanceof o("WAWebBackendErrors").ServerStatusCodeError){var c={id:e};switch(t.status){case 401:case 404:c.tag="",c.timestamp=Date.now(),c.eurlStale=!1,c.stale=!1;break;case 423:c.stale=!0;break;case 429:c.stale=!0;break;default:c.eurlStale=!1;break}return(p||(p=n("Promise"))).resolve(c)}throw t}}),T.apply(this,arguments)}l.requestDeletePicture=_,l.sendSetPicture=g,l.mapProfilePictureToProfilePicThumbRowType=y,l.persistProfilePicToDB=C,l.profilePicResync=k,l.requestProfilePicFromServer=I}),98); __d("WAWebMexFetchAboutStatusJobQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"user"}],t=[{kind:"Literal",name:"updates",value:["STATUS"]},{items:[{kind:"Variable",name:"users.0",variableName:"user"}],kind:"ListValue",name:"users"}],n={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null}],type:"XWA2UserStatusUpdate",abstractKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebMexFetchAboutStatusJobQuery",selections:[{alias:null,args:t,concreteType:"XWA2UserUpdate",kind:"LinkedField",name:"xwa2_users_updates_since",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"updates",plural:!0,selections:[n],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebMexFetchAboutStatusJobQuery",selections:[{alias:null,args:t,concreteType:"XWA2UserUpdate",kind:"LinkedField",name:"xwa2_users_updates_since",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"updates",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},n],storageKey:null}],storageKey:null}]},params:{id:"24535500086059408",metadata:{},name:"WAWebMexFetchAboutStatusJobQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebMexFetchAboutStatusJob",["Promise","WALogger","WAWebBackendErrors","WAWebMexClient","WAWebMexFetchAboutStatusJobQuery.graphql","WAWebPrivacyGatingUtils","WAWebTrustedContactsUtils","WAWebWid","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=t.tcToken,i=t.wid;if(!r("WAWebWid").isWid(i)||!i.isUser())return o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[mex][about_status] this method should only take user wid, instead it received: ",""])),i).tags("mex","about_status").sendLogs("mex-about-status-wrong-wid"),(c||(c=n("Promise"))).resolve({id:i});var l=e!==void 0?e:e=n("WAWebMexFetchAboutStatusJobQuery.graphql"),d={user_id:i.user};a!=null&&o("WAWebPrivacyGatingUtils").isProfileScrappingProtectionInMexFetchEnabled()&&(d.privacy_token={tctoken:o("WAWebTrustedContactsUtils").encodeTcTokenForMex(a)});var m={user:d};try{var p,_,f=yield o("WAWebMexClient").fetchQuery(l,m),g=(p=f.xwa2_users_updates_since)==null?void 0:p[0];g==null&&o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[mex][about_status] empty return list"]))).tags("mex","about_status").sendLogs("mex-about-status-empty-return-list");var h=g==null||(_=g.updates)==null||(_=_[0])==null?void 0:_.text;return{id:i,status:h}}catch(e){if(e instanceof o("WAWebBackendErrors").ServerStatusCodeError){var y=e.statusCode;return y===401?{id:i,status:""}:{id:i,error:{errorCode:y,errorText:e.message}}}throw e}}),m.apply(this,arguments)}l.mexGetAbout=d}),98); __d("WAWebGetAboutQueryJob",["Promise","WALogger","WAWebMexFetchAboutStatusJob","WAWebUsync","WAWebUsyncUser","WAWebWid","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.wid;if(!t.isLid()){var n=yield o("WAWebMexFetchAboutStatusJob").mexGetAbout(e);return n}return p(e)}),m.apply(this,arguments)}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=t.tcToken,i=t.wid;if(!r("WAWebWid").isWid(i)||!i.isUser())return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getAbout: this method should only take user wid, instead it received: ",""])),i),(c||(c=n("Promise"))).resolve({id:i});var l=new(o("WAWebUsyncUser")).USyncUser().withId(i);a!=null&&(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["getAbout: adding tcToken to usync query"]))),l.withTcToken(a));var d=new(o("WAWebUsync")).USyncQuery().withContext("interactive").withMode("query").withStatusProtocol().withUser(l),m=yield d.execute();if(m.error.all||m.error.status){var p=m.error.all||m.error.status;return o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["getAbout: failed "," : ",""])),p.errorCode,p.errorText),{id:i,error:p}}var _=m.list;return _.length?{id:i,status:_[0].status}:(c||(c=n("Promise"))).reject(r("err")("no status data returned for user"))}),_.apply(this,arguments)}l.getAbout=d}),98); __d("WAWebMexUsersGetAboutStatus",["$InternalEnum","WAWebMexUsync","WAWebPrivacyGatingUtils","WAWebTrustedContactsUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=n("$InternalEnum").Mirrored(["EMPTY","NOT_ALLOWED","NO_CHANGE"]);function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.tcToken,r=t.wid,a={jid:r.toJid()};n!=null&&o("WAWebPrivacyGatingUtils").isProfileScrappingProtectionInUsyncEnabled()&&(a.privacy_token={tctoken:o("WAWebTrustedContactsUtils").encodeTcTokenForMex(n)});var i=yield o("WAWebMexUsync").mexUsyncQuery({users:[a],telemetry:{context:"INTERACTIVE"},fetch:{about_status:!0}}),l=i.response;if(l!=null){var s,u,c=(s=l[0].about_status_info)==null?void 0:s.text,d=e.cast((u=l[0].about_status_info)==null?void 0:u.status);return d==null?{status:c,state:null}:d===e.NOT_ALLOWED?{status:"",state:null}:d===e.EMPTY?{status:null,state:null}:{state:d}}return{state:e.EMPTY}}),u.apply(this,arguments)}l.getMexUsersAboutStatus=s}),98); __d("WAWebContactStatusBridge",["WALogger","WAWebABProps","WAWebAck","WAWebApiStatus","WAWebGetAboutQueryJob","WAWebMexUsersGetAboutStatus","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebSendReadReceiptJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.wid;if(o("WAWebABProps").getABPropConfigValue("mex_usync_about_status")){var r=yield o("WAWebMexUsersGetAboutStatus").getMexUsersAboutStatus(t),a=r.state,i=r.status;return a==null?{id:n,status:i}:{id:n,stale:!0,status:null}}return o("WAWebGetAboutQueryJob").getAbout(t).then(function(t){return t.error?(o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getStatus: failed "," : ",""])),t.error.errorCode,t.error.errorText),{id:t.id,stale:!0,status:""}):{id:t.id,status:t.status}})}),u.apply(this,arguments)}function c(e){return o("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(o("WAWebPersistedJobDefinitions").jobSerializers.setAbout(e))}function d(){return o("WAWebApiStatus").getAllStatuses()}function m(e,t,n){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){try{return yield o("WAWebSendReadReceiptJob").markStatusRead(e,t,n),e.ack=o("WAWebAck").ACK.READ,!0}catch(e){return!1}}),p.apply(this,arguments)}l.getStatus=s,l.setMyStatus=c,l.queryStatusAll=d,l.sendReadStatus=m}),98); __d("WAWebContactSyncBridge",["WAWebLidAwareContactsDB","WAWebSyncContactJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield r("WAWebLidAwareContactsDB").allPrimaryKeys();if(t.length>0){var n=t.map(o("WAWebWidFactory").createWid).filter(function(e){return e.isEligibleForUSync()});return o("WAWebSyncContactJob").syncContactListInChunksJob(n,e,"full")}}),s.apply(this,arguments)}l.doFullContactSync=e}),98); __d("WAWebRequestMediaReuploadBridge",["WAWebProtobufsMmsRetry.pb","WAWebRequestMediaReuploadManager"],(function(t,n,r,o,a,i,l){function e(e){if(e!=null)switch(e){case o("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType.SUCCESS:return 200;case o("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType.NOT_FOUND:case o("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType.DECRYPTION_ERROR:return 404;case o("WAWebProtobufsMmsRetry.pb").MediaRetryNotification$ResultType.GENERAL_ERROR:return 500}return 500}function s(t){return o("WAWebRequestMediaReuploadManager").RequestMediaReuploadManager.requestMediaReupload(t).then(function(t){var n=t.directPath,r=t.result;return{status:e(r),directPath:n,isMD:!0}})}l.default=s}),98); __d("WAWebDBUpdateMessageTable",["WALogger","WAWebSchemaMessage"],(function(t,n,r,o,a,i,l){var e;function s(t,n){return o("WAWebSchemaMessage").getMessageTable().merge(t.toString(),n).catch(function(t){throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["updateMessageTable: failed to update in storage"]))).verbose().sendLogs("updateMessageTable failed"),t})}l.updateMessageTable=s}),98); __d("WAWebMsgReactionsBridge",["Promise","WALogger","WAWebAck","WAWebDBGetReactions","WAWebDBUpdateMessageTable","WAWebLidMigrationUtils","WAWebMsgCollection","WAWebMsgKey","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var r=o("WAWebMsgCollection").MsgCollection.get(e);if(r&&r.hasReaction!==t){var a={hasReaction:t};yield o("WAWebDBUpdateMessageTable").updateMessageTable(r.id,a),r.set(a)}return(s||(s=n("Promise"))).resolve()}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n;try{if(n=yield o("WAWebDBGetReactions").getReactions(t.id.toString()),n.reactions.length===0&&t.id.remote.isStatus()){var a=o("WAWebLidMigrationUtils").getAlternateMsgKey(t.id);a&&(n=yield o("WAWebDBGetReactions").getReactions(a.toString()))}}catch(t){var i=r("getErrorSafe")(t);throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getReactions: failed with error: "," message: ",""])),i.name,i.message).verbose().sendLogs("getReactions failed"),i}var l=n.reactions.map(function(e){var t=e.senders.map(function(e){return babelHelpers.extends({},e,{id:r("WAWebMsgKey").fromString(e.msgKey),isSendFailure:o("WAWebUserPrefsMeUser").isSerializedWidMe(e.senderUserJid)&&e.ack===o("WAWebAck").ACK.CLOCK})});return babelHelpers.extends({},e,{hasReactionByMe:e.hasReactionByMe,id:e.aggregateEmoji,senders:t})}),s=l.length>0;return yield u(t.id.toString(),s),babelHelpers.extends({},n,{id:t.id,reactions:l})}),m.apply(this,arguments)}l.updateHasReactionInParent=u,l.sendQueryReactions=d}),98); __d("WAWebMsgUtilsBridge",["WALogger","WATimeUtils","WAWebABProps","WAWebBackendApi","WAWebChatThreadLogging","WAWebChatThreadLoggingUtils","WAWebContactCollection","WAWebDBMsgUtils","WAWebDBProcessReplyMsgs","WAWebEphemeralityResolver","WAWebForwardSendWamEvent","WAWebMsgGetters","WAWebMsgType","WAWebWamGroupMetadataMetricUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=!!t.caption;t.type===o("WAWebMsgType").MSG_TYPE.DOCUMENT&&(n=t.isCaptionByUser);var r={messageType:t.getWamMessageType(),messageMediaType:t.getWamMediaType(),mediaCaptionPresent:n,fastForwardEnabled:!0,messageIsFanout:!0,isFrequentlyForwarded:!!o("WAWebMsgGetters").getIsFrequentlyForwarded(t),isForwardedForward:o("WAWebMsgGetters").getNumTimesForwarded(t)>1};t.ephemeralDuration!=null&&(r.ephemeralityDuration=t.ephemeralDuration);var a=o("WAWebMsgGetters").getWamDisappearingModeTrigger(t);a!=null&&(r.ephemeralityTriggerAction=a);var i=o("WAWebMsgGetters").getWamDisappearingModeInitiatedByMe(t);if(i!=null&&(r.ephemeralityInitiator=i),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["createMessageForwardMetric"]))),!o("WAWebMsgGetters").getIsGroupMsg(t)){var l=o("WAWebEphemeralityResolver").getEphemeralDurationForUser(o("WAWebContactCollection").ContactCollection.getMeContact());l!=null&&(r.senderDefaultDisappearingDuration=l);var s=o("WAWebEphemeralityResolver").getEphemeralDurationForUser(o("WAWebContactCollection").ContactCollection.get(t.to));s!=null&&(r.receiverDefaultDisappearingDuration=s)}var u=t.getWamDisappearingModeInitiator();u!=null&&(r.disappearingChatInitiator=u);var c=yield o("WAWebWamGroupMetadataMetricUtils").getGroupTypeFromChatWid(t.to);return c!=null&&(r.typeOfGroup=c),new(o("WAWebForwardSendWamEvent")).ForwardSendWamEvent(r)}),u.apply(this,arguments)}function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t;return((t=e.quotedMsg)==null?void 0:t.type)!==o("WAWebMsgType").MSG_TYPE.PRODUCT||!o("WAWebMsgGetters").getIsSentByMe(e)?!1:o("WAWebBackendApi").frontendSendAndReceive("isMessageSentToBusiness",{msgKey:e.id})}),d.apply(this,arguments)}function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(o("WAWebChatThreadLoggingUtils").shouldIncrementMsgSendAndReceive(e)){if(o("WAWebABProps").getABPropConfigValue("group_status_receiver_enabled")){var t=o("WAWebDBProcessReplyMsgs").createQuotedMsgKey(e);if(t!=="missing-stanza-id"){var n=yield o("WAWebDBMsgUtils").getMsgByMsgKey(t);if(n!=null&&o("WAWebMsgGetters").getIsGroupStatus(n)){var r=o("WAWebMsgGetters").getIsSentByMe(n),a=o("WAWebMsgGetters").getIsReply(e);return o("WAWebChatThreadLogging").handleActivitiesForChatThreadLogging([{activityType:"groupStatusMsgSend",chatId:e.id.remote,ts:o("WATimeUtils").unixTime(),isGroupStatusReplyOwnToOwn:a&&r,isGroupStatusReplyOwnToOthers:a&&!r}])}}}o("WAWebChatThreadLogging").handleActivitiesForChatThreadLogging([{activityType:"msgSend",chatId:e.id.remote,ts:o("WATimeUtils").unixTime(),isViewOnce:!!e.isViewOnce,isReaction:o("WAWebMsgGetters").getIsReaction(e),isForwarded:o("WAWebMsgGetters").getIsForwarded(e),isCommerceMessage:o("WAWebChatThreadLoggingUtils").isCommerceMessage(e),isPdpInquiry:yield c(e),isReply:o("WAWebMsgGetters").getIsReply(e),isEdit:o("WAWebMsgGetters").getIsEditProtocolMsg(e),isBot:o("WAWebMsgGetters").getIsBotQuery(e),isEventCreation:e.type===o("WAWebMsgType").MSG_TYPE.EVENT_CREATION,isEventResponse:e.type===o("WAWebMsgType").MSG_TYPE.EVENT_RESPONSE}])}}),p.apply(this,arguments)}function _(e){e.markMessageSendT(),e.commit()}l.createMessageForwardMetric=s,l.logMessageSendForChatThreadLogging=m,l.logMessageMetric=_}),98); __d("WAWebErrorType",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum").Mirrored(["NoError","EditWindowExpired","UserReachedMaxMonthlyLimitForNewMessages"]);i.SendFailureErrorCode=e}),66); __d("WAWebWamEnumMessageCappingActionType",[],(function(t,n,r,o,a,i){var e=Object.freeze({CLICK:0,VIEW:1,API:2,ENTER:3,DEBUG:4});i.MESSAGE_CAPPING_ACTION_TYPE=e}),66); __d("WAWebMessageCappingWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMessageCappingActionType","WAWebWamEnumSurfaceType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({MessageCapping:[6854,{extraAttributes:[2,e.TYPES.STRING],messageCappingActionType:[6,o("WAWebWamEnumMessageCappingActionType").MESSAGE_CAPPING_ACTION_TYPE],messageCappingEntryPoint:[9,o("WAWebWamEnumSurfaceType").SURFACE_TYPE],messageCappingSequence:[7,e.TYPES.INTEGER],messageCappingSession:[8,e.TYPES.STRING],surface:[4,o("WAWebWamEnumSurfaceType").SURFACE_TYPE],userActionTarget:[5,e.TYPES.STRING]},[1,1,1],"regular"]},{MessageCapping:[]});l.MessageCappingWamEvent=s}),98); __d("WAWebSendMsgRecordBridge",["WALogger","WAWebAck","WAWebAddOnsUpdateSendStatesAction","WAWebBackendApi","WAWebCreateNackFromStanza","WAWebDBUpdateMessageTable","WAWebErrorType","WAWebHandleMsgError","WAWebIndividualNewChatMessageCappingLimitGatingUtils","WAWebIndividualNewChatMessageCappingLimitUtils","WAWebMessageCappingWamEvent","WAWebMsgUtilsBridge","WAWebSendMsgJob","WAWebSendMsgTypes","WAWebUserPrefsTypes","WAWebWamEnumMessageCappingActionType","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var r;t.isForwarded&&(r=o("WAWebMsgUtilsBridge").createMessageForwardMetric(t));try{var a=yield o("WAWebSendMsgJob").encryptAndSendMsg({type:o("WAWebSendMsgTypes").SendMessageRecordType.Message,data:t},n);if(r&&r.then(o("WAWebMsgUtilsBridge").logMessageMetric),a.error!=null)throw new(o("WAWebHandleMsgError")).MessageSentAckError(a.error);return{t:parseInt(a.t,10),count:a.count}}catch(n){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["sendMsgRecord: send failure, msg: ",""])),t.id.toString()).tags("messaging");var i={isSendFailure:!0};throw n instanceof o("WAWebHandleMsgError").MessageSentAckError&&(i=babelHelpers.extends({},i,{ack:o("WAWebAck").ACK.FAILED}),n.ackErrorCode===o("WAWebCreateNackFromStanza").NackReason.NewChatMessagesCapped&&(i=babelHelpers.extends({},i,{errorCode:o("WAWebErrorType").SendFailureErrorCode.UserReachedMaxMonthlyLimitForNewMessages}),o("WAWebIndividualNewChatMessageCappingLimitGatingUtils").isIndividualNewChatMessageCappingEnabled()&&(yield o("WAWebIndividualNewChatMessageCappingLimitUtils").resetCappingStatus(o("WAWebUserPrefsTypes").NewChatMessageCappingStatusType.CAPPED),o("WAWebBackendApi").frontendFireAndForget("individualNewChatMessageCappingStateChange",{}),new(o("WAWebMessageCappingWamEvent")).MessageCappingWamEvent({messageCappingActionType:o("WAWebWamEnumMessageCappingActionType").MESSAGE_CAPPING_ACTION_TYPE.API,userActionTarget:"nack_received",extraAttributes:JSON.stringify(o("WAWebIndividualNewChatMessageCappingLimitUtils").getCappingData()||{})}).commit()))),o("WAWebDBUpdateMessageTable").updateMessageTable(t.id,i),t.set(i),o("WAWebAddOnsUpdateSendStatesAction").updateAddOnSendStatesForMsgAction(t,i),n}}),u.apply(this,arguments)}l.sendMsgRecord=s}),98); __d("WAWebCommsHandleStanza",["WALogger","WAWap","WAWebCommsHandleWorkerCompatibleStanza","WAWebHandlePairDevice","WAWebHandlePairSuccess","WAWebOfflineHandler","asyncToGeneratorRuntime","cr:12278","err","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t,n){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r){var a=e.attrs;if(a.offline){var i=parseInt(a.t,10),l=parseInt(a.offline,10);o("WAWebOfflineHandler").OfflineMessageHandler.newOfflineStanza(i,r,l)}if(e.tag==="iq")return p(e);var s=o("WAWebCommsHandleWorkerCompatibleStanza").handleWorkerCompatibleStanza(e);return s!=null?s:n("cr:12278").handleLoggedInStanza(e,t)}),c.apply(this,arguments)}function d(e,t,n){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a){a===void 0&&(a=0);try{var i=yield u(t,n,a);if(i!=null)return i}catch(n){var l,c;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[handleStanza] exception for tag:"," type:"," id:",""])),t.tag,(l=t.attrs)==null?void 0:l.type,(c=t.attrs)==null?void 0:c.id),o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[handleStanza] ",""])),r("getErrorSafe")(n).stack).sendLogs("handle-stanza")}return"NO_ACK"}),m.apply(this,arguments)}function p(e){var t=e.attrs,n=e.content;if(t.xmlns==="urn:xmpp:ping")return o("WAWap").wap("iq",{type:"result",to:t.from});if(t.xmlns==="md"){if(!Array.isArray(n)||!n.length)return;var a=n[0].tag;switch(a){case"pair-device":return r("WAWebHandlePairDevice")(e);case"pair-success":return r("WAWebHandlePairSuccess")(e)}}else throw r("err")("handleIq unrecognized "+e.toString())}l.default=d}),98); __d("WAWebDBGetEventMessagesForChat",["Promise","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebSchemaMessage"],(function(t,n,r,o,a,i,l){var e;function s(t,r,a){return(e||(e=n("Promise"))).resolve().then(function(){if(a!=null)return o("WAWebSchemaMessage").getMessageTable().get(a.toString())}).then(function(e){var n=e==null?[o("WAWebDBMessageUtils").endOfChat(t),1/0]:[e.internalId,e.isEventMsg],a=[o("WAWebDBMessageUtils").beginningOfChat(t),0];return o("WAWebSchemaMessage").getMessageTable().between(["internalId","isEventMsg"],a,n,{lowerInclusive:!1,upperInclusive:!1,reverse:!0,limit:r}).then(function(e){return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})})})}l.getEventMessagesForChat=s}),98); __d("WAWebDBMessageFindLocal",["Promise","WAFilteredCatch","WALogger","WATimeUtils","WAWebCallLogMsgData.flow","WAWebDBGetEventMessagesForChat","WAWebDBGetStarredMessagesForChat","WAWebDBMessageSerialization","WAWebDBMessageStoreUtils","WAWebDBMessageUtils","WAWebFtsClient","WAWebMediaHubGating","WAWebModelStorageUtils","WAWebMsgKey","WAWebMsgType","WAWebSchemaMessage","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m=20,p=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o=0&&(m.limit=a.count,m.page=a.page),o("WAWebFtsClient").ftsClient.search(a.searchTerm,m)}else if(t==="media"){var _=a.remote,f=i(),g=a.media;switch(g){case"allDocs":return M(a.count,f,a.direction,_);case"allLinks":return P(a.count,f,a.direction);case"allMedia":return x(a.count,f,a.direction);case"url":return h(_,a.count,a.direction,"hasLink",f).then(function(e){return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})});case"document":return h(_,a.count,a.direction,"isDocMsg",f).then(function(e){return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})});default:return(d||(d=n("Promise"))).all(["isMediaMsg","isDocMsg","hasLink","isCarouselMsg"].map(function(e){return h(_,a.count,a.direction,e,f).then(function(e){return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})})})).then(function(e){var t=e[0],n=e[1],r=e[2],o=e[3],a=[t,r,n,o].flat();return{docCount:n.length,linkCount:r.length,mediaCount:t.length,messages:a}})}}return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Message query type "," not implemented."])),t),(d||(d=n("Promise"))).reject(r("err")("Message query type "+t+" not implemented."))}function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return o("WAWebSchemaMessage").getMessageTable().equals(["vcardWAids"],e.toString()).then(function(e){return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})})}),g.apply(this,arguments)}function h(e,t,r,a,i){var l=i==null?(d||(d=n("Promise"))).resolve(void 0):o("WAWebSchemaMessage").getMessageTable().equals(["id"],i.toString());return l.then(function(n){if(i&&n!=null&&n.length===0)throw o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Anchor message "," does not exist in message table"])),i&&i.toString()),new p;var l=n==null?void 0:n[0],u,c,d=!1;return r==="before"?(u=o("WAWebDBMessageUtils").beginningOfChat(e),c=l==null?o("WAWebDBMessageUtils").endOfChat(e):o("WAWebDBMessageUtils").craftInternalId(e.toString(),o("WAWebDBMessageUtils").getInChatMsgId(l.internalId||"")),d=!0):(u=l==null?o("WAWebDBMessageUtils").beginningOfChat(e):o("WAWebDBMessageUtils").craftInternalId(e.toString(),o("WAWebDBMessageUtils").getInChatMsgId(l.internalId||"")),c=o("WAWebDBMessageUtils").endOfChat(e)),o("WAWebSchemaMessage").getMessageTable().between(["internalId",a],[u,0],[c,1/0],{lowerInclusive:!1,upperInclusive:!1,limit:t,reverse:d})})}function y(e,t){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield b(t,function(e){return e==null?void 0:e.isStarred}),r=n[0],a=n[1],i=0;return o("WAWebSchemaMessage").getMessageTable().between(["isStarred"],i,a,{lowerInclusive:!1,upperInclusive:!1,reverse:!0,limit:e}).then(function(e){return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})})}),C.apply(this,arguments)}function b(e,t,n,r){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){n===void 0&&(n="before"),r===void 0&&(r=-1/0);var a=null;e!=null&&(a=yield o("WAWebSchemaMessage").getMessageTable().get(e.toString()));var i=a==null?void 0:t(a);return n==="before"?[r,i!=null?i:1/0]:[i!=null?i:r,1/0]}),v.apply(this,arguments)}function S(e,t){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield b(t,function(e){return e==null?void 0:e.isCallLogMsg}),r=n[0],a=n[1],i=yield o("WAWebSchemaMessage").getMessageTable().between(["isCallLogMsg"],r,a,{lowerInclusive:!1,upperInclusive:!0,reverse:!0,limit:e});return i.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})}),R.apply(this,arguments)}function L(){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSchemaMessage").getMessageTable().equals(["callOutcome"],o("WAWebCallLogMsgData.flow").CallOutcome.Ongoing);return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})}),E.apply(this,arguments)}function k(){var e,t=(e=o("WAWebUserPrefsMultiDevice").getPairingTimestamp())!=null?e:o("WATimeUtils").unixTime();return t-o("WATimeUtils").DAY_SECONDS*o("WAWebMediaHubGating").getMaxDaysInMediaHub()}function I(){var e=o("WAWebMediaHubGating").isFilesMediaHubComponentEnabled();return e}function T(e,t,n,r,o,a){return D.apply(this,arguments)}function D(){return D=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a,i){n===void 0&&(n="before");var l=I(),s=n==="before",u=yield b(t,function(e){return l?e==null?void 0:e.t:e==null?void 0:e[a]},n,r),c=u[0],d=u[1],m=[];if(l){var p=function(t){return[[t,c],[t,d]]};m=yield o("WAWebSchemaMessage").getMessageTable().inAnyRange(["typeFlag","t"],i.map(function(e){return p(e)}),{reverse:s,limit:e})}else m=yield o("WAWebSchemaMessage").getMessageTable().between(["internalId",a],["0",c],["_g",d],{lowerInclusive:!1,upperInclusive:!0,reverse:!0,limit:e}),m=m.filter(function(e){return e.t>(r!=null?r:0)});return m}),D.apply(this,arguments)}function x(e,t,n,r){return $.apply(this,arguments)}function $(){return $=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){r===void 0&&(r=k());var a=I(),i=yield T(e,t,n,a?r:k(),"isMediaMsg",[o("WAWebMsgType").MESSAGE_TYPE_FLAGS.MEDIA_MSG,o("WAWebMsgType").MESSAGE_TYPE_FLAGS.MEDIA_MSG|o("WAWebMsgType").MESSAGE_TYPE_FLAGS.HAS_LINK]);return i.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})}),$.apply(this,arguments)}function P(e,t,n,r){return N.apply(this,arguments)}function N(){return N=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){var a=I(),i=yield T(e,t,n,a?r:void 0,"hasLink",[o("WAWebMsgType").MESSAGE_TYPE_FLAGS.HAS_LINK,o("WAWebMsgType").MESSAGE_TYPE_FLAGS.MEDIA_MSG|o("WAWebMsgType").MESSAGE_TYPE_FLAGS.HAS_LINK,o("WAWebMsgType").MESSAGE_TYPE_FLAGS.DOC_MSG|o("WAWebMsgType").MESSAGE_TYPE_FLAGS.HAS_LINK]);return i.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})}),N.apply(this,arguments)}function M(e,t,n,r){return w.apply(this,arguments)}function w(){return w=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){if(r!=null)return h(r,e,n,"isDocMsg",t).then(function(e){return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})});var a=yield T(e,t,n,void 0,"isDocMsg",[o("WAWebMsgType").MESSAGE_TYPE_FLAGS.DOC_MSG,o("WAWebMsgType").MESSAGE_TYPE_FLAGS.DOC_MSG|o("WAWebMsgType").MESSAGE_TYPE_FLAGS.HAS_LINK]);return a.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})}),w.apply(this,arguments)}function A(e,t){return F.apply(this,arguments)}function F(){return F=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield b(t,function(e){return e==null?void 0:e.isEventMsg}),r=n[0],a=n[1],i=0;return o("WAWebSchemaMessage").getMessageTable().between(["isEventMsg"],i,a,{lowerInclusive:!1,upperInclusive:!1,reverse:!0,limit:e}).then(function(e){return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})})}),F.apply(this,arguments)}function O(e,t){return B.apply(this,arguments)}function B(){return B=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(t===void 0&&(t=m),!e.remote)return(d||(d=n("Promise"))).resolve([]);var a=e.remote.toString(),i=void 0;if(e instanceof r("WAWebMsgKey")){var l=yield o("WAWebSchemaMessage").getMessageTable().equals(["id"],e.toString());if(l.length===0)throw o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Anchor message "," does not exist in message table"])),e.toString()),new p;i=l[0]}var s=o("WAWebDBMessageUtils").beginningOfChat(e.remote),u=o("WAWebDBMessageUtils").endOfChat(e.remote);if(i){var _=o("WAWebDBMessageUtils").getInChatMsgId(i.internalId||""),f=Math.max(0,_-t);u=o("WAWebDBMessageUtils").craftInternalId(a,_),s=o("WAWebDBMessageUtils").craftInternalId(a,f)}var g={lowerInclusive:!0,upperInclusive:!1};s=o("WAWebDBMessageUtils").beginningOfChat(e.remote);var h=yield o("WAWebDBMessageStoreUtils").queryChatVisibleMessageHelper(s,u,babelHelpers.extends({},g,{reverse:!0}),t);return h.reverse().map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})}),B.apply(this,arguments)}function W(e,t){if(t===void 0&&(t=m),e instanceof r("WAWebMsgKey")){var a=e.remote.toString();return o("WAWebSchemaMessage").getMessageTable().equals(["id"],e.toString()).then(function(n){if(n.length===0)throw o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Anchor message "," does not exist in message table"])),e.toString()),new p;var r=n[0],i=o("WAWebDBMessageUtils").getInChatMsgId(r.internalId||""),l=i+t,s=o("WAWebDBMessageUtils").craftInternalId(a,i),c=o("WAWebDBMessageUtils").craftInternalId(a,l),d={lowerInclusive:!1,upperInclusive:!0};return c=o("WAWebDBMessageUtils").endOfChat(e.remote),o("WAWebDBMessageStoreUtils").queryChatVisibleMessageHelper(s,c,d,t).then(function(e){return e.map(function(e){return o("WAWebDBMessageSerialization").messageFromDbRow(e)})})})}return(d||(d=n("Promise"))).resolve([])}l.msgFindQuery=_,l.queryVcard=f,l.queryMessageType=h,l.getVoipOngoingCallLogMessages=L,l.getMediaAvailableMsgBoundary=k,l.libraryIsChunkEnabled=I,l.getAllMediaMessages=x}),98); __d("WAWebDBMessageRange",["Promise","WALogger","WALongInt","WANullthrows","WATimeUtils","WAWebDBDeleteAssociatedMsgsByMsgKey","WAWebDBMessageStoreUtils","WAWebDBMessageUtils","WAWebE2EProtoUtils","WAWebLidMigrationUtils","WAWebMessageAssociationGatingUtils","WAWebModelStorageUtils","WAWebMsgKey","WAWebMsgType","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=1e3;function m(e){return o("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],o("WAWebDBMessageStoreUtils").beginningOfMessageRange(e,o("WAWebDBMessageUtils").MessagePropertyType.IncomingChatMessage),o("WAWebDBMessageStoreUtils").endOfMessageRange(e,o("WAWebDBMessageUtils").MessagePropertyType.IncomingChatMessage),{lowerInclusive:!0,reverse:!0,limit:1,shouldDecrypt:!1}).then(function(e){var t;return o("WAWebDBMessageStoreUtils").extractC2STimestampFromMessageRangeIndex((t=e[0])==null?void 0:t.messageRangeIndex)})}function p(e){return o("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],o("WAWebDBMessageStoreUtils").beginningOfMessageRange(e,o("WAWebDBMessageUtils").MessagePropertyType.SystemMessage),o("WAWebDBMessageStoreUtils").endOfMessageRange(e,o("WAWebDBMessageUtils").MessagePropertyType.SystemMessage),{lowerInclusive:!0,reverse:!0,limit:1,shouldDecrypt:!1}).then(function(e){var t;return o("WAWebDBMessageStoreUtils").extractC2STimestampFromMessageRangeIndex((t=e[0])==null?void 0:t.messageRangeIndex)})}function _(e){return o("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],o("WAWebDBMessageStoreUtils").beginningOfMessageRange(e,o("WAWebDBMessageUtils").MessagePropertyType.SystemMessage),o("WAWebDBMessageStoreUtils").endOfMessageRange(e,o("WAWebDBMessageUtils").MessagePropertyType.SystemMessage),{lowerInclusive:!0,reverse:!1,limit:1,shouldDecrypt:!1}).then(function(e){var t;return o("WAWebDBMessageStoreUtils").extractC2STimestampFromMessageRangeIndex((t=e[0])==null?void 0:t.messageRangeIndex)})}function f(e,t){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a,i,l=o("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],(a=o("WAWebDBMessageStoreUtils")).beginningOfMessageRange(e,(i=o("WAWebDBMessageUtils")).MessagePropertyType.Outgoing,t),a.endOfMessageRange(e,i.MessagePropertyType.Outgoing),{reverse:!0,shouldDecrypt:!1}),s=o("WAWebSchemaMessage").getMessageTable().anyOf(["messageRangeIndex"],[a.beginningOfMessageRange(e,i.MessagePropertyType.IncomingChatMessage,t),a.beginningOfMessageRange(e,i.MessagePropertyType.Outgoing,t),a.beginningOfMessageRange(e,i.MessagePropertyType.Outgoing)],{reverse:!0,shouldDecrypt:!1}),u=yield(c||(c=n("Promise"))).all([l,s]).then(function(e){var t=e[0],n=e[1],a=function(t){return!(t.ack===-1&&t.isSendFailure===!0||t.type===o("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE)},i=t.concat(n).filter(a),l=function(t){var e,n=r("WAWebMsgKey").fromString(t.id),a=(e=o("WAWebDBMessageStoreUtils").extractC2STimestampFromMessageRangeIndex(t.messageRangeIndex))!=null?e:void 0,i={key:o("WAWebE2EProtoUtils").msgKeyToProtobuf(n),timestamp:a};return i};return i.map(l)}),m=h(u,d),p=m.messages,_=m.newLastMessageTimestamp;return{messages:p,newLastMessageTimestamp:_}}),g.apply(this,arguments)}function h(e,t){var n=[],a=[];if(e.forEach(function(e){e.timestamp!=null?n.push(e):a.push(e)}),n.lengtho("WATimeUtils").unixTime()-o("WATimeUtils").DAY_SECONDS)})),(r==null?void 0:r.skipStarred)!==!1&&(a=a.filter(function(e){return e.isStarred===void 0})),n===o("WAWebDBMessageUtils").MessagePropertyType.SystemMessage){for(var i,l=a.length-1;l>=0;l--)if(o("WAWebDBMessageStoreUtils").isBizBotDisclosureMessage(a[l])){i=a[l].id;break}i!=null&&(a=a.filter(function(e){return e.id!==i}))}return a.map(function(e){return e.id})}),b.apply(this,arguments)}function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebDBMessageUtils").beginningOfChat(e),n=o("WAWebDBMessageUtils").endOfChat(e),r=yield o("WAWebSchemaMessage").getMessageTable().between(["messageRangeIndex"],t,n,{lowerInclusive:!0,shouldDecrypt:!1});return r.filter(function(e){return e.type===o("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE}).map(function(e){return e.id})}),S.apply(this,arguments)}function R(e,t,n){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a=t.map(function(e){return o("WAWebE2EProtoUtils").protobufToMsgKey(r("WANullthrows")(e.key)).toString()}),i=[];e.isGroup()&&a.forEach(function(e){var t=r("WAWebMsgKey").fromString(e);if(t.fromMe){var n=o("WAWebLidMigrationUtils").getAlternateMsgKey(t);n&&i.push(n.toString())}});var l=yield o("WAWebSchemaMessage").getMessageTable().bulkGet(a.concat(i)),s=[];return l.forEach(function(e){e!=null&&((n==null?void 0:n.skipStarred)!==!1&&e.isStarred!=null||s.push(e.id))}),s}),L.apply(this,arguments)}function E(e,t,r){var a=t.lastMessageTimestamp,i=t.lastSystemMessageTimestamp,l=t.messages;return o("WAWebModelStorageUtils").getStorage().lock(["message","message-association"],(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var s,u=t[0],d=[],m=[];a!=null&&(m.push(C(e,a,o("WAWebDBMessageUtils").MessagePropertyType.IncomingChatMessage,r)),m.push(C(e,a,o("WAWebDBMessageUtils").MessagePropertyType.Outgoing,r)));var p=i!=null?i:a;p!=null&&m.push(C(e,p,o("WAWebDBMessageUtils").MessagePropertyType.SystemMessage,r)),m.push(R(e,l,r)),(r==null?void 0:r.deleteAutomatedGreetingMessages)===!0&&m.push(v(e));var _=yield(c||(c=n("Promise"))).all(m);d=(s=d).concat.apply(s,_);var f=r==null?void 0:r.skipMessages;f&&(d=d.filter(function(e){return!f.has(e)}));var g=[u.bulkRemove(d)];return o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&g.push(o("WAWebDBDeleteAssociatedMsgsByMsgKey").bulkDeleteMessagesByMsgKeys(d)),yield c.all(g),d});return function(e){return t.apply(this,arguments)}})())}function k(t){var n,r,a=t.messages,i={messages:a,lastMessageTimestamp:t.lastMessageTimestamp};if(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: additionalMessages length: ",""])),a.length),a.length>d){var l=h(a,d),s=l.messages,u=l.newLastMessageTimestamp;u!=null&&(i.lastMessageTimestamp=u,I(i.lastMessageTimestamp,"resultantRange")),i.messages=s}return o("WALongInt").numberOrThrowIfTooLarge((n=t.lastSystemMessageTimestamp)!=null?n:0)>o("WALongInt").numberOrThrowIfTooLarge((r=i.lastMessageTimestamp)!=null?r:0)&&(i.lastSystemMessageTimestamp=t.lastSystemMessageTimestamp),i}function I(e,t){try{o("WALongInt").numberOrThrowIfTooLarge(e!=null?e:0)/o("WATimeUtils").unixTime()>10&&o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: large timestamp: "," returned a large timestamp: ",""])),t,e).sendLogs("syncd: "+t+" returned a large timestamp")}catch(t){o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: error reporting logMaybeMillisecondTimestamp for ",": ",""])),e,t)}}var T={limitAdditionalMessages:h};l.getLastMessageTimestamp=m,l.getLastSystemMessageTimestamp=p,l.getFirstSystemMessageTimestamp=_,l.getAdditionalMessages=f,l.timestampComparison=y,l.deleteMessagesInMessageRange=E,l.fixMessageRange=k,l.logMaybeMillisecondTimestamp=I,l._test=T}),98); __d("WAWebReparseRichResponseMsgs",["Promise","WAWebBackendApi","WAWebBackendEventBus","WAWebBotGating","WAWebDBMessageSerialization","WAWebMessageProcessDBPipeline","WAWebRichResponse.flow","WAWebRichResponseParseUtils","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){"use strict";var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(o("WAWebBotGating").isRichStructuredResponseReceiverEnabled()){var a=r("compactMap")(t,function(e){var t=o("WAWebDBMessageSerialization").messageFromDbRow(e),n=t.richResponse;if(n==null||n.parseState===o("WAWebRichResponse.flow").RichResponseParseState.Parsed)return null;var r=o("WAWebRichResponseParseUtils").parseRichResponse(n);return r.parseState===o("WAWebRichResponse.flow").RichResponseParseState.Unparsed?null:babelHelpers.extends({},t,{richResponse:r})});a.length!==0&&(yield o("WAWebMessageProcessDBPipeline").processMsgDataDBPipeline(a,!0),o("WAWebBackendEventBus").BackendEventBus.isMainStreamReadyMd&&(yield(e||(e=n("Promise"))).all(a.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return o("WAWebBackendApi").frontendSendAndReceive("updateMessageUI",{chatId:e.id.remote,msg:e})});return function(t){return e.apply(this,arguments)}})()))))}}),u.apply(this,arguments)}l.reparseRichResponseMsgs=s}),98); __d("WAWebDBMessageStoreUtils",["WALogger","WAWebABProps","WAWebAck","WAWebAddonGatingUtils","WAWebApiMessageInfoStore","WAWebBotGating","WAWebDBAddOnProviders","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebFutureproofReparseMsgsAction","WAWebGroupMetadataCollection","WAWebGroupUtils","WAWebMsgGetters","WAWebMsgKey","WAWebMsgType","WAWebReparseRichResponseMsgs","WAWebRichResponse.flow","WAWebSchemaMessage","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWid","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=["limit"],s,u,c,d,m=10,p=1e9;function _(e){var t=e.toString(16);return(t.length-1).toString(16)+t}function f(e){if(e==null||e.length<3)return null;var t=e.split("_")[2];return t?o("WAWebDBMessageUtils").undoOrderPreservingHex(t):null}function g(e,t,n){var r=n!=null?_(n):"";return e.toString()+"_"+t+"_"+r}function h(e,t){return e.toString()+"_"+t+"_g"}function y(e,t,n){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield o("WAWebSchemaMessage").getMessageTable().between(["internalId"],e,t,n),a=r.filter(function(e){return I(e)});return yield T(a),a}),C.apply(this,arguments)}function b(){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSchemaMessage").getMessageTable().startsWithAnyOf(["internalId"],[o("WAWebDBMessageUtils").InternalIdPrefix.GroupStatus]);return e}),v.apply(this,arguments)}function S(e){if(!o("WAWebGroupUtils").INVALID_CAG_NON_ADMIN_SYSTEM_MSG_SUBTYPES.has(e.subtype)||!r("WAWebWid").isGroup(e.from))return!1;var t=r("WAWebGroupMetadataCollection").get(e.from);if(t==null||!t.isCag)return!1;var n=t.participants.iAmAdmin();return!n}function R(e,t,n,r,o){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r,a,i){i===void 0&&(i=[]);var l=r.limit,s=babelHelpers.objectWithoutPropertiesLoose(r,e),u=o("WAWebABProps").getABPropConfigValue("web_init_chat_max_unread_message_count"),d=[],m=[],p=0,_=0,f=function(t){return _++,a!=null&&p===a?!0:(I(t,i)&&(o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.CHAT,t.viewMode)&&p++,p>u&&o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["queryChatVisibleMessageHelper: visibleMsgsCount exceeds the threshold"])))),!1)},g=self.performance.now(),h=yield o("WAWebSchemaMessage").getMessageTable().between(["internalId"],t,n,s,f),y=h.filter(function(e){if(E(e)){var t=o("WAWebDBMessageSerialization").messageFromDbRow(e),n=o("WAWebDBAddOnProviders").getAddOnProviderForFutureproofMsg(t);e.futureproofReparsed!==!0&&(!n||n!=null&&n.canRenderInUi(t)&&!i.includes(e.id.toString()))&&d.push(e)}else k(e)&&o("WAWebBotGating").isRichStructuredResponseReceiverEnabled()&&m.push(e);return!(!I(e,i)||S(e))});return yield T(y),d.length&&o("WAWebFutureproofReparseMsgsAction").processFutureproof(d),m.length&&o("WAWebReparseRichResponseMsgs").reparseRichResponseMsgs(m),y}),L.apply(this,arguments)}function E(e){return e.type===o("WAWebMsgType").MSG_TYPE.UNKNOWN}function k(e){var t;return e.type===o("WAWebMsgType").MSG_TYPE.RICH_RESPONSE&&((t=e.richResponse)==null?void 0:t.parseState)!==o("WAWebRichResponse.flow").RichResponseParseState.Parsed}function I(e,t){t===void 0&&(t=[]);var n=o("WAWebDBMessageSerialization").messageFromDbRow(e),r=P(e),a=o("WAWebDBAddOnProviders").getAddOnProviderForFutureproofMsg(n);return!(r||E(e)&&e.futureproofReparsed===!0||a&&a.canRenderInUi(n)&&!t.includes(e.id.toString())||e.type===o("WAWebMsgType").MSG_TYPE.DEBUG||!o("WAWebBotGating").isBizBot1pEnabled()&&e.type===o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&e.subtype==="biz_bot_1p_disclosure")}function T(e){return D.apply(this,arguments)}function D(){return D=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=x(e);if(t.length!==0){var n=yield o("WAWebApiMessageInfoStore").getHighestMsgAcks(t.map(function(e){return r("WAWebMsgKey").from(e.id)})),a=[];t.forEach(function(e){var t=e.ack,r=e.id,i=n.get(r);i!=null&&(i>t&&(a.push({id:r,ack:i}),e.ack=i),a.length>0&&(o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["maybeUpdateMsgAck: storing ack updates ",""])),JSON.stringify(a)).tags("message-store"),o("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(a)))})}}),D.apply(this,arguments)}function x(e){return e.filter(function(e){if(!o("WAWebMsgGetters").getIsUnreadType(e)||e.type===o("WAWebMsgType").MSG_TYPE.CIPHERTEXT||e.type===o("WAWebMsgType").MSG_TYPE.UNKNOWN||e.ack<=o("WAWebAck").ACK.CLOCK)return!1;var t=r("WAWebMsgKey").fromString(e.id);if(!t.fromMe)return!1;if(t.remote.isGroup()&&(e.rowId!=null&&e.rowId=a?(p==null&&(p=r.id),d||(o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[init-from-storage] getKeyMsgsFromChatHistory: Exceeded limit "," to find a non futureproof reaction message"])),a),d=r),!0):(g++,!1)}if(p==null&&(p=r.id),d||(d=r),!c&&!h&&r.botPluginReferenceIndex==null&&o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.CHAT_LIST,r.viewMode)&&![o("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION,o("WAWebMsgType").MSG_TYPE.PROTOCOL,o("WAWebMsgType").MSG_TYPE.DEBUG].includes(r.type)&&(c=r),!t&&(c!=null||_>m))return!0;if(l===0&&s>0)if(r.type===o("WAWebMsgType").MSG_TYPE.REVOKED){if(s-=1,s===0)return i=r.id.toString(),!0}else return!0;return!!((l===0&&s===0||a!==0&&e.unreadCount>=a)&&c||l>0&&o("WAWebMsgGetters").getIsUnreadType(r)&&(l-=1,l===0&&(i=r.id.toString(),s===0)))};return o("WAWebSchemaMessage").getMessageTable().between(["internalId"],e.id+"_/",e.id+"_g",{reverse:!0},h).then(function(){return f.length&&o("WAWebFutureproofReparseMsgsAction").processFutureproof(f),{anchor:i,previewMsg:c||d,lastReceivedKey:p}})}function P(e){if(e.type===o("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT)return!0;var t=e.futureproofType;return t!=null?o("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(t):o("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(e.type)}var N=new Map([[o("WAWebMsgType").MSG_TYPE.GP2,["remove","add","ephemeral","invite","leave"]],[o("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION,["encrypt","encrypt_now","e2e_identity_unavailable","identity","device","chat_psa"]],[o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE,["change_number","masked_thread_created","cag_masked_thread_created","verified_initial_unknown","verified_initial_low","verified_initial_high","verified_transition_any_to_none","verified_transition_any_to_high","verified_transition_high_to_low","verified_transition_high_to_unknown","verified_transition_unknown_to_low","verified_transition_low_to_unknown","verified_transition_none_to_low","verified_transition_none_to_unknown","payment_transaction_status_update_failed","payment_transaction_status_update_refunded","payment_transaction_status_update_refund_failed","payment_transaction_status_receiver_pending_setup","payment_transaction_status_receiver_success_after_hiccup","payment_transaction_request_cancelled","payment_action_account_setup_reminder","payment_action_send_payment_reminder","payment_action_send_payment_invitation","payment_action_request_declined","payment_action_request_expired","biz_bot_1p_disclosure","biz_bot_3p_disclosure","bot_init"]]]);function M(e){var t;return((t=N.get(e.type))==null?void 0:t.includes(e.subtype))||!1}function w(e,t){return o("WAWebSchemaMessage").getMessageTable().between(["internalId"],e+"_/",e+"_g",{reverse:!0},t)}function A(e){return e.type===o("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION&&e.subtype==="encrypt"||e.type===o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&e.subtype==="biz_privacy_mode_init_fb"||e.type===o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&e.subtype==="biz_me_account_type_is_hosted"||e.type===o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&e.subtype==="biz_me_account_type_is_hosted_transition"||e.type===o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&e.subtype==="biz_account_type_is_hosted"||e.type===o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&e.subtype==="biz_account_type_changed_to_hosted"}function F(e){return e.type===o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&(e.subtype==="biz_bot_1p_disclosure"||e.subtype==="biz_bot_3p_disclosure")}l.extractC2STimestampFromMessageRangeIndex=f,l.beginningOfMessageRange=g,l.endOfMessageRange=h,l.queryChatMessageHelper=y,l.queryGroupStatusMsgsHelper=b,l.queryChatVisibleMessageHelper=R,l.shouldRenderInUI=I,l.getKeyMsgsFromChatHistory=$,l.isSecuritySensitiveMessage=M,l.getMessagesBefore=w,l.isInitialEncryptionMessage=A,l.isBizBotDisclosureMessage=F}),98); __d("WAWebGroupUnreadMessageType",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum").Mirrored(["NEW_MESSAGE","PERSISTANCE_LOAD","HISTORYC_SYNC_CHUNK"]);i.UnreadMessageType=e}),66); __d("WAWebUnreadMentionModel",["WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a=parseInt(e.inviteCodeExp,10)}),e.associationType!=null&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&g.push({msgKey:e.id.toString(),parentMsgKey:e.parentMsgKey.toString(),associationType:e.associationType,msgKeyInternalId:e.internalId}),o("WAWebThreadMsgUtils").isThreadMsg(e)&&y.push(e)});var b=[o("WAWebSchemaMessage").getMessageTable().bulkCreateWith_ALREADY_ENCRYPTED_RECORDS_ONLY(f.messages)];if(g.length&&b.push(o("WAWebSchemaMessageAssociation").getMessageAssociationTable().bulkCreate(g)),y.length){var v=o("WAWebThreadCommonModelUtils").getAggregatedThreadDetailUpdatesFromMessages(y);b.push(o("WAWebThreadMetadataBulkJob").bulkCreateOrUpdateThreadsMetadata(v))}return o("WAWebDBReportingTokenUtils").handleHistorySyncedReportingInfo(f.messages),i.size&&(i.forEach(function(e,t){var n,a,i=o("WAWebChatCollection").ChatCollection.get(o("WAWebWidFactory").createWid(t)),s=e.map(function(e){var t=e.id,n=e.timestamp;return new(r("WAWebUnreadMentionModel"))({id:t,timestamp:n})}),u=i==null||(n=i.groupMetadata)==null?void 0:n.unreadMentionMetadata,c=(a=u==null?void 0:u.pendingUnreadMentionCount)!=null?a:0;u!=null&&u.pendingUnreadMentionCount&&(u.pendingUnreadMentionCount=Math.max(c-s.length,0),l.set(t,u.pendingUnreadMentionCount)),u==null||u.addUnreadMentions(s,o("WAWebGroupUnreadMessageType").UnreadMessageType.HISTORYC_SYNC_CHUNK)}),o("WAWebApiChat").addUnreadMentionChat(i,l)),(p||(p=n("Promise"))).all(b).catch(function(e){if(o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error storing initial sync messages with error "," with optimization"])),e),e instanceof r("WAWeb-dexie").BulkError||e instanceof r("WAWeb-dexie").ConstraintError)return o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Retrying initial sync bulk add on error"]))).tags("history-sync-initial-sync-optimized"),o("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge(f.messages);throw e}).then(function(){r("WAWeb-dexie").ignoreTransaction(function(){o("WAWebSchemaFtsIndexingQueue").getFtsIndexingQueueTable().bulkCreateOrReplace(f.messages.map(function(e){return{id:String(e.rowId)}})).then(function(){o("WAWebFtsClient").ftsClient.index().catch(r("WAWebNoop"))})})}).catch(function(e){o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error storing initial sync messages with error "," after retry"])),e);var t=f.messages.map(function(e){return e.id.toString()})})}),g.apply(this,arguments)}function h(e,t){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){for(var n=e,r=new Set,a=[],i=t.length-1;i>=0&&!(n<=0);i--){var l=t[i],s=o("WAWebDBStoreMessage").isPendingUnreadReceipt(l.id,l);if(s&&(n--,r.add(String(l.id)),o("WAWebMsgGetters").getIsImportantMessage(l))){var u={id:String(l.id),timestamp:l.t};a.push(u)}}return{pendingUnreadIds:r,unreadMentions:a}}),y.apply(this,arguments)}function C(e,t){var n=r("sumBy")(e[t].msgs,function(e){return o("WAWebDBGroupHistoryPreProcessor").getBumpIdCountForGroupJoin(e)});return _-e[t].msgs.length-n}l.storeInitialSyncMessages=f}),98); __d("WAWebDBQueryAndRemoveMessageHistory",["Promise","WAWebDBDeleteAssociatedMsgsByMsgKey","WAWebDBMessageRange","WAWebDBMessageUtils","WAWebFtsClient","WAWebMessageAssociationGatingUtils","WAWebNoop","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebDBMessageUtils").beginningOfChat(e),n=o("WAWebDBMessageUtils").endOfChat(e),r=yield o("WAWebSchemaMessage").getMessageTable().between(["internalId"],t,n,{lowerInclusive:!1,upperInclusive:!1,limit:1});if(r.length===0)return null;var a=r[0].rowId,i=yield o("WAWebSchemaMessage").getMessageTable().between(["internalId"],t,n,{lowerInclusive:!1,upperInclusive:!1,limit:1,reverse:!0});if(i.length===0)return null;var l=i[0].rowId,s=i[0].t;return a==null||l==null?null:{startRowId:a,endRowId:l,tsOfLastMessage:s}}),u.apply(this,arguments)}function c(e,t,n){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a=yield o("WAWebDBMessageRange").deleteMessagesInMessageRange(e,t,n);return o("WAWebFtsClient").ftsClient.purge(a).catch(r("WAWebNoop")),a}),d.apply(this,arguments)}function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var r=o("WAWebDBMessageUtils").beginningOfChat(t),a=o("WAWebDBMessageUtils").endOfChat(t),i=yield o("WAWebSchemaMessage").getMessageTable().between(["internalId"],r,a,{lowerInclusive:!1,upperInclusive:!1,returnKeyType:"primary_key"}),l=[o("WAWebSchemaMessage").getMessageTable().bulkRemove(i)];return o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&l.push(o("WAWebDBDeleteAssociatedMsgsByMsgKey").bulkDeleteMessagesByMsgKeys(i)),yield(e||(e=n("Promise"))).all(l),i}),p.apply(this,arguments)}l.getBoundsForChat=s,l.queryAndRemoveMessagesInMessageRange=c,l.queryAndRemoveMessageHistory=m}),98); __d("WAWebGroupsPrivacyTokenUtils",["WAWebSchemaChat","WAWebTrustedContactsUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";function e(e){var t=e.tcToken,n=e.tcTokenTimestamp;return t==null||n==null||o("WAWebTrustedContactsUtils").isTokenExpired(n,o("WAWebTrustedContactsUtils").TcTokenMode.Receiver)?null:{anyElementValue:new Uint8Array(t)}}function s(t,n){var r=new Map;return n.map(function(n){var o=t.find(function(e){return(e==null?void 0:e.id)===n.toString()});o!=null&&r.set(n,e(o))}),r}function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebSchemaChat").getChatTable().bulkGet(e.map(function(e){return e.toString()}),!0);return s(t,e)}),c.apply(this,arguments)}l.getPermissionTokenMap=s,l.getPermissionTokenMapForChatIds=u}),98); __d("WAWebMexFetchTextStatusListJobQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XWA2TextStatus",kind:"LinkedField",name:"xwa2_text_status_list",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"jid",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"last_update_time",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ephemeral_duration_sec",storageKey:null},{alias:null,args:null,concreteType:"XWA2TextStatusEmoji",kind:"LinkedField",name:"emoji",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"content",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebMexFetchTextStatusListJobQuery",selections:t,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebMexFetchTextStatusListJobQuery",selections:t},params:{id:"24072923595647473",metadata:{},name:"WAWebMexFetchTextStatusListJobQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebMexFetchTextStatusListJob",["WALogger","WAWebGroupsPrivacyTokenUtils","WAWebMexClient","WAWebMexFetchTextStatusListJobQuery.graphql","WAWebPrivacyGatingUtils","WAWebTrustedContactsUtils","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err","nullthrows"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e,t){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a){if(!r("WAWebWid").isWid(t)||!t.isUser())throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[MEX][TEXT-STATUS] this method should only take user wid, instead it received: ",""])),t.toLogString()).sendLogs("mex-text-status-list-invalid-wid"),r("err")("[MEX][TEXT-STATUS] this method should only take user wid, instead it received: "+t.toLogString());var i={jid:t.toJid(),last_update_time:a==null?void 0:a.toString()};if(o("WAWebPrivacyGatingUtils").isProfileScrappingProtectionInMexFetchEnabled()){var l,c=yield o("WAWebGroupsPrivacyTokenUtils").getPermissionTokenMapForChatIds([t]),d=(l=c.get(t))==null?void 0:l.anyElementValue;d!=null&&(i.privacy_token={tctoken:o("WAWebTrustedContactsUtils").encodeTcTokenForMex(d.buffer)})}var p=e!==void 0?e:e=n("WAWebMexFetchTextStatusListJobQuery.graphql"),_={input:[i]},f=yield o("WAWebMexClient").fetchQuery(p,_),g=r("nullthrows")(f.xwa2_text_status_list,"textStatusListResponse is null"),h=r("nullthrows")(g[0],"textStatusListResponse[0] is null"),y=h.text;o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[MEX][TEXT-STATUS] fetched text status for ",""])),h.jid).tags("GQL","MEX");var C=m(h);return{id:C.id,text:C.textStatusString,emoji:C.textStatusEmoji,lastUpdateTime:C.textStatusLastUpdateTime,ephemeralDurationSeconds:C.textStatusEphemeralDuration}}),d.apply(this,arguments)}function m(e){var t;return{id:o("WAWebWidFactory").createWid(e.jid),textStatusString:e.text,textStatusEmoji:(t=e.emoji)==null?void 0:t.content,textStatusEphemeralDuration:e.ephemeral_duration_sec,textStatusLastUpdateTime:Number(e.last_update_time)}}l.mexGetTextStatusList=c,l.parseTextStatusServerResponse=m}),98); __d("WAWebContactTextStatusBridge",["WALogger","WAWebMexFetchTextStatusListJob","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){try{var r=yield o("WAWebMexFetchTextStatusListJob").mexGetTextStatusList(t,n);return{id:r.id,text:r.text,emoji:r.emoji,lastUpdateTime:r.lastUpdateTime,ephemeralDurationSeconds:r.ephemeralDurationSeconds}}catch(n){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getTextStatus: failed "," : ",""])),n.statusCode,n.message).sendLogs("getTextStatus-failed",{sampling:.01}),{id:t,error:n,text:""}}}),u.apply(this,arguments)}function c(e,t,n,r){return o("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(o("WAWebPersistedJobDefinitions").jobSerializers.setTextStatus(e,t,n,r))}l.getTextStatus=s,l.setTextStatus=c}),98); __d("WAWebGetDisappearingModeJob",["Promise","WALogger","WAWebUserPrefsMeUser","WAWebUsync","WAWebUsyncUser","WAWebWid","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(!r("WAWebWid").isWid(t)||!t.isUser())return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getDisappearingMode: this method should only take user wid, instead it received: ",""])),t),(c||(c=n("Promise"))).resolve({id:t});var a=new(o("WAWebUsync")).USyncQuery().withContext("interactive").withMode("query").withDisappearingModeProtocol().withUser(new(o("WAWebUsyncUser")).USyncUser().withId(t)),i=yield a.execute();if(i.error.all||i.error.status){var l=i.error.all||i.error.status;return o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["getDisappearingMode: failed "," : ",""])),l.errorCode,l.errorText),{id:t,error:l}}var d=i.list;if(d.length===0||d[0].disappearing_mode==null)return(c||(c=n("Promise"))).reject(r("err")("no disappearing_mode data returned for user"));var m=d[0].disappearing_mode,p=m.duration,_=m.ephemeralityDisabled,f=m.t;return _&&o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["handleDisappearingMode: ephemeralityDisabled is true, wid is my account: ",""])),o("WAWebUserPrefsMeUser").isMeAccount(t)).sendLogs("handleDisappearingMode-ephemeralityDisabled-true"),{id:t,disappearingModeDuration:p,disappearingModeSettingTimestamp:f}}),m.apply(this,arguments)}l.getDisappearingMode=d}),98); __d("WAWebTextStatusGatingUtils",["WAWebABProps","WAWebPrimaryFeatures"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebPrimaryFeatures").primaryFeatureEnabled("text_status_receive_support")&&o("WAWebABProps").getABPropConfigValue("evolve_about_m1_receiver_enabled")}function s(){return e()&&o("WAWebABProps").getABPropConfigValue("evolve_about_m1_receiver_for_new_surfaces_enabled")}function u(){return o("WAWebABProps").getABPropConfigValue("web_evolve_about_send_enabled")&&o("WAWebPrimaryFeatures").primaryFeatureEnabled("text_status_creation_support")}l.receiveTextStatusEnabled=e,l.receiveTextStatusForNewSurfacesEnabled=s,l.sendTextStatusEnabled=u}),98); __d("WAWebDBUpdateContactTable",["WAJids","WAWebLidAwareContactsDB"],(function(t,n,r,o,a,i,l){function e(e,t){var n=e.isLid()?o("WAJids").toLidUserJid(e.user):o("WAJids").toPhoneUserJid(e.user);return r("WAWebLidAwareContactsDB").merge(n,t)}l.updateContactTable=e}),98); __d("WAWebUpdateDisappearingModeForContact",["WALogger","WAWebApiContact","WAWebBackendApi","WAWebDBUpdateContactTable","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.contactId,r=t.newDuration,a=t.newEphemeralityDisabled,i=t.newSettingTimestamp,l=o("WAWebWidFactory").createUserWidOrThrow(n.user,n.server),s=yield o("WAWebApiContact").getContactRecord(l);if(s){var u=s.disappearingModeSettingTimestamp;if(u==null&&i!==0||u!=null&&u0&&a!==o("WAWebTextStatusUtils").CLEAR_TEXT_STATUS_LAST_UPDATE_TIME_VAL&&(u=Number(a)+Number(r));var c={textStatusString:t,textStatusEmoji:n,textStatusEphemeralDuration:r,textStatusLastUpdateTime:a,textStatusExpiryTs:u};yield o("WAWebDBUpdateContactTable").updateContactTable(i,babelHelpers.extends({},c)),o("WAWebBackendApi").frontendFireAndForget("updateTextStatus",babelHelpers.extends({},c,{contactId:i}))}}),s.apply(this,arguments)}l.updateTextStatusForContact=e}),98); __d("WAWebHandleAccountSyncNotification",["Promise","WADeprecatedWapParser","WAJids","WALogger","WATimeUtils","WAWap","WAWebABProps","WAWebAccountSyncJob","WAWebAdvHandlerApi","WAWebApiPendingDeviceSync","WAWebBackendApi","WAWebBackendEventBus","WAWebBizCoexGatingUtils","WAWebBizCoexUtils","WAWebCommsWapMd","WAWebContactTextStatusBridge","WAWebGetAboutQueryJob","WAWebGetDisappearingModeJob","WAWebJidToWid","WAWebMarketingMessagesUserFeedbackGatingUtils","WAWebMexFetchTextStatusListJob","WAWebMexUsersGetAboutStatus","WAWebOfflineDeviceCache","WAWebOfflineHandler","WAWebPDFNTypes","WAWebQueryBlockListJob","WAWebSetUsernameJob","WAWebSignalCommonUtils","WAWebSignalStoreApi","WAWebTextStatusGatingUtils","WAWebUpdateDisappearingModeForContact","WAWebUpdateTextStatusForContact","WAWebUserDisclosureCollection","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebUsernameGatingUtils","WAWebWidFactory","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m=function(t){var e,n=t.maybeChild("key-index-list"),r=n==null?null:{ts:n.attrTime("ts"),signedKeyIndexBytes:n.hasContent()?n.contentBytes():null,expectedTs:(e=n.maybeAttrTime("expected_ts"))!=null?e:void 0},a=t.mapChildrenWithTag("device",function(e){var n,r=e.attrDeviceJid("jid");if(o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(r!=null&&r.endsWith("@hosted")||r!=null&&r.endsWith("@hosted.lid"))){var a,i=(a=o("WAWebWidFactory").createHostedDeviceWidOrThrow(r))==null?void 0:a.device;if(i==null||i!==o("WAWebBizCoexUtils").HOSTED_DEVICE_ID)throw t.createParseError("invalid hosted device jid");return{id:i,keyIndex:e.maybeAttrInt("key-index"),isHosted:!0}}return{id:(n=o("WAWebWidFactory").createWid(e.attrDeviceJid("jid")).device)!=null?n:o("WAJids").DEFAULT_DEVICE_ID,keyIndex:e.maybeAttrInt("key-index")}});return o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()||(a=a.filter(function(e){return e.id!==o("WAWebBizCoexUtils").HOSTED_DEVICE_ID})),a.length===0?null:{deviceList:a,keyIndex:r}},p=new(r("WADeprecatedWapParser"))("incomingAccountSyncNotification",function(e){e.assertTag("notification");var t={stanzaId:e.attrString("id"),ts:e.attrTime("t"),from:o("WAWebJidToWid").deviceJidToDeviceWid(e.attrDeviceJid("from"))};if(e.hasChild("status")){var n=e.child("status"),r=n.hasAttr("action")?n.attrString("action"):void 0;return babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.STATUS,action:r},t)}else if(e.hasChild("text_status")){var a=e.child("text_status"),i=a.hasAttr("action")?a.attrString("action"):void 0,l=a.hasAttr("text")?a.attrString("text"):void 0,s=a.hasChild("emoji")?a.child("emoji"):void 0,u=s!=null&&s.hasAttr("content")?s==null?void 0:s.attrString("content"):void 0,c=a.hasAttr("ephemeral_duration_sec")?a.attrInt("ephemeral_duration_sec"):void 0,d=a.hasAttr("last_update_time")?a.attrString("last_update_time"):void 0;return babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.TEXT_STATUS,action:i,text:l,emoji:u,ephemeralDurationSeconds:c,lastUpdateTime:d},t)}else{if(e.hasChild("privacy"))return babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.PRIVACY},t);if(e.hasChild("devices"))return babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.DEVICES,devices:m(e.child("devices"))},t);if(e.hasChild("blocklist")){var p=e.child("blocklist"),_=[];return o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&p.forEachChildWithTag("item",function(e){var t=e.maybeAttrString("username"),n=o("WAWebJidToWid").userJidToUserWid(e.attrUserJid("jid"));t!=null&&_.push({userId:n,username:t})}),babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.BLOCKLIST,usernames:_},t)}else{if(e.hasChild("picture"))return babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.PICTURE},t);if(e.hasChild("tos")){var f=e.child("tos"),g=[];return f.forEachChildWithTag("notice",function(e){var t=e.maybeAttrString("state")!=="false",n=e.attrString("id");g.push({id:n,state:t})}),babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.TOS,notices:g},t)}else if(e.hasChild("disappearing_mode")){var h=e.child("disappearing_mode"),y,C,b;return h.hasAttr("action")?y=h.attrString("action"):(C=h.attrInt("duration"),b=h.attrInt("t")),babelHelpers.extends({},t,{type:o("WAWebAccountSyncJob").AccountSyncType.DISAPPEARING_MODE,action:y,disappearingModeDuration:C,disappearingModeSettingTimestamp:b})}else if(e.hasChild("notice")){var v=e.child("notice");return babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.NOTICE,noticeId:v.attrString("id"),noticeStage:v.maybeAttrString("stage"),noticeVersion:v.maybeAttrString("version"),noticeTimestamp:v.attrInt("t")},t)}else if(e.hasChild("user")){var S=e.child("user"),R=S.maybeAttrString("state")==="AI available";return babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.USER,isAiAvailable:R},t)}else if(e.hasChild("biz_opt_out_list")){var L=e.child("biz_opt_out_list"),E=L.mapChildren(function(e){return{action:e.attrString("action"),biz_jid:e.attrUserJid("biz_jid")}}),k=L.maybeAttrString("dhash"),I=L.maybeAttrString("prev_dhash");return babelHelpers.extends({type:o("WAWebAccountSyncJob").AccountSyncType.OPTOUTLIST,list:E,dhash:k,prevDhash:I},t)}}}throw e.createParseError("notification type not supported")});function _(){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),r;if(o("WAWebABProps").getABPropConfigValue("mex_usync_about_status")){var a=yield o("WAWebMexUsersGetAboutStatus").getMexUsersAboutStatus({wid:t,tcToken:null}),i=a.state,l=a.status;i==null&&(r=l)}else{var s=yield o("WAWebGetAboutQueryJob").getAbout({wid:t,tcToken:null});if(s.error)return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getStatus failed for ",": failed "," : ",""])),t,s.error.errorCode,s.error.errorText),(d||(d=n("Promise"))).reject(s.error.errorText);r=s.status}r!==""&&(yield o("WAWebBackendApi").frontendSendAndReceive("setMyStatus",{status:r}))}),f.apply(this,arguments)}function g(){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow(),t=yield o("WAWebContactTextStatusBridge").getTextStatus(e);if(t.error)return(d||(d=n("Promise"))).reject(t.error.message);var r=t.emoji,a=t.ephemeralDurationSeconds,i=t.id,l=t.lastUpdateTime,s=t.text,u=o("WAWebMexFetchTextStatusListJob").parseTextStatusServerResponse({text:s,emoji:r!=null?{content:r}:null,ephemeral_duration_sec:a,last_update_time:l.toString(),jid:i.toJid()});return o("WAWebUpdateTextStatusForContact").updateTextStatusForContact(u.id,u.textStatusString,u.textStatusEmoji,u.textStatusEphemeralDuration,u.textStatusLastUpdateTime)}),h.apply(this,arguments)}function y(e){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.devices,n=e.wid,r=o("WAWebUserPrefsMeUser").getMeLidUserOrThrow(),a=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),i={wid:n,devices:t};if(!n.isSameAccountAndAddressingMode(a))return o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["wid-is-not-self"]))).sendLogs("wid-is-not-self"),[i];var l=yield o("WAWebSignalStoreApi").waSignalStore.bulkGetIdentity([o("WAWebSignalCommonUtils").createSignalAddress(a),o("WAWebSignalCommonUtils").createSignalAddress(r)]),u=l[0],c=l[1];return c==null&&u!=null&&(yield o("WAWebSignalStoreApi").waSignalStore.putIdentity(o("WAWebSignalCommonUtils").createSignalAddress(r).toString(),u)),[i,{wid:r,devices:t}]}),C.apply(this,arguments)}function b(e){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=p.parse(e);if(t.error)return o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""])),t.error.toString()),(d||(d=n("Promise"))).reject(t.error);var r=t.success,a=o("WAWap").wap("ack",{id:o("WAWap").CUSTOM_STRING(r.stanzaId),to:o("WAWebCommsWapMd").JID(r.from),class:"notification",type:"account_sync"});switch(r.type){case o("WAWebAccountSyncJob").AccountSyncType.STATUS:yield _();break;case o("WAWebAccountSyncJob").AccountSyncType.TEXT_STATUS:if(!o("WAWebTextStatusGatingUtils").receiveTextStatusEnabled())break;if(r.action==="modify")yield g();else{var i=r.emoji,l=r.ephemeralDurationSeconds,s=r.lastUpdateTime,m=r.text,f=o("WAWebWidFactory").asUserWidOrThrow(r.from);yield o("WAWebUpdateTextStatusForContact").updateTextStatusForContact(f,m,i,l,s!=null?Number(s):void 0)}break;case o("WAWebAccountSyncJob").AccountSyncType.DEVICES:{if(o("WAWebOfflineHandler").OfflineMessageHandler.isResumeFromRestartComplete()){if(o("WAWebOfflineHandler").OfflineMessageHandler.isResumeOnSocketDisconnectInProgress())return yield o("WAWebApiPendingDeviceSync").addUserToPendingDeviceSync([r.from.toString()]),a}else return o("WAWebOfflineDeviceCache").OfflinePendingDeviceCache.addOfflinePendingDevice(r.from.toString(),a),"NO_ACK";var h=r.devices;if(h){var C=yield y({wid:o("WAWebWidFactory").asUserWidOrThrow(r.from),devices:h});yield o("WAWebAdvHandlerApi").handleADVDeviceSyncResult(C)}else yield o("WAWebAccountSyncJob").getDevices("notification");break}case o("WAWebAccountSyncJob").AccountSyncType.PICTURE:yield o("WAWebAccountSyncJob").getAndUpdateProfilePicture();break;case o("WAWebAccountSyncJob").AccountSyncType.PRIVACY:o("WAWebBackendEventBus").BackendEventBus.triggerAccountSyncForPrivacy(yield o("WAWebAccountSyncJob").updatePrivacySettings());break;case o("WAWebAccountSyncJob").AccountSyncType.BLOCKLIST:o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&r.usernames!=null&&(yield o("WAWebSetUsernameJob").setUsernamesJob(r.usernames)),o("WAWebQueryBlockListJob").fetchAndUpdateBlocklist("notification");break;case o("WAWebAccountSyncJob").AccountSyncType.OPTOUTLIST:{var b=o("WAWebUserPrefsMultiDevice").getOptOutListHash(),v=r.dhash,S=r.list,R=r.prevDhash;if(o("WAWebMarketingMessagesUserFeedbackGatingUtils").isMMOptOutListServerSyncEnabled()&&b!==R){o("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("updateOptOutList");break}else v!=null&&(S==null||S.forEach((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.action,n=e.biz_jid,r=t==="block",a=o("WAWebJidToWid").userJidToUserWid(n);yield o("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("updateOptOutListModelInCollection",{targetWid:a,isBlocked:r})});return function(t){return e.apply(this,arguments)}})()),yield o("WAWebUserPrefsMultiDevice").setOptOutlistHash(v));break}case o("WAWebAccountSyncJob").AccountSyncType.TOS:r.notices&&o("WAWebAccountSyncJob").updateTosStateFromAccountSync(r.notices);break;case o("WAWebAccountSyncJob").AccountSyncType.DISAPPEARING_MODE:{var L=r.action,E=r.from,k=r.disappearingModeDuration,I=r.disappearingModeSettingTimestamp;if(L==="modify"){var T=yield o("WAWebGetDisappearingModeJob").getDisappearingMode(E);T.error==null&&T.disappearingModeDuration!=null&&T.disappearingModeSettingTimestamp!=null&&(k=T.disappearingModeDuration,I=T.disappearingModeSettingTimestamp)}k!=null&&I!=null&&(yield o("WAWebUpdateDisappearingModeForContact").updateDisappearingModeForContact({contactId:E,newDuration:k,newSettingTimestamp:I}));break}case o("WAWebAccountSyncJob").AccountSyncType.NOTICE:{var D=r.noticeId,x=r.noticeStage,$=r.noticeTimestamp,P=r.noticeVersion;if(D!=null&&D!==""&&x!=null&&P!=null&&$!=null){var N=x===o("WAWebPDFNTypes").NOTICE_STAGES.PDFN_ACCEPTED;yield o("WAWebUserDisclosureCollection").UserDisclosureCollection.updateNoticeStage({id:D,accepted:N,policyVersion:P}),o("WAWebAccountSyncJob").updateTosStateFromAccountSync([{id:D,state:N,timestamp:o("WATimeUtils").castToUnixTime($)}])}break}case o("WAWebAccountSyncJob").AccountSyncType.USER:{r.isAiAvailable===!0&&o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Receieved account sync notification for Ai Available"])));break}}return a}),v.apply(this,arguments)}l.getAndUpdateStatus=_,l.getDeviceSyncInputs=y,l.handleAccountSyncNotification=b}),98); __d("WAWebHandlePairDevice",["Promise","WABinary","WALogger","WAShiftTimer","WASmaxMdSetToCompanionRPC","WAWebAdvSignatureApi","WAWebConnModel","WAWebNetworkStatus","WAWebSocketConstants","WAWebSocketModel","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u=6e4,c=20*1e3,d=[],m=null;function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a;try{a=o("WASmaxMdSetToCompanionRPC").receiveSetToCompanionRPC(t)}catch(t){var i=r("getErrorSafe")(t);return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["handlePairDevice: error: ",""])),i.toString()),(s||(s=n("Promise"))).reject(i)}var l=a,u=l.makeSetToCompanionResponseClientResponse,c=l.parsedRequest,d=c.pairDeviceRef.map(function(e){var t=new(o("WABinary")).Binary(e.elementValue);return t.readString(t.size())});return f(d),u()}),_.apply(this,arguments)}function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield o("WAWebAdvSignatureApi").generateADVSecretKey(),d=e,m||(m=new(o("WAShiftTimer")).ShiftTimer(function(){if(o("WAWebUserPrefsMultiDevice").isRegistered()||!r("WAWebNetworkStatus").online)m&&m.cancel(),m=null;else if(!d||!d.length)m&&m.cancel(),m=null,o("WAWebSocketModel").Socket.state=o("WAWebSocketConstants").SOCKET_STATE.UNPAIRED_IDLE;else{var e=d.length===6?u:c,t=d.shift();o("WAWebConnModel").Conn.set({ref:t,refTTL:e}),o("WAWebSocketModel").Socket.state=o("WAWebSocketConstants").SOCKET_STATE.UNPAIRED,m&&m.onOrAfter(e)}})),m.forceRunNow()}),g.apply(this,arguments)}l.default=p}),98); __d("WAWebMdClientSessionIdUtils",["WABase64","WABinary","WACryptoSha256","WAWebAltDeviceLinkingApi","WAWebConnModel","WAWebUserPrefsInfoStore","asyncToGeneratorRuntime","justknobx"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebAltDeviceLinkingApi").getPairingType();return t===o("WAWebAltDeviceLinkingApi").PairingType.ALT_DEVICE_LINKING&&r("justknobx")._("527")?u():d(e)}),s.apply(this,arguments)}function u(){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WAWebAltDeviceLinkingApi").getCurrentRef(),t=o("WAWebAltDeviceLinkingApi").getCurrentHelloCached();if(e==null||(t==null?void 0:t.linkCodePairingWrappedCompanionEphemeralPub)==null)return null;var n=t.linkCodePairingWrappedCompanionEphemeralPub;if(n.byteLength===0||e.byteLength===0)return null;var r=new(o("WABinary")).Binary;r.writeBuffer(n),r.writeByteArray(e);var a=r.readByteArrayView(),i=yield o("WACryptoSha256").sha256(a);return o("WABase64").encodeB64(i)}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=yield o("WAWebUserPrefsInfoStore").waNoiseInfo.get();if(!n)return null;var r=n==null||(t=n.staticKeyPair)==null?void 0:t.pubKey,a=o("WAWebConnModel").Conn.ref;if(!a||a.length===0||e.byteLength===0||r.byteLength===0)return null;var i=new(o("WABinary")).Binary;i.writeBuffer(e),i.writeBuffer(r);for(var l=0;la?{shouldPerformRecovery:!1,reason:o("WAWebWamEnumRecoveryStatusEnum").RECOVERY_STATUS_ENUM.MUTATION_COUNT_TOO_HIGH}:{shouldPerformRecovery:!0}}l.syncdSnapshotRecoveryEnabled=s,l.updatePrimaryDeviceSupportsSyncdRecovery=u,l.shouldPreformSnapshotRecovery=d}),98); __d("WAWebHandlePairSuccess",["invariant","Promise","WABase64","WABinary","WACryptoHmac","WAJids","WALogger","WANullthrows","WAQplTypes","WASmaxMdSetRegRPC","WATimeUtils","WAWebAdvSignatureApi","WAWebAltDeviceLinkingApi","WAWebAppTracker","WAWebBizAgentAction","WAWebBizCoexGatingUtils","WAWebCompanionRegUtils","WAWebConnModel","WAWebCryptoCurve25519","WAWebE2ETestPairingConstants","WAWebEnvironment","WAWebFtsClient","WAWebJidToWid","WAWebLid11MigrationLifecycleWamEvent","WAWebLid1X1MigrationGating","WAWebLocalStorage","WAWebLogoutReasonConstants","WAWebMdClientSessionIdUtils","WAWebMobilePlatforms","WAWebProtobufsAdv.pb","WAWebProtobufsCompanionReg.pb","WAWebQrDeviceLinkingQpl","WAWebSignalCommonUtils","WAWebSignalStoreApi","WAWebSocketLogoutJob","WAWebSyncdSnapshotRecoveryGatingUtils","WAWebUserPrefsHistorySync","WAWebUserPrefsInfoStore","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebUserPrefsTypes","WAWebViewerContextAuthUtils","WAWebWamDeviceLinkReporter","WAWebWamEnumMdLinkDeviceCompanionStage","WAWebWamEnumMigrationStageEnum","WAWebWidFactory","asyncToGeneratorRuntime","cr:1064","cr:17219","decodeProtobuf","encodeProtobuf","getErrorSafe","gkx"],(function(t,n,r,o,a,i,l,s){var e,u,c,d,m,p,_,f=!1;function g(e){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(r("gkx")("26256")&&(r("WAWebLocalStorage")==null||r("WAWebLocalStorage").removeItem(o("WAWebE2ETestPairingConstants").PAIRING_ATTEMPT_ONGOING_KEY)),!(f||o("WAWebUserPrefsMultiDevice").isRegistered())){f=!0;var a=o("WATimeUtils").unixTimeWithoutClockSkewCorrection(),i=null;try{i=o("WASmaxMdSetRegRPC").receiveSetRegRPC(t)}catch(t){var l=r("getErrorSafe")(t);return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Parsing Error: ",""])),l.toString()),f=!1,(_||(_=n("Promise"))).reject(l)}var d=i,m=d.makeSetRegResponseClientResponse,p=d.makeSetRegResponseError,g=d.parsedRequest;try{if(o("WAWebCompanionRegUtils").resetCompanionReg(),yield o("WAWebUserPrefsMultiDevice").setPairingTimestamp(a),o("WAWebAppTracker").AppTracker.start(o("WAWebAppTracker").AppTrackerType.Registration),o("WAWebAltDeviceLinkingApi").getPairingType()===o("WAWebAltDeviceLinkingApi").PairingType.ALT_DEVICE_LINKING){var h,C;(h=o("WAWebAltDeviceLinkingApi").getCurrentMarker())==null||h.addPoint("alt_linking_pair_success"),(C=o("WAWebAltDeviceLinkingApi").getCurrentMarker())==null||C.end(o("WAQplTypes").QuickLogActionType.SUCCESS)}else o("WAWebAltDeviceLinkingApi").getPairingType()===o("WAWebAltDeviceLinkingApi").PairingType.QR_CODE&&o("WAWebQrDeviceLinkingQpl").companionDeviceLinkingScreenQpl.pairStarted();var v=g.pairSuccessClientProps,S=g.pairSuccessDeviceIdentityElementValue,R=g.pairSuccessDeviceJid,L=g.pairSuccessDeviceLid,E=g.pairSuccessEncryptionMetadata,k=g.pairSuccessPlatformName;o("WAWebConnModel").Conn.blockStoreAdds=!1,o("WAWebConnModel").Conn.platform=k,yield o("WAWebMobilePlatforms").setMobilePlatform(k),o("WAWebUserPrefsMeUser").setMe(o("WAWebJidToWid").deviceJidToDeviceWid(R)),L!=null&&o("WAWebUserPrefsMeUser").setMeLid(o("WAWebJidToWid").deviceJidToDeviceWid(L)),v&&(yield y(v));var I=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufsAdv.pb").ADVSignedDeviceIdentityHMACSpec,S),T=I.details,D=I.hmac;T!=null&&D!=null||s(0,56299);var x=new(o("WABinary")).Binary(T).readByteArrayView();o("WAWebBizCoexGatingUtils").smbHostedPrimaryPairingAllowed()&&I.accountType===o("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(yield o("WAWebUserPrefsMultiDevice").setIsHostedMeAccount(),x=o("WABinary").Binary.build(o("WAWebAdvSignatureApi").ADV_HOSTED_PREFIX_DEVICE_IDENTITY_ACCOUNT_SIGNATURE,r("WANullthrows")(T)).readByteArrayView());var $=yield o("WAWebAdvSignatureApi").getADVSecretKey(),P=yield o("WACryptoHmac").hmacSha256($,x),N=o("WABase64").encodeB64(P),M=o("WABase64").encodeB64(D);if(N!==M)return o("WAWebCompanionRegUtils").logoutAfterValidationFail(),f=!1,o("WAWebQrDeviceLinkingQpl").companionDeviceLinkingScreenQpl.pairFailed(),p();var w=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufsAdv.pb").ADVSignedDeviceIdentitySpec,T),A=w.accountSignatureKey;A!=null||s(0,56344);var F=w.accountSignature;F!=null||s(0,56295);var O=yield o("WAWebSignalStoreApi").waSignalStore.getRegistrationInfo();O!=null||s(0,56296);var B=yield o("WAWebWamDeviceLinkReporter").initDeviceLinkEvent(A,O.identityKeyPair.pubKey,a),W=yield o("WAWebMdClientSessionIdUtils").genMdClientSessionId(A);yield o("WAWebWamDeviceLinkReporter").setDeviceLinkPairStage(o("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE.PAIR_SUCCESS_RECEIVED),o("WAWebCompanionRegUtils").initDevicePairingLatencyMeasurement();var q=o("WAWebAdvSignatureApi").verifyDeviceIdentityAccountSignature(w,O.identityKeyPair.pubKey,null);if(!q)return yield o("WAWebWamDeviceLinkReporter").commitDeviceLinkEvent(401),o("WAWebCompanionRegUtils").logoutAfterValidationFail(),f=!1,o("WAWebQrDeviceLinkingQpl").companionDeviceLinkingScreenQpl.pairFailed(),p();w.deviceSignature=yield o("WAWebAdvSignatureApi").generateDeviceSignature(w,O.identityKeyPair,A),yield o("WAWebSignalStoreApi").waSignalStore.putIdentity(o("WAWebSignalCommonUtils").createSignalAddress(o("WAWebWidFactory").asUserWidOrThrow(o("WAWebJidToWid").deviceJidToDeviceWid(R))).toString(),o("WAWebSignalCommonUtils").bufferToStr(o("WAWebCryptoCurve25519").toSignalCurvePubKey(A))),yield o("WAWebAdvSignatureApi").setADVSignedIdentity(w);var U=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufsAdv.pb").ADVDeviceIdentitySpec,w.details),V=U.keyIndex;V!=null||s(0,56297),w.accountSignatureKey=void 0;var H=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufsAdv.pb").ADVSignedDeviceIdentitySpec,w).readByteArrayView(),G=m({deviceIdentityElementValue:H,deviceIdentityKeyIndex:V});if(r("WAWebEnvironment").isWindows){var z,j,K=yield o("WAWebUserPrefsInfoStore").waNoiseInfo.get(),Q=K==null||(z=K.staticKeyPair)==null?void 0:z.privKey,X=Q!=null?o("WABase64").encodeB64(Q):"";yield n("cr:17219")==null||(j=n("cr:17219").getWindowsBridge())==null||(j=j.getClientKeyBridge())==null?void 0:j.setClientKey(X),yield o("WAWebFtsClient").ftsClient.initExternalStorage()}yield o("WAWebWamDeviceLinkReporter").setDeviceLinkPairStage(o("WAWebWamEnumMdLinkDeviceCompanionStage").MD_LINK_DEVICE_COMPANION_STAGE.PAIR_DEVICE_SIGN_SENT);var Y=yield o("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete();return Y!==!0&&o("WAWebCompanionRegUtils").startInitialHistorySyncTimeout(),f=!1,o("WAWebBizAgentAction").setShouldLogAgentLogin({loginTimestamp:a}),o("WAWebQrDeviceLinkingQpl").companionDeviceLinkingScreenQpl.pairSuccess(),n("cr:1064")==null||n("cr:1064").setMdSessionId(B),W!=null&&(n("cr:1064")==null||n("cr:1064").setMdClientSessionId(W)),n("cr:1064")==null||n("cr:1064").trigger("post_pair_success"),o("WAWebViewerContextAuthUtils").isViewerContextAuthEnabled()?yield b(E,L!=null?L:R):o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] viewer context auth is disabled"]))),G}catch(e){o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["error in handlePairSuccess, ",""])),e).verbose().sendLogs("error in handlePairSuccess"),o("WAWebQrDeviceLinkingQpl").companionDeviceLinkingScreenQpl.pairFailed(),yield o("WAWebWamDeviceLinkReporter").commitDeviceLinkEvent(-1),yield o("WAWebSocketLogoutJob").socketLogout(o("WAWebLogoutReasonConstants").LogoutReason.UnknownCompanion)}finally{o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.Registration)}}}),h.apply(this,arguments)}function y(e){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufsCompanionReg.pb").ClientPairingPropsSpec,e.elementValue),n=t.isChatDbLidMigrated,r=t.isSyncdPureLidSession,a=t.isSyncdSnapshotRecoveryEnabled;n===!0&&(yield o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.setIsLidMigrated(!0,o("WAWebUserPrefsTypes").LidMigrationSource.HISTORY,r),new(o("WAWebLid11MigrationLifecycleWamEvent")).Lid11MigrationLifecycleWamEvent({migrationStage:o("WAWebWamEnumMigrationStageEnum").MIGRATION_STAGE_ENUM.COMPANION_MIGRATED_ON_NEW_PAIRING,webClientDidPairingStanzaIndicated1x1MigrationThisSession:!0,isLocally1x1MigratedFromDb:o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()}).commit()),o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[syncd snapshot recovery] isSyncdSnapshotRecoveryEnabled: ",""])),a),yield o("WAWebSyncdSnapshotRecoveryGatingUtils").updatePrimaryDeviceSupportsSyncdRecovery(a===!0)}),C.apply(this,arguments)}function b(e,t){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] begin viewer context auth process"])));try{if(e==null||t==null)return;var n=yield o("WAWebViewerContextAuthUtils").decryptNonce(e);if(n==null)return;var r=o("WAWebViewerContextAuthUtils").parseNoncePayload(n);if(r==null)return;var a=o("WAJids").extractDeviceId(t),i=yield o("WAWebViewerContextAuthUtils").exchangeNonceForTokenWithTimeout({userId:r.fbid,deviceId:a,nonce:r.nonce});i&&o("WAWebViewerContextAuthUtils").setViewerContextReady()}catch(e){o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] unexpected error in viewer context auth process: ",""])),String(e)).sendLogs("vc-auth-error")}}),v.apply(this,arguments)}l.default=g}),98); __d("WAWebHandleBusinessNameChangeLidHelpers",["Promise","WAWebBizGatingUtils","WAWebHandleBusinessRemoval","WAWebLidMigrationUtils","WAWebModelStorageUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return e.map(function(e){var t=o("WAWebBizGatingUtils").isLidMigrationForVnameEnabled()?o("WAWebLidMigrationUtils").getPnAndLidToUpdate(e.id):[e.id];return t.map(function(t){return babelHelpers.extends({},e,{id:t})})}).reduce(function(e,t){return e.concat(t)},[])}function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){return o("WAWebModelStorageUtils").getStorage().lock(["contact","verified-business-name"],function(r){var a=r[0],i=r[1],l=o("WAWebBizGatingUtils").isLidMigrationForVnameEnabled()?o("WAWebLidMigrationUtils").getPnAndLidToUpdate(t):[t];return(e||(e=n("Promise"))).all([].concat(l.map(o("WAWebHandleBusinessRemoval").removeBusinessPropsFromContact),l.map(function(e){return o("WAWebHandleBusinessRemoval").removeVerifiedName(i,e)})))})}),c.apply(this,arguments)}l.getVerifiedNamesToUpdateLidAware=s,l.removeVerifiedNameFromTableLidAware=u}),98); __d("WAWebHandleBusinessRemoval",["WAWebApiContact","WAWebBackendApi","WAWebContactCollection","WAWebHandleBusinessNameChangeLidHelpers","WAWebLidAwareContactsDB","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.toString(),n=yield r("WAWebLidAwareContactsDB").get(t);if(n!=null)return n.isBusiness=!1,n.verifiedLevel=0,n.verifiedName="",r("WAWebLidAwareContactsDB").merge(t,n)}),s.apply(this,arguments)}function u(e,t){return e.remove(t.isLid()?t.toString():t.user)}var c={isBusiness:!1};function d(e,t,n){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=o("WAWebContactCollection").ContactCollection.get(e),a=r?{isBusiness:r.isBusiness,privacyMode:r.privacyMode}:c;yield o("WAWebHandleBusinessNameChangeLidHelpers").removeVerifiedNameFromTableLidAware(e);var i=o("WAWebContactCollection").ContactCollection.get(e);i!=null&&i.set({isBusiness:!1,verifiedLevel:null,verifiedName:null}),o("WAWebBackendApi").frontendFireAndForget("generateAndUpdatePrivacySystemMessages",{wid:e,previousState:a,currentState:c})}),m.apply(this,arguments)}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.type!=="remove_hash")throw r("err")("Invalid notification type");var t=yield o("WAWebApiContact").getContactRecordByHash(e.hash);if(t==null)return!1;var n=o("WAWebWidFactory").createUserWidOrThrow(t.id);return yield d(n,e.stanzaId,e.ts),!0}),_.apply(this,arguments)}function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.type!=="remove_jid")throw r("err")("Invalid notification type");yield d(e.jid,e.stanzaId,e.ts)}),g.apply(this,arguments)}l.removeBusinessPropsFromContact=e,l.removeVerifiedName=u,l.handleBusinessRemoval=d,l.handleBusinessRemovalNotificationHash=p,l.handleBusinessRemovalNotificationContact=f}),98); __d("WAWebHistorySyncDynamicThrottlingManager",["WAWebDynamicThrottlingManager"],(function(t,n,r,o,a,i,l){var e=new(o("WAWebDynamicThrottlingManager")).DynamicThrottlingManager({targetTimeMs:150,maxDelayTimeMs:3e3,minBatchSize:1,maxBatchSize:500,defaultBatchSize:50});l.historySyncDynamicThrottlingManager=e}),98); __d("WAWebHistorySyncWorkerCompatibleNotificationUtils",["WALogger","WAWebBackendApi","WAWebChatConstants","WAWebProtobufsHistorySync.pb","WAWebSchemaChat","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t,n){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r){r===void 0&&(r=!1);var a=c(n),i={id:t,endOfHistoryTransferType:a};o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync] update chat "," end of history transfer type to ",""])),t.toLogString(),a),r&&(i.t=0),yield o("WAWebSchemaChat").getChatTable().merge(t.toString(),{endOfHistoryTransferType:a}),yield o("WAWebBackendApi").frontendSendAndReceive("chatCollectionAdd",{things:[i],options:{merge:!0,add:!1}})}),u.apply(this,arguments)}function c(e){return e===o("WAWebProtobufsHistorySync.pb").Conversation$EndOfHistoryTransferType.COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY?o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY:e===o("WAWebProtobufsHistorySync.pb").Conversation$EndOfHistoryTransferType.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY?o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY:e===o("WAWebProtobufsHistorySync.pb").Conversation$EndOfHistoryTransferType.COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY?o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY:e===o("WAWebProtobufsHistorySync.pb").Conversation$EndOfHistoryTransferType.COMPLETE_ON_DEMAND_SYNC_WITH_MORE_MSG_ON_PRIMARY_BUT_NO_ACCESS?o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.COMPLETE_ON_DEMAND_SYNC_WITH_MORE_MSG_ON_PRIMARY_BUT_NO_ACCESS:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}l.updateEndOfHistorySync=s}),98); __d("WAWebMmsClientErrors",["WAWebHttpErrors"],(function(t,n,r,o,a,i,l){var e,s=(function(e){function t(t,n){var r;return r=e.call(this,404,t)||this,r.name="MediaNotFoundError",r}return babelHelpers.inheritsLoose(t,e),t})((e=o("WAWebHttpErrors")).HttpStatusCodeError),u=(function(e){function t(t,n){var r;return r=e.call(this,413,t)||this,r.name="MediaTooLargeError",r}return babelHelpers.inheritsLoose(t,e),t})(e.HttpStatusCodeError),c=(function(e){function t(t,n){var r;return r=e.call(this,415,t)||this,r.name="MediaInvalidError",r}return babelHelpers.inheritsLoose(t,e),t})(e.HttpStatusCodeError),d=(function(e){function t(t,n){var r;return r=e.call(this,401,t)||this,r.name="MMSUnauthorizedError",r}return babelHelpers.inheritsLoose(t,e),t})(e.HttpStatusCodeError),m=(function(e){function t(t,n){var r;return r=e.call(this,403,t)||this,r.name="MMSForbiddenError",r}return babelHelpers.inheritsLoose(t,e),t})(e.HttpStatusCodeError),p=(function(e){function t(t,n){var r;return r=e.call(this,507,t)||this,r.name="MMSThrottleError",r}return babelHelpers.inheritsLoose(t,e),t})(e.HttpStatusCodeError);l.MediaNotFoundError=s,l.MediaTooLargeError=u,l.MediaInvalidError=c,l.MMSUnauthorizedError=d,l.MMSForbiddenError=m,l.MMSThrottleError=p}),98); __d("WAWebMmsClientIsErrorRetryable",["WAWebHttpErrors","WAWebMediaHostsErrors","WAWebMmsClientErrors"],(function(t,n,r,o,a,i,l){function e(e){return e===408?!0:e===507?!1:e>=500}function s(e){return e instanceof o("WAWebMmsClientErrors").MMSThrottleError?!1:e instanceof o("WAWebMediaHostsErrors").NoMediaHostsError||e instanceof o("WAWebHttpErrors").HttpNetworkError||e instanceof o("WAWebMmsClientErrors").MMSUnauthorizedError||e instanceof o("WAWebHttpErrors").HttpStatusCodeError&&e.status>=500}l.isRetriableStatusCode=e,l.isErrorRetryable=s}),98); __d("WAWebMmsClientMmsBackoffOptions",[],(function(t,n,r,o,a,i){var e={minTimeout:1e3,retries:3},l=e;i.default=l}),66); __d("WAWebMmsClientFormatHashUrl",["WABase64UrlSafe","WANullthrows","WAWebMmsMediaTypes","WAWebPonyfillsUrlSearchParams"],(function(t,n,r,o,a,i,l){var e,s,u=(e={audio:"/mms/audio",document:"/mms/document",gif:"/mms/gif",image:"/mms/image",ppic:"/pps/photo",product:"/mms/image",ptt:"/mms/ptt",sticker:"/mms/sticker","thumbnail-document":"/mms/thumbnail-document","thumbnail-link":"/mms/thumbnail-link",video:"/mms/video","md-app-state":"/mms/md-app-state","md-msg-hist":"/mms/md-msg-hist","product-catalog-image":"/product/image","biz-cover-photo":"/pps/biz-cover-photo","thumbnail-image":"/mms/thumbnail-image","thumbnail-video":"/mms/thumbnail-video"},e[(s=o("WAWebMmsMediaTypes")).MEDIA_TYPES.NEWSLETTER_AUDIO]="/newsletter/newsletter-audio",e[s.MEDIA_TYPES.NEWSLETTER_IMAGE]="/newsletter/newsletter-image",e[s.MEDIA_TYPES.NEWSLETTER_DOCUMENT]="/newsletter/newsletter-document",e[s.MEDIA_TYPES.NEWSLETTER_IMAGE]="/newsletter/newsletter-image",e[s.MEDIA_TYPES.NEWSLETTER_GIF]="/newsletter/newsletter-gif",e[s.MEDIA_TYPES.NEWSLETTER_PTT]="/newsletter/newsletter-ptt",e[s.MEDIA_TYPES.NEWSLETTER_PTV]="/newsletter/newsletter-ptv",e[s.MEDIA_TYPES.NEWSLETTER_STICKER]="/newsletter/newsletter-sticker",e[s.MEDIA_TYPES.NEWSLETTER_STICKER_PACK]="/newsletter/newsletter-sticker-pack",e[s.MEDIA_TYPES.NEWSLETTER_THUMBNAIL_LINK]="/newsletter/newsletter-thumbnail-link",e[s.MEDIA_TYPES.NEWSLETTER_VIDEO]="/newsletter/newsletter-video",e[s.MEDIA_TYPES.NATIVE_AD_IMAGE]="/mms/ads-image",e[s.MEDIA_TYPES.NATIVE_AD_VIDEO]="/mms/ads-video",e[s.MEDIA_TYPES.STICKER_PACK]="/mms/sticker-pack",e[s.MEDIA_TYPES.THUMBNAIL_STICKER_PACK]="/mms/thumbnail-sticker-pack",e[s.MEDIA_TYPES.MUSIC_ARTWORK]="/mms/music-artwork",e[s.MEDIA_TYPES.NEWSLETTER_MUSIC_ARTWORK]="/mms/newsletter-music-artwork",e[s.MEDIA_TYPES.GROUP_HISTORY]="/mms/group-history",e[s.MEDIA_TYPES.WAFFLE_VIDEO]="/mms/waffle-video",e[s.MEDIA_TYPES.WAFFLE_IMAGE]="/mms/waffle-image",e);function c(e){var t=e.encFilehash,n=e.hostname,a=e.query,i=e.type,l=r("WANullthrows")(u[i]),s=new URL("https://"+n+l+"/"+o("WABase64UrlSafe").urlSafeBase64(t)),c={};a&&Object.keys(a).forEach(function(e){a[e]!=null&&(c[e]=a[e])});var d=new(r("WAWebPonyfillsUrlSearchParams"))(c).toString();return d&&(d="?"+d),"https://"+s.host+s.pathname+d}l.default=c}),98); __d("WAWebMmsClientFormatUploadUrl",["WABase64UrlSafe","WAWebABProps","WAWebMmsClientFormatHashUrl"],(function(t,n,r,o,a,i,l){function e(e){var t,n,a=e.auth,i=e.byteRange,l=e.encFilehash,s=e.hostname,u=e.mediaId,c=e.query,d=e.token,m=e.type,p=c==null?void 0:c.final_hash;return r("WAWebMmsClientFormatHashUrl")({encFilehash:l,hostname:s,type:m,query:{auth:a,token:o("WABase64UrlSafe").urlSafeBase64(d),resume:c==null||(t=c.resume)==null?void 0:t.toString(10),stream:c==null||(n=c.stream)==null?void 0:n.toString(10),final_hash:p!=null?o("WABase64UrlSafe").urlSafeBase64(p):void 0,bytestart:i==null?void 0:i.start.toString(10),byteend:i==null?void 0:i.end.toString(10),media_id:u.toString(10),server_thumb_gen:(c==null?void 0:c.server_thumb_gen)!=null?"1":void 0,server_transcode:m==="newsletter-video"&&o("WAWebABProps").getABPropConfigValue("web_channel_video_server_transcode_upload")?"1":void 0}})}l.default=e}),98); __d("WAWebMmsClientMmsLogError",["WAAbortError","WALogger","WAWebMmsClientErrors"],(function(t,n,r,o,a,i,l){var e,s,u;function c(t,n,r,a){a===void 0&&(a=!0),n instanceof o("WAWebMmsClientErrors").MediaNotFoundError&&a?o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["",": expected error"])),t):typeof n=="object"&&(n==null?void 0:n.name)===o("WAAbortError").ABORT_ERROR?o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["",": canceled"])),t):o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["",": ",""])),t,n)}l.mmsLogError=c}),98); __d("WAWebMmsClientMmsGetUploadProgress",["WALogger","WAWebHttpErrors","WAWebHttpExtendedFetch","WAWebMmsClientErrors","WAWebMmsClientFormatUploadUrl","WAWebMmsClientMmsLogError","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.auth,a=t.encFilehash,i=t.generateThumbnailOnServer,l=t.hostname,u=t.mediaId,c=t.onProgress,d=t.signal,m=t.token,p=t.type,_=r("WAWebMmsClientFormatUploadUrl")({auth:n,encFilehash:a,hostname:l,query:{resume:1,server_thumb_gen:i===!0?1:void 0},type:p,mediaId:u,token:m}),f={encFilehash:a,type:p,url:_};o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["mmsGetUploadProgress: start"])));try{var g=yield o("WAWebHttpExtendedFetch").extendedFetch(_,{method:"post",signal:d,onProgress:c});if(!g.ok)e:throw g.status===401?new(o("WAWebMmsClientErrors")).MMSUnauthorizedError("mmsGetUploadProgress",{url:_}):g.status===404?new(o("WAWebMmsClientErrors")).MediaNotFoundError("mmsGetUploadProgress",{url:_}):new(o("WAWebHttpErrors")).HttpStatusCodeError(g.status,"mmsGetUploadProgress",{url:_});var h=yield g.json();if(!h.resume)throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsGetUploadProgress: missing resume",{url:_});return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["mmsGetUploadProgress: success"]))),{directPath:h.direct_path,resume:h.resume,url:h.url,handle:h.handle}}catch(e){throw o("WAWebMmsClientMmsLogError").mmsLogError("mmsUpload",e,f),e}}),c.apply(this,arguments)}l.default=u}),98); __d("WAWebMmsClientMmsCheckIfUploadExists",["WALogger","WAWebHttpErrors","WAWebMmsClientErrors","WAWebMmsClientMmsGetUploadProgress","WAWebMmsClientMmsLogError","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c="complete";function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n={encFilehash:t.encFilehash,type:t.type};o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["mmsCheckIfUploadExists: start"])));try{var a=yield r("WAWebMmsClientMmsGetUploadProgress")(t),i=a.directPath,l=a.handle,d=a.resume,m=a.url;if(d===c){if(i==null||i==="")throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsCheckIfUploadExists: missing directPath");if(m==null||m==="")throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsCheckIfUploadExists: missing url");return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["mmsCheckIfUploadExists: success"]))),{directPath:i,url:m,handle:l,complete:!0}}var p=parseInt(d,10);if(p===0)throw new(o("WAWebMmsClientErrors")).MediaNotFoundError("mmsCheckIfUploadExists");if(Number.isNaN(p))throw o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["mmsCheckIfUploadExists: resume is NaN, resume=",""])),p).sendLogs("upload-offset-is-NaN"),new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsCheckIfUploadExists: invalid resume");return{complete:!1,resume:p}}catch(e){throw o("WAWebMmsClientMmsLogError").mmsLogError("mmsCheckIfUploadExists",e,n),e}}),m.apply(this,arguments)}l.default=d}),98); __d("WAWebMmsClientMmsDeleteMdHistorySyncBlob",["WABase64","WABase64UrlSafe","WAWebHttpErrors","WAWebMmsClientFormatHashUrl","WAWebMmsMediaTypes","WAWebPonyfillsFetch","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.auth,n=e.companionUserSecret,a=e.directPath,i=e.encFilehash,l=e.encHandle,s=e.hostname,u=a.split("?")[0],c=new TextEncoder().encode(u),d=o("WABase64").encodeB64UrlSafe(c),m=o("WAWebMmsMediaTypes").MEDIA_TYPES.HISTORY_SYNC,p=r("WAWebMmsClientFormatHashUrl")({encFilehash:i,hostname:s,type:m,query:{token:o("WABase64UrlSafe").urlSafeBase64(i),d_md:d,auth:t,e_handle:l}}),_={};l!=null&&n!=null&&(_.Companion_User_Secret=n);var f=yield r("WAWebPonyfillsFetch")(p,{method:"DELETE",headers:_});if(!f.ok)throw new(o("WAWebHttpErrors")).HttpStatusCodeError(f.status,"MMS Delete error")}),s.apply(this,arguments)}l.default=e}),98); __d("WAWebMmsCdnUrlValidationUtils",["WATimeUtils"],(function(t,n,r,o,a,i,l){var e={OE:"oe"};function s(t){var n=t instanceof URL?t.searchParams:new URL(t).searchParams,r=n.get(e.OE),a=r==null?void 0:o("WATimeUtils").convertHexToDate(r);return{expirationDate:a}}l.parseCdnUrlParams=s}),98); __d("WAWebMmsClientFormatDownloadUrl",["WABase64UrlSafe","WALogger","WAWebABProps","WAWebMmsClientFormatHashUrl","WAWebPonyfillsUrlSearchParams","WAWebSharedConstants","err","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e,s;function u(t){var n,a=t.byteRange,i=t.directPath,l=t.downloadBucket,s=t.encFilehash,u=t.hostname,d=t.mode,m=t.type;if(!r("isStringNullOrEmpty")(i)){var p;return c({encFilehash:s,hostname:u,directPath:i,query:(p={mode:d,bytestart:a==null?void 0:a.start.toString(),byteend:a==null?void 0:a.end.toString()},p[o("WAWebSharedConstants").MMS_URL_MEDIA_TYPE_SEARCH_PARAM]=m,p[o("WAWebSharedConstants").IS_MMS_URL_SEARCH_PARAM]="",p),downloadBucket:l,type:m})}if(o("WAWebABProps").getABPropConfigValue("web_deprecate_mms4_hash_based_download"))throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[mms] missing direct path, media type: ",""])),m).sendLogs("media-fault: missing direct path"),r("err")("No direct path is available for download, abort");return r("WAWebMmsClientFormatHashUrl")({hostname:u,type:m,encFilehash:s,query:(n={mode:d},n[o("WAWebSharedConstants").IS_MMS_URL_SEARCH_PARAM]="",n)})}function c(e){var t=e.directPath,n=e.downloadBucket,a=e.encFilehash,i=e.hostname,l=e.query,u=e.type,c=new URL(t,"https://"+i);if(c.hostname!==i)throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["url.hostname: ",", hostname: ",", directPath: ",""])),c.hostname,i,t).sendLogs("malicious directPath"),r("err")("malicious directPath");var d=c.searchParams||new(r("WAWebPonyfillsUrlSearchParams"))(c.search);d.set("hash",o("WABase64UrlSafe").urlSafeBase64(a)),n!=null&&d.set("_nc_cat",n.toString());var m=o("WAWebABProps").getABPropConfigValue("low_cache_hit_rate_media_types");if(m!=null){var p=m.split(",");p.includes(u)&&d.set("_nc_map","whatsapp-nofna")}return Object.keys(l).forEach(function(e){var t=l[e];t!=null&&d.set(e,t)}),"https://"+c.host+c.pathname+"?"+d.toString()}l.default=u}),98); __d("WAWebMmsClientMmsDownload",["WALogger","WAMediaCalculateFilehash","WATimeUtils","WAWebHttpErrors","WAWebHttpExtendedFetch","WAWebMiscErrors","WAWebMmsCdnUrlValidationUtils","WAWebMmsClientErrors","WAWebMmsClientFormatDownloadUrl","WAWebMmsClientMmsLogError","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.ciphertextValidator,r=t.debug,a=t.debugString,i=t.onData,l=t.onHeadersReceived,c=t.onProgress,d=t.signal,m=t.url;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["mmsDownload: [","] start"])),a);try{var p=yield o("WAWebHttpExtendedFetch").extendedFetch(m,{signal:d,onProgress:c,onData:i,onHeadersReceived:l});yield h({response:p,functionName:"mmsDownload",url:m});var _=yield p.arrayBuffer();if(n&&!(yield n(_)))throw o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["download hash mismatch error. downloaded size: ",""])),_.byteLength),new(o("WAWebHttpErrors")).MmsDownloadFilehashMismatchError({url:m});return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["mmsDownload: [","] success"])),a),_}catch(e){throw o("WAWebMmsClientMmsLogError").mmsLogError("mmsDownload",e,r),e instanceof TypeError?new(o("WAWebHttpErrors")).HttpNetworkError(e.message):e}}),d.apply(this,arguments)}function m(e){var t=e.byteRange,a=e.debugString,i=e.directPath,l=e.downloadBucket,s=e.encFilehash,u=e.hostname,d=e.mode,m=e.onData,p=e.onHeadersReceived,_=e.onProgress,f=e.signal,g=e.staticUrl,h=e.type,y=g||r("WAWebMmsClientFormatDownloadUrl")({directPath:i,encFilehash:s,hostname:u,type:h,mode:d,byteRange:t,downloadBucket:l}),C=t?null:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return(yield o("WAMediaCalculateFilehash").calculateFilehash(e))===s});return function(t){return e.apply(this,arguments)}})();return c({url:y,signal:f,onHeadersReceived:p,onProgress:_,onData:m,ciphertextValidator:C,debugString:a,debug:{encFilehash:s,type:h,url:y}})}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.directPath,n=e.encFilehash,r=e.hostname,o=e.signal,a=e.type;yield C({directPath:t,encFilehash:n,hostname:r,type:a,signal:o,functionName:"mmsCheckExistence"})}),_.apply(this,arguments)}function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.directPath,n=e.encFilehash,r=e.hostname,a=e.signal,i=e.type,l=yield C({directPath:t,encFilehash:n,hostname:r,type:i,signal:a,functionName:"mmsGetEncryptedMediaSize"}),s=l.headers.get("content-length");if(!s)throw new(o("WAWebMiscErrors")).UnableToGetContentLengthError;return parseInt(s,10)}),g.apply(this,arguments)}function h(e){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.functionName,n=e.response,r=e.url;if(!n.ok)e:{if(n.status===401)throw new(o("WAWebMmsClientErrors")).MMSUnauthorizedError(t,{url:r});if(n.status===403){var a=yield n.text();if(a.includes("URL signature expired"))throw new(o("WAWebMmsClientErrors")).MediaNotFoundError(t,{url:r,status:n.status});var i=o("WAWebMmsCdnUrlValidationUtils").parseCdnUrlParams(r),l=i.expirationDate;throw l!=null&&o("WATimeUtils").toDate(o("WATimeUtils").unixTime())>=l?new(o("WAWebMmsClientErrors")).MediaNotFoundError(t,{url:r,status:n.status}):new(o("WAWebMmsClientErrors")).MMSForbiddenError(t,{url:r})}throw n.status===404||n.status===410?new(o("WAWebMmsClientErrors")).MediaNotFoundError(t,{url:r,status:n.status}):n.status===507?new(o("WAWebMmsClientErrors")).MMSThrottleError(t,{url:r}):new(o("WAWebHttpErrors")).HttpStatusCodeError(n.status,t,{url:r})}}),y.apply(this,arguments)}function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.directPath,n=e.encFilehash,a=e.functionName,i=e.hostname,l=e.signal,s=e.type,u=r("WAWebMmsClientFormatDownloadUrl")({directPath:t,encFilehash:n,hostname:i,type:s,mode:"auto"}),c=yield o("WAWebHttpExtendedFetch").extendedFetch(u,{method:"HEAD",signal:l});return yield h({response:c,functionName:a,url:u}),c}),b.apply(this,arguments)}l.mms4Download=m,l.mmsCheckExistence=p,l.mmsGetEncryptedMediaSize=f,l.validateMmsResponse=h}),98); __d("WAWebMmsClientMmsUpload",["WALogger","WAWebHttpErrors","WAWebHttpExtendedFetch","WAWebMmsClientErrors","WAWebMmsClientFormatUploadUrl","WAWebMmsClientMmsLogError","WAWebMmsMediaTypes","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e){var t,n;if(e.direct_path==null||e.direct_path==="")throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUpload: missing direct_path");if(e.url==null||e.url==="")throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUpload: missing url");return{directPath:e.direct_path,url:e.url,handle:e.handle,thumbnailDirectPath:(t=e.thumbnail_info)==null?void 0:t.thumbnail_direct_path,thumbnailSha256:(n=e.thumbnail_info)==null?void 0:n.thumbnail_sha256,metadataUrl:e.metadata_url}}function c(e){if(e.ts==null)throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUpload: missing ts (timestamp)");if(e.meta_hmac==null)throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUpload: missing meta_hmac");if(e.fbid==null)throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUpload: missing fbid");return{directPath:"",url:"",ts:e.ts,metaHmac:e.meta_hmac,fbid:e.fbid}}function d(e){if(e.direct_path==null||e.direct_path==="")throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUpload: missing direct_path");if(e.url==null||e.url==="")throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUpload: missing url");if(e.fbid==null)throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUpload: missing fbid");return{directPath:e.direct_path,url:e.url,fbid:e.fbid}}function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.auth,a=t.byteRange,i=t.ciphertextHmac,l=t.encFilehash,m=t.generateThumbnailOnServer,p=t.hostname,_=t.mediaId,f=t.onProgress,g=t.signal,h=t.type,y=r("WAWebMmsClientFormatUploadUrl")({auth:n,encFilehash:l,hostname:p,type:h,byteRange:a,mediaId:_,token:t.token,query:{server_thumb_gen:m===!0?1:void 0}}),C={encFilehash:l,type:h,url:y};o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["mmsUpload: start"])));try{var b=h===o("WAWebMmsMediaTypes").MEDIA_TYPES.NATIVE_AD_IMAGE||h===o("WAWebMmsMediaTypes").MEDIA_TYPES.NATIVE_AD_VIDEO?d:h===o("WAWebMmsMediaTypes").MEDIA_TYPES.BIZ_COVER_PHOTO?c:u,v=yield o("WAWebHttpExtendedFetch").extendedFetch(y,{method:"post",body:i,signal:g,onProgress:f}).then(function(e){if(!e.ok)switch(e.status){case 401:throw new(o("WAWebMmsClientErrors")).MMSUnauthorizedError("mmsUpload",{url:y});case 413:throw new(o("WAWebMmsClientErrors")).MediaTooLargeError("mmsUpload",{url:y});case 415:throw new(o("WAWebMmsClientErrors")).MediaInvalidError("mmsUpload: hash mismatch",{url:y});case 507:throw new(o("WAWebMmsClientErrors")).MMSThrottleError("mmsUpload",{url:y});default:throw new(o("WAWebHttpErrors")).HttpStatusCodeError(e.status,"mmsUpload",{url:y})}return e.json()}).then(b);return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["mmsUpload: success"]))),v}catch(e){throw o("WAWebMmsClientMmsLogError").mmsLogError("mmsUpload",e,C,!1),e}}),p.apply(this,arguments)}l.default=m}),98); __d("WAWebMediaHostsMaybeSwitchHost",[],(function(t,n,r,o,a,i){var e=52428800;function l(e,t,n){return e.equals(t)&&n!=null&&t!=null&&!t.equals(n)}function s(t,n,r,o){var a=n.fallbackHost,i=n.selectedHost,s=r.fallbackHost,u=r.selectedHost;return oo("WAWebMediaHostsMaybeSwitchHost").THRESHOLD}function c(e,t){return e===o("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT&&(t!=null?t:0)>o("WAWebMediaHostsMaybeSwitchHost").THRESHOLD}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=t.connectionBlock;return yield o("WAPromiseDelays").delayMs(s,t.signal),r("WARetryPromise")(function(r){var i=r.retry;return new(e||(e=n("Promise")))(function(e){return t.getMediaHosts().then(function(n){var r=n.fallbackHost,l=n.selectedHost,u={selectedHost:l,fallbackHost:r},c=t.getRemainingBytes();if(c==null)return i(s);var d=o("WAWebMediaHostsMaybeSwitchHost").maybeSwitchHost(t.getHost(),a,u,c),m=d.changed,p=d.host;return a=u,m?e(p):i(s)})})},t.signal)}),m.apply(this,arguments)}l.SERVER_POLLING_INTERVAL=s,l.shouldPollUploadHosts=u,l.shouldPollDownloadHosts=c,l.pollMediaHosts=d}),98); __d("WAWebMmsClientSelectHost",[],(function(t,n,r,o,a,i){var e=4;function l(t){var n=t.attemptCount,r=t.fallbackHost,o=t.lastFetchMadeProgress,a=t.lastHostUsed,i=t.selectedHost;return o&&a?a:n<=1?i:n===e-1&&r?r:a!=null&&a.equals(i)&&i.fallback!=null?i.fallback:r!=null?r:i}i.default=l}),66); __d("WAWebMmsClientMmsUploadStream",["WALogger","WAWebHttpErrors","WAWebHttpExtendedFetch","WAWebMmsClientErrors","WAWebMmsClientFormatUploadUrl","WAWebMmsClientMmsLogError","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t,n){e:throw e===401?new(o("WAWebMmsClientErrors")).MMSUnauthorizedError(t,{url:n}):e===413?new(o("WAWebMmsClientErrors")).MediaTooLargeError(t,{url:n}):e===415?new(o("WAWebMmsClientErrors")).MediaInvalidError(t+": hash mismatch",{url:n}):e===507?new(o("WAWebMmsClientErrors")).MMSThrottleError("mmsUploadStreamFinalize",{url:n}):new(o("WAWebHttpErrors")).HttpStatusCodeError(e,t,{url:n})}function c(e){var t=e.auth,n=e.byteEnd,a=e.byteStart,i=e.chunk,l=e.encFilehash,s=e.generateThumbnailOnServer,c=e.hostname,d=e.mediaId,m=e.onProgress,p=e.signal,_=e.token,f=e.type,g=r("WAWebMmsClientFormatUploadUrl")({auth:t,encFilehash:l,type:f,hostname:c,query:{stream:1,server_thumb_gen:s===!0?1:void 0},byteRange:{start:a,end:n},mediaId:d,token:_});return o("WAWebHttpExtendedFetch").extendedFetch(g,{method:"post",body:i,signal:p,onProgress:m}).then(function(e){e.ok||u(e.status,"mmsUploadStream",g)})}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.auth,a=t.encFilehash,i=t.finalHash,l=t.generateThumbnailOnServer,c=t.hostname,d=t.mediaId,m=t.signal,p=t.type,_=r("WAWebMmsClientFormatUploadUrl")({auth:n,encFilehash:a,type:p,hostname:c,query:{stream:1,final_hash:i,server_thumb_gen:l===!0?1:void 0},mediaId:d,token:a}),f={encFilehash:a,type:p,url:_};o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["mmsUploadStreamFinalize: start"])));try{var g=yield o("WAWebHttpExtendedFetch").extendedFetch(_,{method:"post",signal:m}).then(function(e){return e.ok||u(e.status,"mmsUploadStreamFinalize",_),e.json()}).then(function(e){if(e.direct_path==null||e.direct_path==="")throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUploadStreamFinalize: missing direct_path");if(e.url==null||e.url==="")throw new(o("WAWebHttpErrors")).HttpInvalidResponseError("mmsUploadStreamFinalize: missing url");return{directPath:e.direct_path,url:e.url,handle:e.handle}});return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["mmsUploadStreamFinalize: success"]))),g}catch(e){throw o("WAWebMmsClientMmsLogError").mmsLogError("mmsUpload",e,f,!1),e}}),m.apply(this,arguments)}l.mmsUploadStream=c,l.mmsUploadStreamFinalize=d}),98); __d("WAWebWamEnumOverallLastUploadRetryPhaseType",[],(function(t,n,r,o,a,i){var e=Object.freeze({RESUME_CHECK:1,UPLOAD:2,FINALIZE:3});i.OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE=e}),66); __d("WAWebMmsClientUploadStreamer",["Promise","WAExponentialBackoff","WALogger","WARaceSignal","WARetryPromise","WAWebHttpErrors","WAWebMediaHosts","WAWebMediaHostsRouteSelection","WAWebMmsClientIsErrorRetryable","WAWebMmsClientMmsBackoffOptions","WAWebMmsClientMmsUploadStream","WAWebMmsClientPollMediaHosts","WAWebMmsClientSelectHost","WAWebMmsMediaTypes","WAWebNetworkStatus","WAWebWamEnumOverallLastUploadRetryPhaseType","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e=["auth"],s,u,c,d;function m(e,t){var n=g(t);return t===o("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT&&n>0&&e>n}var p=(function(){function t(e){var t,r;this.$2=Date.now(),this.$3=0,this.$4=0,this.$9=(d||(d=n("Promise"))).resolve(),this.$6=e.encFilehash,this.$5=e.type,this.$7=e.signal,this.$3=(t=e.byteOffset)!=null?t:0,this.$1=e.encFilehash.slice(0,10),this.$11=e.token,this.$12=(r=e.generateThumbnailOnServer)!=null?r:!1,this.$13=e.onUploadHostFound,this.$14=e.onUploadAttemptSuccess,this.$15=e.onUploadAttemptError,this.$16=e.onProgress,this.$17=e.onFinalize,this.$18=e.onStreamUploadStart,this.$10=e.mediaId}var a=t.prototype;return a.uploadCompleteFile=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n,a=e.ciphertextHmac,i=new Uint8Array(a);this.$8=i.byteLength;var l=g(this.$5),u=l===0?i.byteLength:l;(t=this.$18)==null||t.call(this),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["uploadStreamer: [","] start upload"])),this.$1),yield r("WAWebNetworkStatus").waitIfOffline();for(var c=Math.ceil((i.byteLength-this.$3)/u),d=0;d=500?!1:_(e,t)}function g(e){return e===o("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT?50*1024*1024:0}l.shouldUseStreamingUpload=m,l.UploadStreamer=p}),98); __d("WAWebMmsOperationsConst",[],(function(t,n,r,o,a,i){var e={DOWNLOAD:"DOWNLOAD",UPLOAD:"UPLOAD"},l=e;i.default=l}),66); __d("WAWebMmsClient",["Promise","WAExponentialBackoff","WALogger","WANullthrows","WARaceSignal","WARetryPromise","WAWebMediaHosts","WAWebMmsClientIsErrorRetryable","WAWebMmsClientMmsBackoffOptions","WAWebMmsClientMmsCheckIfUploadExists","WAWebMmsClientMmsDeleteMdHistorySyncBlob","WAWebMmsClientMmsDownload","WAWebMmsClientMmsLogError","WAWebMmsClientMmsUpload","WAWebMmsClientPollMediaHosts","WAWebMmsClientSelectHost","WAWebMmsClientUploadStreamer","WAWebMmsMediaTypes","WAWebMmsOperationsConst","WAWebNetworkStatus","WAWebWamEnumOverallLastUploadRetryPhaseType","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e=["ciphertextHmac"],s,u,c,d,m,p,_,f,g,h,y,C,b,v,S;function R(e){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.encFilehash,a=e.generateThumbnailOnServer,i=e.mediaId,l=e.signal,s=e.type,u=!1,c={encFilehash:e.encFilehash,type:e.type};o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.checkIfUploadExists: start"])));try{var d=null,f=yield o("WAExponentialBackoff").exponentialBackoff(babelHelpers.extends({},r("WAWebMmsClientMmsBackoffOptions"),{signal:l}),(function(){var c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n,c){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.checkIfUploadExists: attempt #",""])),c+1),yield r("WAWebNetworkStatus").waitIfOffline();try{var m=yield o("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:r("WAWebMmsOperationsConst").UPLOAD,encFilehash:t,type:s,signal:l}),_=m.auth,f=m.fallbackHost,g=m.selectedHost,h=r("WAWebMmsClientSelectHost")({selectedHost:g,fallbackHost:f,lastHostUsed:d,attemptCount:c,lastFetchMadeProgress:u});return d=h,yield r("WAWebMmsClientMmsCheckIfUploadExists")({auth:_,encFilehash:t,hostname:h.hostname,type:s,signal:l,onProgress:function(){u=!0},mediaId:i,token:e.token,generateThumbnailOnServer:a})}catch(e){var y=r("getErrorSafe")(e);if(o("WAWebMmsClientIsErrorRetryable").isErrorRetryable(y))return n(y);throw y}});return function(e,t){return c.apply(this,arguments)}})());return o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.checkIfUploadExists: success"]))),f}catch(e){var g=r("getErrorSafe")(e);throw o("WAWebMmsClientMmsLogError").mmsLogError("mmsClient.checkIfUploadExists",g,c),g}}),L.apply(this,arguments)}function E(e){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.encFilehash,a=t.onUploadAttemptSuccess,i=t.type,l={encFilehash:n,type:i};o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.upload: start"])));try{if(o("WAWebMmsClientUploadStreamer").shouldUseStreamingUpload(t.ciphertextHmac.byteLength,t.type)){var s=t.ciphertextHmac,u=babelHelpers.objectWithoutPropertiesLoose(t,e),c=new(o("WAWebMmsClientUploadStreamer")).UploadStreamer(u);return yield c.uploadCompleteFile({ciphertextHmac:s})}var d=yield O(t),m=d.response,p=d.retryStartTime;return a(Date.now()-p),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.upload: success"]))),r("WANullthrows")(m)}catch(e){var _=r("getErrorSafe")(e);throw o("WAWebMmsClientMmsLogError").mmsLogError("mmsClient.upload",_,l,!1),_}}),k.apply(this,arguments)}function I(e){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.debugString,n=e.directPath,a=e.filehash,i=e.onDownloadAttemptSuccess,l=e.staticUrl,s=e.type,u={directPath:n,filehash:a,type:s,staticUrl:l};o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.download: [","] start"])),t);try{var c=yield M(e),d=c.response,m=c.retryStartTime;return i(Date.now()-m),o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.download: [","] success"])),t),d}catch(e){var p=r("getErrorSafe")(e);throw o("WAWebMmsClientMmsLogError").mmsLogError("mmsClient.download",p,u),p}}),T.apply(this,arguments)}function D(e){return $(function(t){return o("WAWebMmsClientMmsDownload").mmsCheckExistence(babelHelpers.extends({},e,{hostname:t}))},e)}function x(e){return $(function(t){return o("WAWebMmsClientMmsDownload").mmsGetEncryptedMediaSize(babelHelpers.extends({},e,{hostname:t}))},e)}function $(e,t){var a=t.directPath,i=t.encFilehash,l=t.signal,c=t.type,d={directPath:a,type:c};return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["runTaskWithBackoff: start"]))),o("WAExponentialBackoff").exponentialBackoff(babelHelpers.extends({},r("WAWebMmsClientMmsBackoffOptions"),{signal:l}),(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["runMmsTaskWithBackoff: attempt #",""])),n+1);try{var s=yield P({operation:r("WAWebMmsOperationsConst").DOWNLOAD,directPath:a,encFilehash:i,type:c,signal:l,failCount:n}),d=yield e(s);return d}catch(e){var m=r("getErrorSafe")(e);if(o("WAWebMmsClientIsErrorRetryable").isErrorRetryable(m))return t(m);throw m}});return function(e,n){return t.apply(this,arguments)}})())}function P(e){return N.apply(this,arguments)}function N(){return N=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.directPath,n=e.encFilehash,r=e.failCount,a=e.operation,i=e.signal,l=e.type,s=yield o("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:a,directPath:t,encFilehash:n,type:l,signal:i}),u=s.fallbackHost,c=s.selectedHost,d=r>=2&&u?u:c;return d.hostname}),N.apply(this,arguments)}function M(e){return w.apply(this,arguments)}function w(){return w=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.byteRange,a=e.debugString,i=e.directPath,l=e.filehash,s=e.mode,u=e.onData,c=e.onDownloadAttemptError,d=e.onDownloadHostFound,m=e.onProgress,p=e.signal,_=e.staticUrl,f=e.type,g=Date.now(),h=!1,y={directPath:i,filehash:l,type:f,staticUrl:_},b=null,v=yield o("WAExponentialBackoff").exponentialBackoff(babelHelpers.extends({},r("WAWebMmsClientMmsBackoffOptions"),{signal:p}),(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,y){g=Date.now(),o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.download: [","] attempt #",""])),a,y+1);var v=function(t){return o("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:r("WAWebMmsOperationsConst").DOWNLOAD,directPath:i,encFilehash:l,type:f,signal:p,forceRefresh:t})};try{var R=yield v(),L=R.fallbackHost,E=R.selectedHost,k=r("WAWebMmsClientSelectHost")({selectedHost:E,fallbackHost:L,attemptCount:y,lastHostUsed:b,lastFetchMadeProgress:h});b=k,d({hostName:k.hostname,hostClass:k.class,failCount:y});var I=0,T=null,D={selectedHost:E,fallbackHost:L},x=function(t){if(t!=null&&T==null){var e=t.get("Content-Length"),n=parseInt(e,10);T=Number.isNaN(n)?null:n}};return yield r("WARetryPromise")((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var c=e.failCount,d=e.retry,g=function(t){m==null||m(t),h=!0,t.lengthComputable&&(I=t.loaded)};I=0;var y=new AbortController,C=y.signal,R=yield r("WARaceSignal")([p,C],function(e){var r=o("WAWebMmsClientMmsDownload").mms4Download({directPath:i,encFilehash:l,staticUrl:_,hostname:k.hostname,type:f,signal:e,mode:s,byteRange:t,debugString:a,onHeadersReceived:x,onProgress:g,onData:u,downloadBucket:k.selectedBucket}).then(function(e){return{kind:"download-completed",arrayBuffer:e}}),c=o("WAWebMmsClientPollMediaHosts").shouldPollDownloadHosts(f,T)?o("WAWebMmsClientPollMediaHosts").pollMediaHosts({connectionBlock:D,getHost:function(){return k},getMediaHosts:function(){return v(!0)},getRemainingBytes:function(){return T!=null?T-I:null},signal:e}).then(function(e){return{kind:"host-changed",host:e}}):null;return(S||(S=n("Promise"))).race([r,c].filter(Boolean)).finally(function(){return y.abort()})});return R.kind==="host-changed"?(k=R.host,b=k,d()):R.arrayBuffer});return function(t){return e.apply(this,arguments)}})())}catch(t){var $=r("getErrorSafe")(t);h=!1;var P=o("WAWebMmsClientIsErrorRetryable").isErrorRetryable($),N=!P||y===r("WAWebMmsClientMmsBackoffOptions").retries;if(N||c({error:$,overallT:Date.now()-g,failCount:y}),P)return e($);throw $}});return function(t,n){return e.apply(this,arguments)}})());return{response:r("WANullthrows")(v),retryStartTime:g}}),w.apply(this,arguments)}function A(e){return F.apply(this,arguments)}function F(){return F=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.auth,n=e.byteLength,a=e.byteOffset,i=e.encFilehash,l=e.failCount,s=e.generateThumbnailOnServer,u=e.hostname,c=e.mediaId,d=e.signal,m=e.token,p=e.type;if(a!=null&&l===0)return a;if(!o("WAWebMmsClientPollMediaHosts").shouldPollUploadHosts(p,n))return 0;try{var _=yield r("WAWebMmsClientMmsCheckIfUploadExists")({auth:t,encFilehash:i,hostname:u,type:p,signal:d,mediaId:c,token:m,generateThumbnailOnServer:s});if(_.complete)return 0;var f=_.resume;return f>=n?0:f}catch(e){var g=r("getErrorSafe")(e);return o("WALogger").ERROR(b||(b=babelHelpers.taggedTemplateLiteralLoose(["Failed to compute upload offset"]))).verbose().sendLogs("upload-offset-failed"),0}}),F.apply(this,arguments)}function O(e){return B.apply(this,arguments)}function B(){return B=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.byteOffset,a=e.ciphertextHmac,i=e.encFilehash,l=e.generateThumbnailOnServer,s=e.mediaId,u=e.onProgress,c=e.onUploadAttemptError,d=e.onUploadHostFound,m=e.signal,p=e.type,_=!1,f=Date.now(),g={encFilehash:i,type:p},h=null,y=yield o("WAExponentialBackoff").exponentialBackoff(babelHelpers.extends({},r("WAWebMmsClientMmsBackoffOptions"),{signal:m}),(function(){var g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(g,y){var C=function(t){return o("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:r("WAWebMmsOperationsConst").UPLOAD,encFilehash:i,type:p,signal:m,forceRefresh:t})};f=Date.now(),o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["mmsClient.upload: attempt #",""])),y+1);try{yield r("WAWebNetworkStatus").waitIfOffline();var b=yield C(),R=b.auth,L=b.fallbackHost,E=b.selectedHost,k={selectedHost:E,fallbackHost:L},I=r("WAWebMmsClientSelectHost")({selectedHost:E,fallbackHost:L,attemptCount:y,lastHostUsed:h,lastFetchMadeProgress:_});return h=I,d({hostName:I.hostname,hostClass:I.class,failCount:y}),yield r("WARetryPromise")((function(){var c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(c){var d=c.retry,f=yield A({auth:R,encFilehash:i,byteLength:a.byteLength,hostname:I.hostname,type:p,signal:m,byteOffset:t,failCount:y,mediaId:s,token:e.token,generateThumbnailOnServer:l}),g=new AbortController,b=g.signal,v=yield r("WARaceSignal")([m,b],function(t){var c=o("WAWebMmsClientPollMediaHosts").shouldPollUploadHosts(p,a.byteLength)?o("WAWebMmsClientPollMediaHosts").pollMediaHosts({connectionBlock:k,getHost:function(){return I},getMediaHosts:function(){return C(!0)},getRemainingBytes:function(){return a.byteLength},signal:t}).then(function(e){return{kind:"host-changed",host:e}}):null,d=r("WAWebMmsClientMmsUpload")({auth:R,ciphertextHmac:f>0?new Uint8Array(a).subarray(f):a,hostname:I.hostname,encFilehash:i,type:p,signal:m,onProgress:function(t){_=!0,u(t,f)},byteRange:f>0?{start:f,end:a.byteLength}:void 0,mediaId:s,token:e.token,generateThumbnailOnServer:l}).then(function(e){return{kind:"upload-completed",value:e}});return(S||(S=n("Promise"))).race([d,c].filter(Boolean)).finally(function(){return g.abort()})});return v.kind==="host-changed"?(I=v.host,h=I,d()):v.value});return function(e){return c.apply(this,arguments)}})())}catch(e){var T=r("getErrorSafe")(e);_=!1;var D=o("WAWebMmsClientIsErrorRetryable").isErrorRetryable(T),x=!D||y===r("WAWebMmsClientMmsBackoffOptions").retries;if(x||c(T,Date.now()-f,y,o("WAWebWamEnumOverallLastUploadRetryPhaseType").OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.UPLOAD),D)return g(T);throw T}});return function(e,t){return g.apply(this,arguments)}})());return{response:y,retryStartTime:f}}),B.apply(this,arguments)}function W(e){var t=e.companionUserSecret,n=e.directPath,a=e.encFilehash,i=e.encHandle;return q(function(e,o){return r("WAWebMmsClientMmsDeleteMdHistorySyncBlob")({directPath:n,hostname:e,encFilehash:a,auth:o,encHandle:i,companionUserSecret:t})},babelHelpers.extends({},e,{type:o("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE,operation:r("WAWebMmsOperationsConst").UPLOAD}))}function q(e,t){var a=t.directPath,i=t.encFilehash,l=t.operation,s=t.signal,u=t.type,m={directPath:a,type:u};return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["runTaskWithBackoff: start"]))),o("WAExponentialBackoff").exponentialBackoff(babelHelpers.extends({},r("WAWebMmsClientMmsBackoffOptions"),{signal:s}),(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["runMmsTaskWithBackoff: attempt #",""])),n+1);try{var c=yield U({operation:l,directPath:a,encFilehash:i,type:u,signal:s,failCount:n}),m=c.auth,p=c.hostname,_=yield e(p,m);return _}catch(e){var f=r("getErrorSafe")(e);if(o("WAWebMmsClientIsErrorRetryable").isErrorRetryable(f))return t(f);throw f}});return function(e,n){return t.apply(this,arguments)}})())}function U(e){return V.apply(this,arguments)}function V(){return V=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.directPath,n=e.encFilehash,r=e.failCount,a=e.operation,i=e.signal,l=e.type,s=yield o("WAWebMediaHosts").mediaHosts.getHostsInfo({operation:a,directPath:t,encFilehash:n,type:l,signal:i}),u=s.auth,c=s.fallbackHost,d=s.selectedHost,m=r>=2&&c?c:d;return{hostname:m.hostname,auth:u}}),V.apply(this,arguments)}var H={download:I,upload:E,checkExistence:D,getEncryptedMediaSize:x,checkIfUploadExists:R,deleteMdHistorySyncBlob:W},G=H;l.default=G}),98); __d("WAWebNonMessageDataRequestLoggingUtils",["WALogger","WATimeUtils","WAWebNonMessagePeerDataMediaUploadWamEvent","WAWebNonMessagePeerDataOperationResponseWamEvent","WAWebNonMessagePeerDataRequestWamEvent","WAWebProtobufsE2E.pb","WAWebWamEnumPeerDataRequestType","WAWebWebcLinkPreviewResponseHandleWamEvent","err"],(function(t,n,r,o,a,i,l){var e,s=new Map;function u(t,n,r){var a=void 0,i=o("WATimeUtils").unixTimeMs();if(t!=null){var l=s.get(t);l!=null&&(a=i-l)}o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["link preview: session id: ",", is success: ",", durationMs: ",""])),t,n,a),new(o("WAWebWebcLinkPreviewResponseHandleWamEvent")).WebcLinkPreviewResponseHandleWamEvent({previewSessionId:t,isPreviewSuccess:n,previewDurationMs:a!=null?a:void 0,didRespondHqPreview:r}).commit(),t!=null&&s.delete(t)}function c(e,t){var n=m(e);new(o("WAWebNonMessagePeerDataRequestWamEvent")).NonMessagePeerDataRequestWamEvent({peerDataRequestCount:d(e,t),peerDataRequestType:n,peerDataRequestSessionId:t.id.id}).commit()}function d(e,t){var n,r,a,i,l,s;return e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP||e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.WAFFLE_LINKING_NONCE_FETCH||e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.FULL_HISTORY_SYNC_ON_DEMAND?1:e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER?(n=(r=t.peerDataOperationRequestMessage)==null||(r=r.requestStickerReupload)==null?void 0:r.length)!=null?n:0:e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW?(a=(i=t.peerDataOperationRequestMessage)==null||(i=i.requestStickerReupload)==null?void 0:i.length)!=null?a:0:e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND?1:e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND?(l=(s=t.peerDataOperationRequestMessage)==null||(s=s.placeholderMessageResendRequest)==null?void 0:s.length)!=null?l:0:e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_META_NONCE_FETCH||e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_CANONICAL_USER_NONCE_FETCH||e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY||e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_CHUNK_RETRY||e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GALAXY_FLOW_ACTION?1:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}function m(e){switch(e){case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER:return o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.UPLOAD_STICKER;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP:return o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.SEND_RECENT_STICKER_BOOTSTRAP;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:return o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.GENERAL_LINK_PREVIEW;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND:return o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.HISTORY_SYNC_ON_DEMAND;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND:return o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.PLACEHOLDER_MESSAGE_RESEND;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.WAFFLE_LINKING_NONCE_FETCH:return o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.WAFFLE_LINKING_NONCE_FETCH;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.FULL_HISTORY_SYNC_ON_DEMAND:throw r("err")("full history sync on demand is not supported in web");case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_META_NONCE_FETCH:throw r("err")("companion meta nonce fetch is not supported in web");case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_CANONICAL_USER_NONCE_FETCH:return o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.UPLOAD_STICKER;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY:return o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.SYNCD_SNAPSHOT_RECOVERY;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_CHUNK_RETRY:throw r("err")("history sync chunk retry is not supported in web");case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GALAXY_FLOW_ACTION:return o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.UPLOAD_STICKER}}function p(e,t,n,r,a,i,l){var s=m(e);new(o("WAWebNonMessagePeerDataOperationResponseWamEvent")).NonMessagePeerDataOperationResponseWamEvent({peerDataResponseCount:n,peerDataSuccessResponseCount:r,peerDataSuccessProcessCount:a,peerDataErrorCount:i,peerDataNotFoundCount:l,peerDataRequestType:s,peerDataRequestSessionId:t}).commit()}function _(e,t,n,r,a,i,l){if(e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER){var s=m(e);new(o("WAWebNonMessagePeerDataMediaUploadWamEvent")).NonMessagePeerDataMediaUploadWamEvent({peerDataRequestCount:n,peerDataSuccessUploadCount:r,peerDataExistingDataNoUploadCount:a,peerDataErrorCount:i,peerDataNotFoundCount:l,peerDataRequestType:s,peerDataRequestSessionId:t}).commit()}}function f(e,t){new(o("WAWebNonMessagePeerDataOperationResponseWamEvent")).NonMessagePeerDataOperationResponseWamEvent({peerDataRequestType:o("WAWebWamEnumPeerDataRequestType").PEER_DATA_REQUEST_TYPE.HISTORY_SYNC_ON_DEMAND,peerDataResponseApplyResult:e,peerDataRequestSessionId:t}).commit()}function g(e,t,n,r,a,i){var l=m(e);new(o("WAWebNonMessagePeerDataOperationResponseWamEvent")).NonMessagePeerDataOperationResponseWamEvent({peerDataResponseCount:r,peerDataSuccessResponseCount:a,peerDataErrorCount:i,peerDataResponseApplyResult:n,peerDataRequestType:l,peerDataRequestSessionId:t}).commit()}l.sendTimes=s,l.logLinkPreviewResponse=u,l.logNonMessagePeerDataRequest=c,l.logNonMessagePeerDataResponse=p,l.logMediaUpload=_,l.logHistorySyncOnDemandResponse=f,l.logPlaceholderMessageResendResponse=g}),98); __d("WAWebCryptoMediaRetry",["WABinary","WACryptoAesGcm","WACryptoHkdf","WALogger","WAWebProtobufsMmsRetry.pb","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf"],(function(t,n,r,o,a,i,l){var e;function s(t){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["encodeServerErrorReceipt"])));var n=new(o("WABinary")).Binary;return o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufsMmsRetry.pb").ServerErrorReceiptSpec,t,n),n.readByteArrayView()}function u(e,t,n){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield f(e),a=(n==null?void 0:n.slice())||g(),i=s({stanzaId:t}),l=yield o("WACryptoAesGcm").gcmEncrypt(r,a,i,t);return{ciphertext:l,iv:a}}),c.apply(this,arguments)}function d(e,t,n,r){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){var a=yield f(e),i=yield o("WACryptoAesGcm").gcmDecrypt(a,n,r,t);return o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufsMmsRetry.pb").MediaRetryNotificationSpec,i)}),m.apply(this,arguments)}var p=12,_="WhatsApp Media Retry Notification";function f(e){return o("WACryptoHkdf").extractAndExpand(e,_,32)}function g(){var e=new Uint8Array(p);return self.crypto.getRandomValues(e),e}l.encryptServerErrorReceipt=u,l.decryptMediaRetryNotification=d,l.ENC_IV_SIZE=p}),98); __d("WAWebSendHistSyncServerErrorReceiptJob",["WABase64","WADeprecatedSendIq","WAWap","WAWebCommsAckParser","WAWebCommsWapMd","WAWebCryptoMediaRetry","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t,n){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r,a=o("WABase64").decodeB64(n),i=yield o("WAWebCryptoMediaRetry").encryptServerErrorReceipt(a,t),l=i.ciphertext,s=i.iv,u=(r=o("WAWap")).wap("receipt",{type:"server-error",to:o("WAWebCommsWapMd").USER_JID(e),id:r.CUSTOM_STRING(t),category:"peer"},r.wap("encrypt",null,r.wap("enc_p",null,l),r.wap("enc_iv",null,s)));return o("WADeprecatedSendIq").deprecatedSendStanzaAndWaitForAck(u,o("WAWebCommsAckParser").toCoreAckTemplate({id:t,class:"receipt",type:"server-error",from:e,participant:null}))}),s.apply(this,arguments)}l.default=e}),98); __d("WAWebQplFlow",["WAQplTypes","WAWebEnvironment","WAWebNoop","WAWebQplQuickPerformanceLoggerModule"],(function(t,n,r,o,a,i,l){var e=0;function s(t,n){var a,i=(a=n==null?void 0:n.instanceKey)!=null?a:e++,l=n==null?void 0:n.timeoutInMs,s=!0,u=o("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(t,{annotations:n==null?void 0:n.annotations,cancelOnUnload:!0,instanceKey:i});u.annotate({string:{subplatform:r("WAWebEnvironment").isWindows?"hybrid":"web",environment:r("WAWebEnvironment").getEnvironment()}});var c=l!=null?globalThis.setTimeout(function(){u.end(o("WAQplTypes").QuickLogActionType.TIMEOUT)},l):null,d=function(){c!=null&&(globalThis.clearTimeout(c),c=null)};return{addAnnotations:function(t){u.annotate(t)},addPoint:function(t,n){u.addPoint(t,{data:n})},endCancel:function(t,n){s=!1,d(),n!=null&&u.annotate(n),u.end(o("WAQplTypes").QuickLogActionType.CANCEL)},endFail:function(t,n){s=!1,d(),u.addPoint(t,{data:n}),u.end(o("WAQplTypes").QuickLogActionType.FAIL)},endFailWithError:function(t,n,r){s=!1,d(),u.addPoint(t,{data:r}),u.annotate({string:{failReason:n}}),u.end(o("WAQplTypes").QuickLogActionType.FAIL)},endSuccess:function(t){s=!1,d(),t!=null&&u.annotate(t),u.end(o("WAQplTypes").QuickLogActionType.SUCCESS)},getQPLAttrs:function(){return{instanceKey:i}},isActive:function(){return s},start:r("WAWebNoop")}}l.startQplFlow=s}),98); __d("WAWebStartMediaDownloadQpl",["WAWebQplFlow","WAWebQplQuickPerformanceLoggerMarkerIds"],(function(t,n,r,o,a,i,l){var e=6e5;function s(t){var n=t.entryPoint;return o("WAWebQplFlow").startQplFlow(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.MEDIA_DOWNLOAD,{annotations:{string:{entryPoint:n}},timeoutInMs:e})}l.startMediaDownloadQpl=s}),98); __d("WAWebHandleHistorySyncChunk",["WAAsyncSleep","WABinary","WAGzip","WALogger","WALongInt","WAPromiseDelays","WATimeUtils","WAWebABProps","WAWebAddonProcessMsgsUtils","WAWebApiChat","WAWebApiHistorySyncNotification","WAWebAppTracker","WAWebBackendEventBus","WAWebChatConstants","WAWebCurrentUser","WAWebDBCreateLidPnMappings","WAWebDBMessageUtils","WAWebDownloadManager","WAWebHandleHistorySyncMsg","WAWebHistoryMsgHandlerAction","WAWebHistorySyncDynamicThrottlingManager","WAWebHistorySyncNotificationUtils","WAWebHistorySyncProgress","WAWebHistorySyncWorkerCompatibleNotificationUtils","WAWebHttpErrors","WAWebMessageAssociation.flow","WAWebMessageAssociationGatingUtils","WAWebMetricsAttributionActions","WAWebMmsClient","WAWebMsgKey","WAWebNetworkStatus","WAWebNonMessageDataRequestHistorySyncOnDemandUtils","WAWebNonMessageDataRequestLoggingUtils","WAWebProtobufsE2E.pb","WAWebProtobufsHistorySync.pb","WAWebSchemaMessage","WAWebSendHistSyncServerErrorReceiptJob","WAWebSendReceiptJobCommon","WAWebSetUsernameJob","WAWebStartMediaDownloadQpl","WAWebSyncGatingUtils","WAWebThreadMsgUtils","WAWebUpdateLidMetadataApi","WAWebUserPrefsAppStateSync","WAWebUserPrefsHistorySync","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsTypes","WAWebUsernameGatingUtils","WAWebWamEnumMdBootstrapStepResult","WAWebWamEnumPeerDataResponseApplyResultType","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","getErrorSafe","gkx","isEmptyObject"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T,D,x,$,P,N,M,w,A,F,O,B,W,q,U=10,V=100;function H(e,t){return G.apply(this,arguments)}function G(){return G=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(t===void 0&&(t=U),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleHistorySyncChunk started for ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(e)).tags("history-sync"),e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP){var n=yield o("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete();if(n===!0){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Skip duplicate initial sync chunk ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(e)).tags("history-sync");return}}if(o("WAWebMetricsAttributionActions").startHistorySyncAttributionTracking(e.syncType),e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3)try{var a=r("WAWebMsgKey").fromString(e.msgKey);o("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:a.remote,type:o("WAWebSendReceiptJobCommon").RECEIPT_TYPE.HISTORY_SYNC_COMPLETION,groupedReceipt:new Map().set(a.remote,[a.id])})}catch(e){o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[history sync] history_sync_notification_handler: sending Status receipt failed"]))).tags("history-sync")}var i=yield o("WAWebHistorySyncNotificationUtils").getHistorySyncProgress(e),l=o("WAWebHistorySyncNotificationUtils").maybeGetInlinePayload(e),F=yield o("WAWebHistorySyncNotificationUtils").getHistorySyncMetrics(e,l==null),O=F.historySyncDataAppliedMetric,B=F.historySyncDownloadedMetric,W=F.historySyncStartDownloadingMetric;o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(e.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADING,e.chunkOrder),o("WAWebHistorySyncNotificationUtils").commitHistoryStartDownloadingMetric(W,e.historySyncStepStartedTs,o("WATimeUtils").unixTimeMs());var q=null;if(l!=null)o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[history sync] get inline payload in chunk, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(e)).tags("history-sync"),q=l;else{var G=o("WAWebStartMediaDownloadQpl").startMediaDownloadQpl({entryPoint:"HandleHistorySyncChunk"});try{o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start downloading chunk, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(e)).tags("history-sync"),q=yield o("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt(babelHelpers.extends({signal:new AbortController().signal,downloadQpl:G},e.downloadOptions)),G.endSuccess()}catch(n){if(G.endFailWithError("download_failed",r("getErrorSafe")(n).message),o("WALogger").WARN(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[history sync] history sync download failed"]))),o("WAWebMetricsAttributionActions").stopHistorySyncAttributionTracking(e.syncType),n instanceof o("WAWebHttpErrors").HttpNetworkError){if(e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP&&t>0){yield r("WAWebNetworkStatus").waitIfOffline(),o("WALogger").WARN(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Initial sync download failed due to network error retry download"]))).tags("history-sync");var Q=t-1;return H(e,Q)}o("WAWebApiHistorySyncNotification").removeLocalFailureFromInFlightChunk(e.msgKey);return}var X=r("WAWebMsgKey").fromString(e.msgKey);if(o("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(B,e.historySyncStepStartedTs,!1,o("WATimeUtils").unixTimeMs()),e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND){var Y,J;o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[history sync][rdu] history sync on demand chunk fails to download."]))),o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandFailure((Y=e.peerDataRequestChatId)!=null?Y:""),o("WAWebNonMessageDataRequestLoggingUtils").logHistorySyncOnDemandResponse(o("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.FAIL_TO_DOWNLOAD,(J=e.peerDataRequestSessionId)!=null?J:"")}r("WAWebSendHistSyncServerErrorReceiptJob")(X.remote,X.id,e.downloadOptions.mediaKey),yield o("WAWebApiHistorySyncNotification").markChunkForReuploadPending(e.msgKey);return}}o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(e.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADED,e.chunkOrder),e.downloadOptions.mediaKey="",B.mdBootstrapStepResult=o("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.SUCCESS;var Z=new(o("WABinary")).Binary(q),ee=yield o("WAGzip").inflate(Z.readByteArrayView());o("WAWebAppTracker").AppTracker.start(o("WAWebAppTracker").AppTrackerType.HSProtobufParsing);var te=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufsHistorySync.pb").HistorySyncSpec,ee);o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.HSProtobufParsing);var ne=[];te.phoneNumberToLidMappings.forEach(function(e){var t=e.lidJid,n=e.pnJid;t!=null&&n!=null&&ne.push({lid:o("WAWebWidFactory").createUserLidOrThrow(t),pn:o("WAWebWidFactory").createUserWidOrThrow(n)})});var re={mappings:ne,flushImmediately:!0,learningSource:"other"};e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP?yield o("WAWebDBCreateLidPnMappings").createLidPnMappings(re):yield o("WAWebDBCreateLidPnMappings").createLidPnMappingsInBatches(re);var oe=o("WAWebHistorySyncNotificationUtils").getLidMappingAsStringSet(ne);o("WAWebCurrentUser").isEmployee()&&o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["completed learning lid mappings for history sync. count: ",". ","..."])),oe==null?void 0:oe.size,o("WAWebHistorySyncNotificationUtils").getLidsForLogging(oe)).verbose();var ae=new Map;o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(e.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DECODED,e.chunkOrder),o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["[history sync] chunk downloaded, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(e,void 0,te.conversations.length));var ie=o("WATimeUtils").unixTimeMs();e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&e.chunkOrder!=null&&o("WAWebHistorySyncProgress").updateHistorySyncProgressModel();var le=function(n){o("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric({historySyncDataAppliedMetric:O,startTs:e.historySyncStepStartedTs,isSuccess:!1,forceFlushWamBuffer:!0,failureReason:n})};e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3&&te.statusV3Messages&&te.statusV3Messages.length>0?yield o("WAWebHistoryMsgHandlerAction").handleStatusMessages(te,e,B,O,ie).catch(function(e){throw o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing status messages failed: ",""])),e),le(""+e),e}):e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.NON_BLOCKING_DATA?yield o("WAWebHistoryMsgHandlerAction").handleNonBlockingData(te,e,B,O,ie).catch(function(e){throw o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing non blocking data failed: ",""])),e),le(""+e),e}):e.syncType!==o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.PUSH_NAME&&(te.conversations=te.conversations.reduce(function(e,t){var n=null;try{n=o("WAWebWidFactory").createWid(t.id)}catch(e){o("WALogger").WARN(b||(b=babelHelpers.taggedTemplateLiteralLoose(['[history sync] handleHistorySyncChunk: failed to create wid from "','": ',""])),t.id,e).tags("history-sync")}return n?e.concat(t):e},[]));var se=[],ue=[],ce=[];if(e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP)yield o("WAWebHistoryMsgHandlerAction").handleInitialSyncMsgs(te,e,se,B,O,ie,ce,ne).catch(function(e){throw o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing initial sync messages failed: ",""])),e),le(""+e),e});else if(e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.PUSH_NAME)yield o("WAWebHistoryMsgHandlerAction").handlePushName(te,e,B,O,ie).catch(function(e){throw o("WALogger").LOG(S||(S=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing initial pushname failed: ",""])),e),le(""+e),e});else if(![o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3,o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.NON_BLOCKING_DATA].includes(e.syncType)&&(o("WALogger").LOG(R||(R=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start processing non initial status messages"]))),yield o("WAPromiseDelays").releaseToMainThread(),!z(e,te))){var de=[],me=new Set,pe=[],_e=[],fe=[],ge=new Set,he=[],ye=o("WAWebUserPrefsHistorySync").getHistoryInitialSyncBoundary(),Ce=0,be=0,ve=!1,Se=o("WAWebSyncGatingUtils").getRecentSyncMessageProcessingBreakIteration(),Re=yield o("WAWebUserPrefsAppStateSync").getAllCriticalDataSynced();(ye==null||r("isEmptyObject")(ye))&&o("WALogger").LOG(L||(L=babelHelpers.taggedTemplateLiteralLoose(["[history sync] boundary data is null or empty"])));for(var Le=0;Le=Be.batchSize&&o("WAWebABProps").getABPropConfigValue("wa_web_history_sync_dynamic_throttling")){var We=self.performance.now(),qe=We-Ne;o("WALogger").LOG(D||(D=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Observed process time ","ms, target process time ","ms, batch size ",""])),qe.toFixed(),o("WAWebHistorySyncDynamicThrottlingManager").historySyncDynamicThrottlingManager.targetTimeMs.toFixed(),Pe).tags("history-sync"),o("WAWebHistorySyncDynamicThrottlingManager").historySyncDynamicThrottlingManager.setLastProcessTime(qe,Pe),Be.delayMs>0&&(o("WALogger").LOG(x||(x=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Applying message throttling delay: ","ms"])),Be.delayMs.toFixed()).tags("history-sync"),yield o("WAAsyncSleep").asyncSleep(Be.delayMs)),Pe=0,Ne=self.performance.now()}var Ue=ke.messages[Me],Ve=o("WALongInt").maybeNumberOrThrowIfTooLarge(Ue.msgOrderId);if(!(Ie!=null&&Ie!==-1&&Ve!=null&&Ve>=Ie)){var He=(Ue==null||(we=Ue.message)==null||(we=we.message)==null||(we=we.protocolMessage)==null?void 0:we.type)===o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE;if(He===!0){o("WALogger").LOG($||($=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping request welcome message"])));continue}var Ge=(Ue==null||(Ae=Ue.message)==null||(Ae=Ae.message)==null||(Ae=Ae.protocolMessage)==null?void 0:Ae.type)===o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.BOT_MEMU_ONBOARDING_MESSAGE;if(Ge){o("WALogger").LOG(P||(P=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping memu onboarding message"])));continue}ge.add(ke.id);var ze=o("WAWebHistorySyncNotificationUtils").parseWebMsgInfoAndReturnNullOnFailure(De,Ue.message,e,oe,ae);if(ze&&ze.id.remote.toString()!==ke.id&&ge.add(ze.id.remote.toString()),Me===0&&ze&&xe){var je=yield o("WAWebSchemaMessage").getMessageTable().betweenCount(["internalId"],o("WAWebDBMessageUtils").beginningOfChat(De),o("WAWebDBMessageUtils").endOfChat(De));je===0&&he.push(ze)}if(fe=fe.concat(o("WAWebAddonProcessMsgsUtils").parseHistorySyncMsg({webMsgInfo:Ue.message,parsedWebMsgInfo:ze,isFromCag:(Fe=ke.isDefaultSubgroup)!=null?Fe:!1})),ze!=null&&((Oe=Ue.message)==null||(Oe=Oe.commentMetadata)==null?void 0:Oe.commentParentKey)==null&&(me.has(ze.id.toString())&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&me.delete(ze==null?void 0:ze.id.toString()),de.push(ze)),ze!=null&&o("WAWebMessageAssociation.flow").isAssociatedMsg(ze)&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var Ke=ze.parentMsgKey.toString();me.add(Ke),pe.push(ze)}ze!=null&&o("WAWebThreadMsgUtils").isThreadMsg(ze)&&_e.push(ze),o("WAWebABProps").getABPropConfigValue("wa_web_history_sync_dynamic_throttling")||(yield o("WAAsyncSleep").asyncSleepAfterGivenLoopIteration(be++,Re?Se:V))}}if(Pe>0){var Qe=self.performance.now(),Xe=Qe-Ne;o("WAWebHistorySyncDynamicThrottlingManager").historySyncDynamicThrottlingManager.setLastProcessTime(Xe,Pe)}}}B.mdBootstrapMessagesCount=Ce,B.mdBootstrapChatsCount=te.conversations.length,o("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(B,e.historySyncStepStartedTs,!0,ie),o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(e.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.MESSAGE_PREPROCESSED,e.chunkOrder);try{de.length!==0?yield o("WAWebHandleHistorySyncMsg").handleProgressiveHistorySyncMsgs(de,Array.from(ge),fe,he,e.syncType,e.chunkOrder,pe,me,_e):o("WALogger").LOG(N||(N=babelHelpers.taggedTemplateLiteralLoose(["[history sync] no messages from history sync need to handle"]))),yield o("WAWebUserPrefsHistorySync").setLastHistorySyncedChunk(e.syncType,e.chunkOrder,i),o("WAWebHistorySyncProgress").updateHistorySyncProgressModel(),yield o("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(e.msgKey,e.syncType,e.chunkOrder);var Ye=new Set;te.conversations.forEach(function(e){var t=o("WAWebWidFactory").createWid(e.id);Ye.add(t.toString());var n=(ye==null?void 0:ye[e.id])!=null,r=null;if(n&&(r=e.endOfHistoryTransferType),r!=null)return o("WAWebHistorySyncWorkerCompatibleNotificationUtils").updateEndOfHistorySync(t,r)}),j(e,te,ve),o("WAWebBackendEventBus").BackendEventBus.triggerHistorySyncChunkProcessed(Ye),o("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric({historySyncDataAppliedMetric:O,startTs:e.historySyncStepStartedTs,isSuccess:!0}),o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(e.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.APPLIED,e.chunkOrder),o("WALogger").LOG(M||(M=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing recent/full/on-demand chunk complete, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(e,Ce,ge.size))}catch(e){throw o("WALogger").LOG(w||(w=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing recent/full/on-demand chunk failed: ",""])),e),le(String(e)),e}}var Je=r("WAWebMsgKey").fromString(e.msgKey),Ze=new Map;Ze.set(Je.remote,[Je.id]),e.syncType!==o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3&&o("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:Je.remote,type:o("WAWebSendReceiptJobCommon").RECEIPT_TYPE.HISTORY_SYNC_COMPLETION,groupedReceipt:Ze}),yield o("WAWebDBCreateLidPnMappings").createLidPnMappingsInBatches({mappings:ue,flushImmediately:!0,learningSource:"other"}),yield o("WAWebUpdateLidMetadataApi").updateLidMetadata({updates:se}),o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&(yield o("WAWebSetUsernameJob").setUsernamesJob(ce)),yield o("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(e.msgKey,e.syncType,e.chunkOrder),e.downloadOptions.encFilehash!=null&&r("WAWebMmsClient").deleteMdHistorySyncBlob({directPath:e.downloadOptions.directPath,encFilehash:e.downloadOptions.encFilehash,signal:new AbortController().signal,encHandle:e.encHandle,companionUserSecret:o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get("WAWebCompanionMetaNonce")}).catch(function(e){o("WALogger").WARN(A||(A=babelHelpers.taggedTemplateLiteralLoose(["MMS client delete error"])))});var et=te.conversations.length===1?te.conversations[0].id:null;yield K(e.syncType,te.progress,et),o("WAWebHistorySyncNotificationUtils").reportMissingMapping(ae)}),G.apply(this,arguments)}function z(t,n){if(t.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND&&n.conversations.length!==1){var a,i;return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync][rdu] dropping history sync on demand response as its conversation length "," is not 1."])),r("gkx")("26258")?"":n.conversations.length),o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandFailure((a=t.peerDataRequestChatId)!=null?a:""),o("WAWebNonMessageDataRequestLoggingUtils").logHistorySyncOnDemandResponse(o("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.INVALID_RESPONSE,(i=t.peerDataRequestSessionId)!=null?i:""),!0}return!1}function j(e,t,n){if(e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND&&t.conversations.length===1){var r;o("WAWebMetricsAttributionActions").stopHistorySyncAttributionTracking(e.syncType);var a=t.conversations[0].id;n?o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandFailure(a):o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandSuccess(a),o("WAWebNonMessageDataRequestLoggingUtils").logHistorySyncOnDemandResponse(n?o("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.OTHER_ERROR:o("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.SUCCESS,(r=e.peerDataRequestSessionId)!=null?r:"")}}function K(e,t,n){return Q.apply(this,arguments)}function Q(){return Q=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a=o("WAWebSyncGatingUtils").isHistorySyncOnDemandEnabled();if((t===100||e===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP)&&o("WAWebMetricsAttributionActions").stopHistorySyncAttributionTracking(e),e===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP)o("WALogger").LOG(F||(F=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Initial bootstrap history sync complete"]))).tags("history-sync"),yield o("WAWebUserPrefsHistorySync").setInitialHistorySyncComplete(),yield o("WAWebUserPrefsHistorySync").setHistorySyncStatus({initialCompleted:!0}),o("WAWebBackendEventBus").BackendEventBus.triggerInitialChatHistorySynced();else if(e===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&t===100)o("WALogger").LOG(O||(O=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Recent history sync complete"]))).tags("history-sync"),yield o("WAWebUserPrefsHistorySync").setHistorySyncStatus({recentCompleted:!0}),o("WAWebBackendEventBus").BackendEventBus.triggerRecentChatHistorySynced();else if(e===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL&&t===100)o("WALogger").LOG(B||(B=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Full history sync complete"]))).tags("history-sync"),a||(o("WALogger").LOG(W||(W=babelHelpers.taggedTemplateLiteralLoose(["[history sync] set history initial sync boundary to empty"]))),o("WAWebUserPrefsHistorySync").setHistoryInitialSyncBoundary({})),yield o("WAWebUserPrefsHistorySync").setHistorySyncStatus({fullCompleted:!0}),o("WAWebBackendEventBus").BackendEventBus.triggerFullChatHistorySynced();else if(a&&e===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND&&t===100){var i;o("WALogger").LOG(q||(q=babelHelpers.taggedTemplateLiteralLoose(["[history sync] On demand history sync complete for chat ",""])),r("gkx")("26258")?"-":n).tags("history-sync");var l="onDemandCompleted_"+(n!=null?n:"");yield o("WAWebUserPrefsHistorySync").setHistorySyncStatus((i={},i[l]=!0,i))}}),Q.apply(this,arguments)}l.handleHistorySyncChunk=H}),98); __d("WAWebDBProcessRecentAndFullHistorySyncMessage",["Promise","WALogger","WATimeUtils","WAWebABProps","WAWebApiChat","WAWebApiFilterAndReplaceMessages","WAWebApiGroupInviteV4Store","WAWebBackendApi","WAWebDBEncryptMultipleMsgs","WAWebDBStoreEncryptedMsgs","WAWebMessageAssociationGatingUtils","WAWebMsgGetters","WAWebMsgType","WAWebProcessMessageAssociationMessages","WAWebRunInBatches","WAWebRuntimeEnvironmentUtils","WAWebSchemaChat","WAWebSyncGatingUtils","WAWebThreadCommonModelUtils","WAWebThreadMetadataBulkJob","WAWebUserPrefsHistorySync","WAWebUserPrefsTypes","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g=2500,h=1e3;function y(e,t,n,r,o,a,i){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r,a,i,l,s,u){var c=t,d,m;if(l.length&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var p;if(m=o("WAWebProcessMessageAssociationMessages").classifyAssociatedMsgsFromHistorySyncUsingMissingParentsCache(l,s),(p=m)!=null&&p.validAssociatedMsgs){var _;d=o("WAWebApiFilterAndReplaceMessages").validateMsgFn((_=m)==null?void 0:_.validAssociatedMsgs)}}try{var g=yield o("WAWebApiFilterAndReplaceMessages").filterAndReplaceMessages(t,d),h=g.newMsgs;c=h}catch(t){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["filterAndReplaceMessages failed with error ",""])),t).tags("history-sync")}var y=new Map,C=[];c.forEach(function(e){e.type===o("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE&&C.push(o("WAWebApiGroupInviteV4Store").persistGroupInviteV4Msg(e.id.toString(),{id:e.id.toString(),from:e.from.toString(),to:e.to.toString(),groupId:e.inviteGrp,expiration:parseInt(e.inviteCodeExp,10),expired:o("WATimeUtils").unixTime()>=parseInt(e.inviteCodeExp,10)}));var t=e.id.remote.toString();if(o("WAWebMsgGetters").getIsImportantMessage(e))if(y.has(t)){var n;(n=y.get(t))==null||n.push(e)}else y.set(t,[e])}),C.length>0&&(yield(f||(f=n("Promise"))).all(C));var v=o("WAWebSyncGatingUtils").isRecentSyncWorkerComaptibleHandlingEnabled()||o("WAWebSyncGatingUtils").isRecentSyncChunkDataHandlingInWorkerEnabled(),R=v&&o("WAWebRuntimeEnvironmentUtils").isWorker()?yield S(y):yield o("WAWebBackendApi").frontendSendAndReceive("processAndGetUnreadMentionsInfo",{filteredMsgs:c}),L=R.pendingUnreadMentionsMap,E=R.unreadMentionsToAdd,I=yield o("WAWebDBEncryptMultipleMsgs").encryptMultipleDBMsgs(c,!0);o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(a,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.ENCRYPTED,i),yield b(I,r,E,L,v),yield k(u)}),C.apply(this,arguments)}function b(e,t,n,r,o){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a,i){try{if(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedRecentAndFullSyncMsgs: storing "," messages: start"])),e.length),o("WAWebABProps").getABPropConfigValue("web_anr_throttle_history_sync_db_writes"))try{yield o("WAWebRunInBatches").runInBatches(e,(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: storing "," messages: start"])),e.length),yield o("WAWebDBStoreEncryptedMsgs").storeEncryptedDBMessages(e,t,!0),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: storing "," messages: done"])),e.length)});return function(t){return e.apply(this,arguments)}})(),{batchSize:g,delayMs:h})}catch(t){throw o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedDBMessages: failed to store "," in batches: ",""])),e.length,t).sendLogs("failed-to-store-encrypted-db-messages-in-batches"),t}else yield o("WAWebDBStoreEncryptedMsgs").storeEncryptedDBMessages(e,t,!0);if(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["storeEncryptedRecentAndFullSyncMsgs: storing "," messages: done"])),e.length),r.size>0){var l=i&&o("WAWebRuntimeEnvironmentUtils").isWorker()?yield L(r,a):yield o("WAWebBackendApi").frontendSendAndReceive("getChatIdsNeedToBeDeletedFromUnreadMentionInfo",{unreadMentionsToAdd:r,pendingUnreadMentionsMap:a});l.forEach(function(e){r.delete(e)}),r.size>0&&o("WAWebApiChat").addUnreadMentionChat(r,a)}}catch(t){o("WALogger").WARN(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[history sync] error storing "," recent or full sync messages: ",""])),e.length,t)}}),v.apply(this,arguments)}function S(e){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=new Map,n=new Map,r=Array.from(e.keys()),a=(yield o("WAWebSchemaChat").getChatTable().bulkGet(r)).reduce(function(e,t){return t&&t.id&&e.set(t.id,t),e},new Map);return e.forEach(function(e,r){var o=a.get(r);e.forEach(function(e){var a=0;if(n.has(r)){var l;a=(l=n.get(r))!=null?l:0}else{var i;a=(i=o==null?void 0:o.unreadMentionCount)!=null?i:0,n.set(r,a)}if(a>0){n.set(r,a-1);var s={id:e.id.toString(),timestamp:e.t};if(t.has(r)){var u;(u=t.get(r))==null||u.push(s)}else t.set(r,[s])}})}),{unreadMentionsToAdd:t,pendingUnreadMentionsMap:n}}),R.apply(this,arguments)}function L(e,t){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=Array.from(e.keys()),r=(yield o("WAWebSchemaChat").getChatTable().bulkGet(n)).reduce(function(e,t){return t&&t.id&&e.set(t.id,t),e},new Map),a=[];return e.forEach(function(e,n){var i,l=r.get(n),s=(i=t.get(n))!=null?i:0;if((l==null?void 0:l.unreadMentionCount)===0){a.push(n);return}(l==null?void 0:l.unreadMentionCount)!=null&&(l==null?void 0:l.unreadMentionCount)>0&&o("WAWebBackendApi").frontendFireAndForget("updateUnreadMentionMetadataByAdding",{chatId:n,newUnreadMentions:e,pendingUnreadMentionCount:s})}),a}),E.apply(this,arguments)}function k(e){return I.apply(this,arguments)}function I(){return I=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.length!==0)try{var t=o("WAWebThreadCommonModelUtils").getAggregatedThreadDetailUpdatesFromMessages(e);yield o("WAWebThreadMetadataBulkJob").bulkCreateOrUpdateThreadsMetadata(t)}catch(e){o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["storeThreadMetadataFromHistorySyncMessages: failed to store thread metadata: ",""])),e).sendLogs("failed-to-store-thread-metadata-from-history-sync-messages")}}),I.apply(this,arguments)}l.storeRecentAndFullHistSyncMessages=y}),98); __d("WAWebHandleHistorySyncMsg",["Promise","WAFilteredCatch","WALogger","WAWebAddonProcessMsgs","WAWebBackendErrors","WAWebCheckUpdateOrphanReactions","WAWebDBProcessRecentAndFullHistorySyncMessage","WAWebNoop","WAWebSyncdOrphan","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e,t,n,r,o,a,i,l,s){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a,i,l,c,d,m,p,_){return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync] starts handling recent/full/on-demand sync progressive history messages"]))),yield(u||(u=n("Promise"))).resolve(),o("WAWebDBProcessRecentAndFullHistorySyncMessage").storeRecentAndFullHistSyncMessages(t,a,c,d,m,p,_).then(function(){var e=a.map(function(e){return e}),n=t.map(function(e){return e.id.toString()});return o("WAWebCheckUpdateOrphanReactions").checkUpdateForOrphanReactions(n),o("WAWebSyncdOrphan").checkOrphanMutations(n,e)}).then(function(){return(u||(u=n("Promise"))).all(i).then(function(e){var t;return o("WAWebAddonProcessMsgs").processHistoryMsgs((t=[]).concat.apply(t,e))})}).then(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){for(var e of l){if(!e||!e.id||!e.id.remote)return;var t=e.id.remote;if(t.isNewsletter())return;yield o("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("processLastMsgs",{chatId:t,msgObjs:[e],meta:{add:"last",isHistory:!0},processMessagesOrigin:"historyMsgHandlerAction",chatMsgsCollection:null})}})).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").LogoutDrop,r("WAWebNoop"))).catch(function(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error: ",", message: ",", stack: ",""])),e.name,e.message,e.stack).sendLogs("handleProgressiveHistorySyncMsgs: error storing/processing multiple messages")})}),d.apply(this,arguments)}l.handleProgressiveHistorySyncMsgs=c}),98); __d("WAWebBackendWorkerBridge",["WAResolvable"],(function(t,n,r,o,a,i,l){"use strict";var e=0,s=(function(){function t(e){this.$1=e,this.$2=new Map;var t=this.$2;this.$1.addEventListener("message",function(e){if(e.type==="message"){var n,r=(n=e.data)==null?void 0:n.message;if(r==null)return;var o=r.data,a=r.id,i=t.get(a);i!=null&&(t.delete(a),i.resolve(o))}})}var n=t.prototype;return n.send=function(n,r,a){var t=n+"_"+e++;this.$1.postMessage({type:"message",message:{type:n,id:t,data:r}},a);var i=new(o("WAResolvable")).Resolvable;return this.$2.set(t,i),i.promise},t})();l.WAWebBackendWorkerBridge=s}),98); __d("WAWebBackendWorkerClient",["Promise","WAResolvable","WAWebBackendWorkerBridge","WAWebBackendWorkerResource","WorkerBundleResource","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s=new(o("WAResolvable")).Resolvable;function u(){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WorkerBundleResource").createDedicatedWebWorker(r("WAWebBackendWorkerResource"));yield m(e),s.resolve(new(o("WAWebBackendWorkerBridge")).WAWebBackendWorkerBridge(e))}),c.apply(this,arguments)}function d(){return s.promise}function m(t){return new(e||(e=n("Promise")))(function(e){var n=function(o){o.data.message.type==="worker_started"&&(e(),t.removeEventListener("message",n))};t.addEventListener("message",n)})}l.startBackendWorker=u,l.getBackendWorkerBridge=d}),98); __d("WAWebHandleWorkerCompatibleRecentSyncChunk",["WABinary","WAGzip","WALogger","WAPromiseDelays","WATimeUtils","WAWebABProps","WAWebApiHistorySyncNotification","WAWebBackendEventBus","WAWebBackendWorkerClient","WAWebDBCreateLidPnMappings","WAWebDownloadManager","WAWebHandleHistorySyncMsg","WAWebHistorySyncNotificationUtils","WAWebHistorySyncProgress","WAWebHistorySyncWorkerCompatibleNotificationUtils","WAWebHttpErrors","WAWebMetricsAttributionActions","WAWebMmsClient","WAWebMsgKey","WAWebPreprocessHistorySyncProto","WAWebProtobufsHistorySync.pb","WAWebSendHistSyncServerErrorReceiptJob","WAWebSendReceiptJobCommon","WAWebSetUsernameJob","WAWebStartMediaDownloadQpl","WAWebSyncGatingUtils","WAWebUpdateLidMetadataApi","WAWebUserPrefsHistorySync","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsTypes","WAWebUsernameGatingUtils","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b;function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] handleHistorySyncChunk started for ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(t)).tags("history-sync"),o("WAWebMetricsAttributionActions").startHistorySyncAttributionTracking(t.syncType);var n=yield o("WAWebHistorySyncNotificationUtils").getHistorySyncProgress(t),a=o("WAWebSyncGatingUtils").isRecentSyncDownloadOptimizationEnabled(),i=a?t.downloadedHistorySyncPayload:null,l=yield o("WAWebHistorySyncNotificationUtils").getHistorySyncMetrics(t,!0),v=l.historySyncDataAppliedMetric,S=l.historySyncDownloadedMetric,R=l.historySyncStartDownloadingMetric,L=o("WAWebStartMediaDownloadQpl").startMediaDownloadQpl({entryPoint:"HandleWorkerCompatibleRecentSyncChunk"}),E=null;if(i!=null)o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] get downloaded payload in chunk, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(t)).tags("history-sync"),E=i;else{o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(t.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADING,t.chunkOrder),o("WAWebHistorySyncNotificationUtils").commitHistoryStartDownloadingMetric(R,t.historySyncStepStartedTs,o("WATimeUtils").unixTimeMs());try{o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] start downloading chunk, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(t)).tags("history-sync"),E=yield o("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt(babelHelpers.extends({signal:new AbortController().signal,downloadQpl:L},t.downloadOptions)),L.endSuccess()}catch(e){if(L.endFailWithError("download_failed",String(e)),o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] history sync download failed"]))),o("WAWebMetricsAttributionActions").stopHistorySyncAttributionTracking(t.syncType),e instanceof o("WAWebHttpErrors").HttpNetworkError){o("WAWebApiHistorySyncNotification").removeLocalFailureFromInFlightChunk(t.msgKey);return}var k=r("WAWebMsgKey").fromString(t.msgKey);o("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(S,t.historySyncStepStartedTs,!1,o("WATimeUtils").unixTimeMs()),r("WAWebSendHistSyncServerErrorReceiptJob")(k.remote,k.id,t.downloadOptions.mediaKey),yield o("WAWebApiHistorySyncNotification").markChunkForReuploadPending(t.msgKey);return}o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(t.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADED,t.chunkOrder),t.downloadOptions.mediaKey="",o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] chunk downloaded, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(t))}var I;if(o("WAWebABProps").getABPropConfigValue("web_history_sync_worker_enabled")){var T=yield o("WAWebBackendWorkerClient").getBackendWorkerBridge();I=yield T.send("process_history_sync",E,[E])}else{var D=new(o("WABinary")).Binary(E),x=yield o("WAGzip").inflate(D.readByteArrayView());I=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufsHistorySync.pb").HistorySyncSpec,x)}var $=[];I.phoneNumberToLidMappings.forEach(function(e){var t=e.lidJid,n=e.pnJid;t!=null&&n!=null&&$.push({lid:o("WAWebWidFactory").createUserLidOrThrow(t),pn:o("WAWebWidFactory").createUserWidOrThrow(n)})}),yield o("WAWebDBCreateLidPnMappings").createLidPnMappingsInBatches({mappings:$,flushImmediately:!0,identityChangeHandlingEnabled:!1,learningSource:"other"}),o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] learned "," mappings"])),$.length),o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(t.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DECODED,t.chunkOrder),o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] chunk decoded, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(t,void 0,I.conversations.length));var P=o("WATimeUtils").unixTimeMs();t.chunkOrder!=null&&o("WAWebHistorySyncProgress").updateHistorySyncProgressModel(),I.conversations=I.conversations.reduce(function(e,t){var n=null;try{n=o("WAWebWidFactory").createWid(t.id)}catch(e){o("WALogger").WARN(_||(_=babelHelpers.taggedTemplateLiteralLoose(['[history sync][recent sync] handleWorkerCompatibleRecentSyncChunk: failed to create wid from "','": ',""])),t.id,e).tags("history-sync")}return n?e.concat(t):e},[]);var N=[],M=[],w=[];try{o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] start processing recent sync messages"]))),yield o("WAPromiseDelays").releaseToMainThread();var A=yield o("WAWebPreprocessHistorySyncProto").preprocessHistorySyncProto(I,$),F=A.associatedMsgs,O=A.chatsWithRecentOrFullSyncMsgs,B=A.lastMsgs,W=A.missingParentsCache,q=A.recentOrFullSyncMsgs,U=A.threadMsgs,V=A.totalChunkMsgCount,H=A.unifiedAddons;a||(S.mdBootstrapMessagesCount=V,S.mdBootstrapChatsCount=I.conversations.length,o("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(S,t.historySyncStepStartedTs,!0,P)),o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(t.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.MESSAGE_PREPROCESSED,t.chunkOrder),q.length!==0?yield o("WAWebHandleHistorySyncMsg").handleProgressiveHistorySyncMsgs(q,Array.from(O),H,B,t.syncType,t.chunkOrder,F,W,U):o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] no messages from history sync need to handle"]))),o("WAWebUserPrefsHistorySync").setHistorySyncTotalProcessedMessageCount(V),yield o("WAWebUserPrefsHistorySync").setLastHistorySyncedChunk(t.syncType,t.chunkOrder,n),o("WAWebHistorySyncProgress").updateHistorySyncProgressModel(),yield o("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(t.msgKey,t.syncType,t.chunkOrder);var G=o("WAWebUserPrefsHistorySync").getHistoryInitialSyncBoundary(),z=new Set;I.conversations.forEach(function(e){var t=o("WAWebWidFactory").createWid(e.id);z.add(t.toString());var n=(G==null?void 0:G[e.id])!=null;if(n){var r=e.endOfHistoryTransferType;if(r!=null)return o("WAWebHistorySyncWorkerCompatibleNotificationUtils").updateEndOfHistorySync(t,r)}}),o("WAWebBackendEventBus").BackendEventBus.triggerHistorySyncChunkProcessed(z),o("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric({historySyncDataAppliedMetric:v,startTs:t.historySyncStepStartedTs,isSuccess:!0}),o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(t.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.APPLIED,t.chunkOrder),o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] storing recent chunk complete, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(t,V,O.length))}catch(e){throw o("WALogger").WARN(y||(y=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] handleWorkerCompatibleRecentSyncChunk failed with error ",""])),e),o("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric({historySyncDataAppliedMetric:v,startTs:t.historySyncStepStartedTs,isSuccess:!1,forceFlushWamBuffer:!0,failureReason:String(e)}),e}var j=r("WAWebMsgKey").fromString(t.msgKey),K=new Map;K.set(j.remote,[j.id]),t.syncType!==o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3&&o("WAWebSendReceiptJobCommon").sendAggregateReceipts({to:j.remote,type:o("WAWebSendReceiptJobCommon").RECEIPT_TYPE.HISTORY_SYNC_COMPLETION,groupedReceipt:K}),yield o("WAWebDBCreateLidPnMappings").createLidPnMappingsInBatches({mappings:M,flushImmediately:!0,identityChangeHandlingEnabled:!1,learningSource:"other"}),yield o("WAWebUpdateLidMetadataApi").updateLidMetadata({updates:N}),o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&(yield o("WAWebSetUsernameJob").setUsernamesJob(w)),yield o("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(t.msgKey,t.syncType,t.chunkOrder),t.downloadOptions.encFilehash!=null&&r("WAWebMmsClient").deleteMdHistorySyncBlob({directPath:t.downloadOptions.directPath,encFilehash:t.downloadOptions.encFilehash,signal:new AbortController().signal,encHandle:t.encHandle,companionUserSecret:o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get("WAWebCompanionMetaNonce")}).catch(function(e){o("WALogger").WARN(C||(C=babelHelpers.taggedTemplateLiteralLoose(["MMS client delete error"])))}),n===100&&(o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] Recent history sync complete"]))).tags("history-sync"),o("WAWebMetricsAttributionActions").stopHistorySyncAttributionTracking(t.syncType),yield o("WAWebUserPrefsHistorySync").setHistorySyncStatus({recentCompleted:!0}),o("WAWebBackendEventBus").BackendEventBus.triggerRecentChatHistorySynced())}),S.apply(this,arguments)}l.handleWorkerCompatibleRecentSyncChunk=v}),98); __d("WAWebPreprocessHistorySyncProto",["WAAsyncSleep","WALogger","WALongInt","WAWebABProps","WAWebAddonProcessMsgsUtils","WAWebApiChat","WAWebChatConstants","WAWebCurrentUser","WAWebDBMessageUtils","WAWebHistorySyncDynamicThrottlingManager","WAWebHistorySyncNotificationUtils","WAWebMessageAssociation.flow","WAWebMessageAssociationGatingUtils","WAWebProtobufsE2E.pb","WAWebSchemaMessage","WAWebSyncGatingUtils","WAWebThreadMsgUtils","WAWebUserPrefsAppStateSync","WAWebUserPrefsHistorySync","WAWebWidFactory","asyncToGeneratorRuntime","gkx","isEmptyObject"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g=100;function h(e,t){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var a=o("WAWebHistorySyncNotificationUtils").getLidMappingAsStringSet(n);o("WAWebCurrentUser").isEmployee()&&o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["first lid mappings for recent sync preprocess: ","..."])),o("WAWebHistorySyncNotificationUtils").getLidsForLogging(a)).verbose();var i=new Map,l=[],h=[],y=[],C=new Set,b=[],v=new Set,S=[],R=o("WAWebUserPrefsHistorySync").getHistoryInitialSyncBoundary(),L=0,E=0,k=o("WAWebSyncGatingUtils").getRecentSyncMessageProcessingBreakIteration(),I=yield o("WAWebUserPrefsAppStateSync").getAllCriticalDataSynced(),T=self.performance.now(),D=0;(R==null||r("isEmptyObject")(R))&&o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] boundary data is null or empty"])));for(var x=0;x=N)){var G=(V==null||(B=V.message)==null||(B=B.message)==null||(B=B.protocolMessage)==null?void 0:B.type)===o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE;if(G===!0){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[history sync][recent sync] Dropping request welcome message"])));continue}var z=(V==null||(W=V.message)==null||(W=W.message)==null||(W=W.protocolMessage)==null?void 0:W.type)===o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.BOT_MEMU_ONBOARDING_MESSAGE;if(z){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping memu onboarding message"])));continue}v.add(P.id);var j=o("WAWebHistorySyncNotificationUtils").parseWebMsgInfoAndReturnNullOnFailure(w,V.message,void 0,a,i);if(j&&j.id.remote.toString()!==P.id&&v.add(j.id.remote.toString()),O===0&&j&&A){var K=yield o("WAWebSchemaMessage").getMessageTable().betweenCount(["internalId"],o("WAWebDBMessageUtils").beginningOfChat(w),o("WAWebDBMessageUtils").endOfChat(w));K===0&&S.push(j)}if(b=b.concat(o("WAWebAddonProcessMsgsUtils").parseHistorySyncMsg({webMsgInfo:V.message,parsedWebMsgInfo:j,isFromCag:(q=P.isDefaultSubgroup)!=null?q:!1})),j!=null&&((U=V.message)==null||(U=U.commentMetadata)==null?void 0:U.commentParentKey)==null&&(C.has(j.id.toString())&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&C.delete(j==null?void 0:j.id.toString()),l.push(j)),j!=null&&o("WAWebMessageAssociation.flow").isAssociatedMsg(j)&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var Q=j.parentMsgKey.toString();C.add(Q),h.push(j)}if(j!=null&&o("WAWebThreadMsgUtils").isThreadMsg(j)&&y.push(j),o("WAWebABProps").getABPropConfigValue("wa_web_history_sync_dynamic_throttling")){D++;var X=o("WAWebHistorySyncDynamicThrottlingManager").historySyncDynamicThrottlingManager.getThrottleRate();if(D>=X.batchSize){var Y=self.performance.now()-T;o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Observed process time ","ms, target process time ","ms, batch size ",""])),Y.toFixed(),o("WAWebHistorySyncDynamicThrottlingManager").historySyncDynamicThrottlingManager.targetTimeMs.toFixed(),D).tags("history-sync"),o("WAWebHistorySyncDynamicThrottlingManager").historySyncDynamicThrottlingManager.setLastProcessTime(Y,D),X.delayMs>0&&(o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Applying message throttling delay: ","ms"])),X.delayMs.toFixed()).tags("history-sync"),yield o("WAAsyncSleep").asyncSleep(X.delayMs)),D=0,T=self.performance.now()}}else yield o("WAAsyncSleep").asyncSleepAfterGivenLoopIteration(E++,I?k:g)}}}return o("WAWebHistorySyncNotificationUtils").reportMissingMapping(i),{recentOrFullSyncMsgs:l,chatsWithRecentOrFullSyncMsgs:Array.from(v),unifiedAddons:b,lastMsgs:S,totalChunkMsgCount:L,associatedMsgs:h,missingParentsCache:C,threadMsgs:y}}),y.apply(this,arguments)}l.preprocessHistorySyncProto=h}),98); __d("WAWebGetMetricHistorySyncPayloadType",["WAWebWamEnumMdBootstrapHistoryPayloadType"],(function(t,n,r,o,a,i,l){function e(e){return e===0?o("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.INITIAL:e===1?o("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.STATUS_V3:e===2?o("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.FULL_HISTORY:e===3?o("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.RECENT_HISTORY:e===4?o("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.PUSHNAME:e===5?o("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.NON_BLOCKING_DATA:e===6?o("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.ON_DEMAND:o("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.PUSHNAME}l.getMetricHistorySyncPayloadType=e}),98); __d("WAWebHistorySyncMsgKeyOverrideUtils",["WALogger","WAWebLid1X1MigrationGating","WAWebMsgKey"],(function(t,n,r,o,a,i,l){var e;function s(t,n){var a,i,l,s=t.id;return!o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||s.remote.equals(n)?t:(o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync] msg key remote differs from chatId, overriding. type: ",", subtype: ",", kind: ",""])),(a=t.type)!=null?a:"unknown",(i=t.subtype)!=null?i:"unknown",(l=t.kind)!=null?l:"unknown").sendLogs("history-sync-override-msg-key"),babelHelpers.extends({},t,{id:new(r("WAWebMsgKey"))({fromMe:s.fromMe,remote:n,id:s.id,participant:s.participant})}))}l.maybeOverrideMsgKeyRemoteWithChatId=s}),98); __d("WAWebHistorySyncNotificationUtils",["$InternalEnum","Promise","WALogger","WALongInt","WANullthrows","WATimeUtils","WAWebApiHistorySyncNotification","WAWebChatCollection","WAWebChatThreadLogging","WAWebCurrentUser","WAWebDBGroupParticipant","WAWebDBGroupsGroupMetadata","WAWebEphemeralityUtils","WAWebGetMetricHistorySyncPayloadType","WAWebGroupMetadataCollection","WAWebGroupParticipantModel","WAWebGroupParticipantsJob","WAWebHistorySyncMsgKeyOverrideUtils","WAWebLeaveReasonType","WAWebMdBootstrapDataAppliedWamEvent","WAWebMdBootstrapHistoryDataDownloadedWamEvent","WAWebMdBootstrapHistoryDataStartDownloadingWamEvent","WAWebParseWebMessageInfoApi","WAWebProtobufsHistorySync.pb","WAWebSchemaHistorySyncNotification","WAWebSignalProtocolStore","WAWebSyncdMdSyncFieldstatMeta","WAWebUserPrefsHistorySync","WAWebUserPrefsMeUser","WAWebUserPrefsNotifications","WAWebWamEnumMdBootstrapPayloadType","WAWebWamEnumMdBootstrapSource","WAWebWamEnumMdBootstrapStepResult","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","getErrorSafe","gkx"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k=n("$InternalEnum").Mirrored(["NewRecentSyncNotification","NewOnDemandSyncNotification","LastProcessedNotification","InitialSyncComplete","BackendStart","HistorySyncStatusCheck","ManualRestart"]);function I(e,t){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=e.pastParticipants.map(function(e){return{groupId:r("WANullthrows")(e.groupJid),pastParticipants:e.pastParticipants.map(function(e){return{id:o("WAWebWidFactory").createWid(r("WANullthrows")(e.userJid)),leaveReason:e.leaveReason===o("WAWebProtobufsHistorySync.pb").PastParticipant$LeaveReason.LEFT?o("WAWebLeaveReasonType").LeaveReason.Left:o("WAWebLeaveReasonType").LeaveReason.Removed,leaveTs:o("WALongInt").numberOrThrowIfTooLarge(r("WANullthrows")(e.leaveTs))}})}});yield o("WAWebDBGroupParticipant").addPastParticipants(n),n.forEach(function(e){var t=o("WAWebChatCollection").ChatCollection.gadd(o("WAWebWidFactory").createWid(e.groupId)),n=t.groupMetadata;n==null||n.pastParticipants.add(e.pastParticipants,{merge:!0})}),o("WALogger").LOG(R||(R=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Past Participants completed, ",""])),D(t))}),T.apply(this,arguments)}function D(e,t,n){var r,o,a;if(e==null)return"";var i=(e.msgKey||"").split("_")[2],l=x(e.syncType,e.chunkOrder,e.isReupload),s=(r=(o=e.downloadOptions.filehash)==null?void 0:o.slice(0,10))!=null?r:(a=e.filehash)==null?void 0:a.slice(0,10);return" "+l+", id: "+i+" ## msgCount: "+(t!=null?t:"-")+", ## chatCount: "+(n!=null?n:"-")+", ## downloadStr: "+(s!=null?s:"")+" "}function x(e,t,n){return"type_"+(e!=null?e:"none")+"_order_"+(t!=null?t:"none")+"_isReupload_"+(n||0)}function $(t,n,a,i,l){var u=null;try{n!=null&&(u=o("WAWebParseWebMessageInfoApi").parseWebMessageInfo(n))}catch(t){var c=r("getErrorSafe")(t);o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync] parseWebMessageInfo failed with error "," "," and stack ",""])),c.name,c.errorCode,c.stack),r("gkx")("26258")||o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] parseWebMessageInfo failed on msg key ",", msg type: "," in chunk ",""])),n==null?void 0:n.key.id,n==null?void 0:n.messageStubType,D(a)).sendLogs("parseWebMessageInfo failed during history sync")}return u!=null&&u.id!=null&&t.isRegularUserPn()?o("WAWebHistorySyncMsgKeyOverrideUtils").maybeOverrideMsgKeyRemoteWithChatId(u,t):u}function P(e,t){return N.apply(this,arguments)}function N(){return N=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WAWebSignalProtocolStore").getPersistSignalProtocolStore().loadIdentityKey(e);n!=null&&n!==t&&o("WALogger").ERROR(L||(L=babelHelpers.taggedTemplateLiteralLoose(["[history sync] get changed self identity key from history sync,\n existing length: ",", new length: ",""])),n.length,t.length).tags("history-sync").sendLogs("self-identity-change-from-history-sync")}),N.apply(this,arguments)}function M(e,t){var n;if(t.isGroup()){var a=(n=e.disappearingMode)==null?void 0:n.trigger,i;if(a!=null){var l=o("WAWebEphemeralityUtils").getDisappearingModeTriggerFromProtobuf(a);l!=null&&(i=l)}if(e.suspended!=null||e.terminated!=null||e.createdBy!=null||e.createdAt!=null||e.description!=null||e.support!=null||e.isParentGroup!=null||e.isDefaultSubgroup!=null||e.parentGroupId!=null||e.disappearingMode!=null){var s,c,d={id:t,subject:e.name,suspended:e.suspended,terminated:e.terminated,owner:e.createdBy!=null?o("WAWebWidFactory").createWid(e.createdBy):void 0,creation:e.createdAt,desc:e.description,support:e.support,isParentGroup:e.isParentGroup,defaultSubgroup:e.isDefaultSubgroup,parentGroup:e.parentGroupId!=null?o("WAWebWidFactory").createWid(e.parentGroupId):void 0,disappearingModeInitiatedByMe:(s=e.disappearingMode)==null?void 0:s.initiatedByMe,disappearingModeTrigger:i};o("WAWebDBGroupsGroupMetadata").persistGroupMetadata(t,babelHelpers.extends({},d,{id:d.id.toString(),owner:d.owner!==void 0?d.owner.toString():void 0,creation:d.creation!==void 0?Number(d.creation):void 0,parentGroup:d.parentGroup!==void 0?String(d.parentGroup):void 0}));var m=r("WAWebGroupMetadataCollection").add(babelHelpers.extends({},d),{merge:!0})[0],p=(c=e.participant)==null?void 0:c.map(function(e){var t=e.rank===o("WAWebProtobufsHistorySync.pb").GroupParticipant$Rank.SUPERADMIN,n=e.rank===o("WAWebProtobufsHistorySync.pb").GroupParticipant$Rank.ADMIN;return new(r("WAWebGroupParticipantModel"))({id:o("WAWebWidFactory").createWid(e.userJid),isAdmin:n||t,isSuperAdmin:t})});m==null||m.participants.add(p,{merge:!0}),(e.readOnly===!0||p.length>0)&&o("WAWebGroupParticipantsJob").updateParticipantsJob({group:t,participants:p.map(function(e){return{id:e.id,isAdmin:e.isAdmin,isSuperAdmin:e.isSuperAdmin}}),skipDeviceSync:e.readOnly}).catch(function(e){o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["updateParticipantsJob: failed: ",""])),e)})}}}function w(e){var t=(E||(E=n("Promise"))).resolve(),r=E.resolve();return e.threadIdUserSecret!=null?t=o("WAWebChatThreadLogging").setThreadIdUserSecret(e.threadIdUserSecret):o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleChatThreadLoggingMetadata: missing threadIdUserSecret"]))).sendLogs("ctl-missing-secret-history-sync"),e.threadDsTimeframeOffset!=null?r=o("WAWebChatThreadLogging").setThreadDsTimeframeOffset(e.threadDsTimeframeOffset):o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleChatThreadLoggingMetadata: missing threadDsTimeframeOffset"]))).sendLogs("ctl-missing-offset-history-sync"),E.all([t,r])}function A(e,t){return F.apply(this,arguments)}function F(){return F=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP?o("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE.CRITICAL:o("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE.NON_CRITICAL,r=o("WAWebGetMetricHistorySyncPayloadType").getMetricHistorySyncPayloadType(e.syncType),a=yield o("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId(),i=yield U(e),l=new(o("WAWebMdBootstrapHistoryDataStartDownloadingWamEvent")).MdBootstrapHistoryDataStartDownloadingWamEvent({mdBootstrapPayloadType:n,mdBootstrapPayloadSize:e.historySyncPayloadSize,mdBootstrapHistoryPayloadType:r,mdSessionId:a,historySyncStageProgress:i}),s=new(o("WAWebMdBootstrapHistoryDataDownloadedWamEvent")).MdBootstrapHistoryDataDownloadedWamEvent({mdBootstrapPayloadType:n,mdBootstrapPayloadSize:e.historySyncPayloadSize,mdBootstrapHistoryPayloadType:r,mdSessionId:a,historySyncStageProgress:i}),u=new(o("WAWebMdBootstrapDataAppliedWamEvent")).MdBootstrapDataAppliedWamEvent({mdBootstrapPayloadType:n,mdBootstrapSource:o("WAWebWamEnumMdBootstrapSource").MD_BOOTSTRAP_SOURCE.HISTORY,mdBootstrapHistoryPayloadType:r,mdSessionId:a,sentViaMms:t,historySyncStageProgress:i});e.chunkOrder!=null&&(l.historySyncChunkOrder=e.chunkOrder,s.historySyncChunkOrder=e.chunkOrder,u.historySyncChunkOrder=e.chunkOrder);var c=yield o("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getStorageEstimation();return c.mdStorageQuotaBytes!==o("WAWebSyncdMdSyncFieldstatMeta").STORAGE_QUOTA_UNAVAILABLE&&(s.mdStorageQuotaUsedBytes=c.mdStorageQuotaUsedBytes,s.mdStorageQuotaBytes=c.mdStorageQuotaBytes),{historySyncStartDownloadingMetric:l,historySyncDownloadedMetric:s,historySyncDataAppliedMetric:u}}),F.apply(this,arguments)}function O(e,t,n){e.mdTimestamp=n,e.mdBootstrapStepDuration=n-t,e.commit()}function B(e,t,n,r){e.mdTimestamp=r,e.mdBootstrapStepDuration=r-t,e.mdBootstrapStepResult=n?o("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.SUCCESS:o("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.FAILURE,e.commit()}function W(e){return q.apply(this,arguments)}function q(){return q=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.failureReason,n=e.forceFlushWamBuffer,r=e.historySyncDataAppliedMetric,a=e.isSuccess,i=e.startTs,l=o("WATimeUtils").unixTimeMs();return r.mdTimestamp=l,r.mdBootstrapStepDuration=l-i,r.mdBootstrapStepResult=a?o("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.SUCCESS:o("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.FAILURE,t!=null&&(r.mdSyncFailureReason=t),r.commitAndWaitForFlush(n)}),q.apply(this,arguments)}function U(e){return V.apply(this,arguments)}function V(){return V=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.progress,n=yield o("WAWebUserPrefsHistorySync").getChunkCountForEndOfRecentHistorySync();return(e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL||e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&e.chunkOrder===n)&&(t=100),t!=null?t:0}),V.apply(this,arguments)}function H(e){return[o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_BOOTSTRAP,o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.INITIAL_STATUS_V3,o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.PUSH_NAME].includes(e.syncType)&&e.initialHistBootstrapInlinePayload!=null&&(e==null?void 0:e.initialHistBootstrapInlinePayload.byteLength)>0?e.initialHistBootstrapInlinePayload:null}function G(){return z.apply(this,arguments)}function z(){return z=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed","syncType"],[0,o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT],{shouldDecrypt:!1}).then(function(e){return e.filter(function(e){return!o("WAWebApiHistorySyncNotification").inFlightChunk.has(e.msgKey)&&!e.reuploadPending}).sort(function(e,t){var n,r;return((n=e.chunkOrder)!=null?n:0)-((r=t.chunkOrder)!=null?r:0)})})}),z.apply(this,arguments)}function j(e){var t=null;if(o("WAWebCurrentUser").isEmployee())try{t=new Set(e.map(function(e){var t=e.lid;return t.toString()}))}catch(e){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[history] could not create allLidMapping ",""])),e)}return t}function K(e){if(e==null)return"N/A";var t=0,n=[];for(var r of e)if(n.push(r),t++===50)break;return n.join(",")}function Q(e){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[history] start to report missing mapping. is sw enabled: ",""])),o("WAWebUserPrefsNotifications").getGlobalOfflineNotifications().toString());try{var t=!1;e.forEach(function(e,n){e>0&&(t=!0,o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["total missing mapping for type ",": ",""])),n,e))}),t&&o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["missing Lid mapping in history Sync"]))).sendLogs("missing Lid mapping in history Sync")}catch(e){o("WALogger").ERROR(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[history] could not calculate missing mapping: ",""])),e)}o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["[history] end to report missing mapping"])))}function X(e,t,n,r){}l.HistorySyncScheduleSource=k,l.processPastParticipants=I,l.getHistorySyncLogDetailsString=D,l.getHistorySyncBasicChunkInfoString=x,l.parseWebMsgInfoAndReturnNullOnFailure=$,l.checkSelfHistorySyncIdentity=P,l.saveGroupMetadataForLeftGroup=M,l.handleChatThreadLoggingMetadata=w,l.getHistorySyncMetrics=A,l.commitHistoryStartDownloadingMetric=O,l.commitHistoryDownloadedMetric=B,l.commitHistoryDataAppliedMetric=W,l.getHistorySyncProgress=U,l.maybeGetInlinePayload=H,l.getUnprocessedRecentSyncNotifications=G,l.getLidMappingAsStringSet=j,l.getLidsForLogging=K,l.reportMissingMapping=Q}),98); __d("WAWebCanonicalTokenRefreshJob",["WALogger","WATimeUtils","WAWebLocalStorage","WAWebProtobufsE2E.pb","WAWebSendNonMessageDataRequest","WAWebViewerContextAuthUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d="noncePeerRequestTimestamp",m=4;function p(){var e=Date.now();r("WAWebLocalStorage")==null||r("WAWebLocalStorage").setItem(d,String(e))}function _(){r("WAWebLocalStorage")==null||r("WAWebLocalStorage").removeItem(d)}function f(){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield C();if(t){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[vc-auth] Skipping nonce request, already waiting for response"])));return}p(),yield o("WAWebSendNonMessageDataRequest").sendPeerDataOperationRequest(o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_CANONICAL_USER_NONCE_FETCH,{})}),g.apply(this,arguments)}function h(){var e=r("WAWebLocalStorage")==null?void 0:r("WAWebLocalStorage").getItem(d);if(e==null)return null;var t=parseInt(e,10);return t==null?null:Date.now()-t}function y(){var e=h();if(e==null)return null;var t=o("WATimeUtils").HOUR_MILLISECONDS*m,n=t-e;return n<=0?null:Math.ceil(n/1e3)}function C(){var e=h();return e==null?!1:e=5){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] skip sync status logging as we've logged for more than 5 times"])));return}if(e>=60){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 60 minutes after pairing"]))),yield C(o("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_60),o("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(5);return}if(t<4&&e>=40){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 40 minutes after pairing"]))),yield C(o("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_40),o("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(4);return}if(t<3&&e>=20){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 20 minutes after pairing"]))),yield C(o("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_20),o("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(3);return}if(t<2&&e>=10){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 10 minutes after pairing"]))),yield C(o("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_10),o("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(2);return}if(t<1&&e>=5){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[history sync] log status for 5 minutes after pairing"]))),yield C(o("WAWebWamEnumActiveTimeAfterPairing").ACTIVE_TIME_AFTER_PAIRING.MINS_5),o("WAWebUserPrefsHistorySync").setHistorySyncStatusAfterPairingLoggingCount(1);return}o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[history sync] do not log status as no requirment meets"])))}),y.apply(this,arguments)}function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield v(e)}),b.apply(this,arguments)}function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n,a=yield o("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId(),i=new(o("WAWebMdBootstrapHistorySyncStatusAfterPairingWamEvent")).MdBootstrapHistorySyncStatusAfterPairingWamEvent({mdBootstrapHistoryPayloadType:o("WAWebWamEnumMdBootstrapHistoryPayloadType").MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.RECENT_HISTORY,mdSessionId:a,mdTimestamp:o("WATimeUtils").unixTimeMs(),activeTimeAfterPairing:e,isLoopRunning:r("WAWebSyncBootstrap").getIsHistorySyncRunning()}),l=yield o("WAWebUserPrefsHistorySync").getLastHistoryRecentSyncedChunk(),s=l!=null?l.chunkOrder:-1,u=l!=null?l.progress:-1;i.lastProcessedNotificationChunkOrder=s,i.lastProcessedNotificationChunkProgress=u;var c=(t=yield o("WAWebUserPrefsHistorySync").getHistorySyncTotalProcessedMessageCount())!=null?t:0;i.totalProcessedMessageCount=c;var d=yield o("WAWebUserPrefsHistorySync").getHistorySyncStatus();if((d==null?void 0:d.recentCompleted)===!0){i.mdHistorySyncStatusResult=o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.SUCCESS,i.commit();return}var m=yield o("WAWebHistorySyncNotificationUtils").getUnprocessedRecentSyncNotifications(),p=m.length;i.unprocessedNotificationCount=p;var _=p>0?(n=m[0].chunkOrder)!=null?n:0:-1;if(i.nextNotificationChunkOrder=_,o("WAWebApiHistorySyncNotification").inFlightChunk.size>0){i.mdHistorySyncStatusResult=o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.IN_PROGRESS,i.commit();return}var f=l?s+1:1,g=yield o("WAWebUserPrefsHistorySync").getRecentSyncSingleChunkStatus(),h=R(g,f);i.mdHistorySyncStatusResult=h,i.commit()}),S.apply(this,arguments)}function R(e,t){return e==null||e[t]==null?o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_RECEIVE:(function(e){return e===o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.RECEIVED?o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_STORE_CHUNK:e===o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.NOTIFICATION_STORED?o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_FETCH:e===o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADING?o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_DOWNLOAD:e===o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DOWNLOADED?o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.PROTOBUF_ERROR:e===o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.DECODED?o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_PREPROCESS:e===o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.MESSAGE_PREPROCESSED?o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_ENCRYPT:e===o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.ENCRYPTED?o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.FAIL_TO_STORE:o("WAWebWamEnumMdHistorySyncStatusResult").MD_HISTORY_SYNC_STATUS_RESULT.OTHER_ERROR})(e[t])}l.logHistorySyncStatusAfterPairingJob=g,l.logHistorySyncStatusAfterPairing=h,l.commitHistorySyncStatusData=C}),98); __d("WAWebSendServerErrorReceiptJob",["Promise","WABase64","WADeprecatedSendIq","WALogger","WAWap","WAWebChatGetters","WAWebCommsAckParser","WAWebCommsWapMd","WAWebCryptoMediaRetry","WAWebFrontendMsgGetters","WAWebMsgGetters","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var r=t.id.id;if(o("WAWebMsgGetters").getIsNewsletterMsg(t))return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Called RMR on newsletter media, which has null mediaKey"]))).tags("newsletter").sendLogs("newsletter-called-rmr"),(u||(u=n("Promise"))).resolve();if(t.mediaKey==null)return o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[media][rmr] Called RMR with null mediaKey"]))).tags("media","non-sad").sendLogs("rmr-called-with-null-media-key",{sampling:.01}),(u||(u=n("Promise"))).resolve();var a=o("WABase64").decodeB64(t.mediaKey),i=yield o("WAWebCryptoMediaRetry").encryptServerErrorReceipt(a,r),l=i.ciphertext,c=i.iv,d=o("WAWebFrontendMsgGetters").getChat(t),m=o("WAWap").CUSTOM_STRING(d.id.toString({legacy:!0})),p=o("WAWebChatGetters").getIsGroup(d)||o("WAWebChatGetters").getIsBroadcast(d)?o("WAWap").CUSTOM_STRING(o("WAWebMsgGetters").getSender(t).toString({legacy:!0})):o("WAWap").DROP_ATTR,_=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),f=o("WAWap").wap("receipt",{type:"server-error",to:o("WAWebCommsWapMd").USER_JID(_),id:o("WAWap").CUSTOM_STRING(r)},o("WAWap").wap("encrypt",null,o("WAWap").wap("enc_p",null,l),o("WAWap").wap("enc_iv",null,c)),o("WAWap").wap("rmr",{jid:m,from_me:o("WAWap").CUSTOM_STRING(String(o("WAWebMsgGetters").getIsSentByMe(t))),participant:p}));return o("WADeprecatedSendIq").deprecatedSendStanzaAndWaitForAck(f,o("WAWebCommsAckParser").toCoreAckTemplate({id:r,class:"receipt",type:"server-error",from:_,participant:null}))}),d.apply(this,arguments)}l.default=c}),98); __d("WAWebResendUserMsg",["WALogger","WATimeUtils","WAWebDBDeviceListFanout","WAWebMsgFanoutTypes","WAWebMsgUtilsBridge","WAWebSendMsgCommonApi","WAWebSendMsgToDeviceList","WAWebSyncDeviceAdvDeviceListJob","WAWebUserPrefsMeUser","WAWebWamEnumMessageSendResultType","asyncToGeneratorRuntime","cr:10198","lodash"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m;function p(e,t,n,r,o){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a,i,l){var p=t.data.to,_=t.data.id.id;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: "," to ",""])),_,p.toString()).tags("messaging");var f=o("WAWebSendMsgCommonApi").getResendTimeoutInSeconds();if(o("WATimeUtils").unixTime()-i>f){var g;o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": skip resending due to "," min timeout"])),_,f/60).tags("messaging"),(g=l.sendReporter)==null||g.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_EXPIRED,isTerminal:!1}),l.sendReporter=null;return}try{var h,y=p.isLid()&&(h=o("WAWebUserPrefsMeUser").getMaybeMeDeviceLid())!=null?h:o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow(),C=yield o("WAWebDBDeviceListFanout").getFanOutList({wids:[p,y]}),b=r("lodash").differenceBy(C,a,String);if(b.length===0){var v;o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": skip resending to the empty list"])),_).tags("messaging"),(v=l.sendReporter)==null||v.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_BACKFILL_USYNC_FAILED,isTerminal:!1}),l.sendReporter=null;return}if(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": resending to devices: ",""])),_,b.join(",")).tags("messaging"),t.data.isOverwrittenByRevoke===!0){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": skip resending because this message has been overwritten by a revoke"])),_).tags("messaging");return}var S=yield o("WAWebSendMsgToDeviceList").sendMsgToDeviceList(t,n,b,{fanoutType:o("WAWebMsgFanoutTypes").FANOUT_TYPE.CHAT,isResendingMsg:!0},l),R=S.phash;R!=null&&(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": got phash during the resend"])),_).tags("messaging"),o("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob([p,y],"message",R))}catch(e){var L;throw(L=l.sendReporter)==null||L.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!1}),l.sendReporter=null,e}yield o("WAWebMsgUtilsBridge").logMessageSendForChatThreadLogging(t.data)}),_.apply(this,arguments)}l.resendUserMsg=p}),98); __d("WAWebSendAppStateSyncMsgJob",["WADeprecatedSendIq","WALogger","WAWebCommsAckParser","WAWebE2EProtoGenerator","WAWebEventsWaitForOfflineDeliveryEnd","WAWebSendMsgCreateDeviceStanza","WAWebSendMsgTypes","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.msg,r=t.privacySensitive,a=t.pushPriority;yield o("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd(),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendKeyMsg: sending ",""])),n.id.toString()).tags("messaging");var i=n.to,l=o("WAWebE2EProtoGenerator").createPeerMsgProtobuf(n),s=yield o("WAWebSendMsgCreateDeviceStanza").createUserDeviceMsgStanza({type:o("WAWebSendMsgTypes").SendMessageRecordType.Message,data:n},l,{to:i,recipient:null,option:{type:o("WAWebSendMsgCreateDeviceStanza").MsgType.AppStateSync,pushPriority:a,privacySensitive:r}});return o("WADeprecatedSendIq").deprecatedSendStanzaAndWaitForAck(s,o("WAWebCommsAckParser").toCoreAckTemplate({id:n.id.id,class:"message",from:i,participant:null}))}),u.apply(this,arguments)}l.encryptAndSendKeyMsg=s}),98); __d("WAWebGroupMsgSendUtils",["WALogger","WAWebAddonGatingUtils","WAWebBotGroupGatingUtils","WAWebGroupType","WAWebGroupUtils","WAWebMsgGetters","WAWebSchemaGroupMetadata","WAWebSchemaParticipant","WAWebWamGroupMetricUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t,n){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r){var a=yield o("WAWebSchemaGroupMetadata").getGroupMetadataTable().get(t);a==null&&o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["_getGroupData: no group metadata record found for: ",""])),t);var i={groupId:t,amIAdmin:null,isCag:null,isLid:null,isLidAddressingMode:null,wamTypeOfGroup:null,participantCount:null,deviceCount:null,deviceSizeBucket:null,isCapiGroup:null,isOpenBotGroup:null},l=(a==null?void 0:a.isLidAddressingMode)===!0;if(a!=null){var s=o("WAWebGroupType").getGroupTypeFromGroupMetadata(a),u=s===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP;i.wamTypeOfGroup=o("WAWebGroupType").groupTypeToWamEnum(s),i.isLid=u&&(r==null?void 0:r.type)==="addon",i.isCag=u,i.isLidAddressingMode=l,i.isCapiGroup=a.hasCapi===!0,i.isOpenBotGroup=o("WAWebBotGroupGatingUtils").isOpenGroupBotSendEnabled()&&a.isOpenBotGroup===!0}if(n!=null){var c=o("WAWebGroupUtils").amIGroupAdmin(n.admins);i.amIAdmin=c,Object.assign(i,o("WAWebWamGroupMetricUtils").getGroupMetricsFromDbRecord(n))}return i}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebSchemaParticipant").getParticipantTable().get(e);return t==null&&o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["_getParticipantRecord: no participants record found for: ",""])),e),t}),m.apply(this,arguments)}function p(e,t){return t.isCag===!0?o("WAWebMsgGetters").getIsReaction(e)||o("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(e.type):!1}function _(e){var t=e.filter(function(e){return e.isLid()}),n=e.length-t.length;return t.length+" lid participants & "+n+" pn participants"}function f(e){var t=e.isLidAddressingMode===!0?"lid":"pn",n=e.isCag===!0?"cag":"nonCag";return"group type: "+t+", "+n}l.getGroupData=u,l.getParticipantRecord=d,l.isCagAddon=p,l.formatWidTypeCountsForLog=_,l.formatGroupTypeForLog=f}),98); __d("WAWebEncryptMsgProtobuf",["Promise","WALogger","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebE2eMessageSendWamEvent","WAWebGroupMsgSendUtils","WAWebMsgGetters","WAWebPostE2eMessageSendMetric","WAWebSendMsgCommonApi","WAWebSignal","WAWebSignalSessionApi","WAWebUserPrefsMeUser","WAWebWamAddressingModeUtils","WAWebWamEnumE2eDestination","WAWebWamEnumEditType","WAWebWamMsgUtils","asyncToGeneratorRuntime","err","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e,t,n,r,o){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a,i,l,s){s===void 0&&(s=o("WAWebWamEnumEditType").EDIT_TYPE.NOT_EDITED);try{var c=yield o("WAWebSignal").Cipher.encryptSignalProto(t,o("WAWebSendMsgCommonApi").encodeAndPad(i)),d=c.ciphertext,m=c.type;return o("WAWebPostE2eMessageSendMetric").postSuccessDirectE2eMessageSendMetric({to:t,retryCount:a,type:m,msg:l,editType:s}),{type:m,ciphertext:d}}catch(i){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["encryptMsgProtobuf: encryption fail for ",", ",""])),t.toString(),r("getErrorSafe")(i)).tags("messaging"),o("WAWebSignalSessionApi").maybeDeleteUnconvertedSession(t),o("WAWebPostE2eMessageSendMetric").postFailureDirectE2eMessageSendMetric({to:t,retryCount:a,msg:l,editType:s}),(u||(u=n("Promise"))).reject(r("err")("[messaging] encryptMsgProtobuf: encryption fail for "+t.toString()+", "+r("getErrorSafe")(i).message))}}),d.apply(this,arguments)}function m(e,t,n,r){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i){var l,c,d=new(o("WAWebE2eMessageSendWamEvent")).E2eMessageSendWamEvent({e2eSuccessful:!0,e2eCiphertextType:o("WAWebBackendJobsCommon").getMetricE2eCiphertextType(o("WAWebBackendJobs.flow").CiphertextType.Skmsg),e2eCiphertextVersion:o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION,e2eDestination:o("WAWebWamEnumE2eDestination").E2E_DESTINATION.GROUP,messageMediaType:o("WAWebWamMsgUtils").getWamMediaType(e),retryCount:0,isLid:!!i.isLid||((l=e.author)==null?void 0:l.isLid()),typeOfGroup:(c=i.wamTypeOfGroup)!=null?c:void 0,editType:o("WAWebMsgGetters").getWamEditType(e),localAddressingMode:o("WAWebWamAddressingModeUtils").getAddressingModeMetricsFromGroupMetadata(i)}),m=o("WAWebWamMsgUtils").getWamAgentEngagementType(e);m!=null&&(d.agentEngagementType=m);var p=o("WAWebUserPrefsMeUser").getMeDeviceLidOrThrow(),_=o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow(),f=o("WAWebGroupMsgSendUtils").isCagAddon(e,i)||i.isLidAddressingMode===!0?p:_;try{return babelHelpers.extends({},yield o("WAWebSignal").Cipher.encryptSenderKeyMsgSignalProto(t,f,a))}catch(e){return d.e2eSuccessful=!1,d.weight=1,o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["encryptMsgSenderKey: encryption fail for ",", ",""])),t.toString(),r("getErrorSafe")(e)).tags("messaging"),(u||(u=n("Promise"))).reject(r("err")("[messaging] encryptMsgSenderKey: encryption fail for "+t.toString()+", "+r("getErrorSafe")(e).message))}finally{d.commit()}}),p.apply(this,arguments)}l.encryptMsgProtobuf=c,l.encryptMsgSenderKey=m}),98); __d("WAWebSendMsgMetaNode",["WAWap","WAWebCommonMsgSubtypeTypes","WAWebCommsWapMd","WAWebE2EProtoUtils","WAWebHandleMsgCommon","WAWebMsgType","WAWebPollsGatingUtils","WAWebProtobufsE2E.pb","WAWebUsernameTypes","WAWebVerifyProtobufMsgObjectKeys"],(function(t,n,r,o,a,i,l){function e(e,t){var n=t==null?void 0:t.origin;return e.isLid()&&n!=null&&n===o("WAWebUsernameTypes").LidOriginType.PNH_CTWA?n:null}function s(t,n,r,a,i){var l,s,_=(l=o("WAWebVerifyProtobufMsgObjectKeys").getUnwrappedProtobufMessage(r))!=null?l:r,f=u(_),g=c(_),h=m(i),y;n.type==="addon"&&(y=o("WAWebE2EProtoUtils").extractCommentTargetIdAndSenderLid(n.data));var C=e(t,i),b=d(n,i),v=p(n),S=((s=n.data.mediaData)==null?void 0:s.isViewOnce)===!0,R=f!=null||g!=null||y!=null||C!=null||(i==null?void 0:i.appendHostedSenderIntent)===!0||b!=null||S||h!=null||v!=null;if(R){var L,E;return o("WAWap").wap("meta",{origin:C!=null?o("WAWap").CUSTOM_STRING(C):o("WAWap").DROP_ATTR,sender_intent:(i==null?void 0:i.appendHostedSenderIntent)===!0?"hosted":o("WAWap").DROP_ATTR,polltype:f!=null?f:o("WAWap").DROP_ATTR,event_type:g!=null?g:o("WAWap").DROP_ATTR,thread_msg_id:((L=y)==null?void 0:L.threadMsgId)!=null?o("WAWap").CUSTOM_STRING(y.threadMsgId):o("WAWap").DROP_ATTR,thread_msg_sender_jid:(E=y)!=null&&E.threadMsgSenderLid?o("WAWebCommsWapMd").USER_JID(y.threadMsgSenderLid):o("WAWap").DROP_ATTR,appdata:b!=null?o("WAWap").CUSTOM_STRING(b):o("WAWap").DROP_ATTR,view_once:S?"true":o("WAWap").DROP_ATTR,conversation_thread_id:h!=null?o("WAWap").CUSTOM_STRING(h):o("WAWap").DROP_ATTR,tag_reason:v!=null?o("WAWap").CUSTOM_STRING(v):o("WAWap").DROP_ATTR})}}function u(e){var t;return e.pollCreationMessage!=null||e.pollCreationMessageV2!=null||e.pollCreationMessageV3!=null?o("WAWebHandleMsgCommon").POLL_TYPES.creation:((t=e.pollUpdateMessage)==null?void 0:t.vote)!=null?o("WAWebHandleMsgCommon").POLL_TYPES.vote:(e.pollResultSnapshotMessage!=null||e.pollResultSnapshotMessageV3!=null)&&o("WAWebPollsGatingUtils").isPollResultSnapshotPollTypeEnvelopeEnabled()?o("WAWebHandleMsgCommon").POLL_TYPES.result_snapshot:null}function c(e){var t;return e.eventMessage!=null?o("WAWebHandleMsgCommon").EVENT_TYPES.creation:e.encEventResponseMessage!=null?o("WAWebHandleMsgCommon").EVENT_TYPES.response:((t=e.secretEncryptedMessage)==null?void 0:t.secretEncType)===o("WAWebProtobufsE2E.pb").Message$SecretEncryptedMessage$SecretEncType.EVENT_EDIT?o("WAWebHandleMsgCommon").EVENT_TYPES.edit:null}function d(e,t){var n=e.data.type===o("WAWebMsgType").MSG_TYPE.PROTOCOL&&e.data.subtype==="member_label";if(n)return"member_tag";var r=e.data.type===o("WAWebMsgType").MSG_TYPE.PROTOCOL&&e.data.subtype===o("WAWebCommonMsgSubtypeTypes").MsgSubtype.EphemeralSyncResponse,a=(t==null?void 0:t.isCategoryPeerMessage)===!0;return r||a?"default":e.data.type===o("WAWebMsgType").MSG_TYPE.MESSAGE_HISTORY_NOTICE?"group_history":null}function m(e){var t=e!=null?e:{},n=t.hashedAiThreadId;return n!=null?n:null}function p(e){var t,n=e.data.type===o("WAWebMsgType").MSG_TYPE.PROTOCOL&&e.data.subtype==="member_label";if(!n)return null;var r=(t=e.data.memberLabelData)==null?void 0:t.label;return r===""||r==null?"user_delete":"user_update"}l.getOriginAttribute=e,l.genMetaNode=s}),98); __d("WAWebSendMsgCreateDeviceStanza",["invariant","$InternalEnum","Promise","WALogger","WAWap","WAWebAdvSignatureApi","WAWebApiContact","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebBizCoexGatingUtils","WAWebBotGroupGatingUtils","WAWebCommsWapMd","WAWebDeviceSentMessageProtoUtils","WAWebE2EProtoGenerator","WAWebE2EProtoUtils","WAWebEncryptMsgProtobuf","WAWebGroupMsgSendUtils","WAWebHandleMsgCommon","WAWebICDCMetaApi","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebManageE2ESessionsJob","WAWebMsgType","WAWebReportingTokenUtils","WAWebSendMsgCommonApi","WAWebSendMsgMetaNode","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","WAWebUsernameGatingUtils","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l,s){var e,u,c=n("$InternalEnum").Mirrored(["Retry","AppStateSync"]),d=n("$InternalEnum")({OnDemand:1});function m(e,t,n,r){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){var a=n.option,i=n.recipient,l=n.to,u=t;return yield o("WAWebManageE2ESessionsJob").ensureE2ESessions([l]),o("WAWebUserPrefsMeUser").isMeAccount(l)&&a.type!==c.AppStateSync?(i!=null||s(0,56363),u=o("WAWebDeviceSentMessageProtoUtils").wrapDeviceSentMessage(t,i),yield o("WAWebICDCMetaApi").populateICDCMeta(o("WAWebWidFactory").asUserWidOrThrow(i),u)):yield o("WAWebICDCMetaApi").populateICDCMeta(o("WAWebWidFactory").asUserWidOrThrow(l),u),g(e,u,babelHelpers.extends({type:"user"},n),r)}),p.apply(this,arguments)}function _(e,t,n){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a){var i=a.option,l=a.participant,s=a.to;if(yield o("WAWebManageE2ESessionsJob").ensureE2ESessions([l]),i.type===c.AppStateSync)return(u||(u=n("Promise"))).reject(r("err")("[messaging] createGroupDeviceMsgStanza: not expect for App State Sync message"));var d=e.data.id.remote;if(!d.isGroup())return(u||(u=n("Promise"))).reject(r("err")("[messaging] createGroupDeviceMsgStanza: function called for non group WID"));var m=yield o("WAWebGroupMsgSendUtils").getParticipantRecord(d.toString()),p=yield o("WAWebGroupMsgSendUtils").getGroupData(d.toString(),m,e),_=o("WAWebUserPrefsMeUser").isMeAccount(l)?o("WAWebDeviceSentMessageProtoUtils").wrapDeviceSentMessage(t,s):t;return yield o("WAWebICDCMetaApi").populateICDCMeta(o("WAWebWidFactory").asUserWidOrThrow(l),_),g(e,_,babelHelpers.extends({type:"group",groupData:p},a))}),f.apply(this,arguments)}function g(e,t,n,r){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r,a){var i,l,u,d=t.data,m=r.botMessageSecret,p=r.isLidBot,_=r.option,f=r.to,g,h;r.type==="user"?g=r.recipient:h=r.participant;var y=h||f,C=(i=_.retryCount)!=null?i:0,b=o("WAWebBackendJobsCommon").mediaTypeFromProtobuf(n),v=d.id,S=o("WAWebBackendJobsCommon").getMetricEditTypeFromMsg(n,d),R=!1;if(o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&C>0){var L;((L=t.data)==null?void 0:L.senderOrRecipientAccountTypeHosted)===!0&&(R=!0)}var E=f.isBot()&&g!=null&&!g.isBot(),k=!!((l=h)!=null&&l.isBot()||E),I=!1;if((u=h)!=null&&u.isBot()&&o("WAWebBotGroupGatingUtils").isOpenGroupBotSendEnabled()){var T=t.data.id.remote,D=yield o("WAWebGroupMsgSendUtils").getGroupData(T.toString(),void 0);I=D.isOpenBotGroup===!0}var x=yield o("WAWebEncryptMsgProtobuf").encryptMsgProtobuf(y,C,k&&m?o("WAWebE2EProtoGenerator").updateBotInvokeMsgProtoCopyForCapi(n,m,I):n,d,S),$=x.ciphertext,P=x.type,N=null;if(P===o("WAWebBackendJobs.flow").CiphertextType.Pkmsg){var M=yield o("WAWebAdvSignatureApi").getADVEncodedIdentity();N=o("WAWap").wap("device-identity",null,M)}_.type!==c.Retry&&(yield o("WAWebSendMsgCommonApi").updateIdentityRange(t,[y])),yield o("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();var w;_.pushPriority!=null?w=o("WAWap").CUSTOM_STRING(_.pushPriority):w=_.type===c.AppStateSync?"high":o("WAWap").DROP_ATTR;var A=null;r.type==="group"&&(A=r.groupData.isLidAddressingMode===!0?o("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid:o("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.pn);var F=o("WAWebSendMsgMetaNode").genMetaNode(f,t,n,r.type==="group"?r.groupData:void 0,{appendHostedSenderIntent:R,isCategoryPeerMessage:_.type===c.AppStateSync,origin:a}),O=g&&E?g:f,B=o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(P),count:C===0?o("WAWap").DROP_ATTR:o("WAWap").INT(C),mediatype:o("WAWebBackendJobsCommon").encodeMaybeMediaType(b),"decrypt-fail":o("WAWebBackendJobsCommon").encodeMaybeDecryptFail(o("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(n))},$);if(k){var W=f.isBot()?f:h;W!=null&&W.isBot()||s(0,75934),B=o("WAWap").wap("bot",{is_lid:p===!0?"true":o("WAWap").DROP_ATTR},o("WAWap").wap("to",{jid:o("WAWebCommsWapMd").DEVICE_JID(W)},B))}var q=!o("WAWebUserPrefsMeUser").isMeAccount(f)&&t.data.kind!==o("WAWebMsgType").MsgKind.PeerMessage?yield o("WAWebReportingTokenUtils").genReportingTokenBody(t.data,n):null,U=o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated(),V,H,G;if(U&&o("WAWebUserPrefsMeUser").isMeAccount(O)&&g!=null&&g.isRegularUser())if(g.isLid()){if(V=o("WAWebApiContact").getPhoneNumber(g),o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()){var z=yield o("WAWebApiContact").getContactRecord(g);(z==null?void 0:z.username)!=null&&(G=z.username)}}else{var j;H=(j=r.peerRecipientLid)!=null?j:o("WAWebLidMigrationUtils").toLid(g),H!=null&&!H.isLid()&&o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["createDeviceMsgStanza: peerRecipientLid is not a LID: ",""])),H.toLogString()).sendLogs("peer-recipient-lid-not-lid-device")}return o("WAWap").wap("message",{id:o("WAWap").CUSTOM_STRING(v.id),to:o("WAWebCommsWapMd").JID(O),participant:h&&!k?o("WAWebCommsWapMd").DEVICE_JID(h):o("WAWap").DROP_ATTR,recipient:g&&!k?o("WAWebCommsWapMd").USER_JID(g):o("WAWap").DROP_ATTR,type:o("WAWebE2EProtoUtils").typeAttributeFromProtobuf(n),peer_recipient_pn:V?o("WAWebCommsWapMd").USER_JID(V):o("WAWap").DROP_ATTR,peer_recipient_lid:H?o("WAWebCommsWapMd").USER_JID(H):o("WAWap").DROP_ATTR,peer_recipient_username:G!==void 0?o("WAWap").CUSTOM_STRING(G):o("WAWap").DROP_ATTR,edit:o("WAWebSendMsgCommonApi").editAttribute(n,d.subtype),category:_.type===c.AppStateSync?"peer":o("WAWap").DROP_ATTR,push_priority:w,privacy_sensitive:_.privacySensitive!=null?o("WAWap").CUSTOM_STRING(_.privacySensitive.valueOf().toString()):o("WAWap").DROP_ATTR,addressing_mode:A!=null?o("WAWap").CUSTOM_STRING(A):o("WAWap").DROP_ATTR},B,N,F,q)}),h.apply(this,arguments)}l.MsgType=c,l.PrivacySensitiveType=d,l.createUserDeviceMsgStanza=m,l.createGroupDeviceMsgStanza=_}),98); __d("WAWebWamEnumPrekeysFetchContext",[],(function(t,n,r,o,a,i){var e=Object.freeze({SEND_MESSAGE:1,GET_VNAME_CERTIFICATE:2,SEND_LIVE_LOCATION_RETRY:3,SEND_LIVE_LOCATION_KEY:4,SEND_PEER_MESSAGE:5,MULTI_DEVICE_CALL:6,CALL_PEER_E2E_FAIL:7,IDENTITY_CHANGE_NOTIFICATION:8,BACK_OFF:9,USER_INTENT_PREFETCH:10,RESEND_MESSAGE:11,RETRY_MESSAGE:12,USER_INTENT_STATUS_PREFETCH:13});i.PREKEYS_FETCH_CONTEXT=e}),66); __d("WAWebPrekeysDepletionWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMessageType","WAWebWamEnumPrekeysFetchContext","WAWebWamEnumSizeBucket"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({PrekeysDepletion:[3014,{deviceSizeBucket:[3,o("WAWebWamEnumSizeBucket").SIZE_BUCKET],messageType:[2,o("WAWebWamEnumMessageType").MESSAGE_TYPE],prekeysFetchReason:[1,o("WAWebWamEnumPrekeysFetchContext").PREKEYS_FETCH_CONTEXT]},[1,20,20],"regular"]},{PrekeysDepletion:[]});l.PrekeysDepletionWamEvent=e}),98); __d("WAWebPostPrekeysDepletionMetric",["WAWebPrekeysDepletionWamEvent"],(function(t,n,r,o,a,i,l){function e(e){var t=e.count,n=e.deviceSizeBucket,r=e.messageType,a=e.prekeysFetchReason;if(!(t==null||t===0)){var i={};a!=null&&(i.prekeysFetchReason=a),r!=null&&(i.messageType=r),n!=null&&(i.deviceSizeBucket=n),self.setTimeout(function(){for(var e=0;eo("WATimeUtils").WEEK_MILLISECONDS}function c(t){try{Object.keys(t).forEach(function(e){u(t[e])&&delete t[e]}),r("WAWebUserPrefsStore").setUser(o("WAWebUserPrefsKeys").KEYS.EXTERNAL_ENTRY_POINT,t)}catch(t){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[external_ctx] failed to persist entry points"])))}}function d(){try{var e=r("WAWebUserPrefsStore").getUser(o("WAWebUserPrefsKeys").KEYS.EXTERNAL_ENTRY_POINT);return e==null?{}:e}catch(e){return o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[external_ctx] failed to load entry points"]))),{}}}function m(e,t,n,r){var o=d(),a=Date.now();o[e.toString()]={addedTime:a,deepLinkType:t,authSuccess:n,partnerName:r!=null?r:null},c(o)}function p(e){var t=d(),n=t[e.toString()];n!=null&&(delete t[e.toString()],c(t))}function _(e){var t=d(),n=t[e.toString()];return n==null||u(n)?null:n}l.saveExternalEntryPoint=m,l.deleteExternalEntryPoint=p,l.getExternalEntryPoint=_}),98); __d("WAWebSendMsgCtwaAttributionNode",["WASmaxOutMessagePublishCtwaAttributionMixin","WAWebExternalCtxConfig","WAWebExternalEntryPointPrefs","WAWebMsgType"],(function(t,n,r,o,a,i,l){function e(e){for(var t=e.getAllCMCs(),n=0,r=0;r1))return!0}return!1}function s(t,n){var r=o("WAWebExternalCtxConfig").getFirstMessageLoggingOption();return r==="NEW_CHATS_OR_EXISTING_CHATS_WITH_PARTNER_LINKS"?n!=null||!e(t):r==="ALL_CHATS"?!0:r==="NEW_CHATS_ONLY"?!e(t):(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+r)})()}function u(e){if(e==null||!o("WAWebExternalCtxConfig").isCtxLoggingEnabled())return null;var t=o("WAWebExternalEntryPointPrefs").getExternalEntryPoint(e.id);if(t==null||!s(e,t.partnerName))return null;var n={lt:"WEB_"+t.deepLinkType};t.authSuccess||(n.s=0),t.partnerName!=null&&(n.p=t.partnerName);var r=new TextEncoder().encode(JSON.stringify(n));return o("WASmaxOutMessagePublishCtwaAttributionMixin").makeCtwaAttributionCtwaAttribution({ctwaAttributionElementValue:r})}l.getCtwaAttributionNode=u}),98); __d("WAWebSendMsgCreateFanoutStanza",["Promise","WALogger","WAWap","WAWebABProps","WAWebAdvSignatureApi","WAWebApiContact","WAWebApiMessageInfoStore","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebBotGating","WAWebBotTypes","WAWebBotUtils","WAWebChatCollection","WAWebChatThreadLogging","WAWebCommsAckParser","WAWebCommsWapMd","WAWebContactCollection","WAWebDeviceSentMessageProtoUtils","WAWebE2EProtoGenerator","WAWebE2EProtoUtils","WAWebEncryptMsgProtobuf","WAWebHandleMsgCommon","WAWebICDCMetaApi","WAWebLid1X1MigrationGating","WAWebManageE2ESessionsJob","WAWebMsgFanoutTypes","WAWebMsgGetters","WAWebMsgRcatUtils","WAWebPostPrekeysDepletionMetric","WAWebReportingTokenUtils","WAWebSendMsgCommonApi","WAWebSendMsgCtwaAttributionNode","WAWebSendMsgMetaNode","WAWebSignalProtocolStore","WAWebSimpleSignalPNToFBIDMigration","WAWebThreadMsgUtils","WAWebTrustedContactsUtils","WAWebUserPrefsMeUser","WAWebUsernameGatingUtils","WAWebUsernameTypes","WAWebWamEnumMessageType","WAWebWamEnumPrekeysFetchContext","WAWebWamNumberToSizeBucket","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p;function _(e,t,n,r,o,a,i){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a,i,l,u,c,d){var m,_,f=o("WAWebBackendJobsCommon").mediaTypeFromProtobuf(l),g=o("WAWebBackendJobsCommon").nativeFlowNameTypeFromProtobuf(l),h=o("WAWebBotGating").isBotEnabled()&&((m=t.invokedBotWid)==null?void 0:m.isBot())===!0,y=o("WAWebBotGating").isBotEnabled()&&o("WAWebMsgGetters").getIsBotFeedbackMessage(t),C=y&&!!(t.bizBotType&&((_=t.protocolMessageKey)!=null&&_.remote.equals(a))),b=y&&a.isBot()||C,v=y&&!a.isBot()&&!C,S=o("WAWebMsgGetters").getIsRevokeForMsgFromOrDeliveredToBot(t),R=o("WAWebSimpleSignalPNToFBIDMigration").getFbidBotPersonaType(a);if(u.fanoutType===o("WAWebMsgFanoutTypes").FANOUT_TYPE.CHAT&&i.length===1&&o("WAWebSendMsgCommonApi").isPrimaryDevice(i[0])&&!v&&!o("WAWebBotUtils").isMetaAiBot(a)){var L=i[0],E=o("WAWebUserPrefsMeUser").isMeAccount(L)?o("WAWebDeviceSentMessageProtoUtils").wrapDeviceSentMessage(l,a):l,k=E;L.isBot()&&b&&(k=o("WAWebE2EProtoGenerator").updateBotInvokeMsgProtoCopyForCapi(E));var I=yield o("WAWebEncryptMsgProtobuf").encryptMsgProtobuf(L,0,k,t,d),T=I.ciphertext,D=I.type,x=null;return(b||R!=null)&&(x=o("WAWap").wap("bot",{type:b?"feedback":o("WAWap").DROP_ATTR,persona_type:R?o("WAWap").CUSTOM_STRING(R):o("WAWap").DROP_ATTR})),{shouldHaveIdentity:D===o("WAWebBackendJobs.flow").CiphertextType.Pkmsg,body:o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(D),mediatype:o("WAWebBackendJobsCommon").encodeMaybeMediaType(f),"decrypt-fail":o("WAWebBackendJobsCommon").encodeMaybeDecryptFail(o("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(l)),native_flow_name:o("WAWebBackendJobsCommon").encodeMaybeNativeFlowName(g)},T),botBody:x}}var $=!1,P=i.map((function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n){var r=o("WAWebUserPrefsMeUser").isMeAccount(n)?o("WAWebDeviceSentMessageProtoUtils").wrapDeviceSentMessage(l,a):l,i=u.fanoutType===o("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT?o("WAWebWidFactory").asUserWidOrThrow(n):o("WAWebWidFactory").asUserWidOrThrow(a);yield o("WAWebICDCMetaApi").populateICDCMeta(i,r);var m=c==null?void 0:c.get(o("WAWebWidToJid").widToUserJid(i)),p=m!=null?o("WAWap").wap("content_binding",null,m):null;try{var _=r,y=n.isBot()&&(h||v||S);y&&(_=o("WAWebE2EProtoGenerator").updateBotInvokeMsgProtoCopyForCapi(r,t.botMessageSecret)),n.isFbidBot()&&(_=o("WAWebE2EProtoGenerator").updateFbidBotProtobuf(_)),n.isBot()&&(_=o("WAWebE2EProtoGenerator").updateBotProtobuf(_));var C=yield o("WAWebEncryptMsgProtobuf").encryptMsgProtobuf(n,0,_,t,d),b=C.ciphertext,R=C.type;return R===o("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&($=!0),{shouldFanoutToBot:y,node:o("WAWap").wap("to",{jid:o("WAWebCommsWapMd").DEVICE_JID(n)},o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(R),mediatype:o("WAWebBackendJobsCommon").encodeMaybeMediaType(f),"decrypt-fail":o("WAWebBackendJobsCommon").encodeMaybeDecryptFail(o("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(l)),native_flow_name:o("WAWebBackendJobsCommon").encodeMaybeNativeFlowName(g)},b),p)}}catch(t){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendUserMsg: encryption fail for ",": ",""])),String(n),t),o("WAWebSendMsgCommonApi").isPrimaryDevice(n)&&o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendUserMsg: encryption fail for primary device: ",""])),t).tags("messaging").sendLogs("encryption-fail-for-primary-device"),null}});return function(e){return r.apply(this,arguments)}})()),N=yield(p||(p=n("Promise"))).all(P),M=[],w=[];return N.forEach(function(e){(e==null?void 0:e.node)!=null&&(e!=null&&e.shouldFanoutToBot?w.push(e.node):M.push(e.node))}),M.length>0||w.length>0?{body:M.length>0?o("WAWap").wap("participants",null,M):null,botBody:w.length>0||b?o("WAWap").wap("bot",{type:y?"feedback":o("WAWap").DROP_ATTR},w):null,shouldHaveIdentity:$}:p.reject(r("err")("[messaging] encryptAndSendUserMsg: encryption fail for all devices"))}),f.apply(this,arguments)}function g(e,t,n,r,o,a){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a,i,l){var s,p,f,g=e.data,h=g.from,b=g.id,v=g.subtype,S=g.to;try{var R,L;(R=i.sendPerfReporter)==null||R.startPrekeysFetchStage();var E=yield o("WAWebManageE2ESessionsJob").ensureE2ESessions(n),k=E==null?void 0:E.missedPrekeyCount;if(k!=null){var I;(I=i.sendPerfReporter)==null||I.setFetchedPrekeyCount(k)}(L=i.sendPerfReporter)==null||L.postPrekeysFetchStage(),o("WAWebPostPrekeysDepletionMetric").maybePostPrekeysDepletionMetric({count:E==null?void 0:E.depletedPrekeyCount,prekeysFetchReason:o("WAWebWamEnumPrekeysFetchContext").PREKEYS_FETCH_CONTEXT.SEND_MESSAGE,messageType:a.fanoutType===o("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT?o("WAWebWamEnumMessageType").MESSAGE_TYPE.GROUP:o("WAWebWamEnumMessageType").MESSAGE_TYPE.INDIVIDUAL,deviceSizeBucket:a.fanoutType===o("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT?r("WAWebWamNumberToSizeBucket")(n.length):null})}catch(e){o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["ensureE2ESessions with error"]))).tags("messaging")}var T=o("WAWebMsgGetters").getIsBotFeedbackMessage(g)&&!!(g.bizBotType&&((s=g.protocolMessageKey)!=null&&s.remote.equals(S))),D=o("WAWebBotGating").isBotEnabled()&&o("WAWebMsgGetters").getIsBotFeedbackMessage(g)&&S.isBot()||T,x=o("WAWebThreadMsgUtils").getMsgAiThread(g),$=x!=null?yield o("WAWebChatThreadLogging").getThreadIDHMAC(x):null,P=n;a.isResendingMsg&&(P=yield o("WAWebSendMsgCommonApi").filterDeviceWithChangedIdentity(e,n));var N=P.map(function(e){return{msgKey:b,receiverId:e}});yield o("WAWebApiMessageInfoStore").createOrMergeReceiptRecords(N),(p=i.sendPerfReporter)==null||p.startClientEncryptStage();var M=yield o("WAWebMsgRcatUtils").genContentBindingForMsg(g,y(h,P)),w=o("WAWebMsgGetters").getWamEditType(g),A=yield _(g,S,P,t,a,M,w);(f=i.sendPerfReporter)==null||f.postClientEncryptStage();var F=null;if(a.fanoutType===o("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT){var O=o("WAWebBackendJobsCommon").mediaTypeFromProtobuf(t);F=o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobs.flow").CiphertextType.Skmsg),mediatype:o("WAWebBackendJobsCommon").encodeMaybeMediaType(O)})}var B=null;if(A.shouldHaveIdentity){var W=yield o("WAWebAdvSignatureApi").getADVEncodedIdentity();B=o("WAWap").wap("device-identity",null,W)}var q=o("WAWebE2EProtoUtils").getBizNativeFlowName(t),U=g.nativeFlowInteractiveMsg,V,H=o("WAWebContactCollection").ContactCollection.get(S),G=o("WAWebChatCollection").ChatCollection.get(S),z=H==null?void 0:H.privacyMode;if(z!=null){var j;V=(j=o("WAWap")).wap("biz",{host_storage:j.INT(z.hostStorage),actual_actors:j.INT(z.actualActors),privacy_mode_ts:j.INT(z.privacyModeTs),native_flow_name:j.MAYBE_CUSTOM_STRING(q)})}var K,Q,X,Y,J=o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();if(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["createFanoutMsgStanza: create fanout for a message. found chat: ",". found contact: ",".\n is lid: ",". lid origin: ",". isLidMigrated: ","\n contact has phone number: ",""])),G!=null,H!=null,S.isLid(),G==null?void 0:G.lidOriginType,J,(H==null?void 0:H.phoneNumber)!=null),S.isLid()?(((G==null?void 0:G.lidOriginType)==null||(G==null?void 0:G.lidOriginType)===o("WAWebUsernameTypes").LidOriginType.PNH_CTWA)&&(H==null?void 0:H.shareOwnPn)!==!0&&(H==null?void 0:H.phoneNumber)!=null&&(K=H==null?void 0:H.phoneNumber),o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&(H==null?void 0:H.username)!=null&&(Y=H.username),J&&(G==null?void 0:G.lidOriginType)!==o("WAWebUsernameTypes").LidOriginType.PNH_CTWA&&(X=o("WAWebApiContact").getPhoneNumber(S))):S.isUser()&&G!=null&&G.accountLid&&(Q=G==null?void 0:G.accountLid,Q.isLid()||o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["createFanoutMsgStanza: peerRecipientLid is not a LID: ",""])),Q.toLogString()).sendLogs("peer-recipient-lid-not-lid-fanout")),V==null&&q!=null&&U===!0){var j;V=(j=o("WAWap")).wap("biz",null,j.wap("interactive",{v:"1",type:j.CUSTOM_STRING("native_flow")},j.wap("native_flow",{name:j.CUSTOM_STRING(q)})))}else V==null&&q!=null&&(V=o("WAWap").wap("biz",{native_flow_name:o("WAWap").CUSTOM_STRING(q)}));a.isResendingMsg||(yield o("WAWebSendMsgCommonApi").updateIdentityRange(e,P)),yield o("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();var Z=o("WAWebSendMsgMetaNode").genMetaNode(S,e,t,l,{origin:G==null?void 0:G.lidOriginType,hashedAiThreadId:$}),ee=M==null?void 0:M.get(o("WAWebWidToJid").widToUserJid(o("WAWebWidFactory").asUserWidOrThrow(h))),te=ee!=null?o("WAWap").wap("sender_content_binding",null,ee):null,ne;if(g.subtype==="bot_request_welcome")ne="request_welcome";else if(g.botMsgBodyType!=null)e:{if(g.botMsgBodyType===o("WAWebBotTypes").BotMsgBodyType.PROMPT){ne="prompt";break e}if(g.botMsgBodyType===o("WAWebBotTypes").BotMsgBodyType.COMMAND){ne="command";break e}if(g.botMsgBodyType===o("WAWebBotTypes").BotMsgBodyType.VOICE){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[bot] outgoing voice message is not supported"])));break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+g.botMsgBodyType)}var re;if(g.bizBotType&&!T)switch(g.bizBotType){case o("WAWebBotTypes").BizBotType.BIZ_1P:re="1p_partial";break;case o("WAWebBotTypes").BizBotType.BIZ_3P:re="3p_full";break}var oe;(ne!=null||re!=null||x!=null)&&(oe=o("WAWap").wap("bot",{type:ne!=null?o("WAWap").CUSTOM_STRING(ne):o("WAWap").DROP_ATTR,local_automated_type:re!=null?o("WAWap").CUSTOM_STRING(re):o("WAWap").DROP_ATTR,client_thread_id:x!=null?o("WAWap").CUSTOM_STRING(x.key.id):o("WAWap").DROP_ATTR}));var ae=yield o("WAWebReportingTokenUtils").genReportingTokenBody(g,t),ie=yield C(G),le;l!=null&&(le=(l==null?void 0:l.isLidAddressingMode)===!0?o("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid:o("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.pn);var se=o("WAWebSendMsgCtwaAttributionNode").getCtwaAttributionNode(G),ue=o("WAWap").wap("message",{id:o("WAWap").CUSTOM_STRING(b.id),to:o("WAWebCommsWapMd").CHAT_JID(S),type:o("WAWebE2EProtoUtils").typeAttributeFromProtobuf(t),peer_recipient_lid:Q?o("WAWebCommsWapMd").USER_JID(Q):o("WAWap").DROP_ATTR,peer_recipient_pn:X?o("WAWebCommsWapMd").USER_JID(X):o("WAWap").DROP_ATTR,peer_recipient_username:Y!==void 0?o("WAWap").CUSTOM_STRING(Y):o("WAWap").DROP_ATTR,edit:o("WAWebSendMsgCommonApi").editAttribute(t,v),device_fanout:a.isResendingMsg===!0||D?"false":o("WAWap").DROP_ATTR,recipient_pn:K?o("WAWebCommsWapMd").USER_JID(K):o("WAWap").DROP_ATTR,addressing_mode:le!=null?o("WAWap").CUSTOM_STRING(le):o("WAWap").DROP_ATTR},A.body,A.botBody,F,B,V,Z,te,oe,ae,ie,se),ce=o("WAWebCommsAckParser").toCoreAckTemplate({id:b.id,class:"message",from:g.to,participant:null});return{stanza:ue,ackTemplate:ce}}),h.apply(this,arguments)}function y(e,t){var n=new Map;n.set(e.user,o("WAWebWidFactory").asUserWidOrThrow(e));for(var r of t)n.has(r.user)||n.set(r.user,o("WAWebWidFactory").asUserWidOrThrow(r));return Array.from(n.values())}function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!o("WAWebABProps").getABPropConfigValue("privacy_token_sending_on_all_1_on_1_messages")||e==null)return null;var t=e.tcToken,n=e.tcTokenTimestamp;return t==null||n==null||o("WAWebTrustedContactsUtils").isTokenExpired(n,o("WAWebTrustedContactsUtils").TcTokenMode.Receiver)?null:o("WAWap").wap("tctoken",null,t)}),b.apply(this,arguments)}l.createFanoutMsgStanza=g}),98); __d("WAWebSendMsgJob",["Promise","WALogger","WAWebABPropsSaga","WAWebE2EProtoGenerator","WAWebEventsWaitForOfflineDeliveryEnd","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebOutgoingMessage","WAWebSendGroupKeyDistributionMsgJob","WAWebSendGroupMsgJob","WAWebSendTcTokenChatAction","WAWebSendUserMsgJob","WAWebSimpleSignalPNToFBIDMigration","WAWebWamEnumMediaType","WAWebWamEnumMessageType","WAWebWid","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a){var i=t.data,l=i.id,u=i.to;if(o("WAWebSimpleSignalPNToFBIDMigration").maybeReplaceWidWithFbIdForBotSend(t),o("WAWebSimpleSignalPNToFBIDMigration").maybeReplaceWidWithFbIdForInvoke(t,"invokedBotWid"),o("WAWebSimpleSignalPNToFBIDMigration").maybeReplaceWidWithFbIdForInvoke(t,"botRespOrInvocationRevokeBotWid"),o("WAWebEventsWaitForOfflineDeliveryEnd").isOfflineDeliveryEnd()||(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[messaging] waiting for offline delivery end before sending "," message"])),l),yield o("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd()),!l||!l.id)return(s||(s=n("Promise"))).reject(r("err")("[messaging] sending message without an id"));if(!u)return(s||(s=n("Promise"))).reject(r("err")("[messaging] sending message without an remote id"));var c=o("WAWebOutgoingMessage").createOutgoingMessageProtobuf(o("WAWebOutgoingMessage").OutgoingMessageOriginType.Chat,t);if(u.isUser()){r("WAWebWid").isCAPISupportAccount(u)&&o("WAWebABPropsSaga").getIsSagaV1Enabled()&&o("WAWebABPropsSaga").getIsSagaV1ReengagementEnabled()&&(yield o("WAWebE2EProtoGenerator").addDebugInfoSupportPayload(c));var d=o("WAWebSendUserMsgJob").encryptAndSendUserMsg(t,c,a);return t.data.type!=="protocol"&&o("WAWebSendTcTokenChatAction").sendTcToken(u),d}else if(u.isGroup())return o("WAWebSendGroupMsgJob").encryptAndSendGroupMsg(t,c,a);return(s||(s=n("Promise"))).reject(r("err")("[messaging] unsupported remote jid type"))}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(yield o("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd(),e.id){if(!e.remote)return(s||(s=n("Promise"))).reject(r("err")("[messaging] sending message without an remote id"))}else return(s||(s=n("Promise"))).reject(r("err")("[messaging] sending message without an id"));if(e.remote.isGroup()){var t=o("WAWebMessageSendReporter").createMessageSendMetricReporter({messageIsInvisible:!0}),a=new(o("WAWebMessageSendPerfReporter")).MessageSendPerfReporter({chatWid:e.remote,mediaType:o("WAWebWamEnumMediaType").MEDIA_TYPE.NONE,messageType:o("WAWebWamEnumMessageType").MESSAGE_TYPE.GROUP});return a.setMessageIsInvisible(!0),o("WAWebSendGroupKeyDistributionMsgJob").encryptAndSendGroupKeyDistributionMsg(e,t).then(function(){a.postWrittenWireStage(),t.post()})}return(s||(s=n("Promise"))).reject(r("err")("[messaging] unsupported remote jid type"))}),m.apply(this,arguments)}l.encryptAndSendMsg=u,l.encryptAndSendKeyDistributionMsg=d}),98); __d("WAWebSendMsgToDeviceList",["WADeprecatedSendIq","WAWebCommsAckParser","WAWebSendMsgCommonApi","WAWebSendMsgCreateFanoutStanza","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){function e(e,t,n,r,o){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a,i){var l,s,u,c,d;(l=i.sendPerfReporter)==null||l.startReadyToSendStage();var m=e.data,p=m.id,_=m.to,f=yield o("WAWebSendMsgCreateFanoutStanza").createFanoutMsgStanza(e,t,n,a,i),g=f.stanza;(s=i.sendPerfReporter)==null||s.postReadyToSendStage(),(u=i.sendPerfReporter)==null||u.startWrittenWireStage();var h=yield o("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(g,o("WAWebCommsAckParser").toCoreAckTemplate({id:p.id,class:"message",from:_,participant:null})),y=o("WAWebSendMsgCommonApi").sendMsgAckSyncParser.parse(h);if(y.error)throw r("err")("[messaging] sendMsgToDeviceList: Invalid ack from server");return(c=i.sendPerfReporter)==null||c.postWrittenWireStage(),i.sendPerfReporter=null,(d=i.sendReporter)==null||d.postSuccess(),i.sendReporter=null,y.success}),s.apply(this,arguments)}l.sendMsgToDeviceList=e}),98); __d("WAWebFetchResendMissingKeyJob",["Promise","WALogger","WAParsableXmlNode","WAPromiseQueue","WASmaxPreKeysFetchMissingPreKeysRPC","WAWap","WAWebApiDeviceList","WAWebBackendErrors","WAWebDeviceListPk","WAWebEventsWaitForOfflineDeliveryEnd","WAWebProcessKeyBundle","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C=new(o("WAPromiseQueue")).PromiseQueueMap;function b(e){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){yield o("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd();var n=Array.from(new Set(t.map(function(e){return o("WAWebWidFactory").asUserWidOrThrow(e).toString()}))).map(function(e){return o("WAWebWidFactory").createUserWidOrThrow(e)}),r=n.map(function(e){return e.toString()}).join();o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys ",""])),r);var a=C.waitIfPending(r);return a?(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys deduped ",""])),r),a):C.enqueueHandlers(r,S(n))}),v.apply(this,arguments)}function S(e){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: start fetching key for "," wids"])),e.length);var t=yield L(e),r=yield k(t),a=new Map;t.forEach(function(e,t){var n=r[t],i=o("WAWebWidFactory").asUserWidOrThrow(e).toString(),l=a.get(i)||[];if(n!=null){var s;l.push({id:(s=e.device)!=null?s:0,regId:n})}a.set(i,l)});var i=[];a.forEach(function(e,t){var n=o("WAWebWidToJid").widToUserJid(o("WAWebWidFactory").createUserWidOrThrow(t)),r={userJid:n,hasUserReasonIdentity:!1,deviceArgs:e.map(function(e){return{deviceId:e.id,registrationElementValue:o("WAWap").BIG_ENDIAN_CONTENT(e.regId)}})};i.push(r)}),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: start sending fetching iq for "," wids"])),e.length);var l=yield o("WASmaxPreKeysFetchMissingPreKeysRPC").sendFetchMissingPreKeysRPC({userArgs:i});e:{var s=l;if((typeof s=="object"&&s!==null||typeof s=="function")&&s.name==="FetchMissingPreKeysResponseSuccess"&&"value"in s){var _=s.value;return o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: start processing keys for "," wids"])),e.length),I(_);break e}if((typeof s=="object"&&s!==null||typeof s=="function")&&s.name==="FetchMissingPreKeysResponseServerError"&&"value"in s){var f=s.value,g=f.errorServerErrors.value;return o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys failed: ",":",""])),g.code,g.text),(y||(y=n("Promise"))).reject(new(o("WAWebBackendErrors")).ServerStatusCodeError(Number(g.code),g.text));break e}if((typeof s=="object"&&s!==null||typeof s=="function")&&s.name==="FetchMissingPreKeysResponseRequestError"&&"value"in s){var h=s.value,C=h.errorRequestErrorsFetch.value;return o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys failed: ",":",""])),C.code,C.text),(y||(y=n("Promise"))).reject(new(o("WAWebBackendErrors")).ServerStatusCodeError(Number(C.code),C.text));break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+s)}}),R.apply(this,arguments)}function L(e){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: find "," users"])),e.length);var t=yield o("WAWebApiDeviceList").getDeviceIds(e),n=new Map;return t.forEach(function(t,r){if(t){var a=t.devices;a.forEach(function(e){if(e.id!==0){var r=o("WAWebWidFactory").createDeviceWidFromDeviceListPk(t.id,e.id,e.isHosted);n.set(r.toString(),r)}})}var i=o("WAWebWidFactory").asUserWidOrThrow(e[r]);n.set(i.toString(),i)}),Array.from(n.values())}),E.apply(this,arguments)}function k(e){var t=e.map(function(e){return o("WAWebUserPrefsMeUser").isMeDevice(e)?o("WAWebSignalProtocolStore").getSignalProtocolStore().getLocalRegistrationId():o("WAWebSignalProtocolStore").getSignalProtocolStore().loadSession(String(o("WAWebSignalCommonUtils").createSignalAddress(e))).then(function(e){var t,n=e==null?void 0:e.sessions;if(n){for(var r in n)if(n[r].indexInfo.closed===-1)return n[r].registrationId}return e==null||(t=e.remote)==null?void 0:t.regId})});return(y||(y=n("Promise"))).all(t)}function I(e){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=[];if(e.listUser.forEach(function(e){var n=e.userFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup;switch(n.name){case"FetchMissingPreKeysUserSuccess":{var r=n.value,a=r.device,i=r.jid,l=o("WAWebWidFactory").createWid(i);a.forEach(function(e){var n,r,a=e.preKeyMixin;t.push({identity:e.elementValue,deviceIdentity:(n=(r=e.deviceIdentityMixin)==null?void 0:r.deviceIdentityElementValue)!=null?n:null,skey:{id:o("WAParsableXmlNode").convertBytesToUint(e.skeyIdKeyIDMixin.elementValue,3),pubkey:e.skeyValueKeyDataMixin.elementValue,signature:e.skeySignatureElementValue},key:a&&{id:o("WAParsableXmlNode").convertBytesToUint(a.keyIdKeyIDMixin.elementValue,3),pubkey:a.keyValueKeyDataMixin.elementValue},regId:o("WAParsableXmlNode").convertBytesToUint(e.registrationElementValue,4),wid:o("WAWebWidFactory").createDeviceWidFromDeviceListPk(o("WAWebDeviceListPk").createDeviceListPK(l),e.id,!1)})});return}case"FetchMissingPreKeysUserErrorFallback":case"FetchMissingPreKeysUserError":{var s=n.value;o("WALogger").WARN(f||(f=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys failed for user ",": ",":",""])),e.jid,s.errorCode,s.errorText).sendLogs("fetchResendMissingKeys-user-error");return}}}),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: parsed "," keys"])),t.length),t.length>0){var n=yield o("WAWebProcessKeyBundle").processKeyBundles(t),r=n.processedPrekeyCount;o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: successfully established "," E2E sessions out of "," requested"])),r,t.length)}}),T.apply(this,arguments)}l.fetchResendMissingKeys=b}),98); __d("WAWebPostMdDeviceSyncAckMetric",["WAWebGetMessageChatTypeFromWid","WAWebMdDeviceSyncAckWamEvent","WAWebSendMsgCommonApi","WAWebWamAddressingModeUtils"],(function(t,n,r,o,a,i,l){function e(e,t,n,r,a){var i=new(o("WAWebMdDeviceSyncAckWamEvent")).MdDeviceSyncAckWamEvent({revoke:o("WAWebSendMsgCommonApi").isRevokeMsg(n)});if(i.chatType=o("WAWebGetMessageChatTypeFromWid").getMessageChatTypeFromWid(e),e.isGroup()?i.isLid=t.data.from.isLid():i.isLid=e.isLid(),r!=null){var l=o("WAWebWamAddressingModeUtils").getAddressingModeMetricsFromGroupMetadata(r);l!=null&&(i.localAddressingMode=l)}e.isGroup()&&a!=null&&(i.serverAddressingMode=o("WAWebWamAddressingModeUtils").getWamAddressingModeFromString(a)),i.commit()}l.postMdDeviceSyncAckMetric=e}),98); __d("WAWebSendUserMsgJob",["Promise","WALogger","WATimeUtils","WAWebBizCoexGatingUtils","WAWebBizCoexUtils","WAWebBotGating","WAWebDBDeviceListFanout","WAWebDBUpdateMessageTable","WAWebFetchResendMissingKeyJob","WAWebLidMigrationUtils","WAWebMsgFanoutTypes","WAWebMsgGetters","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebPostMdDeviceSyncAckMetric","WAWebResendUserMsg","WAWebSendMsgToDeviceList","WAWebSimpleSignalPNToFBIDMigration","WAWebSyncDeviceAdvDeviceListJob","WAWebUserPrefsMeUser","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime","cr:10198"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m;function p(e,t,n){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r,a){var i,l=t.data,p=l.botRespOrInvocationRevokeBotWid,_=l.id,h=l.invokedBotWid,y=l.protocolMessageKey,C=l.subtype,b=l.to;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendUserMsg: sending ",""])),_).tags("messaging");var v=b.isLid()&&(i=o("WAWebUserPrefsMeUser").getMaybeMeDeviceLid())!=null?i:o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow(),S={wids:[b,v]};o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&b!=null&&b.isUser()&&(S.chatWidSetToIncludeHostedInFanoutOneToOneChatOnly=b);var R=yield o("WAWebDBDeviceListFanout").getFanOutList(S);if(o("WAWebBotGating").isBotEnabled())if(o("WAWebMsgGetters").getIsBotFeedbackMessage(t.data)&&y!=null){var L;!b.isBot()&&y.participant!=null?L=y.participant:t.data.bizBotType!=null?L=b:L=y.remote,R=[o("WAWebSimpleSignalPNToFBIDMigration").maybeReplaceDeprecatedBotPnWithFbid(L)]}else if(h&&h!=null&&h.isBot()){var E=h;R=[].concat(R,[E])}else p&&p!=null&&p.isBot()&&(C==="sender_revoke"||C==="admin_revoke")&&(R=[].concat(R,[p]));o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&o("WAWebBizCoexUtils").fanoutListContainsHostedDevice(R)&&o("WAWebDBUpdateMessageTable").updateMessageTable(t.data.id,{senderOrRecipientAccountTypeHosted:!0});var k=yield o("WAWebSendMsgToDeviceList").sendMsgToDeviceList(t,r,R,{fanoutType:o("WAWebMsgFanoutTypes").FANOUT_TYPE.CHAT},a);f(b,k);var I=k.phash;if(I!=null){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendUserMsg: phash mismatch, got server phash ",""])),I).tags("messaging");var T=o("WATimeUtils").unixTime();o("WAWebPostMdDeviceSyncAckMetric").postMdDeviceSyncAckMetric(b,t,r),a.sendReporter=a.createSendReporter({isResend:!0,originalMessage:t.type==="message"?t.data:void 0}),(m||(m=n("Promise"))).resolve().then(function(){if(!b.isLid())return o("WAWebFetchResendMissingKeyJob").fetchResendMissingKeys([b,v]).catch(function(){o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["fetchResendMissingKeys: failed"]))).sendLogs("fetchResendMissingKeys-sync-error")})}).then(function(){return o("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob([b,v],"message",I)}).then(function(){return g(t,r,R,T,a)}).catch(function(e){o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: failed to resend message: ",", type: ",""])),t.data.id.toString(),t.data.type).tags("messaging"),o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: failed to resend message: ",""])),e).tags("messaging").sendLogs("message-resend-failed",{sampling:.01})})}return k}),_.apply(this,arguments)}function f(e,t){var n=t.refreshLid;if(n){var r=o("WAWebLidMigrationUtils").toPn(e);r&&o("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("syncContactListJob",{contactIds:[r],shouldSyncDevice:!1,mode:"query"})}}function g(e,t,n,r,o){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a){var i=yield o("WAWebPersistedJobManager").getJobManager().accessors.maybeCreateJob(o("WAWebPersistedJobDefinitions").jobSerializers.resendUserMsg(e,n,r));yield o("WAWebResendUserMsg").resendUserMsg(e,t,n,r,a),yield o("WAWebPersistedJobManager").getJobManager().accessors.deletePersistedJob(i.id)}),h.apply(this,arguments)}l.encryptAndSendUserMsg=p,l.maybeRefreshLid=f}),98); __d("WAWebIdentityIcdcApi",["WACryptoSha256","WAJids","WANullthrows","WASignalOther","WATimeUtils","WAWebABProps","WAWebApiDeviceList","WAWebBizCoexGatingUtils","WAWebCryptoCurve25519","WAWebIdentityApiUtils","WAWebProtobufsAdv.pb","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=8,s=720*60*60;function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebApiDeviceList").getDeviceRecord(e);return!t||t.deleted?null:d(e,t)}),c.apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(!t||t.deleted)return null;var n={keyHash:void 0,timestamp:void 0},a=t.advAccountType,i=t.devices,l=t.id,s=t.timestamp,u=i.some(function(e){return e.id!==o("WAJids").DEFAULT_DEVICE_ID});if(u){var c=i.map(function(e){return[e.keyIndex,o("WAWebWidFactory").createDeviceWidFromDeviceListPk(l,e.id,e.isHosted)]}),d=[],m=null;c.forEach(function(e){var t=e[0],n=e[1];o("WAWebUserPrefsMeUser").isMeDevice(n)?m=t:d.push([t,n])});var _=yield o("WAWebIdentityApiUtils").getAllIdentityKeysBytes(d.map(function(e){var t=e[1];return t})),h=[],y=[];if(_.forEach(function(e,t){e!=null&&(h.push(e),y.push(d[t][0]))}),o("WAWebUserPrefsMeUser").isMeAccount(e)){var C=yield o("WAWebSignalProtocolStore").getSignalProtocolStore().getIdentityKeyPair();if(!C)return null;h.push(new Uint8Array(C.pubKey)),y.push(r("WANullthrows")(m))}var b=f();n.keyHash=yield p(h.map(function(e){return new Uint8Array(o("WAWebCryptoCurve25519").toCurveKeyPubKey(e.buffer))}),b),y.length!==i.length&&(n.keyIndexes=y)}return(u||g(s))&&(n.timestamp=s),o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&(o("WAWebUserPrefsMeUser").isMeAccount(e)&&(yield o("WAWebUserPrefsMultiDevice").getIsHostedMeAccount())===!0&&(n.senderAccountType=o("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED),!o("WAWebUserPrefsMeUser").isMeAccount(e)&&a===o("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED&&(n.receiverAccountType=o("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED)),n}),m.apply(this,arguments)}function p(e,t){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WAWebIdentityApiUtils").identityKeysToBinary(e),r=yield o("WACryptoSha256").sha256(n),a=new Uint8Array(r);return o("WASignalOther").sliceBytes(a,0,t)}),_.apply(this,arguments)}function f(){var t=o("WAWebABProps").getABPropConfigValue("md_icdc_hash_length");return Math.max(t,e)}function g(e){return o("WATimeUtils").unixTime()-ex){var $;o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["resendUserMsg: ",": skip group resending due to "," min timeout"])),I,x/60).tags("messaging"),($=l.sendReporter)==null||$.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_EXPIRED,isTerminal:!1}),l.sendReporter=null;return}try{var P=yield o("WAWebGroupMsgSendUtils").getParticipantRecord(T.toString()),N=P==null?void 0:P.participants;if(N!=null&&N.length!==D.length){var M=N.length-D.length;if(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": group participant list has "," by "," since initial send"])),I,M>0?"increased":"decreased",Math.abs(M)),o("WAWebCurrentUser").isEmployee()){var w=N.map(function(e){return o("WAWebWidFactory").createUserWidOrThrow(e)}),A=new Set(D),F=w.filter(function(e){return!A.has(e)});o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": message was not sent intentionally to following participants: ",""])),I,F.join()).sendLogs("resendGroupMsg-missed-participants",{sampling:.01})}}var O=yield o("WAWebDBDeviceListFanout").getFanOutList({wids:D}),B=r("lodash").differenceBy(O,S,String);if(B.length===0){o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": skip resending to the empty list"])),I).tags("messaging");return}if(o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": resending to devices: ",""])),I,B.join(",")).tags("messaging"),v.data.isOverwrittenByRevoke===!0){o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": skip resending because this message has been overwritten by a revoke"])),I).tags("messaging");return}yield o("WAWebSendDirectMsgToDeviceList").sendDirectMsgToDeviceList(v,b,B,{fanoutType:o("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT,isResendingMsg:!0},a,l),o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: ",": done"])),I).tags("messaging")}catch(e){var W;throw o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: failed to resend "," message: ",""])),I,e).tags("messaging"),o("WALogger").ERROR(C||(C=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: failed to resend message: ",""])),e).tags("messaging"),(W=l.sendReporter)==null||W.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!1}),l.sendReporter=null,e}yield o("WAWebMsgUtilsBridge").logMessageSendForChatThreadLogging(v.data)}),R.apply(this,arguments)}function L(e){var t;(t=e.sendReporter)==null||t.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_BACKFILL_USYNC_FAILED,isTerminal:!1}),e.sendReporter=null}function E(e,t,n,r){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["postGroupParticipantSyncMetric: start"])));var a=yield o("WAWebGroupMsgSendUtils").getParticipantRecord(String(t));if(!a){o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["postGroupParticipantSyncMetric: failed to find participant record for group ",""])),String(t));return}var i=a.participants.map(o("WAWebWidFactory").createWid);o("WAWebMaybePostMdGroupSyncMetrics").maybePostGroupSyncMetrics(r,i,n,e)}),k.apply(this,arguments)}function I(e){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.ackTime,n=e.groupData,r=e.isDirect,a=e.msgRecord,i=e.oldList,l=e.phash,s=e.serverAddressingMode,u=yield o("WAWebPersistedJobManager").getJobManager().accessors.maybeCreateJob(o("WAWebPersistedJobDefinitions").jobSerializers.resendGroupMsg(a,n,r,i,l,t,s));yield S(e),yield o("WAWebPersistedJobManager").getJobManager().accessors.deletePersistedJob(u.id)}),T.apply(this,arguments)}l.resendGroupMsg=S,l.resendPersistedGroupMsgWrapper=I}),98); __d("WAWebSendDirectMsgToDeviceList",["Promise","WADeprecatedSendIq","WAWebCommsAckParser","WAWebSendMsgCommonApi","WAWebSendMsgCreateFanoutStanza","WAWebSignalProtocolStore","WAWebWamEnumMessageDistributionEnumType","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e;function s(e,t,n,r,o,a){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a,i,l,s,u){var c,d,m,p,_,f=t.data,g=f.id,h=f.to,y=yield o("WAWebSendMsgCreateFanoutStanza").createFanoutMsgStanza(t,a,i,l,u,s),C=y.stanza;yield o("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode(),(c=u.sendPerfReporter)==null||c.postReadyToSendStage(),(d=u.sendPerfReporter)==null||d.startWrittenWireStage();var b=yield o("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(C,o("WAWebCommsAckParser").toCoreAckTemplate({id:g.id,class:"message",from:h,participant:null})),v=o("WAWebSendMsgCommonApi").sendMsgAckSyncParser.parse(b);return v.error?(e||(e=n("Promise"))).reject(r("err")("[messaging] encryptAndSendGroupDirectMsg: Invalid ack from server")):((m=u.sendReporter)==null||m.setMessageDistributionType(o("WAWebWamEnumMessageDistributionEnumType").MESSAGE_DISTRIBUTION_ENUM_TYPE.DIRECT_MESSAGE),(p=u.sendPerfReporter)==null||p.postWrittenWireStage(),u.sendPerfReporter=null,(_=u.sendReporter)==null||_.postSuccess(),u.sendReporter=null,v.success)}),u.apply(this,arguments)}l.sendDirectMsgToDeviceList=s}),98); __d("WAWebSendGroupDirectJob",["WALogger","WATimeUtils","WAWebMsgFanoutTypes","WAWebResendGroupMsg","WAWebSendDirectMsgToDeviceList","asyncToGeneratorRuntime","cr:10198"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(e,t,n,r,o){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r,a,i){var l=t.data.to;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupDirectMsg: sending "," with group ",""])),t.data.id,l.toLogString()).tags("messaging");var d=yield o("WAWebSendDirectMsgToDeviceList").sendDirectMsgToDeviceList(t,n,r,{fanoutType:o("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT},a,i),m=d.addressingMode,p=d.phash;return p&&(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupDirectMsg: phash mismatch, got server phash ",""])),p).tags("messaging"),o("WAWebResendGroupMsg").resendPersistedGroupMsgWrapper({isDirect:!0,msgRecord:t,msgProtobuf:n,oldList:r,ackTime:o("WATimeUtils").unixTime(),groupData:a,phash:p,metricReporter:i,serverAddressingMode:m}).catch(function(e){o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["resendGroupDirectMsg: failed to resend group msg: ",", type: ",""])),t.data.id.toString(),t.data.type).tags("messaging"),o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["resendGroupDirectMsg: failed to resend group msg: ",""])),e).tags("messaging").sendLogs("message-resend-failed",{sampling:.01})})),d}),m.apply(this,arguments)}l.encryptAndSendGroupDirectMsg=d}),98); __d("WAWebSendMsgQueueMap",["WAPromiseQueue"],(function(t,n,r,o,a,i,l){var e=new(o("WAPromiseQueue")).PromiseQueueMap;l.sendMsgQueueMap=e}),98); __d("WAWebSendGroupKeyDistributionMsgJob",["Promise","WADeprecatedSendIq","WALogger","WAWap","WAWebAdvSignatureApi","WAWebApiMessageInfoStore","WAWebApiParticipantStore","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebCommsAckParser","WAWebCommsWapMd","WAWebGetGroupKeyDistributionMsg","WAWebGroupMsgSendUtils","WAWebManageE2ESessionsJob","WAWebPhashUtils","WAWebSchemaParticipant","WAWebSendMsgCommonApi","WAWebSendMsgQueueMap","WAWebSignal","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","cr:10198","err"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(t,n){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupKeyDistributionMsg: sending ",""])),t).tags("messaging");var r=t.remote;return o("WAWebSendMsgQueueMap").sendMsgQueueMap.enqueue(r.toString(),function(){return m(t,n)})}function m(e,t){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a=e.id,i=e.remote,l=yield o("WAWebSchemaParticipant").getParticipantTable().get(i.toString()),d=yield o("WAWebGroupMsgSendUtils").getGroupData(i.toString(),l);t.setGroupData(d);var m=yield o("WAWebApiParticipantStore").getGroupSenderKeyListFromParticipantRecord(i,l),p=m.rotateKey,f=m.skDistribList,g=m.skList,h=g.concat(f);if(f.length===0){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupKeyDistributionMsg: skip sending ",": sender key distribution list is empty"])),e).tags("messaging");return}yield o("WAWebApiMessageInfoStore").createOrMergeReceiptRecords(h.map(function(t){return{msgKey:e,receiverId:t}})),yield o("WAWebManageE2ESessionsJob").ensureE2ESessions(f);var y=yield o("WAWebPhashUtils").phashV2([].concat(h,[o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow()])),C=yield _(i,f,p),b=C[0],v=C[1],S=o("WAWap").wap("message",{id:o("WAWap").CUSTOM_STRING(a),to:o("WAWebCommsWapMd").CHAT_JID(i),phash:o("WAWap").CUSTOM_STRING(y),type:"text",device_fanout:"false"},o("WAWap").wap("meta",{appdata:"default"}),o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobs.flow").CiphertextType.Skmsg),"decrypt-fail":"hide"}),b,v);yield o("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode();var R=yield o("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(S,o("WAWebCommsAckParser").toCoreAckTemplate({id:a,class:"message",from:i,participant:null})),L=o("WAWebSendMsgCommonApi").sendMsgAckSyncParser.parse(R);return L.error?(o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: Invalid ack from server"]))).tags("messaging"),(c||(c=n("Promise"))).reject(r("err")("[messaging] encryptAndSendSenderKeyMsg: Invalid ack from server"))):(yield o("WAWebApiParticipantStore").markHasSenderKey(i,f),L.success)}),p.apply(this,arguments)}function _(e,t,n){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=t.every(function(e){return e.isLid()}),a=r?o("WAWebUserPrefsMeUser").getMeDeviceLidOrThrow():o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow();n&&(yield o("WAWebSignal").Session.deleteGroupSenderKeyInfo(e,a));var i=yield o("WAWebSignal").Session.getGroupSenderKeyInfo(e,a),l=yield o("WAWebGetGroupKeyDistributionMsg").getKeyDistributionMsg(null,e,t,i,!0),s=null,u=!1;l&&l.length>0&&(s=o("WAWap").wap("participants",null,l.map(function(e){var t=e.ciphertext,n=e.participant,r=e.type;return r===o("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&(u=!0),o("WAWap").wap("to",{jid:o("WAWebCommsWapMd").DEVICE_JID(n)},o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),"decrypt-fail":"hide",type:o("WAWap").CUSTOM_STRING(r)},t))})));var c=null;if(u){var d=yield o("WAWebAdvSignatureApi").getADVEncodedIdentity();c=o("WAWap").wap("device-identity",null,d)}return[s,c]}),f.apply(this,arguments)}l.encryptAndSendGroupKeyDistributionMsg=d}),98); __d("WAWebSendGroupMsgJob",["WALogger","WAWebABProps","WAWebApiContact","WAWebApiParticipantStore","WAWebDBDeviceListFanout","WAWebE2EProtoGenerator","WAWebGroupHistorySendGroupMsgJobUtils","WAWebGroupMsgSendUtils","WAWebLidMigrationUtils","WAWebMaybe","WAWebMessageEditGatingUtils","WAWebMsgGetters","WAWebMsgKey","WAWebMsgRcatUtils","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebSchemaMessageInfo","WAWebSendGroupDirectJob","WAWebSendGroupSkmsgJob","WAWebSendMsgQueueMap","WAWebWidFactory","asyncToGeneratorRuntime","err","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_=Object.freeze({SKMSG:"skmsg",DIRECT:"direct"});function f(e){return e.isLid()}function g(e){return!e.isLid()}function h(e,t,n,r,o,a,i,l){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a,i,l,s){var u=yield o("WAWebApiParticipantStore").getGroupSenderKeyListFromParticipantRecord(t,l),c=u.skDistribList,d=u.skList,m=s||C(e,i),p=m?f:g,h={type:_.SKMSG,senderKeyList:{skList:d.filter(p),skDistribList:c.filter(p),rotateKey:!1}};if(o("WAWebMsgGetters").getSubtype(e.data)==="sender_revoke"){var y=!i&&o("WAWebABProps").getABPropConfigValue("send_cag_member_revokes_as_GDM"),b=n==null?null:yield S(n,h.senderKeyList,{forceDirectMessage:y,normalizeAddressingModeFn:function(t){return t}});return b!=null?b:h}if(o("WAWebMsgGetters").getType(e.data)==="keep_in_chat"){var v=!i&&o("WAWebABProps").getABPropConfigValue("supports_keep_in_chat_in_cag"),R=r==null?null:yield L(r,h.senderKeyList,v);return R!=null?R:h}return a?k(a,h.senderKeyList,{normalizeAddressingModeFn:function(t){return t}}):h}),y.apply(this,arguments)}function C(e,t){var n=e.data,a=n.keepType,i=n.subtype,l=n.type;if(a===o("WAWebProtobufsE2E.pb").KeepType.UNDO_KEEP_FOR_ALL)return!1;switch(l){case"reaction_enc":case"comment":case"event_response":return!0;case"poll_update":if(i==="poll_vote")return!0;break;case"protocol":{if(e.type==="addon"&&e.data.kind===o("WAWebMsgType").MsgKind.ProtocolAddonRevoke)return!0;if(i==="sender_revoke")return!1;break}case"notification":case"status_notification":case"notification_template":case"gp2":case"broadcast_notification":case"e2e_notification":case"call_log":case"chat":case"location":case"payment":case"vcard":case"ciphertext":case"debug_placeholder":case"multi_vcard":case"revoked":case"oversized":case"groups_v4_invite":case"hsm":case"template_button_reply":case"debug":case"image":case"loading_media":case"video":case"ptv":case"audio":case"ptt":case"sticker":case"status":case"document":case"product":case"order":case"list":case"interactive":case"interactive_response":case"list_response":case"buttons_response":case"reaction":case"poll_creation":case"poll_result_snapshot":case"request_phone_number":case"native_flow":case"biz-cover-photo":case"keep_in_chat":case"pin_message":case"pinned_message":case"unknown":case"newsletter_notification":case"history_bundle":case"newsletter_admin_invite":case"event_creation":case"event_edit_encrypted":case"biz_content_placeholder":case"album":case"sticker-pack":case"rich_response":case"automated_greeting_message":case"newsletter_question_response":case"guest_upsell_system_msg":case"newsletter_follower_invite":case o("WAWebMsgType").MSG_TYPE.MESSAGE_HISTORY_BUNDLE:case"message_history_notice":case"quarantined":case"message_edit_encrypted":break;default:throw r("err")("CAG - Invalid type: "+l)}if(t)return!1;throw r("err")("CAG - non-admin trying to send a regular message")}function b(e,t,n,r,o,a){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a,i){var l=yield o("WAWebApiParticipantStore").getGroupSenderKeyListFromParticipantRecord(e,t),s={senderKeyList:l,type:_.SKMSG},u=function(t){return t.map(o("WAWebLidMigrationUtils").toAddressingModeFactory(a))};if(n){var c=yield S(n,l,{forceDirectMessage:!1,normalizeAddressingModeFn:u});return c!=null?c:s}return r?k(r,l,{normalizeAddressingModeFn:u}):i!=null&&i.length>0?o("WAWebGroupHistorySendGroupMsgJobUtils").getGroupSendListForGroupHistoryBundle(i.map(o("WAWebWidFactory").createWid),l,{normalizeAddressingModeFn:u,isLidAddressingMode:a}):s}),v.apply(this,arguments)}function S(e,t,n){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield o("WAWebSchemaMessageInfo").getMessageInfoTable().equals(["msgKey"],String(e)),a=r.map(function(e){return o("WAWebWidFactory").createWid(e.receiverUserJid)});if(a.length===0)return null;var i=t.skDistribList,l=t.skList,s=new Set([].concat(i,l).map(o("WAWebWidFactory").asUserWidOrThrow).map(String)),u=a.filter(function(e){var t=o("WAWebApiContact").getAlternateUserWid(o("WAWebWidFactory").asUserWidOrThrow(e));return!s.has(String(e))&&!(t!=null&&s.has(String(t)))}),c=n.normalizeAddressingModeFn(u).filter(Boolean);if(n.forceDirectMessage===!1&&c.length===0)return null;var d=yield o("WAWebDBDeviceListFanout").getFanOutList({wids:c});return{type:_.DIRECT,deviceList:[].concat(d,l,i)}}),R.apply(this,arguments)}function L(e,t,n){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield o("WAWebSchemaMessageInfo").getMessageInfoTable().equals(["msgKey"],String(e));if(r.length===0)return null;var a=t.skDistribList,i=t.skList,l=new Set(a.concat(i).map(function(e){return String(o("WAWebWidFactory").asUserWidOrThrow(e))})),s=r.filter(function(e){return!l.has(e.receiverUserJid)}).map(function(e){return o("WAWebWidFactory").createWid(e.receiverUserJid)});if(s.length===0&&n!==!0)return null;var u=yield o("WAWebDBDeviceListFanout").getFanOutList({wids:s}),c=[].concat(u,i,a);return{type:_.DIRECT,deviceList:c}}),E.apply(this,arguments)}function k(e,t,n){return I.apply(this,arguments)}function I(){return I=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(o("WAWebMessageEditGatingUtils").isMessageEditToMessageSecretSenderEnabled())return{type:_.SKMSG,senderKeyList:t};var r=t.skDistribList,a=t.skList,i=yield o("WAWebSchemaMessageInfo").getMessageInfoTable().equals(["msgKey"],String(e)),l=new Set(r.concat(a).map(function(e){return String(o("WAWebWidFactory").asUserWidOrThrow(e))})),s=function(t){return o("WAWebMaybe").ifSome(o("WAWebApiContact").getAlternateUserWid(o("WAWebWidFactory").asUserWidOrThrow(t)),function(e){return l.has(String(e))})},u=i.map(function(e){return o("WAWebWidFactory").createWid(e.receiverUserJid)}).filter(function(e){return l.has(String(e))||s(e)}),c=n.normalizeAddressingModeFn(u).filter(Boolean),d=yield o("WAWebDBDeviceListFanout").getFanOutList({wids:c});return{type:_.DIRECT,deviceList:[].concat(d)}}),I.apply(this,arguments)}function T(t,r,a){var i,l=t.data,d=l.id,m=l.to;return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupMsg: queued ",""])),d).tags("messaging"),(i=a.sendPerfReporter)==null||i.startWaitingToEncryptStage(),o("WAWebSendMsgQueueMap").sendMsgQueueMap.enqueue(m.toString(),n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e,n,i,p,f,g;o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupMsg: sending ",""])),d).tags("messaging"),(e=a.sendPerfReporter)==null||e.postWaitingToEncryptStage(),(n=a.sendPerfReporter)==null||n.startReadyToSendStage();var y=x(r),C=N(r),v=$(r),S=yield o("WAWebGroupMsgSendUtils").getParticipantRecord(m.toString()),R=yield o("WAWebGroupMsgSendUtils").getGroupData(m.toString(),S,t);(i=a.sendReporter)==null||i.setGroupData(R),(p=a.sendPerfReporter)==null||p.setGroupData(R);var L=(f=S==null?void 0:S.participants.map(function(e){return o("WAWebWidFactory").createUserWidOrThrow(e)}))!=null?f:[],E=yield o("WAWebMsgRcatUtils").genContentBindingForMsg(l,L),k=!!R.isLidAddressingMode,I;if(R.isCag===!0){var T=!!R.amIAdmin;o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupMsg: CAG "," "])),T?"admin":"non-admin").tags("messaging"),I=yield h(t,m,y,v,C,T,S,k)}else{var P;o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendGroupMsg: "," group size: ",""])),o("WAWebGroupMsgSendUtils").formatGroupTypeForLog(R),S==null?void 0:S.participants.length).tags("messaging");var M=yield b(m,S,y,C,k,r==null||(P=r.messageHistoryBundle)==null||(P=P.messageHistoryMetadata)==null?void 0:P.historyReceivers);I=D(M,R)}var w=(R==null?void 0:R.isCapiGroup)===!0?o("WAWebE2EProtoGenerator").updateGroupMsgProtoWithCapiFlag(r):r;if(I.type===_.DIRECT){var A,F,O=I,B=O.deviceList;return(A=a.sendReporter)==null||A.setDeviceCount(B.length),(F=a.sendPerfReporter)==null||F.setIsDirectedMessage(!0),o("WAWebSendGroupDirectJob").encryptAndSendGroupDirectMsg(t,w,B,R,a)}var W=I,q=W.senderKeyList;return(g=a.sendReporter)==null||g.setDeviceCount(q.skList.length+q.skDistribList.length),o("WAWebSendGroupSkmsgJob").encryptAndSendSenderKeyMsg(t,w,q,R,a,E)}))}function D(e,t){var n=t.isLidAddressingMode===!0?f:g;e:{var r=e;if((typeof r=="object"&&r!==null||typeof r=="function")&&r.type==="direct"&&"deviceList"in r){var a=r.deviceList,i=a.filter(n);if(i.length0)try{var s,u=yield o("WAWebManageE2ESessionsJob").ensureE2ESessions(n);(s=t.sendPerfReporter)==null||s.setFetchedPrekeyCount(u==null?void 0:u.missedPrekeyCount),o("WAWebPostPrekeysDepletionMetric").maybePostPrekeysDepletionMetric({count:u==null?void 0:u.depletedPrekeyCount,prekeysFetchReason:o("WAWebWamEnumPrekeysFetchContext").PREKEYS_FETCH_CONTEXT.SEND_MESSAGE,messageType:o("WAWebWamEnumMessageType").MESSAGE_TYPE.GROUP,deviceSizeBucket:r.deviceSizeBucket})}catch(t){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["ensureE2ESessions: failed for "," devices: ",""])),n.length,t).tags("messaging")}(l=t.sendPerfReporter)==null||l.postPrekeysFetchStage()}),h.apply(this,arguments)}function y(e,t,n,r,o,a,i,l){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a,i,l,s){var u,c,d,m;(u=l.sendPerfReporter)==null||u.startClientEncryptStage();var p=o("WAWebSendMsgCommonApi").encodeAndPad(a),_=o("WAWebBackendJobsCommon").mediaTypeFromProtobuf(a),f=o("WAWebBotGating").isBotEnabled()&&((c=e.invokedBotWid)==null?void 0:c.isBot())===!0,g=o("WAWebBotGating").isBotEnabled()&&o("WAWebMsgGetters").getIsBotFeedbackMessage(e),h=o("WAWebMsgGetters").getIsRevokeForMsgFromOrDeliveredToBot(e),y=yield o("WAWebEncryptMsgProtobuf").encryptMsgSenderKey(e,t,p,i),C=y.ciphertext,b=y.senderKeyBytes,v;n.length>0&&(v=yield o("WAWebGetGroupKeyDistributionMsg").getKeyDistributionMsg(e,t,n,b,!1)),(d=l.sendPerfReporter)==null||d.postClientEncryptStage();var S=null,R=!1;v&&v.length>0&&!g?S=o("WAWap").wap("participants",null,v.map(function(e){var t=e.ciphertext,n=e.participant,r=e.type;r===o("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&(R=!0);var i=s==null?void 0:s.get(o("WAWebWidToJid").widToUserJid(o("WAWebWidFactory").asUserWidOrThrow(n))),l=i!=null?o("WAWap").wap("content_binding",null,i):null;return o("WAWap").wap("to",{jid:o("WAWebCommsWapMd").DEVICE_JID(n)},o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(r),"decrypt-fail":o("WAWebBackendJobsCommon").encodeMaybeDecryptFail(o("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(a))},t),l)})):s!=null&&(S=o("WAWap").wap("participants",null,r.map(function(e){var t=s==null?void 0:s.get(o("WAWebWidToJid").widToUserJid(o("WAWebWidFactory").asUserWidOrThrow(e)));return t!=null?o("WAWap").wap("to",{jid:o("WAWebCommsWapMd").DEVICE_JID(e)},o("WAWap").wap("content_binding",null,t)):null})));var E=g?null:o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobs.flow").CiphertextType.Skmsg),mediatype:o("WAWebBackendJobsCommon").encodeMaybeMediaType(_),"decrypt-fail":o("WAWebBackendJobsCommon").encodeMaybeDecryptFail(o("WAWebE2EProtoUtils").decryptFailAttributeFromProtobuf(a))},C),k=null,I=f||g||h||o("WAWebBotGroupGatingUtils").isOpenGroupBotSendEnabled()&&i.isOpenBotGroup===!0?yield L(e,a,(m=i.isOpenBotGroup)!=null?m:!1):[null,!1],T=I[0],D=I[1];if(R||D){var x=yield o("WAWebAdvSignatureApi").getADVEncodedIdentity();k=o("WAWap").wap("device-identity",null,x)}return{keyDistributionMsg:S,skeyEncryptedGroupMsg:E,identityNode:k,botMsgNode:T}}),C.apply(this,arguments)}function b(e,t){var n=t.data,a=o("WAWebE2EProtoUtils").getBizNativeFlowName(e),i=n.nativeFlowInteractiveMsg;if(a!=null&&r("WAWebInteractiveMessagesNativeFlowName").cast(a)===r("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO&&i===!0){var l;return(l=o("WAWap")).wap("biz",null,l.wap("interactive",{v:"1",type:l.CUSTOM_STRING("native_flow")},l.wap("native_flow",{name:l.CUSTOM_STRING(a)})))}return null}function v(e,t,n,r,o,a){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i,l,h){var C,v,S,L,E,k,I=e.data,T=I.id,D=I.to,x=e.data;o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: sending ",""])),T).tags("messaging");var $=T.id,P=a.rotateKey,N=a.skDistribList,M=a.skList;R(D,l),(C=l.sendPerfReporter)==null||C.setSenderKeyDistributionCount(N.length);var w=M.concat(N),A=o("WAWebUserPrefsMeUser").getMeDeviceLidOrThrow(),F=o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow(),O=o("WAWebGroupMsgSendUtils").isCagAddon(x,i)||(i==null?void 0:i.isLidAddressingMode)===!0?A:F,B=yield o("WAWebPhashUtils").phashV2([].concat(w,[O]),o("WAWebBotGroupGatingUtils").isOpenGroupBotParticipantAddEnabled()&&i.isOpenBotGroup===!0),W=o("WAWebMsgGetters").getIsBotFeedbackMessage(x);yield o("WAWebApiMessageInfoStore").createOrMergeReceiptRecords(w.map(function(e){return{msgKey:T,receiverId:e}})),P&&(yield o("WAWebSignal").Session.deleteGroupSenderKeyInfo(D,O)),yield g(l,N,i);var q=yield y(x,D,N,M,t,i,l,h),U=q.botMsgNode,V=q.identityNode,H=q.keyDistributionMsg,G=q.skeyEncryptedGroupMsg,z=h==null?void 0:h.get(o("WAWebWidToJid").widToUserJid(o("WAWebWidFactory").asUserWidOrThrow(O))),j=z!=null?o("WAWap").wap("sender_content_binding",null,z):null,K=i.isLidAddressingMode===!0?o("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.lid:o("WAWebHandleMsgCommon").STANZA_MSG_ADDRESSING_MODE.pn,Q=yield o("WAWebReportingTokenUtils").genReportingTokenBody(x,t),X=o("WAWap").wap("message",{id:o("WAWap").CUSTOM_STRING($),to:o("WAWebCommsWapMd").CHAT_JID(D),phash:W?o("WAWap").DROP_ATTR:o("WAWap").CUSTOM_STRING(B),type:o("WAWebE2EProtoUtils").typeAttributeFromProtobuf(t),edit:o("WAWebSendMsgCommonApi").editAttribute(t,x.subtype),addressing_mode:o("WAWap").CUSTOM_STRING(K)},H,G,V,b(t,e),o("WAWebSendMsgMetaNode").genMetaNode(D,e,t,i,{}),U,j,Q);yield o("WAWebSendMsgCommonApi").updateIdentityRange(e,w),yield o("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode(),(v=l.sendPerfReporter)==null||v.postReadyToSendStage(),(S=l.sendPerfReporter)==null||S.startWrittenWireStage(),n("cr:10199")==null||n("cr:10199").printEncNode(t);var Y=yield o("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(X,o("WAWebCommsAckParser").toCoreAckTemplate({id:$,class:"message",from:D,participant:null}));if(H){var J;(J=l.sendReporter)==null||J.setMessageDistributionType(o("WAWebWamEnumMessageDistributionEnumType").MESSAGE_DISTRIBUTION_ENUM_TYPE.SENDER_KEY_DISTRIBUTION_MESSAGE)}var Z=x.type===o("WAWebMsgType").MSG_TYPE.COMMENT&&i.isCag===!0;(L=l.sendReporter)==null||L.setIsCagReply(Z),(E=l.sendPerfReporter)==null||E.postWrittenWireStage(),l.sendPerfReporter=null,(k=l.sendReporter)==null||k.postSuccess(),l.sendReporter=null;var ee=o("WAWebSendMsgCommonApi").sendMsgAckSyncParser.parse(Y);if(ee.error)return o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: invalid ack from server for ",""])),x.id).tags("messaging"),(f||(f=n("Promise"))).reject(r("err")("[messaging] encryptAndSendSenderKeyMsg: Invalid ack from server"));var te=ee.success.error;if(te===o("WAWebCreateNackFromStanza").NackReason.StaleGroupAddressingMode)return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: ack with error code 421"]))).tags("messaging"),(f||(f=n("Promise"))).resolve().then(function(){return o("WAWebGroupQueryBridge").sendQueryGroup(D)}).catch(function(e){o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: sendQueryGroup failed after ack. error: ",""])),e).tags("messaging")}),e.type===o("WAWebSendMsgTypes").SendMessageRecordType.Message&&e.data.updateAck(o("WAWebAck").ACK.FAILED,!1),f.reject(r("err")("[messaging] encryptAndSendSenderKeyMsg: ack with error code 421"));yield o("WAWebApiParticipantStore").markHasSenderKey(D,N);var ne=ee.success,re=ne.addressingMode,oe=ne.count,ae=ne.phash;return ae!=null&&ae!==B?(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendSenderKeyMsg: phash mismatch for ",", got server phash ",""])),x.id,ae).tags("messaging"),o("WAWebResendGroupMsg").resendPersistedGroupMsgWrapper({isDirect:!1,msgRecord:e,msgProtobuf:t,oldList:w,ackTime:o("WATimeUtils").unixTime(),groupData:i,metricReporter:l,serverAddressingMode:re}).catch(function(t){o("WALogger").WARN(p||(p=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: failed to resend group msg: ",", type: ",""])),e.data.id.toString(),e.data.type).tags("messaging"),o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["resendGroupMsg: failed to resend group msg: ",""])),t).tags("messaging").sendLogs("message-resend-failed",{sampling:.01})})):re!=null&&re!==K&&o("WAWebGroupHandleAddressingModeMismatch").handleAddressingModeMismatch(D,{localAddressingMode:K,serverAddressingMode:re,mismatchOrigin:o("WAWebWamEnumMismatchOriginType").MISMATCH_ORIGIN_TYPE.ACK_OUTGOING_MESSAGE}),oe!=null&&o("WAWebSchemaMessage").getMessageTable().merge(String(T),{count:oe}),ee.success}),S.apply(this,arguments)}function R(e,t){var n=o("WAWebUserPrefsGeneral").markUserSentMessageToChat(e);if(n){var r,a;(r=t.sendPerfReporter)==null||r.setMessageIsFirstUserMessage(!0),(a=t.sendReporter)==null||a.setMessageIsFirstUserMessage(!0)}}function L(e,t,n){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=o("WAWebMsgGetters").getIsBotFeedbackMessage(e),a=null,i=o("WAWebMsgGetters").getIsRevokeForMsgFromOrDeliveredToBot(e);if(r){var l;a=(l=e.protocolMessageKey)==null?void 0:l.participant}else i?a=e.botRespOrInvocationRevokeBotWid:o("WAWebBotGroupGatingUtils").isOpenGroupBotSendEnabled()&&n===!0?a=o("WAWebBotUtils").META_BOT_FBID_WID:a=e.invokedBotWid;if(!a||!a.isBot())return[null,!1];yield o("WAWebApiMessageInfoStore").createOrMergeReceiptRecords([{msgKey:e.id,receiverId:a}]);var s=!1;yield o("WAWebManageE2ESessionsJob").ensureE2ESessions([a]);var u=o("WAWebE2EProtoGenerator").updateBotInvokeMsgProtoCopyForCapi(t,e.botMessageSecret,o("WAWebBotGroupGatingUtils").isOpenGroupBotSendEnabled()&&n);i&&a.isFbidBot()&&(u=o("WAWebE2EProtoGenerator").updateFbidBotInvokeProtobuf(u));var c=yield o("WAWebEncryptMsgProtobuf").encryptMsgProtobuf(a,0,u,e,0),d=c.ciphertext,m=c.type;m===o("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&(s=!0);var p=o("WAWap").wap("bot",{type:r?"feedback":o("WAWap").DROP_ATTR},o("WAWap").wap("to",{jid:o("WAWebCommsWapMd").DEVICE_JID(a)},o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(m)},d)));return[p,s]}),E.apply(this,arguments)}l.encryptAndSendSenderKeyMsg=v}),98); __d("WAWebGalaxyFlowCloseEvent",["WAWebEventEmitter"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t){return"galaxy_flow_"+e+"_"+t}var s=(function(e){function t(){return e.apply(this,arguments)||this}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.handleClose=function(t){this.trigger(t)},t})(r("WAWebEventEmitter")),u=new s;l.getGalaxyFlowCloseEventKey=e,l.GalaxyFlowCloseEvent=u}),98); __d("WAWebNonMessageDataRequestHandlerGalaxyFlow",["WALogger","WAWebGalaxyFlowCloseEvent","WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){var e,s,u;function c(t){var n=t.galaxyFlowAction;if(n==null){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["galaxy flow: galaxyFlowAction is null in peer data operation request"])));return}var r=n.flowId,a=n.stanzaId;if(r==null||a==null){o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["galaxy flow: missing required field - flowId="," stanzaId=",""])),r!=null?r:"null",a!=null?a:"null");return}o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["galaxy flow: received NOTIFY_LAUNCH request with flowId="," stanzaId=",""])),r,a),o("WAWebGalaxyFlowCloseEvent").GalaxyFlowCloseEvent.trigger(o("WAWebGalaxyFlowCloseEvent").getGalaxyFlowCloseEventKey(r,a))}function d(e){var t=e.flowId,n=e.stanzaId;return t==null||n==null?null:{type:o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestMessage$GalaxyFlowAction$GalaxyFlowActionType.NOTIFY_LAUNCH,flowId:t,stanzaId:n}}l.handleGalaxyFlowLaunchRequest=c,l.buildGalaxyFlowDataOperationRequest=d}),98); __d("WAWebSendNonMessageDataRequest",["Promise","WALogger","WANullthrows","WAShiftTimer","WATimeUtils","WAWebABProps","WAWebApiPeerMessageStore","WAWebCommsWapMd","WAWebCurrentUser","WAWebDBDeviceListFanout","WAWebE2EProtoUtils","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebMsgKey","WAWebMsgType","WAWebNonMessageDataRequestHandlerGalaxyFlow","WAWebNonMessageDataRequestHistorySyncOnDemandUtils","WAWebNonMessageDataRequestLoggingUtils","WAWebNonMessageDataRequestMediaHandlingUtils","WAWebNonMessageDataRequestPlaceholderMessageResendUtils","WAWebProtobufsE2E.pb","WAWebSendAppStateSyncMsgJob","WAWebSendMsgCreateDeviceStanza","WAWebSyncGatingUtils","WAWebSyncdSnapshotRecoveryGatingUtils","WAWebUserPrefsMeUser","WAWebWamEnumPeerDataResponseApplyResultType","WAWebWidFactory","asyncToGeneratorRuntime","gkx","justknobx"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v=3e3;function S(e,t,n){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r){var a=r!=null?r:{},i=a.skipStoringMessage,l=yield L(e,t);if(l==null){o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[rdu] the constructed peer data operation request object is null"])));return}var s=yield k(l,r);if(s==null||s.length===0){o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[rdu] the constructed peer data operation request message is null or empty"])));return}var u=A(e),p=F(e);yield(b||(b=n("Promise"))).all(s.map((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[rdu] build rdu message successfully, ## type: ",", ## msg: ",""])),e,t.id.id),M(e,t),o("WAWebNonMessageDataRequestLoggingUtils").logNonMessagePeerDataRequest(e,t),i!==!0&&(yield o("WAWebApiPeerMessageStore").storePeerMessages([t])),o("WAWebNonMessageDataRequestLoggingUtils").sendTimes.set(t.id.id,o("WATimeUtils").unixTimeMs()),yield o("WAWebSendAppStateSyncMsgJob").encryptAndSendKeyMsg({msg:t,pushPriority:u!=null?u:void 0,privacySensitive:p!=null?p:void 0})});return function(e){return t.apply(this,arguments)}})()))}),R.apply(this,arguments)}function L(e,t){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[rdu] start building rdu request object, ## type: ",""])),e);var n={peerDataOperationRequestType:e,requestUrlPreview:[],requestStickerReupload:[],placeholderMessageResendRequest:[]};switch(e){case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP:break;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.WAFFLE_LINKING_NONCE_FETCH:break;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER:{var r=T(t);if(r==null)return null;n.requestStickerReupload=r;break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:{var a=D(t);if(a==null)return null;n.requestUrlPreview=a;break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND:{var i=yield $(t);if(i==null)return null;n.historySyncOnDemandRequest=i;break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND:{var l=N(t);if(l==null)return null;n.placeholderMessageResendRequest=l;break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.FULL_HISTORY_SYNC_ON_DEMAND:{o("WALogger").WARN(_||(_=babelHelpers.taggedTemplateLiteralLoose(["full history sync on demand not supported in web"])));break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_META_NONCE_FETCH:{o("WALogger").WARN(f||(f=babelHelpers.taggedTemplateLiteralLoose(["companion meta nonce fetch is not supported in web"])));break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_CANONICAL_USER_NONCE_FETCH:break;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY:{if(o("WAWebSyncdSnapshotRecoveryGatingUtils").syncdSnapshotRecoveryEnabled()===!1)return o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["Syncd Snapshot recovery is not enabled"]))),null;var s=x(t);if(s==null)return null;n.syncdCollectionFatalRecoveryRequest=s;break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_CHUNK_RETRY:{o("WALogger").WARN(h||(h=babelHelpers.taggedTemplateLiteralLoose(["history sync chunk retry is not supported in web"])));break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GALAXY_FLOW_ACTION:{var u=o("WAWebNonMessageDataRequestHandlerGalaxyFlow").buildGalaxyFlowDataOperationRequest(t);if(u==null)return null;n.galaxyFlowAction=u;break}}return n}),E.apply(this,arguments)}function k(e,t){return I.apply(this,arguments)}function I(){return I=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a=t!=null?t:{},i=a.fanout,l=a.msgId;if(i){var s,u=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),c=u.isLid()&&(s=o("WAWebUserPrefsMeUser").getMaybeMeDeviceLid())!=null?s:o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow(),d={wids:[c]},m=yield o("WAWebDBDeviceListFanout").getFanOutList(d),p=yield(b||(b=n("Promise"))).all(m.map(function(e){return r("WAWebMsgKey").newId()}));return m.map(function(t,n){return{id:new(r("WAWebMsgKey"))({fromMe:!0,remote:o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),id:p[n]}),to:t,type:"protocol",subtype:"peer_data_operation_request_message",kind:o("WAWebMsgType").MsgKind.PeerMessage,peerDataOperationRequestMessage:e}})}var _=new(r("WAWebMsgKey"))({fromMe:!0,remote:o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),id:l!=null?l:yield r("WAWebMsgKey").newId()});return[{id:_,to:o("WAWebWidFactory").createDeviceWidFromUserAndDevice(o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow().user,o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow().server,0),type:"protocol",subtype:"peer_data_operation_request_message",kind:o("WAWebMsgType").MsgKind.PeerMessage,peerDataOperationRequestMessage:e}]}),I.apply(this,arguments)}function T(e){var t,n=e.fileSha256Arr,r=n==null||(t=n.filter(function(e){return!o("WAWebNonMessageDataRequestMediaHandlingUtils").inFlightStickerRequests.has(e)}))==null?void 0:t.map(function(e){return w(o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER,o("WAWebNonMessageDataRequestMediaHandlingUtils").inFlightStickerRequests,e),{fileSha256:e}});return(r==null?void 0:r.length)===0?null:r}function D(e){var t=e.urls;return t==null?void 0:t.map(function(t){return{url:t,includeHqThumbnail:e.includeHqThumbnail}})}function x(e){return{collectionName:r("WANullthrows")(e.collectionName),timestamp:e.timestamp}}function $(e){return P.apply(this,arguments)}function P(){return P=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!o("WAWebSyncGatingUtils").isHistorySyncOnDemandEnabled())return null;if(o("WAWebABProps").getABPropConfigValue("history_sync_on_demand_request_send_killswitch")&&o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").historySyncOnDemandRequestsFailureRecord.disableRequestSending)return o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["[rdu] stop sending history sync on demand request as it fails too many times"]))),null;var t=e.chatId;if(t==null)return null;var n=o("WAWebCommsWapMd").CHAT_JID(t).toString();if(new Set(o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").inFlightHistorySyncOnDemandRequests.values()).has(n))return o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["[rdu] drop history sync on demand request as it's in flight"]))),null;var r=yield o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").getOldestMsgInChatFromDB(t),a=yield o("WAWebABProps").getABPropConfigValue("history_sync_on_demand_message_count");return{chatJid:n,oldestMsgId:r==null?void 0:r.id.id,oldestMsgFromMe:r==null?void 0:r.id.fromMe,onDemandMsgCount:a,oldestMsgTimestampMs:r==null?void 0:r.t}}),P.apply(this,arguments)}function N(t){if(!o("WAWebSyncGatingUtils").isPlaceholderMessageResendEnabled())return null;var n=t.msgKeys;return n==null||n.length===0?null:(o("WAWebCurrentUser").isEmployee()&&o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[rdu] send placeholder message backfill request for ",""])),n.map(function(e){return e.toString()})),n.filter(function(e){return!o("WAWebNonMessageDataRequestPlaceholderMessageResendUtils").inFlightPlaceholderResendRequests.has(e.id)}).map(function(e){w(o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND,o("WAWebNonMessageDataRequestPlaceholderMessageResendUtils").inFlightPlaceholderResendRequests,e.id);var t=e.remote.isRegularUser()?o("WAWebLidMigrationUtils").toUserLid(e.remote):null,n=e.remote.isRegularUser()&&o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()?new(r("WAWebMsgKey"))({id:e.id,fromMe:e.fromMe,remote:t!=null?t:e.remote}):e;return{messageKey:o("WAWebE2EProtoUtils").msgKeyToProtobuf(n)}}))}function M(e,t){switch(e){case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER:{var n,a=(n=t.peerDataOperationRequestMessage)==null?void 0:n.requestStickerReupload;a!=null&&a.forEach(function(e){var t=e.fileSha256;if(t!=null){var n;o("WAWebNonMessageDataRequestMediaHandlingUtils").inFlightStickerRequests.add(t),o("WAWebNonMessageDataRequestMediaHandlingUtils").mediaReuploadRequestCountMap.set(t,((n=o("WAWebNonMessageDataRequestMediaHandlingUtils").mediaReuploadRequestCountMap.get(t))!=null?n:0)+1)}});break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND:{var i,l=(i=t.peerDataOperationRequestMessage)==null?void 0:i.historySyncOnDemandRequest;if(l!=null){var u,c=(u=l.chatJid)!=null?u:"";o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").inFlightHistorySyncOnDemandRequests.set(t.id.id,c);var d=o("WAWebABProps").getABPropConfigValue("history_sync_on_demand_timeout_ms"),m=function(){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync][rdu] dropping history sync on demand response as it's timeout with key ","."])),r("gkx")("26258")?"":t.id.id),o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").handleHistorySyncOnDemandFailure(c),o("WAWebNonMessageDataRequestLoggingUtils").logHistorySyncOnDemandResponse(o("WAWebWamEnumPeerDataResponseApplyResultType").PEER_DATA_RESPONSE_APPLY_RESULT_TYPE.REQUEST_TIMEOUT,t.id.id)};w(o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND,o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").inFlightHistorySyncOnDemandRequests,t.id.id,d,m)}break}case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND:{var p,_=(p=t.peerDataOperationRequestMessage)==null?void 0:p.placeholderMessageResendRequest;_!=null&&_.forEach(function(e){var t,n=(t=e.messageKey)==null?void 0:t.id;n!=null&&o("WAWebNonMessageDataRequestPlaceholderMessageResendUtils").inFlightPlaceholderResendRequests.add(n)});break}default:break}}function w(e,t,n,a,i){a===void 0&&(a=v),new(o("WAShiftTimer")).ShiftTimer(function(){t.has(n)&&(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[rdu] clean rdu message request (regardless of success status). key ",", ## type: ",""])),r("gkx")("26258")?"":n,e),t.delete(n),i==null||i())}).onOrAfter(a)}function A(e){switch(e){case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:return o("WAWebSyncGatingUtils").isWebLinkPreviewNseSupportEnabled()?"high_force":null;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND:return o("WAWebSyncGatingUtils").isMessagePlaceholderResendNseSupportEnabled()?"high_force":null;case o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND:return o("WAWebSyncGatingUtils").isHistorySyncOnDemandEnabled()?"high_force":null;default:return null}}function F(e){if(!r("justknobx")._("4199")&&e===o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND)return o("WAWebSendMsgCreateDeviceStanza").PrivacySensitiveType.OnDemand}l.sendPeerDataOperationRequest=S}),98); __d("WAWebEncryptAndSendStatusMsg",["WADeprecatedSendIq","WAJids","WALogger","WANullthrows","WAWap","WAWebAdvSignatureApi","WAWebApiMessageInfoStore","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebCommsAckParser","WAWebCommsWapMd","WAWebDBDeviceListFanout","WAWebE2EProtoUtils","WAWebGetGroupKeyDistributionMsg","WAWebLidMigrationUtils","WAWebLidStatusMigrationGating","WAWebLidStatusMigrationUtils","WAWebManageE2ESessionsJob","WAWebMsgFanoutTypes","WAWebMsgKey","WAWebPostPrekeysDepletionMetric","WAWebProtobufsE2E.pb","WAWebReportingTokenUtils","WAWebSchemaMessageInfo","WAWebSendMsgCommonApi","WAWebSendMsgCreateFanoutStanza","WAWebSignal","WAWebSignalProtocolStore","WAWebUserPrefsMeUser","WAWebUserPrefsStatus","WAWebUserPrefsStatusType","WAWebWamEnumMessageDistributionEnumType","WAWebWamEnumMessageType","WAWebWamEnumPrekeysFetchContext","WAWebWamNumberToSizeBucket","WAWebWidFactory","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g;function h(e){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebSchemaMessageInfo").getMessageInfoTable().equals(["msgKey"],String(e));return t.length===0&&(t=yield o("WAWebSchemaMessageInfo").getMessageInfoTable().equals(["msgKey"],String(o("WAWebLidMigrationUtils").getAlternateMsgKey(e)))),t.map(function(e){return o("WAWebLidStatusMigrationUtils").matWidConvert(o("WAWebWidFactory").createWid(e.receiverUserJid))})}),y.apply(this,arguments)}function C(e,t,n){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a){var i,l,f,g,y,C=t.data.id,b=o("WAWebLidStatusMigrationGating").getLidStatusSendEnabled(),S=o("WAWebWidFactory").createWid(o("WAJids").STATUS_JID),I=b?r("WANullthrows")(o("WAWebUserPrefsMeUser").getMaybeMeDeviceLid()):o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow(),T=L(n),D,x,$=yield r("WAWebUserPrefsStatus").getStatusList();if(b){var P=r("compactMap")($.list,o("WAWebLidMigrationUtils").toUserLid);$.list=P.map(function(e){return e})}if(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: start to send ",", revoke: ",""])),C.id,T),T){var N;(N=a.sendPerfReporter)==null||N.setIsRevokeMessage(!0);var M=yield h(T);if(E(M,$.list)){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: start to send direct revoke message"])));var w=yield o("WAWebDBDeviceListFanout").getFanOutList({wids:[].concat(M,[I]),shouldMergeAltDevices:!0});return k(t,n,w,a)}D=M}else{if($.list.length===0)return;D=$.list,x=o("WAWap").wap("meta",{status_setting:R($.setting)})}var A=yield o("WAWebDBDeviceListFanout").getFanOutList({wids:[].concat(D,[I]),shouldMergeAltDevices:!0});o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: all device list size ",""])),A.length);var F=yield r("WAWebUserPrefsStatus").getStatusSkDistribList(A),O=F.participantList,B=F.skDistribList;if(B.length>0){var W,q,U;o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: distribute "," sender key"])),B.length),(W=a.sendReporter)==null||W.setMessageDistributionType(o("WAWebWamEnumMessageDistributionEnumType").MESSAGE_DISTRIBUTION_ENUM_TYPE.SENDER_KEY_DISTRIBUTION_MESSAGE),(q=a.sendReporter)==null||q.setDeviceCount(B.length),(U=a.sendPerfReporter)==null||U.setSenderKeyDistributionCount(B.length)}if(yield o("WAWebApiMessageInfoStore").createOrMergeReceiptRecords(A.map(function(e){return{msgKey:C,receiverId:e}})),o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: create receipts records"]))),B.length>0)try{var V,H;(V=a.sendPerfReporter)==null||V.startPrekeysFetchStage();var G=yield o("WAWebManageE2ESessionsJob").ensureE2ESessions(B);(H=a.sendPerfReporter)==null||H.setFetchedPrekeyCount(G==null?void 0:G.missedPrekeyCount),o("WAWebPostPrekeysDepletionMetric").maybePostPrekeysDepletionMetric({count:G==null?void 0:G.depletedPrekeyCount,prekeysFetchReason:o("WAWebWamEnumPrekeysFetchContext").PREKEYS_FETCH_CONTEXT.SEND_MESSAGE,messageType:o("WAWebWamEnumMessageType").MESSAGE_TYPE.STATUS,deviceSizeBucket:r("WAWebWamNumberToSizeBucket")(A.length)})}catch(e){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: ensureE2ESessions: failed for "," devices: ",""])),B.length,e).tags("messaging")}(i=a.sendPerfReporter)==null||i.postPrekeysFetchStage(),(l=a.sendPerfReporter)==null||l.startClientEncryptStage();var z=yield v(S,I,B,O,n),j=z[0],K=z[1],Q=z[2];o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: encrypt message body done"])));var X=yield o("WAWebReportingTokenUtils").genReportingTokenBody(t.data,n),Y=o("WAWap").wap("message",{id:o("WAWap").CUSTOM_STRING(C.id),to:o("WAWebCommsWapMd").CHAT_JID(S),type:o("WAWebE2EProtoUtils").typeAttributeFromProtobuf(n),edit:o("WAWebSendMsgCommonApi").editAttribute(n,t.data.subtype)},j,K,Q,x,X);yield o("WAWebSendMsgCommonApi").updateIdentityRange(t,A),yield o("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode(),(f=a.sendPerfReporter)==null||f.postClientEncryptStage(),(g=a.sendPerfReporter)==null||g.startWrittenWireStage(),o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusMsg: start sending ",""])),C.id),yield o("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(Y,o("WAWebCommsAckParser").toCoreAckTemplate({id:C.id,class:"message",from:S,participant:null})),(y=a.sendPerfReporter)==null||y.postWrittenWireStage(),yield r("WAWebUserPrefsStatus").markStatusHasSenderKey(B)}),b.apply(this,arguments)}function v(e,t,n,r,o){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a){var i=o("WAWebSendMsgCommonApi").encodeAndPad(a),l=o("WAWebBackendJobsCommon").mediaTypeFromProtobuf(a),s=yield o("WAWebSignal").Cipher.encryptSenderKeyMsgSignalProto(e,t,i),u=s.ciphertext,c=s.senderKeyBytes,d;n.length>0&&(d=yield o("WAWebGetGroupKeyDistributionMsg").getKeyDistributionMsg(null,e,n,c,!1));var m=[],p=[],_=!1,f=null;d&&d.length>0&&(m=d.map(function(e){var t=e.ciphertext,n=e.participant,r=e.type;return r===o("WAWebBackendJobs.flow").CiphertextType.Pkmsg&&(_=!0),o("WAWap").wap("to",{jid:o("WAWebCommsWapMd").DEVICE_JID(n)},o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(r)},t))})),p=r.map(function(e){return o("WAWap").wap("to",{jid:o("WAWebCommsWapMd").USER_JID(e)})}),(p.length>0||m.length>0)&&(f=o("WAWap").wap("participants",null,m.concat(p)));var g=o("WAWap").wap("enc",{v:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobsCommon").CIPHERTEXT_VERSION.toString()),type:o("WAWap").CUSTOM_STRING(o("WAWebBackendJobs.flow").CiphertextType.Skmsg),mediatype:o("WAWebBackendJobsCommon").encodeMaybeMediaType(l)},u),h=null;if(_){var y=yield o("WAWebAdvSignatureApi").getADVEncodedIdentity();h=o("WAWap").wap("device-identity",null,y)}return[f,g,h]}),S.apply(this,arguments)}function R(e){return e===o("WAWebUserPrefsStatusType").StatusPrivacySettingType.AllowList?"allowlist":e===o("WAWebUserPrefsStatusType").StatusPrivacySettingType.DenyList?"denylist":e===o("WAWebUserPrefsStatusType").StatusPrivacySettingType.Contact?"contacts":(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}function L(e){var t=e.protocolMessage,n=null;if((t==null?void 0:t.type)===o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE&&t!=null&&t.key){var a=t.key,i=a.id,l=a.participant,s=a.remoteJid;s!=null&&i!=null&&l!=null&&(n=new(r("WAWebMsgKey"))({remote:o("WAWebWidFactory").createWid(s),fromMe:!0,id:i,participant:o("WAWebWidFactory").createWid(l)}))}return n}function E(e,t){var n=new Set(t.map(function(e){return o("WAWebWidFactory").asUserWidOrThrow(e).toString()}));return e.some(function(e){return!o("WAWebUserPrefsMeUser").isMeAccount(e)&&!n.has(o("WAWebWidFactory").asUserWidOrThrow(e).toString())})}function k(e,t,n,r){return I.apply(this,arguments)}function I(){return I=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){var a,i,l=e.data.id,s=o("WAWebWidFactory").createWid(o("WAJids").STATUS_JID);o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusDirectMsg: send "," to "," device"])),l.id,n.length);var u=yield o("WAWebSendMsgCreateFanoutStanza").createFanoutMsgStanza(e,t,n,{fanoutType:o("WAWebMsgFanoutTypes").FANOUT_TYPE.GROUP_DIRECT},r),c=u.stanza;yield o("WAWebSignalProtocolStore").getSignalProtocolStore().flushBufferToDiskIfNotMemOnlyMode(),(a=r.sendPerfReporter)==null||a.startWrittenWireStage(),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["encryptAndSendStatusDirectMsg: start sending ",""])),l.id),yield o("WADeprecatedSendIq").deprecatedSendStanzaAndReturnAck(c,o("WAWebCommsAckParser").toCoreAckTemplate({id:l.id,class:"message",from:s,participant:null})),(i=r.sendPerfReporter)==null||i.postWrittenWireStage()}),I.apply(this,arguments)}l.calculateRevokeSenderList=h,l.encryptAndSendStatusMsg=C,l.genMessageBody=v}),98); __d("WAWebMexFetchNewsletterAdminCapabilitiesJobQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"}],t=[{kind:"Variable",name:"newsletter_id",variableName:"newsletter_id"}],n={alias:null,args:null,kind:"ScalarField",name:"capabilities",storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebMexFetchNewsletterAdminCapabilitiesJobQuery",selections:[{alias:null,args:t,concreteType:"XWA2NewsletterAdmin",kind:"LinkedField",name:"xwa2_newsletter_admin",plural:!1,selections:[n],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebMexFetchNewsletterAdminCapabilitiesJobQuery",selections:[{alias:null,args:t,concreteType:"XWA2NewsletterAdmin",kind:"LinkedField",name:"xwa2_newsletter_admin",plural:!1,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}]},params:{id:"9801384413216421",metadata:{},name:"WAWebMexFetchNewsletterAdminCapabilitiesJobQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebMexFetchNewsletterAdminCapabilitiesJob",["WAWebMexClient","WAWebMexFetchNewsletterAdminCapabilitiesJobQuery.graphql","WAWebNewsletterModelUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=e!==void 0?e:e=n("WAWebMexFetchNewsletterAdminCapabilitiesJobQuery.graphql");function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n={newsletter_id:e},r=yield o("WAWebMexClient").fetchQuery(s,n),a=(t=r.xwa2_newsletter_admin)==null?void 0:t.capabilities,i=a==null?[]:a.map(o("WAWebNewsletterModelUtils").getNewsletterCapabilityFromValue);return new Set(i)}),c.apply(this,arguments)}l.mexFetchNewsletterAdminCapabilities=u}),98); __d("WAWebQueryDisappearingModeJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebBackendErrors","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("dmParser",function(e){var t=e.child("disappearing_mode");return{duration:t.attrInt("duration"),t:t.attrInt("t")}});function s(){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=o("WAWap").wap("iq",{xmlns:"disappearing_mode",to:o("WAWap").S_WHATSAPP_NET,type:"get",id:o("WAWap").generateId()}),n=yield o("WADeprecatedSendIq").deprecatedSendIq(t,e);if(!n.success)throw new(o("WAWebBackendErrors")).ServerStatusCodeError(n.errorCode);return n.result}),u.apply(this,arguments)}l.queryDisappearingMode=s}),98); __d("WAWebMexGetPrivacySettingsQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{kind:"Variable",name:"input",variableName:"input"}],n={alias:null,args:null,concreteType:"XWA2PrivacySettingsResponse",kind:"LinkedField",name:"privacy_settings",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2PrivacySetting",kind:"LinkedField",name:"settings",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"feature",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"setting",storageKey:null}],storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebMexGetPrivacySettingsQuery",selections:[{alias:null,args:t,concreteType:null,kind:"LinkedField",name:"xwa2_fetch_wa_users",plural:!0,selections:[{kind:"InlineFragment",selections:[n],type:"XWA2User",abstractKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebMexGetPrivacySettingsQuery",selections:[{alias:null,args:t,concreteType:null,kind:"LinkedField",name:"xwa2_fetch_wa_users",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"InlineFragment",selections:[n,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],type:"XWA2User",abstractKey:null}],storageKey:null}]},params:{id:"25637004609323493",metadata:{},name:"WAWebMexGetPrivacySettingsQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebMexGetPrivacySetting",["WAHasProperty","WALogger","WAWebMexClient","WAWebMexGetPrivacySettingsQuery.graphql","WAWebPrivacySettings","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u=e!==void 0?e:e=n("WAWebMexGetPrivacySettingsQuery.graphql");function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebMexClient").fetchQuery(u,{input:{query_input:[{jid:e.jid,privacy_features:e.privacyFeatures}]}});return m(t)}),d.apply(this,arguments)}function m(e){var t,n,r={};return((t=e.xwa2_fetch_wa_users)==null?void 0:t[0].privacy_settings)==null?(f("response","privacy_settings is null"),r):((n=e.xwa2_fetch_wa_users)==null||(n=n[0].privacy_settings)==null||(n=n.settings)==null||n.forEach(function(e){var t=e.feature,n=e.setting;if(!(t==null||n==null))switch(t){case"READRECEIPTS":{var a=p(t,n,o("WAWebPrivacySettings").ALL_NONE_WITH_ERROR);a!=="error"?r.readReceipts=a:f("readReceipts",a+" is unknown type");break}case"LAST":{var i=p(t,n,o("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);i!=="error"?r.lastSeen=i:f("last",i+" is unknown type");break}case"ONLINE":{var l=p(t,n,o("WAWebPrivacySettings").ONLINE_VISIBILITY_WITH_ERROR);l!=="error"?r.online=l:f("online","categoryValue is unknown type");break}case"PROFILE":{var s=p(t,n,o("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);s!=="error"?r.profilePicture=s:f("profile","categoryValue is unknown type");break}case"ABOUT":{var u=p(t,n,o("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);u!=="error"?r.about=u:f("about","categoryValue is unknown type");break}case"GROUPADD":{var c=p(t,n,o("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);c!=="error"?r.groupAdd=c:f("groupAdd","categoryValue is unknown type");break}case"CALLADD":{var d=p(t,n,o("WAWebPrivacySettings").CALL_ADD_WITH_ERROR);d!=="error"?r.callAdd=d:f("callAdd","categoryValue is unknown type");break}case"MESSAGES":{var m=p(t,n,o("WAWebPrivacySettings").ALL_CONTACTS);r.messages=m;break}case"DEFENSE":{var _=p(t,n,o("WAWebPrivacySettings").DEFENSE_MODE_STATE);r.defenseMode=_;break}case"PIX":case"LINKED_PROFILES":case"DEPENDENT_ACCOUNT_MESSAGES":case"DEPENDENT_ACCOUNT_CALLING":case"STICKERS":break;default:{f("Feature parsing",t+" is unknown type");break}}}),r)}function p(e,t,n){var o=t.toLowerCase();switch(t){case"MYCONTACTS":o="contacts";break;case"MYCONTACTSEXCEPT":o="contact_blacklist";break;default:break}if(!r("WAHasProperty")(n,o)){var a=Object.keys(n).join("|");throw new _(r("err")('to have "'+e+'"={'+a+'} but has value "'+o+'"'))}return n[o]}var _=(function(e){function t(t){var n;return n=e.call(this)||this,n.name="MexPrivacyParsingError",n.error=t,n}return babelHelpers.inheritsLoose(t,e),t})(babelHelpers.wrapNativeSuper(Error));function f(e,t){o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["mexGetPrivacy error: "," - text ",""])),e,t).sendLogs("mexGetPrivacy")}l.fetchPrivacySettings=c,l.MexPrivacyParsingError=_}),98); __d("WAWebQueryPrivacySettingsJob",["WADeprecatedSendIq","WADeprecatedWapParser","WALogger","WAWap","WAWebABProps","WAWebMexGetPrivacySetting","WAWebPrivacySettings","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u;function c(t,n){var r=n.maybeChild("error"),a=r&&r.maybeAttrString("code"),i=r&&r.maybeAttrString("text");o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getPrivacy error: "," - code "," text ",""])),t,a,i).sendLogs("getPrivacy",{sampling:.01})}var d=new(r("WADeprecatedWapParser"))("privacyParser",function(e){e.assertAttr("type","result");var t={};return e.child("privacy").forEachChildWithTag("category",function(e){var n=e.attrString("name");e:{if(n==="readreceipts"){var r=e.attrEnum("value",o("WAWebPrivacySettings").ALL_NONE_WITH_ERROR);r!=="error"?t.readReceipts=r:c("readreceipts",e);break e}if(n==="last"){var a=e.attrEnum("value",o("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);a!=="error"?t.lastSeen=a:c("last",e);break e}if(n==="online"){var i=e.attrEnum("value",o("WAWebPrivacySettings").ONLINE_VISIBILITY_WITH_ERROR);i!=="error"?t.online=i:c("online",e);break e}if(n==="profile"){var l=e.attrEnum("value",o("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);l!=="error"?t.profilePicture=l:c("profile",e);break e}if(n==="status"){var s=e.attrEnum("value",o("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);s!=="error"?t.about=s:c("status",e);break e}if(n==="groupadd"){var u=e.attrEnum("value",o("WAWebPrivacySettings").VISIBILITY_WITH_ERROR);u!=="error"?t.groupAdd=u:c("groupadd",e);break e}if(n==="calladd"){var d=e.attrEnum("value",o("WAWebPrivacySettings").CALL_ADD_WITH_ERROR);d!=="error"?t.callAdd=d:c("calladd",e);break e}if(n==="messages"){var m=e.attrEnum("value",o("WAWebPrivacySettings").ALL_CONTACTS);t.messages=m;break e}if(n==="defense"){var p=e.attrEnum("value",o("WAWebPrivacySettings").DEFENSE_MODE_STATE);t.defenseMode=p;break e}if(n==="pix"||n==="linked_profiles"||n==="stickers")break e;{c(n+" is unknown type",e);break e}}}),t});function m(){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WAWebUserPrefsMeUser").getMaybeMeDeviceLid();if(o("WAWebABProps").getABPropConfigValue("mex_get_privacy_settings_mode")===1&&e!=null)return yield _(e.toString());if(o("WAWebABProps").getABPropConfigValue("mex_get_privacy_settings_mode")===2&&e!=null){var t=yield _(e.toString()),n=yield g();return y(t,n),n}return yield g()}),p.apply(this,arguments)}function _(e){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return o("WAWebMexGetPrivacySetting").fetchPrivacySettings({jid:e,privacyFeatures:["LAST","ONLINE","PROFILE","ABOUT","READRECEIPTS","GROUPADD","CALLADD","STICKERS","MESSAGES"]})}),f.apply(this,arguments)}function g(){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e,t=(e=o("WAWap")).wap("iq",{xmlns:"privacy",to:e.S_WHATSAPP_NET,type:"get",id:e.generateId()},e.wap("privacy",null)),n=yield o("WADeprecatedSendIq").deprecatedSendIq(t,d);if(n.success)return n.result;throw o("WAWebABProps").getABPropConfigValue("mex_get_privacy_settings_mode")===2&&o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["getPrivacy: Request failed over SMAX errorCode: ",""])),n.errorCode).sendLogs("getPrivacy"),r("err")("invalid response")}),h.apply(this,arguments)}function y(e,t){var n=[];e.readReceipts!==t.readReceipts&&n.push("readReceipts"),e.groupAdd!==t.groupAdd&&n.push("groupAdd"),e.profilePicture!==t.profilePicture&&n.push("profilePicture"),e.about!==t.about&&n.push("about"),e.lastSeen!==t.lastSeen&&n.push("lastSeen"),e.online!==t.online&&n.push("online"),e.callAdd!==t.callAdd&&n.push("callAdd"),e.messages!==t.messages&&n.push("messages"),e.defenseMode!==t.defenseMode&&n.push("defenseMode"),n.length>0&&o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["getPrivacy: privacy settings not equal between MEX and XML queries"]))).sendLogs("getPrivacy-xml-mex-privacySettings-notEqual mismatched fields: "+JSON.stringify(n))}l.getPrivacy=m,l.getPrivacySettingsMex=_,l.getPrivacySmax=g}),98); __d("WAWebQueryPrivacyDisallowedListLidJob",["WALogger","WASmaxPrivacyGetContactBlacklistRPC","WAWebDBCreateLidPnMappings","WAWebJidToWid","WAWebLidMigrationUtils","WAWebSchemaPrivacyDisallowedList","WAWebSetUsernameJob","WAWebUsernameGatingUtils","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m;function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n;if(t===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.About)n="status";else if(t===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.GroupAdd)n="groupadd";else if(t===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.LastSeen)n="last";else if(t===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.ProfilePicture)n="profile";else throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["invalid privacyType: ",""])),t),r("err")("GetContactBlacklist lid request invalid privacyType");var a={getContactBlacklistGetContactBlacklistLIDOrGetContactBlacklistPNMixinGroupArgs:{getContactBlacklistGetContactBlacklistLID:{categoryNamesForContactBlacklistMixinArgs:{anyName:n}}}},i=yield o("WASmaxPrivacyGetContactBlacklistRPC").sendGetContactBlacklistRPC(a);if(i.name==="GetContactBlacklistResponseError")throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["retrieved response error for GetContactBlacklist lid request"]))),r("err")("GetContactBlacklist lid request invalid response");var l=i.value,p=l.privacyAddressingMode,_=l.privacyList,f=_==null?void 0:_.user;if(_==null||f==null||f.length===0)return{status:"mismatch",users:[],dhash:_==null?void 0:_.dhash};if(i.name==="GetContactBlacklistResponseSuccess")throw o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["retrieved pn response for GetContactBlacklist lid request"]))),r("err")("GetContactBlacklist lid request invalid response");if(p!=="lid")throw o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["response privacyAddressingMode should be lid but it is pn"]))),r("err")("GetContactBlacklist lid request invalid response");var g=[],h=[],y=f.map(function(e){var t=e.jid,n;if(t==null){var a=e.contactListIds;if(a==null||a.name!=="PnJid")throw o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["response contactListIds should be PnJid for user with no LID"]))),r("err")("GetContactBlacklist lid request invalid response");var i=o("WAWebJidToWid").userJidToUserWid(a.value.pnJid),l=o("WAWebLidMigrationUtils").toUserLid(i);if(l==null)return i;n=o("WAWebLidMigrationUtils").toUserLidOrThrow(l)}else{var s=o("WAWebJidToWid").userJidToUserWid(t);n=o("WAWebLidMigrationUtils").toUserLidOrThrow(s)}var u=e.contactListIds;if((u==null?void 0:u.name)==="Username")g.push({userId:n,username:u.value.username});else if((u==null?void 0:u.name)==="PnJid")h.push({lid:n,pn:o("WAWebJidToWid").userJidToUserWid(u.value.pnJid)});else throw o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["response contactListIds name is unexpected ",""])),u==null?void 0:u.name),r("err")("GetContactBlacklist lid request invalid response");return n});yield o("WAWebDBCreateLidPnMappings").createLidPnMappingsInBatches({mappings:h,flushImmediately:!0,learningSource:"other"}),o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&g.length>0&&(yield o("WAWebSetUsernameJob").setUsernamesJob(g));var C=_.dhash;return{status:"mismatch",users:y,dhash:C}}),_.apply(this,arguments)}l.queryPrivacyDisallowedListLid=p}),98); __d("WAWebQueryPrivacyDisallowedListPnJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebJidToWid","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("getPrivacyDisallowedListParser",function(e){var t=e.child("privacy"),n=t.maybeChild("list");if(n==null)return{status:"match"};var r=n.mapChildren(function(e){return o("WAWebJidToWid").deviceJidToUserWid(e.attrDeviceJid("jid"))});return{status:"mismatch",users:r,dhash:n.attrString("dhash")}});function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n,a=(n=o("WAWap")).wap("iq",{to:n.S_WHATSAPP_NET,type:"get",id:n.generateId(),xmlns:"privacy"},n.wap("privacy",null,n.wap("list",{name:n.CUSTOM_STRING(t),value:n.CUSTOM_STRING("contact_blacklist")}))),i=yield o("WADeprecatedSendIq").deprecatedSendIq(a,e);if(i.success)return i.result;throw r("err")("invalid response")}),u.apply(this,arguments)}l.queryPrivacyDisallowedListPn=s}),98); __d("WAWebQueryPrivacyDisallowedListUtil",["WALogger","WAWebPrivacyGatingUtils","WAWebQueryPrivacyDisallowedListLidJob","WAWebQueryPrivacyDisallowedListPnJob","WAWebSchemaPrivacyDisallowedList","asyncToGeneratorRuntime","justknobx"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(c(t))try{return yield o("WAWebQueryPrivacyDisallowedListLidJob").queryPrivacyDisallowedListLid(t)}catch(n){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[queryPrivacyDisallowedList] Failed to query privacy disallowed list with lid for type "," with error ",", falling back to pn"])),t,n).sendLogs("queryPrivacyDisallowedList-with-lid-failed")}return yield o("WAWebQueryPrivacyDisallowedListPnJob").queryPrivacyDisallowedListPn(t)}),u.apply(this,arguments)}function c(e){return r("justknobx")._("5326")?!1:e===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.About?o("WAWebPrivacyGatingUtils").isPrivacyListLidMigrationForStatusEnabled():e===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.GroupAdd?o("WAWebPrivacyGatingUtils").isPrivacyListLidMigrationForGroupAddEnabled():e===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.LastSeen?o("WAWebPrivacyGatingUtils").isPrivacyListLidMigrationForLastSeenEnabled():e===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.ProfilePicture?o("WAWebPrivacyGatingUtils").isPrivacyListLidMigrationForProfilePictureEnabled():(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}l.queryPrivacyDisallowedList=s,l.isPrivacyDisallowedListTypeLidMigrated=c}),98); __d("WAWebSyncPrivacyDisallowedLists",["Promise","WAWebQueryPrivacyDisallowedListUtil","WAWebSchemaPrivacyDisallowedList","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var r=yield(e||(e=n("Promise"))).all(t.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebQueryPrivacyDisallowedListUtil").queryPrivacyDisallowedList(e);return{type:e,response:t}});return function(t){return e.apply(this,arguments)}})())),a=[];return r.forEach(function(e){var t=e.response,n=t.dhash,r=t.status,o=t.users;r!=="mismatch"||o==null||n==null||a.push({id:e.type,disallowedList:o.map(function(e){return e.toString()}),dhash:n})}),yield o("WAWebSchemaPrivacyDisallowedList").getPrivacyDisallowedListTable().bulkCreateOrReplace(a),a}),u.apply(this,arguments)}function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield s([e])}),d.apply(this,arguments)}l.syncPrivacyDisallowedLists=s,l.syncSinglePrivacyDisallowedList=c}),98); __d("WAWebAccountSyncJob",["$InternalEnum","WATimeUtils","WAWebProfilePicThumbCollection","WAWebQueryDisappearingModeJob","WAWebQueryPrivacySettingsJob","WAWebSchemaPrivacyDisallowedList","WAWebSyncDeviceAdvDeviceListJob","WAWebSyncPrivacyDisallowedLists","WAWebTos","WAWebUpdateDisappearingModeForContact","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=n("$InternalEnum")({BLOCKLIST:"blocklist",OPTOUTLIST:"biz_opt_out_list",DEVICES:"devices",DISAPPEARING_MODE:"disappearing_mode",PICTURE:"picture",PRIVACY:"privacy",STATUS:"status",TOS:"tos",NOTICE:"notice",USER:"user",TEXT_STATUS:"text_status"});function s(e){return o("WAWebSyncDeviceAdvDeviceListJob").syncDeviceListJob(o("WAWebUserPrefsMeUser").getMePNandLIDWids(),e,null)}function u(){var e=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),t=o("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.get(e);return t!=null?o("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.resyncPictures([t]):o("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.resyncPicturesByWid([e])}function c(){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e,t=yield o("WAWebQueryPrivacySettingsJob").getPrivacy();o("WAWebUserPrefsGeneral").setUserPrivacySettings(t);var n=[(e=o("WAWebSchemaPrivacyDisallowedList")).PrivacyDisallowedListType.About,e.PrivacyDisallowedListType.GroupAdd,e.PrivacyDisallowedListType.LastSeen,e.PrivacyDisallowedListType.ProfilePicture],r=yield o("WAWebSyncPrivacyDisallowedLists").syncPrivacyDisallowedLists(n);return{privacySettings:t,privacyDisallowedRows:r}}),d.apply(this,arguments)}function m(e){var t=o("WATimeUtils").unixTime();e.forEach(function(e){var n;o("WAWebTos").TosManager.setState(e.id,e.state?"ACCEPTED":"NOT_ACCEPTED",(n=e.timestamp)!=null?n:t)})}function p(){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebQueryDisappearingModeJob").queryDisappearingMode();yield o("WAWebUpdateDisappearingModeForContact").updateDisappearingModeForContact({contactId:o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),newDuration:e.duration,newSettingTimestamp:e.t})}),_.apply(this,arguments)}l.AccountSyncType=e,l.getDevices=s,l.getAndUpdateProfilePicture=u,l.updatePrivacySettings=c,l.updateTosStateFromAccountSync=m,l.updateDefaultDisappearingMode=p}),98); __d("WAWebRestartRecentSyncJob",["Promise","WAJobOrchestratorTypes","WALogger","WAWebHistorySyncNotificationUtils","WAWebOrchestratorNonPersistedJob","WAWebProtobufsHistorySync.pb","WAWebSchemaHistorySyncNotification","WAWebSyncBootstrap","WAWebSyncGatingUtils","WAWebUserPrefsHistorySync","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m;function p(){return o("WAWebSyncGatingUtils").isHistorySyncHandlingRestartV2Enabled()?o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("restartRecentSyncJob",function(){return _()},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted():(m||(m=n("Promise"))).resolve()}function _(){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(r("WAWebSyncBootstrap").getIsHistorySyncRunning()){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync] History sync is running, skip restart recent sync job"])));return}var t=yield o("WAWebUserPrefsHistorySync").getHistorySyncStatus();if((t==null?void 0:t.recentCompleted)===!0){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Recent sync already completed, skip restart recent sync job"])));return}var n=yield o("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed"],0,{shouldDecrypt:!1}).then(function(e){return e.filter(function(e){return e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT||e.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL})});if(n.length===0){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[history sync] No unprocessed notifications found, skip restart recent sync job"])));return}o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Unprocessed notifications length: ",""])),n.length),o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Restart recent sync job"]))),r("WAWebSyncBootstrap").continueProgressiveHistorySyncProcessingV2(o("WAWebHistorySyncNotificationUtils").HistorySyncScheduleSource.ManualRestart)}),f.apply(this,arguments)}l.restartRecentSyncJob=p}),98); __d("WAWebNonAddressBookContactsJob",["WAJids","WALogger","WAWebApiContact","WAWebChatCollection","WAWebChatGetters","WAWebLidAwareContactsDB","WAWebModelStorageUtils","WAWebSchemaChat","WAWebSchemaParticipant","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m;function p(t){t===void 0&&(t=500);var n=[],r=[],a=new Set,i=new Set;for(var l of o("WAWebChatCollection").ChatCollection.toArray())i.size===t&&(n.push(i),i=new Set),o("WAWebChatGetters").getIsEligibleForContactSync(l)&&(o("WAWebChatGetters").getIsGroup(l)?r.push(l.id):a.has(l.id)||(i.add(l.id),a.add(l.id)));for(var s of r){var u,c,d=o("WAWebChatCollection").ChatCollection.get(s)||{},m=(u=(c=d.groupMetadata)==null?void 0:c.participants.toArray())!=null?u:[];for(var p of m)i.size===t&&(n.push(i),i=new Set),a.has(p.id)||(i.add(p.id),a.add(p.id))}return i.size!==0&&n.push(i),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["get "," chunks of contacts from chat collection, chunk size: ",""])),n.length,t).tags("contact-sync"),n}function _(){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=new Set;return yield o("WAWebSchemaParticipant").getParticipantTable().forEach(function(t){t.participants.forEach(function(t){r("WAWebWid").isStringLid(t)?e.add(o("WAJids").toLidUserJid(o("WAWebWidFactory").createWid(t).user)):e.add(o("WAJids").toPhoneUserJid(o("WAWebWidFactory").createWid(t).user))})}),yield o("WAWebSchemaChat").getChatTable().forEach(function(t){r("WAWebWid").isEligibleForUSync(t.id)&&(r("WAWebWid").isStringLid(t.id)?e.add(o("WAJids").toLidUserJid(o("WAWebWidFactory").createWid(t.id).user)):e.add(o("WAJids").toPhoneUserJid(o("WAWebWidFactory").createWid(t.id).user)))}),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["found "," contacts from chat and group participant tables"])),e.size).tags("contact-sync"),Array.from(e)}),f.apply(this,arguments)}function g(){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield r("WAWebLidAwareContactsDB").anyOf(["isAddressBookContact"],[1,0]),t=new Map(e.map(function(e){return[e.id,e.contactHash]}));return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["found "," contacts with set isAddressBookContact value from contact table"])),t.size).tags("contact-sync"),t}),h.apply(this,arguments)}function y(e,t){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(e.size!==0){var n=function(n,r){var e={id:n,contactHash:o("WAWebApiContact").getContactHash(n)};if(r.isLid()){var a=o("WAWebApiContact").getPhoneNumber(r);if(a!=null){var i,l=a.toJid();e.pnContactHash=(i=t.get(l))!=null?i:o("WAWebApiContact").getContactHash(l)}}return e},a=Array.from(e).reduce(function(e,r){var a;try{a=o("WAWebWidFactory").createUserWidOrThrow(r)}catch(t){return e}var i=n(r,a);if(e.push(i),a.isLid()){var l=o("WAWebApiContact").getPhoneNumber(a);if(l!=null){var s=l.toJid();if(t.get(s)==null){var u=n(s,l);e.push(u)}}}else{var c=o("WAWebApiContact").getCurrentLid(a);if(c!=null){var d=c.toJid();if(t.get(d)==null){var m=n(d,c);e.push(m)}}}return e},[]);return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["add missing contactHashes to "," contacts"])),a.length).tags("contact-sync"),r("WAWebLidAwareContactsDB").bulkCreateOrMerge(a,"NonAddressBookContactsJob.addMissingContactHashesToContacts")}}),C.apply(this,arguments)}function b(){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield _();return o("WAWebModelStorageUtils").getStorage().lock(["contact"],n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield g(),n=new Set,a=Array.from(e,function(e){var r={id:e,isContactSyncCompleted:0};return t.has(e)||(r.isAddressBookContact=0),t.get(e)==null&&n.add(e),r});o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["mark "," contacts dirty during the regular sync"])),a.length).tags("contact-sync"),yield r("WAWebLidAwareContactsDB").bulkCreateOrMerge(a,"NonAddressBookContactsJob.getNonAddressBookContactsAndMarkAllContactsDirty"),t.forEach(function(e,t){e==null&&n.add(t)}),yield y(n,t)}))}),v.apply(this,arguments)}function S(){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield _();return o("WAWebModelStorageUtils").getStorage().lock(["contact"],n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield g(),n=e.filter(function(e){return!t.has(e)}),a=n.map(function(e){return{id:e,isAddressBookContact:0,isContactSyncCompleted:0}});o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["get "," non-address book contacts, mark dirty, and update the contact table during the initial sync"])),a.length).tags("contact-sync"),yield r("WAWebLidAwareContactsDB").bulkCreateOrMerge(a,"NonAddressBookContactsJob.getAndUpdateNonAddressBookContacts");var i=new Set(e.filter(function(e){return t.get(e)==null}));t.forEach(function(e,t){e==null&&i.add(t)}),yield y(i,t)}))}),R.apply(this,arguments)}l.getAllContactsFromChatCollectionIntoChunks=p,l.getNonAddressBookContactsAndMarkAllContactsDirty=b,l.getAndUpdateNonAddressBookContacts=S}),98); __d("WAWebSyncContactJob",["WAJobOrchestratorTypes","WAWebContactSyncApi","WAWebOrchestratorNonPersistedJob"],(function(t,n,r,o,a,i,l){function e(e,t,n){t===void 0&&(t=!0);var r={contactIds:e,shouldDelayBetweenChunks:t,mode:n};return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("syncContactListInChunks",function(e){return o("WAWebContactSyncApi").syncContactListInChunks(e)},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(r)}function s(e,t,n){t===void 0&&(t=!0);var r={contactIds:e,shouldSyncDevice:t,mode:n};return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("syncContactList",function(e){return o("WAWebContactSyncApi").syncContactList(e)},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted(r)}l.syncContactListInChunksJob=e,l.syncContactListJob=s}),98); __d("WAWebSyncContactsJob",["WALogger","WANullthrows","WAShiftTimer","WAWebContactSyncApi","WAWebLidAwareContactsDB","WAWebLocalStorage","WAWebUserPrefsAppStateSync","WAWebUserPrefsKeys","WAWebUserPrefsMultiDevice","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c=86400,d=2e4,m=1e3,p=60,_=null,f=[];function g(t){f.push(t),_?_.debounce(m):(_=new(o("WAShiftTimer")).ShiftTimer(function(){if(o("WAWebUserPrefsMultiDevice").isRegistered()){var t=f;f=[],_=null,o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["start new contact sync for "," contacts"])),t.length).tags("contact-sync"),o("WAWebContactSyncApi").syncContactListInChunks({contactIds:t,shouldDelayBetweenChunks:!0,mode:"query"}).catch(function(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncNewContact: contact sync failed, error: ",""])),e).verbose().tags("non-sad","contact-sync").sendLogs("syncNewContact: contact sync failed")})}}),_.onOrBefore(d))}function h(){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield r("WAWebLidAwareContactsDB").equals(["isContactSyncCompleted"],0),t=e.map(function(e){return o("WAWebWidFactory").createWid(e.id)});return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["sync dirty contacts, found "," contacts to sync"])),t.length).tags("contact-sync"),o("WAWebContactSyncApi").syncContactListInChunks({contactIds:t,shouldDelayBetweenChunks:!0,mode:"query"})}),y.apply(this,arguments)}function C(){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){(yield o("WAWebUserPrefsMultiDevice").getShouldCheckContactSyncStatus())&&self.setTimeout(function(){h()},p*1e3),yield o("WAWebUserPrefsAppStateSync").setShouldCheckContactSyncStatus()}),b.apply(this,arguments)}function v(){var e,t=(e=r("WANullthrows")(r("WAWebLocalStorage")).getItem(o("WAWebUserPrefsKeys").KEYS.CONTACT_SYNC_REFRESH))!=null?e:c;return parseInt(t,10)}l.syncNewContact=g,l.runSyncDirtyContactsJob=C,l.getContactSyncRefreshSeconds=v}),98); __d("WAWebSyncdRequestAllSyncdMissingKeysJob",["WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebSyncdHandleMissingKeys","WAWebSyncdStoreMissingKeys","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("requestAllSyncdMissingKeys",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAWebSyncdHandleMissingKeys").requestAllMissingKeys(),self.setTimeout(o("WAWebSyncdStoreMissingKeys").setMissingKeyTimeoutInTransaction,1e3*20)}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,maxTimeoutMs:1e3*30}).waitUntilCompleted()}l.requestAllSyncdMissingKeysJob=e}),98); __d("WAWebSyncdSyncAllCollectionsJob",["WAJobOrchestratorTypes","WALogger","WASyncdConst","WATimeUtils","WAWebOrchestratorNonPersistedJob","WAWebSyncd","WAWebUserPrefsAppStateSync","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("syncdSyncAllCollections",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: periodic sync for all collection"]))),yield o("WAWebSyncd").markCollectionsForSync([o("WASyncdConst").CollectionName.CriticalBlock,o("WASyncdConst").CollectionName.CriticalUnblockLow,o("WASyncdConst").CollectionName.Regular,o("WASyncdConst").CollectionName.RegularLow,o("WASyncdConst").CollectionName.RegularHigh]),yield o("WAWebUserPrefsAppStateSync").setLastPeriodicAppStateSyncTs(o("WATimeUtils").unixTime())}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.LOW,maxTimeoutMs:1e3*30}).waitUntilCompleted()}l.syncdSyncAllCollectionsJob=s}),98); __d("WAWebNonMessageDataRequestMediaHandlingUtils",["Promise","WAJobOrchestratorTypes","WATimeUtils","WAWebMediaMmsV4Upload","WAWebOrchestratorNonPersistedJob","WAWebProtobufsE2E.pb","WAWebSchemaNonMessageDataRequest","WAWebSendNonMessageDataRequest","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=15,u=15,c=new Set,d=new Map,m=new Map;function p(e){d.clear(),e.forEach(function(e){e.operationType===o("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD&&d.set(e.id,e)})}function _(){return m.clear(),o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("requestAllSyncdMissingKeys",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WATimeUtils").unixTime(),t=o("WAWebSchemaNonMessageDataRequest").getNonMessageDataRequestTable(),n=yield t.all();n.filter(function(t){return!(t.operationType!==o("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD||t.requestType!==o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER||t.lastRequestTimeStampSec!=null&&e-t.lastRequestTimeStampSec>48*o("WATimeUtils").HOUR_SECONDS||t.requestRetryCount!=null&&t.requestRetryCount>=3)}),o("WAWebSendNonMessageDataRequest").sendPeerDataOperationRequest(o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER,{fileSha256Arr:n.map(function(e){return e.fileKey})})}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted()}function f(e,t){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r){var a=o("WAWebSchemaNonMessageDataRequest").getNonMessageDataRequestTable(),i=Array.from(t.keys()),l=o("WATimeUtils").unixTime(),s=[];yield(e||(e=n("Promise"))).all(i.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n,i=b(e,r,o("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.SEND_REQUEST),u=yield a.get(i);s.push({id:i,fileKey:e,requestType:r,operationType:o("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.SEND_REQUEST,lastRequestTimeStampSec:l,requestRetryCount:((n=u==null?void 0:u.requestRetryCount)!=null?n:0)+1,responseError:t.get(e)})});return function(t){return e.apply(this,arguments)}})())).then(function(){a.bulkCreateOrReplace(s)})}),g.apply(this,arguments)}function h(e,t,n){var r=b(e,t,o("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD),a=d.get(r);return a!=null&&a.lastMediaUploadSuccess===!0&&a.lastMediaUploadTimeStampSec!=null&&n-a.lastMediaUploadTimeStampSec<=o("WATimeUtils").DAY_SECONDS}function y(e,t,n){var r=b(e,t,o("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD),a=d.get(r),i=v(n,a==null?void 0:a.lastRequestTimeStampSec);return a!=null&&a.lastMediaUploadSuccess===!1&&i&&a.mediaUploadFailureCount!=null&&a.mediaUploadFailureCount>=s}function C(e,t){var n=[];e.forEach(function(e,r){var a,i=b(r,o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER,o("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD),l=d.get(i),s=!v(t,l==null?void 0:l.lastMediaUploadTimeStampSec),u=e===o("WAWebMediaMmsV4Upload").UploadMediaResultKind.SUCCESS,c=(s?0:(a=l==null?void 0:l.mediaUploadFailureCount)!=null?a:0)+(u?0:1),m={id:i,fileKey:r,requestType:o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.UPLOAD_STICKER,operationType:o("WAWebSchemaNonMessageDataRequest").DataRequestUploadOperationType.MEDIA_UPLOAD,lastMediaUploadTimeStampSec:t,lastMediaUploadSuccess:u,mediaUploadFailureCount:c};d.set(i,m),n.push(m)});var r=o("WAWebSchemaNonMessageDataRequest").getNonMessageDataRequestTable();r.bulkCreateOrReplace(n)}function b(e,t,n){return e+"_"+String(t)+"_"+String(n)}function v(e,t){var n=new Date(e*1e3).toDateString(),r=t!=null?new Date(t*1e3).toDateString():n;return n===r}l.MEDIA_REUPLOAD_REQUEST_LIMIT=u,l.inFlightStickerRequests=c,l.mediaReuploadRequestCountMap=m,l.initializeMediaUploadResultFromStorage=p,l.retryNonMessageDataRequestJob=_,l.insertResponseError=f,l.shouldSkipMediaUploadWithSuccess=h,l.shouldSkipMediaUploadWithCancellation=y,l.insertMediaUploadResult=C}),98); __d("WAWebNonMessageDataRequestPlaceholderMessageResendUtils",["WATimeUtils","WAWebABProps","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebSendNonMessageDataRequest","WAWebSyncGatingUtils"],(function(t,n,r,o,a,i,l){var e=new Set,s=new Set,u=32;function c(t,n){if(!(!o("WAWebSyncGatingUtils").isPlaceholderMessageResendEnabled()||!n)){var r=[],a=o("WATimeUtils").unixTime(),i=o("WAWebABProps").getABPropConfigValue("placeholder_message_resend_maximum_days_limit")*o("WATimeUtils").DAY_SECONDS;if(t.forEach(function(t){t.type===o("WAWebMsgType").MSG_TYPE.CIPHERTEXT&&!e.has(t.id)&&a-t.t<=i&&!t.unsafe().isMdHistoryMsg&&t.subtype!=="bot_unavailable_fanout"&&t.subtype!=="hosted_unavailable_fanout"&&t.subtype!=="view_once_unavailable_fanout"&&(e.add(t.id),r.push(t.id))}),r.length>0)for(var l=0;l0;)try{p=yield s.execute();var g=p.error.all;if(g){var h;throw f=(h=g.errorBackoff)!=null?h:10*Math.random(),r("err")("syncContactList: error "+g.errorCode+": "+g.errorText)}else _=0}catch(e){var y=r("getErrorSafe")(e);_===0&&o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["failed to execute usync query"]))).verbose().sendLogs("failed to execute usync query: "+y.message),yield o("WAPromiseDelays").delayMs(f*1e3)}if(!(p==null||p.error.all)){var C=p.refresh,b=[];for(var S of Object.keys(C))b.push(C[S]);if(b.length>0){var R=Math.min.apply(Math,b);W(R)}yield $(p),yield(v||(v=n("Promise"))).all([i?A(p,d):(v||(v=n("Promise"))).resolve(),D(p),o("WAWebHandleUsernameSync").handleUsernameSync(p),k(p),I(p),N(p)]),yield w(t)}}}),E.apply(this,arguments)}function k(t){var n=t.error.status;if(n){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["handleSyncStatus: failed "," : ",""])),n.errorCode,n.errorText);return}t.list.map(function(e){var t=o("WAWebTextStatusCollection").TextStatusCollection.get(e.id);t&&e.status&&t.set({status:e.status})})}function I(e){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!o("WAWebTextStatusGatingUtils").receiveTextStatusEnabled())return(v||(v=n("Promise"))).resolve();var t=e.error.text_status;if(t){o("WALogger").WARN(p||(p=babelHelpers.taggedTemplateLiteralLoose(["handleSyncTextStatus: failed "," : ",""])),t.errorCode,t.errorText);return}yield(v||(v=n("Promise"))).all(e.list.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.text_status){var t=e.text_status,n=t.emoji,r=t.ephemeralDurationSeconds,a=t.lastUpdateTime,i=t.text;yield o("WAWebUpdateTextStatusForContact").updateTextStatusForContact(e.id,i,n,r,a)}});return function(t){return e.apply(this,arguments)}})()))}),T.apply(this,arguments)}function D(e){return x.apply(this,arguments)}function x(){return x=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.error.status;if(t){o("WALogger").WARN(_||(_=babelHelpers.taggedTemplateLiteralLoose(["handleDisappearingMode: failed "," : ",""])),t.errorCode,t.errorText);return}yield(v||(v=n("Promise"))).all(e.list.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){e.disappearing_mode&&(yield o("WAWebUpdateDisappearingModeForContact").updateDisappearingModeForContact({contactId:e.id,newDuration:e.disappearing_mode.duration,newSettingTimestamp:e.disappearing_mode.t,newEphemeralityDisabled:e.disappearing_mode.ephemeralityDisabled===!0}))});return function(t){return e.apply(this,arguments)}})()))}),x.apply(this,arguments)}function $(e){return P.apply(this,arguments)}function P(){return P=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.error.lid;t&&o("WALogger").WARN(f||(f=babelHelpers.taggedTemplateLiteralLoose(["handleLidSync: error ",": ",""])),t.errorCode,t.errorText);var n=[],r=[];e.list.forEach(function(e){var t=e.id,a=e.lid,i=e.pn;if(a!=null){if(t.isLid()){o("WALogger").WARN(g||(g=babelHelpers.taggedTemplateLiteralLoose(["handleLidSync: lidResults entry has lid as id, skipping: ",""])),t.toLogString());return}n.push({lid:o("WAWebWidFactory").createUserWidOrThrow(a,"lid"),pn:t})}else if(i!=null){if(!t.isLid()){o("WALogger").WARN(h||(h=babelHelpers.taggedTemplateLiteralLoose(["handleLidSync: pnResults entry has phone number as id, skipping: ",""])),t.toLogString());return}r.push({lid:t,pn:i})}}),n.length>0&&r.length>0&&o("WALogger").WARN(y||(y=babelHelpers.taggedTemplateLiteralLoose(["handleLidSync: mixed mapping types detected - lidResults: ",", pnResults: ",""])),n.length,r.length);var a=[].concat(n,r);a.length>0&&(yield o("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:a,flushImmediately:!0,learningSource:"usync"}))}),P.apply(this,arguments)}function N(e){return M.apply(this,arguments)}function M(){return M=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.list.filter(function(e){var t=e.business;return!!t});yield o("WAWebBizVerifiedNameAction").handleVerifiedNameSync(t.map(function(e){var t=e.business.verifiedName,n=e.id;return{id:n,verifiedName:t}}))}),M.apply(this,arguments)}function w(e){var t=e.map(function(e){var t=e.isLid()?o("WAJids").toLidUserJid(e.user):o("WAJids").toPhoneUserJid(e.user);return{id:t,isContactSyncCompleted:1}});return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["mark "," contacts completed for contact sync"])),t.length).tags("contact-sync"),r("WAWebLidAwareContactsDB").bulkCreateOrMerge(t,"ContactSyncApi.markContactsSyncCompleted")}function A(e,t){return F.apply(this,arguments)}function F(){return F=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=e.error.devices;n&&o("WALogger").WARN(C||(C=babelHelpers.taggedTemplateLiteralLoose(["handleSyncDevice: error ",": ",""])),n.errorCode,n.errorText);var r=e.list.filter(function(e){return e.devices&&e.devices.deviceList!=null&&e.devices.keyIndex!=null&&!("errorCode"in e.devices)}).map(function(e){return{wid:e.id,devices:e.devices}});return o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["handleSyncDevice: skipping "," out of "," records"])),e.list.length-r.length,e.list.length),r=o("WAWebContactSyncUtils").backfillMissingDeviceSyncEntries(t,r),yield o("WAWebGetIdentityKeysJob").getAndStoreIdentityKeys(r.map(function(e){return e.wid})),o("WAWebAdvHandlerApi").handleADVDeviceSyncResult(r)}),F.apply(this,arguments)}function O(e){return B.apply(this,arguments)}function B(){return B=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebApiDeviceList").getDeviceIds(e),r=t.map(function(e){return e==null?[]:e.devices.map(function(t){return o("WAWebWidFactory").createDeviceWidFromDeviceListPk(e.id,t.id,t.isHosted)})}),a=yield(v||(v=n("Promise"))).all(r.map(function(e){return e.length===0?"":o("WAWebPhashUtils").phashV2(e)})),i=e.map(function(e,t){return{id:e,hash:a[t]}});return i}),B.apply(this,arguments)}function W(e){if(Number.isNaN(e)||e<=o("WATimeUtils").HOUR_SECONDS){o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["invalid contact sync refresh period: ",""])),e).tags("contact-sync");return}o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["set contact sync refresh period: ",""])),e).tags("contact-sync"),r("WANullthrows")(r("WAWebLocalStorage")).setItem(o("WAWebUserPrefsKeys").KEYS.CONTACT_SYNC_REFRESH,String(e))}l.syncContactListInChunks=S,l.syncContactList=L,l.handleLidSync=$,l.markContactsSyncCompleted=w}),98); __d("WAWebOutgoingMessage",["$InternalEnum","WALogger","WAWebE2EProtoGenerator","WAWebE2EProtoUtils","WAWebFrontendMsgGetters","WAWebHandleMsgError","WAWebMessagePluginParseProtobuf","WAWebMessageSecretLocationUtils","WAWebMsgType","WAWebProcessBaseMsgInfo","WAWebSendMsgTypes","WAWebVerifyProtobufMsgObjectKeys","cr:10197"],(function(t,n,r,o,a,i,l){var e,s,u,c=new Set([(u=o("WAWebMsgType")).MSG_TYPE.CIPHERTEXT,u.MSG_TYPE.UNKNOWN,u.MSG_TYPE.GP2,u.MSG_TYPE.E2E_NOTIFICATION,u.MSG_TYPE.NOTIFICATION_TEMPLATE]),d=n("$InternalEnum")({Chat:"chat",ChatResend:"chat-resend",Retry:"retry",Newsletter:"newsletter",Report:"report",Status:"status",Debug:"debug"}),m=function(n,r,a){if(!c.has(r.data.type)){try{var t=o("WAWebE2EProtoUtils").getMutableMessageProtobuf(a);o("WAWebVerifyProtobufMsgObjectKeys").verifyProtobufMessageObjectKeys(t),o("WAWebMessagePluginParseProtobuf").parseProtobuf({msgContext:"outgoing",messageProtobuf:t,baseMessage:r.type===o("WAWebSendMsgTypes").SendMessageRecordType.Message?o("WAWebProcessBaseMsgInfo").msgToBaseMsgInfo(r.data):o("WAWebProcessBaseMsgInfo").msgDataToBaseMsgInfo(r.data)})}catch(t){throw t instanceof o("WAWebHandleMsgError").MessageValidationError?o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["generate proto: type:"," error:",""])),r.data.type,t.name).tags("messaging").sendLogs("outgoingMsg: "+t.name):o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["generate proto uncategorized error: msgId:"," type:"," error:",""])),r.data.id,r.data.type,t).sendLogs("outgoing "+String(n)+" "+r.data.type,{sampling:.01}),t}o("WAWebMessageSecretLocationUtils").verifyTopLevelMessageSecret(a,o("WAWebMessageSecretLocationUtils").MessageSecretCheckContext.Sender)}},p="https://web.whatsapp.net",_=function(t){t.type===o("WAWebMsgType").MSG_TYPE.STICKER&&t.deprecatedMms3Url==null&&(t.deprecatedMms3Url=p);var e;if(o("WAWebFrontendMsgGetters").getAsMms(t)){var n=t.isUnsentPhoneMsg();e=n?{type:t.type}:t.avParams(),t.type===o("WAWebMsgType").MSG_TYPE.STICKER&&!n&&e.url==null&&(e.url=p)}return o("WAWebE2EProtoGenerator").createMsgProtobuf(t,e||{})},f=function(t,n){var e=n.type===o("WAWebSendMsgTypes").SendMessageRecordType.Message?_(n.data):o("WAWebE2EProtoGenerator").createAddonProtobuf(n.data);return m(t,n,e),e},g=function(t,n){return f(t,{type:o("WAWebSendMsgTypes").SendMessageRecordType.Message,data:n})};l.OutgoingMessageOriginType=d,l.createOutgoingMessageProtobuf=f,l.createOutgoingMsgModelProtobuf=g}),98); __d("WAWebICDCMetaApi",["WAWebAdvMetadataCreationFailureWamEvent","WAWebE2EProtoGenerator","WAWebIdentityIcdcApi","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),r,a;try{r=yield o("WAWebIdentityIcdcApi").getICDCMeta(n)}catch(e){throw new(o("WAWebAdvMetadataCreationFailureWamEvent")).AdvMetadataCreationFailureWamEvent({advMetadataIsMe:!0}).commit(),e}try{a=o("WAWebUserPrefsMeUser").isMeAccount(e)?null:yield o("WAWebIdentityIcdcApi").getICDCMeta(e)}catch(e){throw new(o("WAWebAdvMetadataCreationFailureWamEvent")).AdvMetadataCreationFailureWamEvent({advMetadataIsMe:!1}).commit(),e}o("WAWebE2EProtoGenerator").populateMessageContextInfo(t,r,a)}),s.apply(this,arguments)}l.populateICDCMeta=e}),98); __d("WAWebStatusStorageUtils",["invariant","WAWebIdb","WAWebStorage"],(function(t,n,r,o,a,i,l,s){var e="status-storage",u=null;function c(){var t=new(r("WAWebIdb"))(e);u=new(o("WAWebStorage")).Storage(t)}function d(){return u!=null||s(0,92225),u}l.createStorage=c,l.getStorage=d}),98); __d("WAWebStatusStorageVersions",["WAWebStatusStorageUtils"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebStatusStorageUtils").getStorage().versions.version(0)}l.statusCreateTable=e}),98); __d("WAWebSchemaStatus",["WAWebStatusStorageUtils","WAWebStatusStorageVersions","WAWebStorageMutationBuilder"],(function(t,n,r,o,a,i,l){"use strict";var e=o("WAWebStorageMutationBuilder").columnBuilder(),s=e.addAutoIncrementingPrimaryKey,u=e.addColumn,c=e.addUniqueIndex;function d(){var e=o("WAWebStatusStorageUtils").getStorage();e.add("status").version(o("WAWebStatusStorageVersions").statusCreateTable(),[s("id"),u("status_uuid"),c("status_uuid"),u("sender_user_jid"),u("type"),u("timestamp"),u("state"),u("is_archived"),u("media_row_id"),u("secret")])}l.addTable=d}),98); __d("WAWebStatusStorageInitialize",["WALogger","WAWeb-dexie","WAWebDbRolloutUtil","WAWebSchemaStatus","WAWebStatusStorageUtils","WAWebStorage","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return s==null&&(yield o("WAWebDbRolloutUtil").loadSchemaVersions(),o("WAWebStatusStorageUtils").createStorage(),o("WAWebSchemaStatus").addTable(),s=o("WAWebStatusStorageUtils").getStorage().initialize().catch(function(t){var n="Unknown error";throw t instanceof o("WAWebStorage").AlreadyInitializedError||t instanceof o("WAWebStorage").NoSuchDatabaseError?n=t.toString():t instanceof r("WAWeb-dexie").DexieError&&(n="Unknown DexieError"),o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Failed to initialize status storage: ",""])),n).verbose().sendLogs("failed-to-initialize-status-storage",{sendLogsType:o("WALogger").SendLogsType.CRASH_OR_UNRECOVERABLE_ERROR_SAD}),t})),s}),c.apply(this,arguments)}l.initialize=u}),98); __d("WAWebStatusStorage",["WAWebStatusStorageInitialize","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAWebStatusStorageInitialize").initialize()}),s.apply(this,arguments)}Object.keys(o("WAWebStatusStorageInitialize")).forEach(function(e){e==="default"||e==="__esModule"||(l[e]=o("WAWebStatusStorageInitialize")[e])}),l.initialize=e}),98); __d("WAWebLaunchSocket",["Promise","WAComms","WAGzip","WALogger","WAWebABPropsUpdateFromStorage","WAWebApiContact","WAWebBackendApi","WAWebBackendEventBus","WAWebBridgeInitialization","WAWebBrokerGlobalAppState","WAWebBuildConstants","WAWebCommsConfig","WAWebCommsHandleStanza","WAWebCryptoEncKeyHelper","WAWebCurrentUser","WAWebDbRolloutUtil","WAWebEnvironment","WAWebEventSamplingCache","WAWebFtsClient","WAWebInitFromStorage","WAWebInvocationInterface","WAWebModelStorage","WAWebPageLoadLogging","WAWebPushNotificationsOfflineBbApi","WAWebRegistration","WAWebSchemaVersions","WAWebSignalStorage","WAWebSocketModel","WAWebStartBackend","WAWebStatusStorage","WAWebUserPrefsGeneral","WAWebUserPrefsIsLoggedIn","WAWebUserPrefsMultiDevice","WAWebWaitForInitialChatsSynced","WAWebWamEnumWebcScenarioType","WAWebWamMemoryStat","WAWebWamOfflineResumeReporter","WAWebWorkerStorage","asyncToGeneratorRuntime","err","gkx","requireDeferred"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g=r("requireDeferred")("WAWebSetFrontendHandlerApi").__setRef("WAWebLaunchSocket"),h=r("requireDeferred")("WAWebSetWorkerSafeHandlerApi").__setRef("WAWebLaunchSocket");function y(){o("WAComms").stopComms(),C()}o("WAWebBackendEventBus").BackendEventBus.onReconnectSocket(function(){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["reconnect_socket triggered, resetting socket loop"]))),o("WAComms").closeSocketAndResume()});function C(){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WAWebCommsConfig").getCommsConfig(void 0);return o("WAComms").startComms(r("WAWebCommsHandleStanza"),e,function(e){return(f||(f=n("Promise"))).resolve(o("WAGzip").inflate(e))}),yield o("WAComms").waitForConnection(),o("WAComms").startHandlingRequests()}),b.apply(this,arguments)}function v(e){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[socket] start launchSocket flow with mutexComplete promise ",""])),e==null?"NULL":"not null"),r("gkx")("26258")||(e!=null?o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[socket] entered eager launchSocket flow"]))).sendLogs("intern-launchSocket-eager",{sampling:0}):o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[socket] entered legacy launchSocket flow"]))).sendLogs("intern-launchSocket-legacy",{sampling:0})),o("WAWebPageLoadLogging").startPageLoadQplMeasure("launchSocket");var t=o("WAWebBridgeInitialization").makeBridge();return o("WAWebBackendApi").setApi(t),g.load().then(function(e){var n=e.setFrontendHandlers;return n(t)}),h.load().then(function(e){var n=e.setWorkerSafeHandlers;return n(t)}),o("WAWebFtsClient").ftsClient.initialize(),o("WAWebStartBackend").setupStartBackendListeners(),o("WAWebDbRolloutUtil").loadSchemaVersions().then(function(){return S()}).then(function(){return o("WAWebCryptoEncKeyHelper").initEncSalt()}).then(function(){return o("WAWebCryptoEncKeyHelper").initEncSaltForInvoker()}).then(function(){return o("WAWebSignalStorage").initialize()}).then(function(){return(f||(f=n("Promise"))).all([o("WAWebModelStorage").initialize(),e])}).then(function(){return o("WAWebStatusStorage").initialize()}).then(function(){return(f||(f=n("Promise"))).all([o("WAWebUserPrefsGeneral").getLogoutReason(),o("WAWebWorkerStorage").initialize(),o("WAWebUserPrefsGeneral").setAppVersionBase(o("WAWebBuildConstants").VERSION_BASE)])}).catch(function(e){o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[socket] storageInitializationError triggered logout: ","."])),(e==null?void 0:e.message)||(e==null?void 0:e.name)).tags("launch-socket"),o("WAWebBackendEventBus").BackendEventBus.triggerStorageInitializationError()}).then(function(e){var t=e==null?void 0:e[0];if(t&&(r("WAWebEnvironment").isWindows&&o("WAWebCurrentUser").isEmployee()?o("WAWebBackendEventBus").BackendEventBus.triggerUnexpectedLogoutModal(t.reason):o("WAWebSocketModel").Socket.logout(t.reason)),r("WAWebBrokerGlobalAppState").isLogoutInProgress)throw r("err")("aborting launchSocket due to logout");return o("WAWebUserPrefsMultiDevice").isRegistered()?(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[socket] launchSocket for login"]))),o("WAWebUserPrefsIsLoggedIn").setIsConnectedAsRegistered(!0),o("WAWebBackendEventBus").BackendEventBus.triggerInitialLoadReady(),o("WAWebWamMemoryStat").setCurrentMemoryScenario(o("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.OFFLINE_RESUME),o("WAWebModelStorage").initialize().catch(function(){return o("WAWebBackendEventBus").BackendEventBus.triggerStorageInitializationError()}).then(function(){return(f||(f=n("Promise"))).all([o("WAWebABPropsUpdateFromStorage").updateABPropsFromStorage(),o("WAWebEventSamplingCache").updateEventSamplingFromStorage()])}).then(function(){o("WAWebBackendEventBus").BackendEventBus.triggerAbPropsLoaded(),o("WAWebInitFromStorage").restoreImportantMetaData()}).then(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=function(){return o("WAWebPageLoadLogging").startPageLoadQplMeasure("lidCacheWarmup"),o("WAWebApiContact").warmUpAllLidPnMappings().then(function(e){return o("WAWebPageLoadLogging").endPageLoadQplMeasure("lidCacheWarmup")})};yield(f||(f=n("Promise"))).all([o("WAWebInitFromStorage").restoreBlocklist(),o("WAWebInitFromStorage").restoreOptOutList(),e()])})).then(function(){o("WAWebPushNotificationsOfflineBbApi").setStartCommsT(),o("WAWebPageLoadLogging").endPageLoadQplMeasure("launchSocket"),o("WAWebStartBackend").startBackend()})):(o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[socket] launchSocket for registration"]))),o("WAWebWamMemoryStat").setCurrentMemoryScenario(o("WAWebWamEnumWebcScenarioType").WEBC_SCENARIO_TYPE.INITIAL_PAIRING),o("WAWebWamOfflineResumeReporter").OfflineResumeReporter.setIsInitialSync(),o("WAWebWaitForInitialChatsSynced").initWaitForInitialChatsSynced(),(f||(f=n("Promise"))).all([o("WAWebRegistration").refreshNoiseCredentials(),o("WAWebRegistration").refreshSignalCredentials()]).then(function(){o("WAWebPageLoadLogging").endPageLoadQplMeasure("launchSocket"),C()}))})}function S(){o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[storage] send schema versions to fts worker"]))),o("WAWebInvocationInterface").get().setSchemaVersions(o("WAWebSchemaVersions").getSchemaVersions())}l.refreshQR=y,l.launchSocket=v}),98); __d("WAWebFeatureDetectionDetermineIncognito",["Promise","WACustomError","WAFilteredCatch","WALogger","WAPromiseTimeout","WAWebBoolFunc","WAWebIndexedDB","WAWebLocalStorage","WAWebUA","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s;function u(){var t=new(s||(s=n("Promise")))(function(e){function t(){e(!1)}if(self.requestFileSystem)self.requestFileSystem(window.TEMPORARY,1,t,function(t){e(t.name==="SecurityError")});else if(r("WAWebIndexedDB")){var n=r("WAWebIndexedDB").open("pb_detect");n?(n.onsuccess=t,n.onerror=function(t){t.preventDefault(),window.InvalidStateError?e(t instanceof window.InvalidStateError):e(!0)}):t()}else o("WAWebUA").UA.isTrident?e(!0):t()}).then(function(e){if(e)return e;if(!r("WAWebLocalStorage"))return!1;try{return r("WAWebLocalStorage").setItem("INCOG","0"),r("WAWebLocalStorage").removeItem("INCOG"),!1}catch(e){var t=r("getErrorSafe")(e);if(t.name==="QuotaExceededError")return!0;throw t}});return o("WAPromiseTimeout").promiseTimeout(t,100,"detectIncognitoTimeout").catch(o("WAFilteredCatch").filteredCatch(o("WACustomError").TimeoutError,o("WAWebBoolFunc").returnFalse)).catch(function(t){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["promiseUtil:determineIncognito failed check: ",""])),String(t)).sendLogs("incog-throw"),!1})}l.default=u}),98); __d("WAWebMediaArrayBufferCacheStore",["WAWebKeyValueCacheStore"],(function(t,n,r,o,a,i,l){var e={ignoreSearch:!0,ignoreMethod:!0,ignoreVary:!0},s=(function(t){function n(n){return t.call(this,n,u,c,{encodeKey:d,matchOptions:e})||this}return babelHelpers.inheritsLoose(n,t),n})(r("WAWebKeyValueCacheStore"));function u(e){return new Response(e)}function c(e){return e.arrayBuffer()}function d(e,t){var n=encodeURIComponent(e),r=encodeURIComponent(t);return"https://_media_cache_v2_.whatsapp.com/"+r+"_"+n}l.default=s}),98); __d("WAWebLruMediaStorage",["WAWebLruMediaStorageUtils","once"],(function(t,n,r,o,a,i,l){var e=r("once")(function(){return o("WAWebLruMediaStorageUtils").getStorage().initialize()});l.initialize=e}),98); __d("WAWebMediaLruIdbStoreUtils",["Promise","WAWebAbstractStore","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=(function(t){function r(e,n){var r;return r=t.call(this)||this,r.$IdbStore$p_1=e,r.$IdbStore$p_2=n,r}babelHelpers.inheritsLoose(r,t);var o=r.prototype;return o.doGet=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return yield this.$IdbStore$p_1(),this.$IdbStore$p_2.get(e)});function t(t){return e.apply(this,arguments)}return t})(),o.doQueryByIndex=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){return yield this.$IdbStore$p_1(),this.$IdbStore$p_2.all({limit:t.limit,index:[e]})});function t(t,n){return e.apply(this,arguments)}return t})(),o.doGetAll=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield this.$IdbStore$p_1(),this.$IdbStore$p_2.all()});function t(){return e.apply(this,arguments)}return t})(),o.doPut=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=this;return yield this.$IdbStore$p_1().then(function(){return n.$IdbStore$p_2.createOrReplace(t)}),t});function t(t,n){return e.apply(this,arguments)}return t})(),o.doDel=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return yield this.$IdbStore$p_1(),this.$IdbStore$p_2.remove(e)});function t(t){return e.apply(this,arguments)}return t})(),o.doCount=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield this.$IdbStore$p_1(),this.$IdbStore$p_2.count()});function t(){return e.apply(this,arguments)}return t})(),o.doClear=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield this.$IdbStore$p_1(),this.$IdbStore$p_2.clear(!0)});function t(){return e.apply(this,arguments)}return t})(),o.doOpen=function(){return this.$IdbStore$p_1()},o.doClose=function(){return(e||(e=n("Promise"))).resolve()},r})(r("WAWebAbstractStore"));l.default=s}),98); __d("WAWebSchemaLruMediaArrayBuffer",["WAWebLruMediaStorageUtils","WAWebStorageMutationBuilder"],(function(t,n,r,o,a,i,l){var e="id",s="data",u="lru-media-array-buffer",c=o("WAWebStorageMutationBuilder").columnBuilder(),d=c.addColumn,m=c.addUserDefinedPrimaryKey;o("WAWebLruMediaStorageUtils").getStorage().add(u).version(o("WAWebLruMediaStorageUtils").getStorage().versions.version(0),[m(e),d(s)]).view(function(t){var n={id:t[e],data:t[s]};return n});var p=o("WAWebLruMediaStorageUtils").getStorage().table(u);l.IdbArrayBufferTable=p}),98); __d("WAWebMediaArrayBufferIdbStore",["Promise","WAWebAbstractStore","WAWebLruMediaStorage","WAWebMediaLruIdbStoreUtils","WAWebSchemaLruMediaArrayBuffer","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s=(function(t){function a(e){var n;return n=t.call(this)||this,n.$ArrayBufferIdbStore$p_1=new(r("WAWebMediaLruIdbStoreUtils"))(o("WAWebLruMediaStorage").initialize,o("WAWebSchemaLruMediaArrayBuffer").IdbArrayBufferTable),n}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.doGet=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield this.$ArrayBufferIdbStore$p_1.get(e);return t?t.data:null});function t(t){return e.apply(this,arguments)}return t})(),i.doQueryByIndex=function(t,n){throw r("err")("Not implemented. Actual Arraybuffer store does not need it.")},i.doGetAll=function(){throw r("err")("Not implemented. Actual Arraybuffer store does not need it.")},i.doPut=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield this.$ArrayBufferIdbStore$p_1.put(e,{id:e,data:t});return n.data});function t(t,n){return e.apply(this,arguments)}return t})(),i.doDel=function(t){return this.$ArrayBufferIdbStore$p_1.del(t)},i.doCount=function(){return this.$ArrayBufferIdbStore$p_1.count()},i.clear=function(){return this.$ArrayBufferIdbStore$p_1.clear()},i.doOpen=function(){return(e||(e=n("Promise"))).resolve()},i.doClose=function(){return(e||(e=n("Promise"))).resolve()},a})(r("WAWebAbstractStore"));l.default=s}),98); __d("WAWebMediaStoreDummyImpl",["Promise","WAWebAbstractStore"],(function(t,n,r,o,a,i,l){var e,s=(function(t){function r(){return t.apply(this,arguments)||this}babelHelpers.inheritsLoose(r,t);var o=r.prototype;return o.get=function(r){return(e||(e=n("Promise"))).resolve()},o.queryByIndex=function(r,o){return(e||(e=n("Promise"))).resolve([])},o.getAll=function(){return(e||(e=n("Promise"))).resolve([])},o.put=function(r,o){return(e||(e=n("Promise"))).resolve(o)},o.del=function(r){return(e||(e=n("Promise"))).resolve()},o.count=function(){return(e||(e=n("Promise"))).resolve(0)},o.clear=function(){return(e||(e=n("Promise"))).resolve()},o.setMaxSize=function(r){return(e||(e=n("Promise"))).resolve()},r})(r("WAWebAbstractStore"));l.default=s}),98); __d("WAWebSchemaLruMediaMetaInfo",["WAWebLruMediaStorageUtils","WAWebStorageMutationBuilder"],(function(t,n,r,o,a,i,l){var e,s="id",u="timestamp",c="size",d="lru-media-meta-info",m=o("WAWebStorageMutationBuilder").columnBuilder(),p=m.addColumn,_=m.addIndex,f=m.addUserDefinedPrimaryKey;(e=o("WAWebLruMediaStorageUtils")).getStorage().add(d).version(e.getStorage().versions.version(1),[f(s),p(u),_(u)]).version(e.getStorage().versions.version(2),[p(c)]).view(function(e){var t={id:e.id,timestamp:e.timestamp,size:e.size||0};return t});var g=e.getStorage().table(d);l.metaInfoPrimaryIndex=s,l.metaInfoDateIndex=u,l.metaInfoSizeIndex=c,l.IdbMetaInfoTable=g}),98); __d("WAWebSizeLruObjectStore",["Promise","WALogger","WANullthrows","WAPromiseLoop","WAPromiseQueue","WAShiftTimer","WAWebAbstractStore","asyncToGeneratorRuntime","err","sumBy"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p=(function(t){function a(a,i){var l;if(l=t.call(this)||this,l._queueMap=new(o("WAPromiseQueue")).PromiseQueueMap,l._purge=function(){if(l._pendingPurgePromise)return l._pendingPurgePromise;var t=l.open().then(function(){return o("WAPromiseLoop").promiseLoop((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=function(){l._pendingPurgePromise=null,t()},i=l.getCurrentSize();if(i==null||i<=l._maxSize){a();return}var s=yield l.queryOneByIndex(l._dateIndex),u=l.getCurrentSize(),c=l._maxSize;if(u==null||u<=c){a();return}if(s==null)return n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield l.count();o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["SizeLruObjectStore: _purge error: No row returned but currentSize (",") > maxSize (","). Row count is "," (may be out of date)."])),u,c,t).sendLogs("size-lru-store-invalid-empty")})(),(m||(m=n("Promise"))).reject(r("err")("Query returned no result but currentSize > maxSize"));var d=s[l._primaryIndex];return l.del(d)});return function(e){return t.apply(this,arguments)}})())});return l._pendingPurgePromise=t},l._schedulePurge=function(){l._purgeTimer.debounce(2e3)},l.doPut=function(e,t){return l._queueMap.enqueue(e,n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(t[l._primaryIndex]!==e)throw r("err")("The key you provide does not match.");var n=yield l._store.get(e),o=n==null?0:l._getSize(n),a=l._getSize(t),i=a-o,s=yield l._store.put(e,t);return l._currentSize=r("WANullthrows")(l.getCurrentSize())+i,l._schedulePurge(),s}))},l.doDel=function(e){return l._queueMap.enqueue(e,n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield l._store.get(e);if(t!=null){try{yield l._dispose(e,t)}catch(e){throw o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["SizeLRUObjectStore: _dispose error: ",""])),e.message).sendLogs("size-lru-store-dispose-error"),e}yield l._store.del(e),l._currentSize=r("WANullthrows")(l.getCurrentSize())-l._getSize(t)}}))},l._store=a,l._primaryIndex=i.primaryIndex,l._dateIndex=i.dateIndex,l._sizeIndex=i.sizeIndex,i.maxSize<0)throw r("err")("Cannot set max size to a negative number");return l._maxSize=Math.floor(i.maxSize),l._dispose=i.dispose,l._purgeTimer=new(o("WAShiftTimer")).ShiftTimer(function(){l._purge().catch(function(e){o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Error while purging: ",""])),e.message)})}),l}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.getCurrentSize=function(){return this._currentSize},i.getMaxSize=function(){return this._maxSize},i.setMaxSize=function(t){return t<0?(m||(m=n("Promise"))).reject(r("err")("Cannot set size to a negative number")):(this._maxSize=Math.floor(t),this._purgeTimer.cancel(),this._purge().catch(function(e){o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Error while purging during setMaxSize: ",""])),e.message)}))},i.putObject=function(t){var e=t[this._primaryIndex];return this.put(e,t)},i._getSize=function(t){var e=t[this._sizeIndex];return typeof e!="number"||e<0?(o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Invalid size in index ",": ",""])),this._sizeIndex,e),0):e},i.doGet=function(t){return this._store.get(t)},i.queryOneByIndex=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield this._store.queryByIndex(e,{limit:1});return t.length===0?null:t[0]});function t(t){return e.apply(this,arguments)}return t})(),i.doQueryByIndex=function(t,n){return this._store.queryByIndex(t,n)},i.doGetAll=function(){return this._store.getAll()},i.doClear=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){this._purgeTimer.cancel(),yield this._store.clear(),this._currentSize=0});function t(){return e.apply(this,arguments)}return t})(),i.doCount=function(){return this._store.count()},i.doOpen=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=this;if(yield this._store.open(),this._currentSize==null){var t=yield this._store.doGetAll();this._currentSize=r("sumBy")(t,function(t){return e._getSize(t)})}});function t(){return e.apply(this,arguments)}return t})(),i.doClose=function(){return this._currentSize=null,this._store.close()},a})(r("WAWebAbstractStore"));l.default=p}),98); __d("WAWebMediaStoreMetaInfo",["WAWebLruMediaStorage","WAWebMediaLruIdbStoreUtils","WAWebSchemaLruMediaMetaInfo","WAWebSizeLruObjectStore"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(t,n){var a,i={primaryIndex:(a=o("WAWebSchemaLruMediaMetaInfo")).metaInfoPrimaryIndex,dateIndex:a.metaInfoDateIndex,sizeIndex:a.metaInfoSizeIndex,maxSize:t,dispose:n},l=new(r("WAWebMediaLruIdbStoreUtils"))(o("WAWebLruMediaStorage").initialize,a.IdbMetaInfoTable);return e.call(this,l,i)||this}return babelHelpers.inheritsLoose(t,e),t})(r("WAWebSizeLruObjectStore"));l.default=e}),98); __d("WAWebMediaStoreLruImpl",["Promise","WALogger","WANullthrows","WAPromiseQueue","WAWeb-dexie","WAWebAbstractStore","WAWebMediaStoreMetaInfo","WAWebStorageErrorHandlingUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u=3e7,c=(function(t){function a(a){var i;i=t.call(this)||this,i._queueMap=new(o("WAPromiseQueue")).PromiseQueueMap,i.updateMaxSizeInterval=null,i._dispose=function(e,t){return i._bufferStore.del(e)},i.doPut=function(t,a){return i._queueMap.enqueue(t,n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(a.byteLength>i.getMaxSize()||a.byteLength>u)return a;var n={id:t,timestamp:new Date().getTime(),size:a.byteLength};try{return yield i._metaInfoStore.putObject(n),i._bufferStore.put(t,a)}catch(t){if(t instanceof r("WAWeb-dexie").AbortError&&t.message.includes("QuotaExceededError")){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["LruMediaStore: encounter QuotaExceededError, thus shrink the size of LruMediaStore"]))),i.setMaxSize(r("WANullthrows")(i.getCurrentSize())/2),o("WAWebStorageErrorHandlingUtils").reportQuotaExceededError(t,{op:"put",db:"lru-media-store",writeSize:a.byteLength});return}throw t}}))},i.doDel=function(e){return i._queueMap.enqueue(e,function(){return i._metaInfoStore.del(e)})};var l=a.arrayBufferStore,s=a.maxSize;return i._bufferStore=l,i._metaInfoStore=new(r("WAWebMediaStoreMetaInfo"))(s,i._dispose),i}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.doGet=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield this._bufferStore.get(e);return t!=null&&this.put(e,t),t});function t(t){return e.apply(this,arguments)}return t})(),i.doClear=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield this._bufferStore.clear(),this._metaInfoStore.clear()});function t(){return e.apply(this,arguments)}return t})(),i.doCount=function(){return this._metaInfoStore.count()},i.doOpen=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield(s||(s=n("Promise"))).all([this._metaInfoStore.open(),this._bufferStore.open()])});function t(){return e.apply(this,arguments)}return t})(),i.doClose=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield(s||(s=n("Promise"))).all([this._metaInfoStore.close(),this._bufferStore.close()])});function t(){return e.apply(this,arguments)}return t})(),i.getCurrentSize=function(){return this._metaInfoStore.getCurrentSize()},i.getMaxSize=function(){return this._metaInfoStore.getMaxSize()},i.setMaxSize=function(t){return this._metaInfoStore.setMaxSize(t)},i._calculateTargetedBufferSize=function(t){var e=Math.floor(t*.01);return e<1e8?1e8:e>5e8?5e8:e},i._clearStoreForThisSession=function(){this.setMaxSize(0),this.updateMaxSizeInterval&&(self.clearInterval(this.updateMaxSizeInterval),this.updateMaxSizeInterval=null)},a})(r("WAWebAbstractStore"));l.default=c}),98); __d("WAWebSerializeError",["WAWebNormalizeStack","isEmptyObject"],(function(t,n,r,o,a,i,l){var e=["message","name","stack"];function s(t){var n=o("WAWebNormalizeStack").normalizeError(t),a=n.message,i=n.name,l=n.stack,s=babelHelpers.objectWithoutPropertiesLoose(n,e),u=o("WAWebNormalizeStack").normalizeStack(t,!0),c=r("isEmptyObject")(s)?"":" "+JSON.stringify(s,function(e,t){return e&&typeof t=="object"?String(t):t});return i+" - "+(a||"")+c+"\n"+u}l.default=s}),98); __d("WAWebStoreQuotaManager",["WAStorageEstimator","WAWebABProps","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=1073741824,s=new Map([["lru-media-store",{getQuota:function(n){return n<=o("WAWebABProps").getABPropConfigValue("web_browser_quota_threshold")*e?Math.min(n*.2,o("WAWebABProps").getABPropConfigValue("web_browser_min_storage_quota")*e):.2*n}}]]),u=(function(){function e(e){this.$1=e}var t=e.prototype;return t.getQuotaForStore=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n,r=yield o("WAStorageEstimator").estimateStorage();if(!r.success)return 0;var a=r.value.quota;return Math.floor((t=(n=this.$1.get(e))==null?void 0:n.getQuota(a))!=null?t:0)});function t(t){return e.apply(this,arguments)}return t})(),e})(),c=new u(s);l.storeQuotaManager=c}),98); __d("WAWebMediaStore",["WALogger","WAMemoizeConcurrent","WAWebIndexedDB","WAWebMediaArrayBufferCacheStore","WAWebMediaArrayBufferIdbStore","WAWebMediaStoreDummyImpl","WAWebMediaStoreLruImpl","WAWebMiscErrors","WAWebPromiseQueue","WAWebSerializeError","WAWebStoreQuotaManager","asyncToGeneratorRuntime","getErrorSafe","once"],(function(t,n,r,o,a,i,l){var e,s,u=new AbortController,c=(function(){function t(){var t=this;this._getBackingStore=r("once")(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var t=yield d();if(t!=null)return yield t.open(),t}catch(t){if(r("getErrorSafe")(t).name==="SecurityError")o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["\n There was a security error attempting to open the media storage. This likely indicates a permissions error. Falling back to fake (no-op) storage.\n "],["\n There was a security error attempting to open the media storage. \\\n This likely indicates a permissions error. Falling back to fake \\\n (no-op) storage.\n "])));else{if(t instanceof o("WAWebMiscErrors").DbOnLogoutAbort)throw t;o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["\n Failed to initialize media store! Falling back to fake (no-op) storage. Error:\n ","\n "])),r("WAWebSerializeError")(t)).verbose().sendLogs("Failed to initialize media store")}}return new(r("WAWebMediaStoreDummyImpl"))})),this._promiseQueueHas=new(o("WAWebPromiseQueue")).PromiseQueue,this._memoizedConcurrentHas=r("WAMemoizeConcurrent")(function(e){return e.key},function(e){var n=e.key;return t._promiseQueueHas.enqueue(function(){return t.get(n).then(function(e){return e!=null})})})}var a=t.prototype;return a.setMaxSize=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield this._getBackingStore();return t.setMaxSize(e)});function t(t){return e.apply(this,arguments)}return t})(),a.get=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield this._getBackingStore();return t.get(e)});function t(t){return e.apply(this,arguments)}return t})(),a.has=function(t){return this._memoizedConcurrentHas({key:t,signal:u.signal})},a.queryByIndex=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield this._getBackingStore();return n.queryByIndex(e,t)});function t(t,n){return e.apply(this,arguments)}return t})(),a.getAll=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield this._getBackingStore();return e.getAll()});function t(){return e.apply(this,arguments)}return t})(),a.put=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield this._getBackingStore();return n.put(e,t)});function t(t,n){return e.apply(this,arguments)}return t})(),a.del=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield this._getBackingStore();yield t.del(e)});function t(t){return e.apply(this,arguments)}return t})(),a.count=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield this._getBackingStore();return e.count()});function t(){return e.apply(this,arguments)}return t})(),a.clear=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield this._getBackingStore();yield e.clear()});function t(){return e.apply(this,arguments)}return t})(),a.open=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield this._getBackingStore();yield e.open()});function t(){return e.apply(this,arguments)}return t})(),a.close=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield this._getBackingStore();yield e.close()});function t(){return e.apply(this,arguments)}return t})(),t})();function d(){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=p();if(e==null)return null;var t=yield o("WAWebStoreQuotaManager").storeQuotaManager.getQuotaForStore("lru-media-store");return new(r("WAWebMediaStoreLruImpl"))({maxSize:t,arrayBufferStore:e})}),m.apply(this,arguments)}function p(){if(r("WAWebIndexedDB")!=null){var e=new(r("WAWebMediaArrayBufferIdbStore"))("media_lru_buffer");return"caches"in self?new(r("WAWebMediaArrayBufferCacheStore"))("lru-media-array-buffer-cache"):e}return null}var _=new c;l.MediaStore=c,l.LruMediaStore=_}),98); __d("WAWebUnpairDeviceJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWebCommsWapMd","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("unpairResponse",function(e){e.assertTag("iq"),e.assertFromServer();var t=e.attrString("type"),n=200;return t==="error"&&(n=e.child("error").attrInt("code")),{status:n}});function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n,r=(n=o("WAWap")).wap("iq",{to:n.S_WHATSAPP_NET,type:"set",id:n.generateId(),xmlns:"md"},n.wap("remove-companion-device",{jid:o("WAWebCommsWapMd").DEVICE_JID(o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow()),reason:n.CUSTOM_STRING(t)})),a=yield o("WADeprecatedSendIq").deprecatedSendIq(r,e);return a.success?{status:a.result.status}:{status:a.errorCode}}),u.apply(this,arguments)}l.unpairDevice=s}),98); __d("WAWebSocketModel",["Promise","WAComms","WALogger","WANullthrows","WAPromiseDelays","WAPromiseTimeout","WAWebABPropsCache","WAWebAddMeContactAction","WAWebBackendEventBus","WAWebBackgroundSyncAction","WAWebBaseModel","WAWebConnModel","WAWebCrashlog","WAWebCryptoEncKeyHelper","WAWebCryptoEncryptionSaltHelper","WAWebDeleteAllCacheStorage","WAWebEnvironment","WAWebFeatureDetectionDetermineIncognito","WAWebFtsClient","WAWebFtsStorage","WAWebInvocationInterface","WAWebJobsStorage","WAWebLocalStorage","WAWebLogoutReason","WAWebLogoutReasonConstants","WAWebLruMediaStorageUtils","WAWebMediaStore","WAWebMiscBrowserUtils","WAWebMiscErrors","WAWebModelStorage","WAWebNetworkStatus","WAWebOffdStorage","WAWebPonyfillsUrlSearchParams","WAWebQplStorage","WAWebSentinel","WAWebSignalStorage","WAWebSocketConstants","WAWebSubscribePushManagerAction","WAWebSyncBootstrap","WAWebSyncdGatingUtils","WAWebUnpairDeviceJob","WAWebUpdater","WAWebUserPrefsAppStateSync","WAWebUserPrefsClearLocalState","WAWebUserPrefsGeneral","WAWebUserPrefsKeys","WAWebUserPrefsMeUser","WAWebUserPrefsMultiDevice","WAWebUserPrefsStore","WAWebWorkerStorage","asyncToGeneratorRuntime","cr:10201","cr:17219","err","getErrorSafe","gkx","requireDeferred"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T,D,x,$,P,N,M,w,A,F,O,B,W,q,U,V,H,G,z,j,K,Q=r("requireDeferred")("WAWebClearAppStatesExp").__setRef("WAWebSocketModel"),X=[(K=o("WAWebLogoutReasonConstants")).LogoutReason.WebFailAddChat,K.LogoutReason.WebFailEncSalt,K.LogoutReason.WebFailOfflineResume,K.LogoutReason.WebFailStorageInitialization],Y=(function(t){function a(){for(var e,n=arguments.length,r=new Array(n),a=0;a=400&&o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence composing error ",""])),t.toLogString())})),e.presenceResendTimerId=self.setTimeout(function(){return L(e)},_)}e.typing=!0,e.pausedTimerId&&self.clearTimeout(e.pausedTimerId),e.pausedTimerId=self.setTimeout(function(){return S(e)},p)}function S(e){if(e.typing||e.recording){var t=b(e);o("WAWebChatStateBridge").sendChatStatePaused(t).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){e.status>=400&&o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence paused error ",""])),t.toLogString())}))}e.presenceResendTimerId&&(self.clearTimeout(e.presenceResendTimerId),e.unset("presenceResendTimerId")),e.pausedTimerId&&(self.clearTimeout(e.pausedTimerId),e.unset("pausedTimerId")),e.typing=e.recording=!1}function R(e){if(!e.recording){var t=b(e);o("WAWebChatStateBridge").sendChatStateRecording(t).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){e.status>=400&&o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence recording error ",""])),t.toLogString())})),e.presenceResendTimerId=self.setTimeout(function(){return L(e)},_)}e.pausedTimerId&&(self.clearTimeout(e.pausedTimerId),e.unset("pausedTimerId")),e.recording=!0,e.typing=!1}function L(e){var t=e.id;if(e.recording)o("WAWebChatStateBridge").sendChatStateRecording(t).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){e.status>=400&&o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence resend recording error ",""])),t.toLogString())}));else if(e.typing)o("WAWebChatStateBridge").sendChatStateComposing(t).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){e.status>=400&&o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["models:chat send presence resend composing error ",""])),t.toLogString())}));else{e.unset("presenceResendTimerId");return}e.presenceResendTimerId=self.setTimeout(function(){return L(e)},_)}function E(e){e.presence.isOnline?L(e):e.presenceResendTimerId&&(self.clearTimeout(e.presenceResendTimerId),e.unset("presenceResendTimerId"))}function k(e){e.presenceResendTimerId&&(self.clearTimeout(e.presenceResendTimerId),e.unset("presenceResendTimerId")),e.pausedTimerId&&(self.clearTimeout(e.pausedTimerId),e.unset("pausedTimerId")),e.typing=!1}l.markComposing=f,l.markPaused=g,l.markRecording=h,l.sendPresenceAvailable=y,l.sendPresenceUnavailable=C,l.getChatIdentifier=b,l.presenceOnlineChanged=E,l.clearPresence=k}),98); __d("WAWebStreamModel",["$InternalEnum","WALogger","WAShiftTimer","WAWebABProps","WAWebBackendEventBus","WAWebBaseModel","WAWebBuildConstants","WAWebCallCollection","WAWebEnvironment","WAWebLockScreenResolver","WAWebNetworkStatus","WAWebPresenceChatAction","WAWebPresenceCollection","WAWebSocketConstants","WAWebSocketModel","WAWebUserPrefsMultiDevice","WAWebUserPrefsScreenLock","WAWebWamEnumWebcStreamModeCode","WAWebWamPageLoadReporter","WAWebWebcPageResumeWamEvent","WAWebWebcStreamModeChangeWamEvent","asyncToGeneratorRuntime","cr:17219","gkx"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=(e=n("cr:17219"))!=null?e:{},m=d.getWindowsBridge,p=n("$InternalEnum").Mirrored(["OFFLINE","OPENING","PAIRING","SYNCING","RESUMING","CONNECTING","NORMAL"]),_=n("$InternalEnum").Mirrored(["QR","MAIN","SYNCING","OFFLINE","CONFLICT","PROXYBLOCK","TOS_BLOCK","SMB_TOS_BLOCK","DEPRECATED_VERSION"]),f=n("$InternalEnum").Mirrored(["SHOW","OBSCURE","HIDE"]),g=18e3,h=3e3,y=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0||Array.isArray(n.groupMentions)&&n.groupMentions.length>0||n.conversionTuple||n.isForwarded||n.forwardingScore||n._isPaymentNoteMsg||n.ephemeralDuration||n.ephemeralSettingTimestamp||n.ctwaContext||n.backgroundColor||t!=null&&t.utm||(t==null?void 0:t.isQuestion)===!0||t!=null&&t.questionReplyQuotedMessage||n.paymentLinkMetadata||(t==null?void 0:t.nonJidMentions)!=null&&t.nonJidMentions>0?r("WAWebGenerateExtendedTextUrlChatMessageProto")({json:n,contextInfo:t}):{conversation:n.body}}l.default=e}),98); __d("WAWebGenerateDeclinePaymentMessageProto",["err"],(function(t,n,r,o,a,i,l){function e(e){throw r("err")("Not supported")}l.default=e}),98); __d("WAWebGenerateDocumentMessageProto",["WATypeUtils","WAWebE2EProtoUtils","WAWebMsgType","WAWebWid"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,a=e.mediaMetadata,i=a===void 0?{}:a,l=n.mimetype||i.mimetype,s=void 0,u=void 0;n.type!==o("WAWebMsgType").MSG_TYPE.INTERACTIVE&&(u=n.caption,s=i.filename);var c={url:i.url,mimetype:l,title:s,caption:u,directPath:i.directPath,fileSha256:o("WAWebE2EProtoUtils").encodeBytes(i.filehash),fileEncSha256:o("WAWebE2EProtoUtils").encodeBytes(i.encFilehash),fileName:i.filename,fileLength:o("WATypeUtils").isNumber(n.size)?n.size:void 0,mediaKey:o("WAWebE2EProtoUtils").encodeBytes(i.mediaKey),mediaKeyTimestamp:o("WATypeUtils").isNumber(i.mediaKeyTimestamp)?i.mediaKeyTimestamp:void 0,jpegThumbnail:o("WAWebE2EProtoUtils").encodeBytes(n.body),contextInfo:t,contactVcard:n.isVcardOverMmsDocument,thumbnailDirectPath:i.thumbnailDirectPath,thumbnailSha256:o("WAWebE2EProtoUtils").encodeBytes(i.thumbnailSha256),thumbnailEncSha256:o("WAWebE2EProtoUtils").encodeBytes(i.thumbnailEncSha256),thumbnailHeight:i.thumbnailHeight,thumbnailWidth:i.thumbnailWidth};return Number.isFinite(n.pageCount)&&!Number.isNaN(n.pageCount)&&(c.pageCount=n.pageCount),o("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(n.type,c,r("WAWebWid").isNewsletter(n.to)),{documentMessage:c}}l.default=e}),98); __d("WAWebGenerateEncCommentMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json;return{encCommentMessage:{targetMessageKey:o("WAWebE2EProtoUtils").encodeKey(t.targetMessageKey),encIv:t.encIv,encPayload:t.encPayload}}}l.default=e}),98); __d("WAWebGenerateEphemeralSyncResponseMessageProto",["WAWebE2EProtoUtils","WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json,n={type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.EPHEMERAL_SYNC_RESPONSE,ephemeralExpiration:t.ephemeralDuration,ephemeralSettingTimestamp:t.ephemeralSettingTimestamp,disappearingMode:o("WAWebE2EProtoUtils").disappearingModeInitiatorToProto(t.disappearingModeInitiator,t.disappearingModeTrigger,t.disappearingModeInitiatedByMe)};return{protocolMessage:n}}l.default=e}),98); __d("WAWebGenerateGroupInviteMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json;return{groupInviteMessage:{inviteCode:n.inviteCode,inviteExpiration:parseInt(n.inviteCodeExp,10),groupJid:n.inviteGrp,groupName:n.inviteGrpName,caption:n.comment,jpegThumbnail:o("WAWebE2EProtoUtils").encodeBytes(n.inviteGrpJpegThum),contextInfo:t}}}l.default=e}),98); __d("WAWebGenerateHsmMessageProto",["err"],(function(t,n,r,o,a,i,l){function e(e){throw r("err")("Not supported")}l.default=e}),98); __d("WAWebGenerateImageMessageProto",["WATypeUtils","WAWebE2EProtoUtils","WAWebMediaGatingUtils","WAWebWid","err"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,a=e.mediaMetadata;if(a==null)throw r("err")("generateImageMessageProto: generating image protobuf without mediaMetadata");var i=n.mimetype||a.mimetype,l={};r("WAWebWid").isStatus(n.to)&&(l={thumbnailDirectPath:a.thumbnailDirectPath,thumbnailSha256:o("WAWebE2EProtoUtils").encodeBytes(a.thumbnailSha256),thumbnailEncSha256:o("WAWebE2EProtoUtils").encodeBytes(a.thumbnailEncSha256)}),o("WAWebMediaGatingUtils").isThumbnailGenerationForMsgOnServerEnabled(n)&&(l={thumbnailDirectPath:a.thumbnailDirectPath,thumbnailSha256:o("WAWebE2EProtoUtils").encodeBytes(a.thumbnailSha256)});var s=babelHelpers.extends({url:a.url,mimetype:i,caption:n.caption,directPath:a.directPath,fileSha256:o("WAWebE2EProtoUtils").encodeBytes(a.filehash),fileEncSha256:o("WAWebE2EProtoUtils").encodeBytes(a.encFilehash),height:a.height,width:a.width,fileLength:o("WATypeUtils").isNumber(n.size)?n.size:void 0,mediaKey:o("WAWebE2EProtoUtils").encodeBytes(a.mediaKey),mediaKeyTimestamp:o("WATypeUtils").isNumber(a.mediaKeyTimestamp)?a.mediaKeyTimestamp:void 0,jpegThumbnail:n.isViewOnce?void 0:o("WAWebE2EProtoUtils").encodeBytes(n.body),contextInfo:t,viewOnce:n.isViewOnce},l);return o("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(n.type,s,r("WAWebWid").isNewsletter(n.to)),{imageMessage:s}}l.default=e}),98); __d("WAWebGenerateVideoMessageProto",["WATypeUtils","WAWebE2EProtoUtils","WAWebMediaGatingUtils","WAWebMsgType","WAWebWid"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,a=e.mediaMetadata,i=a==null?void 0:a.duration,l=i!=null&&o("WATypeUtils").isString(i)?parseInt(i,10):i,s=n.caption,u=n.mimetype||(a==null?void 0:a.mimetype),c={};o("WAWebMediaGatingUtils").isThumbnailGenerationForMsgOnServerEnabled(n)&&(c={thumbnailDirectPath:a==null?void 0:a.thumbnailDirectPath,thumbnailSha256:o("WAWebE2EProtoUtils").encodeBytes(a==null?void 0:a.thumbnailSha256)});var d=babelHelpers.extends({url:a==null?void 0:a.url,mimetype:u,directPath:a==null?void 0:a.directPath,fileSha256:o("WAWebE2EProtoUtils").encodeBytes(a==null?void 0:a.filehash),fileEncSha256:o("WAWebE2EProtoUtils").encodeBytes(a==null?void 0:a.encFilehash),height:a==null?void 0:a.height,width:a==null?void 0:a.width,seconds:l,caption:s,fileLength:o("WATypeUtils").isNumber(n.size)?n.size:void 0,mediaKey:o("WAWebE2EProtoUtils").encodeBytes(a==null?void 0:a.mediaKey),mediaKeyTimestamp:o("WATypeUtils").isNumber(a==null?void 0:a.mediaKeyTimestamp)?a.mediaKeyTimestamp:void 0,jpegThumbnail:n.isViewOnce?void 0:o("WAWebE2EProtoUtils").encodeBytes(n.body),gifPlayback:n.isGif,gifAttribution:n.gifAttribution,accessibilityLabel:n.accessibilityLabel,contextInfo:t,streamingSidecar:n.streamingSidecar,viewOnce:n.isViewOnce,metadataUrl:(a==null?void 0:a.metadataUrl)!=null&&o("WAWebMediaGatingUtils").isChannelVideoServerTranscodeUploadEnabled()?a.metadataUrl:void 0},c);return o("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(n.type,d,r("WAWebWid").isNewsletter(n.to)),n.type===o("WAWebMsgType").MSG_TYPE.PTV?{ptvMessage:d}:{videoMessage:d}}l.default=e}),98); __d("WAWebGenerateInteractiveMessageProto",["WAWebE2EProtoUtils","WAWebGenerateDocumentMessageProto","WAWebGenerateImageMessageProto","WAWebGenerateVideoMessageProto","WAWebInteractiveMessageHeaderMediaType","WAWebInteractiveMessagesNativeFlowName"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,a=e.mediaMetadata,i;if(n.interactiveHeader){if(i={title:n.interactiveHeader.title,subtitle:n.interactiveHeader.subtitle,hasMediaAttachment:n.interactiveHeader.hasMediaAttachment},n.interactiveHeader.thumbnail)i=babelHelpers.extends({},i,{jpegThumbnail:o("WAWebE2EProtoUtils").encodeBytes(n.interactiveHeader.thumbnail)});else if(n.interactiveHeader.mediaType)switch(n.interactiveHeader.mediaType){case o("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.VIDEO:{var l=r("WAWebGenerateVideoMessageProto")({json:n,mediaMetadata:a,contextInfo:t}).videoMessage;i=babelHelpers.extends({},i,{videoMessage:babelHelpers.extends({},l,{caption:void 0})});break}case o("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.DOCUMENT:i=babelHelpers.extends({},i,{documentMessage:r("WAWebGenerateDocumentMessageProto")({json:n,mediaMetadata:a,contextInfo:t}).documentMessage});break;case o("WAWebInteractiveMessageHeaderMediaType").InteractiveMessageHeaderMediaType.IMAGE:i=babelHelpers.extends({},i,{imageMessage:r("WAWebGenerateImageMessageProto")({json:n,mediaMetadata:a,contextInfo:t}).imageMessage});break}}var s=babelHelpers.extends({body:n.caption||n.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS?{text:n.caption}:void 0,footer:n.footer?{text:n.footer}:void 0,header:i},t&&{contextInfo:t}),u=o("WAWebE2EProtoUtils").getInteractiveMessageFieldNameForType(n.interactiveType);return u&&(s[u]=n.interactivePayload),{interactiveMessage:s}}l.default=e}),98); __d("WAWebGenerateInteractiveResponseMessageProto",["WAWebABProps","WAWebE2EProtoUtils","WAWebInteractiveMessagesNativeFlowName","WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){var e=["type"],s=["buttonParamsJson","type"],u=["flow_message_version","flow_token","wa_flow_response_params"];function c(t){var n,a=t.contextInfo,i=t.json,l=i.interactivePayload,s=l.type,u=babelHelpers.objectWithoutPropertiesLoose(l,e),c=o("WAWebE2EProtoUtils").getInteractiveResponseMessageFieldNameForType(s),m=u.name===String(r("WAWebInteractiveMessagesNativeFlowName").CTA_FLOW)&&o("WAWebABProps").getABPropConfigValue("flows_wa_web");if(m)return d({json:i,contextInfo:a});var p=(n={body:{text:i.body}},n[c]=u,n.contextInfo=a,n);return{interactiveResponseMessage:p}}function d(e){var t,n=e.contextInfo,r=e.json,a=r.interactivePayload,i=a.buttonParamsJson,l=a.type,c=babelHelpers.objectWithoutPropertiesLoose(a,s),d=o("WAWebE2EProtoUtils").getInteractiveResponseMessageFieldNameForType(l),m=JSON.parse(i),p=m.flow_message_version,_=m.flow_token,f=m.wa_flow_response_params,g=babelHelpers.objectWithoutPropertiesLoose(m,u),h=(t={body:{text:r.body,format:o("WAWebProtobufsE2E.pb").Message$InteractiveResponseMessage$Body$Format.EXTENSIONS_1}},t[d]=babelHelpers.extends({},c,{paramsJson:JSON.stringify(babelHelpers.extends({},g,{flow_token:_,wa_flow_response_params:f})),version:f!=null?3:2}),t.contextInfo=n,t);return{interactiveResponseMessage:h}}l.default=c}),98); __d("WAWebGenerateKeepInChatMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json;return{keepInChatMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.keptMessageKey),keepType:t.keepType,timestampMs:t.senderTimestampMs}}}l.default=e}),98); __d("WAWebGenerateListMessageProto",[],(function(t,n,r,o,a,i){function e(e){var t=e.contextInfo,n=e.json;return{listMessage:babelHelpers.extends({},n.list,{contextInfo:t})}}i.default=e}),66); __d("WAWebGenerateListResponseMessageProto",[],(function(t,n,r,o,a,i){function e(e){var t=e.contextInfo,n=e.json;return{listResponseMessage:babelHelpers.extends({},n.listResponse,{contextInfo:t})}}i.default=e}),66); __d("WAWebGenerateLocationMessageProto",["WATypeUtils","WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,r={};if(n.loc&&o("WATypeUtils").isString(n.loc)){var a=n.loc.split("\n");r={name:a[0],address:a[1],url:n.clientUrl}}return{locationMessage:babelHelpers.extends({},r,{degreesLatitude:parseFloat(n.lat)||void 0,degreesLongitude:parseFloat(n.lng)||void 0,jpegThumbnail:o("WAWebE2EProtoUtils").encodeBytes(n.body),contextInfo:t})}}l.default=e}),98); __d("WAWebGenerateMessageHistoryBundleProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t,n,r,a=e.json,i=e.mediaMetadata;return{messageHistoryBundle:{directPath:i==null?void 0:i.directPath,fileSha256:o("WAWebE2EProtoUtils").encodeBytes(i==null?void 0:i.filehash),fileEncSha256:o("WAWebE2EProtoUtils").encodeBytes(i==null?void 0:i.encFilehash),mediaKey:o("WAWebE2EProtoUtils").encodeBytes(i==null?void 0:i.mediaKey),mediaKeyTimestamp:i==null?void 0:i.mediaKeyTimestamp,messageHistoryMetadata:{messageCount:(t=a.groupHistoryBundleMetadata)==null?void 0:t.messageCount,oldestMessageTimestamp:(n=a.groupHistoryBundleMetadata)==null?void 0:n.oldestMessageTimestamp,historyReceivers:(r=a.groupHistoryBundleMetadata)==null?void 0:r.historyReceivers.map(function(e){return e.toJid()})},mimetype:a.mimetype||(i==null?void 0:i.mimetype)}}}l.default=e}),98); __d("WAWebGenerateMessageHistoryNoticeProto",["err"],(function(t,n,r,o,a,i,l){"use strict";function e(e){var t,n,o,a=e.json,i=a.groupHistoryBundleMetadata;if(i==null)throw r("err")("[group-history] groupHistoryBundleMetadata is null while sending notice");return{messageHistoryNotice:{messageHistoryMetadata:{messageCount:(t=a.groupHistoryBundleMetadata)==null?void 0:t.messageCount,oldestMessageTimestamp:(n=a.groupHistoryBundleMetadata)==null?void 0:n.oldestMessageTimestamp,historyReceivers:(o=a.groupHistoryBundleMetadata)==null?void 0:o.historyReceivers.map(function(e){return e.toJid()})}}}}l.default=e}),98); __d("WAWebGenerateMultiVcardMessageProto",[],(function(t,n,r,o,a,i){function e(e){var t=e.contextInfo,n=e.json;return{contactsArrayMessage:{contacts:n.vcardList.map(function(e){return e}),contextInfo:t}}}i.default=e}),66); __d("WAWebGenerateNativeFlowButtonsMessageProto",["WAWebButtonsMessageProtoUtils","WAWebGenerateImageMessageProto","WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,a=e.mediaMetadata,i=e.message,l=babelHelpers.extends({},i);if(n.headerType===o("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.IMAGE){var s=r("WAWebGenerateImageMessageProto")({json:n,mediaMetadata:a,contextInfo:void 0}),u=s.imageMessage;l=babelHelpers.extends({},l,{imageMessage:u})}return l=o("WAWebButtonsMessageProtoUtils").createDynamicReplyButtonsMessage(l,n,t),l.buttonsMessage=babelHelpers.extends({},l.buttonsMessage,{buttons:n.nativeFlowButtons}),l}l.default=e}),98); __d("WAWebGenerateNewsletterAdminInviteMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,r=n.newsletterAdminInviteInfo,a=r.inviteExpiration,i=r.inviteMessage,l=r.newsletterId,s=r.newsletterName,u=r.pictureThumbnail;return{newsletterAdminInviteMessage:{newsletterJid:o("WAWebE2EProtoUtils").encodeJid(l),newsletterName:s,caption:i,inviteExpiration:a,jpegThumbnail:o("WAWebE2EProtoUtils").encodeBytes(u),contextInfo:t}}}l.default=e}),98); __d("WAWebGenerateNewsletterFollowerInviteMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,r=n.newsletterFollowerInviteInfo,a=r.inviteMessage,i=r.newsletterId,l=r.newsletterName,s=r.pictureThumbnail;return{newsletterFollowerInviteMessageV2:{newsletterJid:o("WAWebE2EProtoUtils").encodeJid(i),newsletterName:l,caption:a,jpegThumbnail:o("WAWebE2EProtoUtils").encodeBytes(s),contextInfo:t}}}l.default=e}),98); __d("WAWebGenerateOrderMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json;return t.itemCount||t.message||t.orderId||t.orderTitle||t.sellerJid||t.status||t.surface||t.thumbnail||t.token||t.totalAmount1000||t.totalCurrencyCode||t.catalogType?{orderMessage:{itemCount:t.itemCount,message:t.message,orderId:t.orderId,orderTitle:t.orderTitle,sellerJid:t.sellerJid,status:t.status,surface:t.surface,thumbnail:o("WAWebE2EProtoUtils").encodeBytes(t.thumbnail),token:t.token,totalAmount1000:t.totalAmount1000,totalCurrencyCode:t.totalCurrencyCode,catalogType:t.catalogType}}:{conversation:t.body}}l.default=e}),98); __d("WAWebGeneratePaymentInviteMessageProto",["err"],(function(t,n,r,o,a,i,l){function e(e){throw r("err")("Not supported")}l.default=e}),98); __d("WAWebGeneratePinMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json;return{pinInChatMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.pinParentKey),type:t.pinMessageType,senderTimestampMs:t.pinSenderTimestampMs},messageContextInfo:{messageAddOnDurationInSecs:t.pinExpiryDuration}}}l.default=e}),98); __d("WAWebGeneratePollResultSnapshotMessageProto",["WAWebPollCreationUtils","WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){"use strict";function e(e){var t=e.contextInfo,n=e.json,r=e.msgContext,a=n.pollName;if(r==="quoted")return{pollResultSnapshotMessage:{name:a,pollVotes:[],contextInfo:t}};var i=o("WAWebPollCreationUtils").getPollTypeAsE2EValue(n.pollType),l=n.pollVotesSnapshot,s=l.pollVotes.map(function(e){var t=e.option,n=e.optionVoteCount;return{optionName:t.name,optionVoteCount:i===o("WAWebProtobufsE2E.pb").Message$PollType.QUIZ?0:n}}),u={name:a,pollVotes:s,contextInfo:t};return i===o("WAWebProtobufsE2E.pb").Message$PollType.QUIZ?{pollResultSnapshotMessageV3:babelHelpers.extends({},u,{pollType:i})}:{pollResultSnapshotMessage:u}}l.default=e}),98); __d("WAWebGenerateProductMessageProto",["WAWebGenerateImageMessageProto"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,o=e.mediaMetadata,a;o!=null&&(a=r("WAWebGenerateImageMessageProto")({json:n,mediaMetadata:o,contextInfo:t}).imageMessage);var i={product:{productImage:a,productId:n.productId,title:n.title,description:n.description,currencyCode:n.currencyCode,priceAmount1000:n.priceAmount1000||void 0,salePriceAmount1000:n.salePriceAmount1000||void 0,retailerId:n.retailerId,url:n.url,productImageCount:n.productImageCount},businessOwnerJid:n.businessOwnerJid,contextInfo:t,body:n.caption,footer:n.footer};return{productMessage:i}}l.default=e}),98); __d("WAWebGenerateProtocolEphemeralSettingMessageProto",["WAWebE2EProtoUtils","WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json;return{protocolMessage:{type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.EPHEMERAL_SETTING,ephemeralExpiration:t.ephemeralDuration,disappearingMode:o("WAWebE2EProtoUtils").disappearingModeInitiatorToProto(t.disappearingModeInitiator,t.disappearingModeTrigger,t.disappearingModeInitiatedByMe)}}}l.default=e}),98); __d("WAWebGenerateProtocolHistorySyncNotificationMessageProto",["err"],(function(t,n,r,o,a,i,l){function e(e){throw r("err")("generateProtocolHistorySyncNotificationMessageProto: Not supported")}l.default=e}),98); __d("WAWebGenerateProtocolLimitSharingMessageProto",["WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json,n=t.limitSharing?{trigger:t.limitSharing.trigger,sharingLimited:t.limitSharing.sharingLimited,limitSharingSettingTimestamp:t.limitSharing.limitSharingSettingTimestamp,initiatedByMe:!0}:void 0;return{limitSharingMessage:{message:{protocolMessage:{type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.LIMIT_SHARING,limitSharing:n}}}}}l.default=e}),98); __d("WAWebGenerateProtocolMemberLabelMessageProto",["WAWebProtobufsE2E.pb","err"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json,n=t.memberLabelData;if(n==null)throw r("err")("Missing memberLabelData for member label message");return{protocolMessage:{type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.GROUP_MEMBER_LABEL_CHANGE,memberLabel:{label:n.label,labelTimestamp:n.labelTimestamp}}}}l.default=e}),98); __d("WAWebGenerateProtocolRevokeMessageProto",["WAWebE2EProtoUtils","WAWebProtobufsE2E.pb","WAWebWid"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json;return babelHelpers.extends({protocolMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.protocolMessageKey),type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE}},t.botTargetSenderJid instanceof r("WAWebWid")?{messageContextInfo:{botMetadata:{invokerJid:t.botTargetSenderJid.toJid()}}}:{})}l.default=e}),98); __d("WAWebGenerateProtocolSharePhoneNumberMessageProto",["WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){function e(e){return{protocolMessage:{type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.SHARE_PHONE_NUMBER}}}l.default=e}),98); __d("WAWebGenerateReactionEncMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json;return{encReactionMessage:{targetMessageKey:o("WAWebE2EProtoUtils").encodeKey(t.targetMessageKey),encIv:t.encIv,encPayload:t.encPayload}}}l.default=e}),98); __d("WAWebGenerateRequestPhoneNumberMessageProto",[],(function(t,n,r,o,a,i){function e(e){var t=e.contextInfo;return{requestPhoneNumberMessage:{contextInfo:t}}}i.default=e}),66); __d("WAWebGenerateSecretMessageEditProto",["WAWebE2EProtoUtils","WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json,n={targetMessageKey:o("WAWebE2EProtoUtils").encodeKey(t.targetMessageKey),encIv:t.encIv,encPayload:t.encPayload,secretEncType:o("WAWebProtobufsE2E.pb").Message$SecretEncryptedMessage$SecretEncType.MESSAGE_EDIT};return{secretEncryptedMessage:n,messageContextInfo:{messageSecret:t.messageSecret}}}l.default=e}),98); __d("WAWebGenerateStickerPackMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json,n=e.mediaMetadata,r=n===void 0?{}:n;return{stickerPackMessage:{stickerPackId:t.stickerPackId,name:t.filename,publisher:t.stickerPackPublisher,fileSha256:o("WAWebE2EProtoUtils").encodeBytes(r.filehash),fileEncSha256:o("WAWebE2EProtoUtils").encodeBytes(r.encFilehash),mediaKey:o("WAWebE2EProtoUtils").encodeBytes(r.mediaKey),directPath:t.directPath,caption:t.caption,packDescription:t.description,thumbnailSha256:o("WAWebE2EProtoUtils").encodeBytes(r.thumbnailSha256),thumbnailEncSha256:o("WAWebE2EProtoUtils").encodeBytes(r.thumbnailEncSha256),thumbnailDirectPath:t.thumbnailDirectPath,stickers:t.stickers,fileLength:t.size,trayIconFileName:t.trayIconFileName,stickerPackSize:t.stickerPackSize}}}l.default=e}),98); __d("WAWebGenerateTemplateButtonReplyMessageProto",[],(function(t,n,r,o,a,i){function e(e){var t=e.contextInfo,n=e.json;return{templateButtonReplyMessage:{selectedId:n.selectedId,selectedIndex:n.selectedIndex,selectedCarouselCardIndex:n.selectedCarouselCardIndex,selectedDisplayText:n.body,contextInfo:t}}}i.default=e}),66); __d("WAWebGenerateVcardMessageProto",[],(function(t,n,r,o,a,i){function e(e){var t=e.contextInfo,n=e.json;return{contactMessage:{displayName:n.vcardFormattedName,vcard:n.body,contextInfo:t}}}i.default=e}),66); __d("WAWebPollsProtoUtils",["WALogger","WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c;function d(t){var n=t.pollContentType,r=t.options;if(n===o("WAWebProtobufsE2E.pb").Message$PollContentType.IMAGE){if(r==null){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Missing options in pollCreationMessage"]))).sendLogs("missing-options-in-pollCreationMessage");return}var a=r.some(function(e){var t=e.optionHash;return t==null||t===""});a&&o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Outgoing photo poll with missing option hashes"]))).sendLogs("outgoing-photo-poll-missing-option-hashes")}}function m(e){var t=e.correctAnswer,n=e.pollType;if(n===o("WAWebProtobufsE2E.pb").Message$PollType.QUIZ){if(t==null){o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Missing correctAnswer in pollCreationMessage"]))).sendLogs("missing-correctAnswer-in-pollCreationMessage");return}}else if(t){o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["correctAnswer present in pollCreationMessage"]))).sendLogs("invalid-correctAnswer-in-pollCreationMessage");return}}l.validatePhotoPollCreationMessage=d,l.validatePollCreationMessage=m}),98); __d("WAWebPollsGeneratePollCreationMessageProto",["WAWebPollCreationUtils","WAWebPollsProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,r=e.msgContext,a=n.pollContentType===o("WAWebPollCreationUtils").PollContentType.IMAGE,i=r==="quoted"?{name:n.pollName,options:[]}:{name:n.pollName,options:n.pollOptions.map(function(e){var t=e.hash,n=e.name;return a?{optionName:n,optionHash:t}:{optionName:n}}),selectableOptionsCount:n.pollSelectableOptionsCount,pollContentType:o("WAWebPollCreationUtils").getPollContentTypeAsE2EValue(n.pollContentType),pollType:o("WAWebPollCreationUtils").getPollTypeAsE2EValue(n.pollType),correctAnswer:n.correctOptionIndex!=null?{optionName:n.pollOptions[n.correctOptionIndex].name,optionHash:n.pollOptions[n.correctOptionIndex].hash}:void 0};return t!=null&&(i.contextInfo=t),o("WAWebPollsProtoUtils").validatePollCreationMessage(i),a&&o("WAWebPollsProtoUtils").validatePhotoPollCreationMessage(i),n.isSentCagPollCreation?{pollCreationMessageV2:i}:n.pollSelectableOptionsCount===1||n.pollContentType===o("WAWebPollCreationUtils").PollContentType.IMAGE?{pollCreationMessageV3:i}:{pollCreationMessage:i}}l.default=e}),98); __d("WAWebPollsGeneratePollVoteMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json,n={pollCreationMessageKey:o("WAWebE2EProtoUtils").encodeKey(t.pollUpdateParentKey),vote:t.encPollVote,senderTimestampMs:t.senderTimestampMs};return{pollUpdateMessage:n}}l.default=e}),98); __d("WAWebPttGenerateAudioOrPttMessageProto",["invariant","WALogger","WATypeUtils","WAWebAudioMessageProtoUtils","WAWebE2EProtoUtils","WAWebWid"],(function(t,n,r,o,a,i,l,s){var e;function u(t){var n=t.contextInfo,a=t.json,i=t.mediaMetadata;i||s(0,66891);var l=a.mimetype||i.mimetype,u=i.duration,c=a.waveform||i.waveform,d=u!=null&&o("WATypeUtils").isString(u)?parseInt(u,10):u,m={url:i.url,mimetype:l,directPath:i.directPath,fileSha256:o("WAWebE2EProtoUtils").encodeBytes(i.filehash),fileEncSha256:o("WAWebE2EProtoUtils").encodeBytes(i.encFilehash),seconds:d,ptt:a.type==="ptt",fileLength:o("WATypeUtils").isNumber(a.size)?a.size:void 0,mediaKey:o("WAWebE2EProtoUtils").encodeBytes(i.mediaKey),mediaKeyTimestamp:o("WATypeUtils").isNumber(i.mediaKeyTimestamp)?i.mediaKeyTimestamp:void 0,contextInfo:n,streamingSidecar:a.streamingSidecar,viewOnce:a.isViewOnce};return c&&(o("WAWebAudioMessageProtoUtils").validateWaveform(c)?m.waveform=c.buffer:o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Outgoing waveform with invalid size: ",""])),c.byteLength).sendLogs("outgoing-waveform-invalid-size")),o("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(a.type?"ptt":"audio",m,r("WAWebWid").isNewsletter(a.to)),{audioMessage:m}}l.default=u}),98); __d("WAWebQuestionsGenerateQuestionResponseMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json;return{questionResponseMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.id),text:t.body}}}l.default=e}),98); __d("WAWebReactionsGenerateReactionMessageProto",["WAWebE2EProtoUtils"],(function(t,n,r,o,a,i,l){function e(e){var t=e.json;return{reactionMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.reactionParentKey),text:t.reactionText,senderTimestampMs:t.reactionTimestamp}}}l.default=e}),98); __d("WAWebStickersGenerateStickerMessageProto",["invariant","WALogger","WATypeUtils","WAWebE2EProtoUtils","WAWebMsgType","WAWebStickerMimeUtils","WAWebWid","err"],(function(t,n,r,o,a,i,l,s){var e;function u(t){var n=t.contextInfo,a=t.json,i=t.mediaMetadata;if(i!=null||s(0,66810),i.mimetype!=null&&!o("WAWebStickerMimeUtils").getValidStickerMimeTypes().has(i.mimetype))throw o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["invalid sticker mimetype: ",""])),i.mimetype),r("err")("invalid sticker mimetype");var l={url:i.url,mimetype:i.mimetype,directPath:i.directPath,fileSha256:o("WAWebE2EProtoUtils").encodeBytes(i.filehash),fileEncSha256:o("WAWebE2EProtoUtils").encodeBytes(i.encFilehash),mediaKey:o("WAWebE2EProtoUtils").encodeBytes(i.mediaKey),mediaKeyTimestamp:o("WATypeUtils").isNumber(i.mediaKeyTimestamp)?i.mediaKeyTimestamp:void 0,fileLength:o("WATypeUtils").isNumber(a.size)?a.size:void 0,height:a.height,width:a.width,firstFrameLength:i.firstFrameLength,firstFrameSidecar:a.firstFrameSidecar||void 0,isAnimated:i.isAnimated,isLottie:i.isLottie,stickerSentTs:a.stickerSentTs,contextInfo:n};return o("WAWebE2EProtoUtils").validateOutgoingRequiredMediaProperties(o("WAWebMsgType").MSG_TYPE.STICKER,l,r("WAWebWid").isNewsletter(a.to)),{stickerMessage:l}}l.default=u}),98); __d("WAWebMessagePluginGenerateProtobufRegistry",["WAWebEventsGenerateEventCreationMessageProto","WAWebEventsGenerateEventEditMessageProto","WAWebEventsGenerateEventResponseMessageProto","WAWebGenerateBizContentPlaceholderProto","WAWebGenerateBotFeedbackProtocolMessageProto","WAWebGenerateBotRequestWelcomeMessageProto","WAWebGenerateButtonsResponseMessageProto","WAWebGenerateCancelPaymentMessageProto","WAWebGenerateChatMessageProto","WAWebGenerateDeclinePaymentMessageProto","WAWebGenerateDocumentMessageProto","WAWebGenerateEncCommentMessageProto","WAWebGenerateEphemeralSyncResponseMessageProto","WAWebGenerateExtendedTextUrlChatMessageProto","WAWebGenerateGroupInviteMessageProto","WAWebGenerateHsmMessageProto","WAWebGenerateImageMessageProto","WAWebGenerateInteractiveMessageProto","WAWebGenerateInteractiveResponseMessageProto","WAWebGenerateKeepInChatMessageProto","WAWebGenerateListMessageProto","WAWebGenerateListResponseMessageProto","WAWebGenerateLocationMessageProto","WAWebGenerateMessageHistoryBundleProto","WAWebGenerateMessageHistoryNoticeProto","WAWebGenerateMultiVcardMessageProto","WAWebGenerateNativeFlowButtonsMessageProto","WAWebGenerateNewsletterAdminInviteMessageProto","WAWebGenerateNewsletterFollowerInviteMessageProto","WAWebGenerateOrderMessageProto","WAWebGeneratePaymentInviteMessageProto","WAWebGeneratePinMessageProto","WAWebGeneratePollResultSnapshotMessageProto","WAWebGenerateProductMessageProto","WAWebGenerateProtocolEphemeralSettingMessageProto","WAWebGenerateProtocolHistorySyncNotificationMessageProto","WAWebGenerateProtocolLimitSharingMessageProto","WAWebGenerateProtocolMemberLabelMessageProto","WAWebGenerateProtocolMessageEditProto","WAWebGenerateProtocolRevokeMessageProto","WAWebGenerateProtocolSharePhoneNumberMessageProto","WAWebGenerateReactionEncMessageProto","WAWebGenerateRequestPaymentMessageProto","WAWebGenerateRequestPhoneNumberMessageProto","WAWebGenerateSecretMessageEditProto","WAWebGenerateSendPaymentMessageProto","WAWebGenerateStickerPackMessageProto","WAWebGenerateTemplateButtonReplyMessageProto","WAWebGenerateVcardMessageProto","WAWebGenerateVideoMessageProto","WAWebPollsGeneratePollCreationMessageProto","WAWebPollsGeneratePollVoteMessageProto","WAWebPttGenerateAudioOrPttMessageProto","WAWebQuestionsGenerateQuestionResponseMessageProto","WAWebReactionsGenerateReactionMessageProto","WAWebStickersGenerateStickerMessageProto"],(function(t,n,r,o,a,i,l){var e,s=[{type:"album",subtype:void 0,generateProtobuf:null},{type:"audio",subtype:void 0,generateProtobuf:r("WAWebPttGenerateAudioOrPttMessageProto")},{type:"biz_content_placeholder",subtype:void 0,generateProtobuf:r("WAWebGenerateBizContentPlaceholderProto")},{type:"buttons_response",subtype:void 0,generateProtobuf:r("WAWebGenerateButtonsResponseMessageProto")},{type:"chat",subtype:"url",generateProtobuf:r("WAWebGenerateExtendedTextUrlChatMessageProto")},{type:"chat",subtype:void 0,generateProtobuf:r("WAWebGenerateChatMessageProto")},{type:"ciphertext",subtype:"bot_unavailable_fanout",generateProtobuf:null},{type:"ciphertext",subtype:"fanout",generateProtobuf:null},{type:"ciphertext",subtype:"hosted_unavailable_fanout",generateProtobuf:null},{type:"ciphertext",subtype:"view_once_unavailable_fanout",generateProtobuf:null},{type:"ciphertext",subtype:void 0,generateProtobuf:null},{type:"comment",subtype:void 0,generateProtobuf:r("WAWebGenerateEncCommentMessageProto")},{type:"debug_placeholder",subtype:void 0,generateProtobuf:null},{type:"document",subtype:void 0,generateProtobuf:r("WAWebGenerateDocumentMessageProto")},{type:"event_creation",subtype:void 0,generateProtobuf:r("WAWebEventsGenerateEventCreationMessageProto")},{type:"event_edit_encrypted",subtype:void 0,generateProtobuf:r("WAWebEventsGenerateEventEditMessageProto")},{type:"event_response",subtype:void 0,generateProtobuf:r("WAWebEventsGenerateEventResponseMessageProto")},{type:"group-history",subtype:"message_history_bundle",generateProtobuf:r("WAWebGenerateMessageHistoryBundleProto")},{type:"groups_v4_invite",subtype:void 0,generateProtobuf:r("WAWebGenerateGroupInviteMessageProto")},{type:"hsm",subtype:void 0,generateProtobuf:r("WAWebGenerateHsmMessageProto")},{type:"image",subtype:void 0,generateProtobuf:r("WAWebGenerateImageMessageProto")},{type:"interactive",subtype:void 0,generateProtobuf:r("WAWebGenerateInteractiveMessageProto")},{type:"interactive_response",subtype:void 0,generateProtobuf:r("WAWebGenerateInteractiveResponseMessageProto")},{type:"keep_in_chat",subtype:void 0,generateProtobuf:r("WAWebGenerateKeepInChatMessageProto")},{type:"list",subtype:void 0,generateProtobuf:r("WAWebGenerateListMessageProto")},{type:"list_response",subtype:void 0,generateProtobuf:r("WAWebGenerateListResponseMessageProto")},{type:"loading_media",subtype:"loading_image",generateProtobuf:null},{type:"loading_media",subtype:"loading_video",generateProtobuf:null},{type:"location",subtype:void 0,generateProtobuf:r("WAWebGenerateLocationMessageProto")},{type:"message_edit_encrypted",subtype:"message_edit",generateProtobuf:r("WAWebGenerateSecretMessageEditProto")},{type:"message_history_notice",subtype:"message_history_notice",generateProtobuf:r("WAWebGenerateMessageHistoryNoticeProto")},{type:"multi_vcard",subtype:void 0,generateProtobuf:r("WAWebGenerateMultiVcardMessageProto")},{type:"native_flow",subtype:void 0,generateProtobuf:r("WAWebGenerateNativeFlowButtonsMessageProto")},{type:"newsletter_admin_invite",subtype:void 0,generateProtobuf:r("WAWebGenerateNewsletterAdminInviteMessageProto")},{type:"newsletter_follower_invite",subtype:void 0,generateProtobuf:r("WAWebGenerateNewsletterFollowerInviteMessageProto")},{type:"newsletter_question_response",subtype:void 0,generateProtobuf:r("WAWebQuestionsGenerateQuestionResponseMessageProto")},{type:"notification_template",subtype:"contact_info_card",generateProtobuf:null},{type:"order",subtype:void 0,generateProtobuf:r("WAWebGenerateOrderMessageProto")},{type:"payment",subtype:"ciphertext",generateProtobuf:null},{type:"payment",subtype:"futureproof",generateProtobuf:null},{type:"payment",subtype:"invite",generateProtobuf:r("WAWebGeneratePaymentInviteMessageProto")},{type:"payment",subtype:"request",generateProtobuf:r("WAWebGenerateRequestPaymentMessageProto")},{type:"payment",subtype:"send",generateProtobuf:r("WAWebGenerateSendPaymentMessageProto")},{type:"pin_message",subtype:void 0,generateProtobuf:r("WAWebGeneratePinMessageProto")},{type:"pinned_message",subtype:void 0,generateProtobuf:null},{type:"poll_creation",subtype:void 0,generateProtobuf:r("WAWebPollsGeneratePollCreationMessageProto")},{type:"poll_result_snapshot",subtype:void 0,generateProtobuf:r("WAWebGeneratePollResultSnapshotMessageProto")},{type:"poll_update",subtype:"poll_vote",generateProtobuf:r("WAWebPollsGeneratePollVoteMessageProto")},{type:"product",subtype:void 0,generateProtobuf:r("WAWebGenerateProductMessageProto")},{type:"protocol",subtype:"admin_revoke",generateProtobuf:e=r("WAWebGenerateProtocolRevokeMessageProto")},{type:"protocol",subtype:"bot_feedback",generateProtobuf:r("WAWebGenerateBotFeedbackProtocolMessageProto")},{type:"protocol",subtype:"bot_memu_onboarding",generateProtobuf:null},{type:"protocol",subtype:"bot_request_welcome",generateProtobuf:r("WAWebGenerateBotRequestWelcomeMessageProto")},{type:"protocol",subtype:"ephemeral_setting",generateProtobuf:r("WAWebGenerateProtocolEphemeralSettingMessageProto")},{type:"protocol",subtype:"ephemeral_sync_response",generateProtobuf:r("WAWebGenerateEphemeralSyncResponseMessageProto")},{type:"protocol",subtype:"event_edit_decrypted",generateProtobuf:null},{type:"protocol",subtype:"history_sync_notification",generateProtobuf:r("WAWebGenerateProtocolHistorySyncNotificationMessageProto")},{type:"protocol",subtype:"limit_sharing_system_message",generateProtobuf:r("WAWebGenerateProtocolLimitSharingMessageProto")},{type:"protocol",subtype:"member_label",generateProtobuf:r("WAWebGenerateProtocolMemberLabelMessageProto")},{type:"protocol",subtype:"message_edit",generateProtobuf:r("WAWebGenerateProtocolMessageEditProto")},{type:"protocol",subtype:"message_edit_decrypted",generateProtobuf:null},{type:"protocol",subtype:"sender_revoke",generateProtobuf:e},{type:"protocol",subtype:"share_phone_number",generateProtobuf:r("WAWebGenerateProtocolSharePhoneNumberMessageProto")},{type:"protocol",subtype:"status_group_mention_message",generateProtobuf:null},{type:"protocol",subtype:"status_mention_message",generateProtobuf:null},{type:"ptt",subtype:void 0,generateProtobuf:r("WAWebPttGenerateAudioOrPttMessageProto")},{type:"ptv",subtype:void 0,generateProtobuf:r("WAWebGenerateVideoMessageProto")},{type:"reaction",subtype:void 0,generateProtobuf:r("WAWebReactionsGenerateReactionMessageProto")},{type:"reaction_enc",subtype:void 0,generateProtobuf:r("WAWebGenerateReactionEncMessageProto")},{type:"request_phone_number",subtype:void 0,generateProtobuf:r("WAWebGenerateRequestPhoneNumberMessageProto")},{type:"revoked",subtype:"admin",generateProtobuf:e},{type:"revoked",subtype:"sender",generateProtobuf:e},{type:"rich_response",subtype:void 0,generateProtobuf:null},{type:"status_notification",subtype:"status_notification_message",generateProtobuf:null},{type:"sticker",subtype:void 0,generateProtobuf:r("WAWebStickersGenerateStickerMessageProto")},{type:"sticker-pack",subtype:void 0,generateProtobuf:r("WAWebGenerateStickerPackMessageProto")},{type:"template_button_reply",subtype:void 0,generateProtobuf:r("WAWebGenerateTemplateButtonReplyMessageProto")},{type:"unknown",subtype:"payment_action_request_declined",generateProtobuf:r("WAWebGenerateDeclinePaymentMessageProto")},{type:"unknown",subtype:"payment_transaction_request_cancelled",generateProtobuf:r("WAWebGenerateCancelPaymentMessageProto")},{type:"unknown",subtype:"phone",generateProtobuf:null},{type:"unknown",subtype:"phone_only_feature",generateProtobuf:null},{type:"unknown",subtype:void 0,generateProtobuf:null},{type:"vcard",subtype:void 0,generateProtobuf:r("WAWebGenerateVcardMessageProto")},{type:"video",subtype:void 0,generateProtobuf:r("WAWebGenerateVideoMessageProto")}];l.default=s}),98); __d("WAWebGenerateBotMetadata",["WAWebAiThreadTypeUtils","WAWebBotGating","WAWebBotGroupGatingUtils","WAWebBotModeSelectionProtoUtils","WAWebBotUnifiedResponseGating","WAWebLidMigrationUtils","WAWebProtobufsAICommon.pb"],(function(t,n,r,o,a,i,l){"use strict";function e(e){var t=e.aiThreadInfo;if(t!=null){var n=o("WAWebAiThreadTypeUtils").getProtoTypeFromAiThreadType(t.aiThreadType);return{clientInfo:{type:n}}}}function s(t){var n=t.botPersonaId!=null?t.botPersonaId:void 0,r=c(t),o=t.aiThreadInfo!=null?e(t):void 0,a=m(t.threadBotModeSelection);if(!(t.botGroupParticipant==null&&n==null&&r==null&&a==null))return{personaId:n,invokerJid:r,capabilityMetadata:t.id?d(t.id.remote):void 0,botThreadInfo:o,botGroupMetadata:u(t.botGroupParticipant),botModeSelectionMetadata:a}}function u(e){if(!(o("WAWebBotGroupGatingUtils").isOpenGroupBotParticipantAddEnabled()!==!0||e==null))return{participantsMetadata:[{botFbid:e==null?void 0:e.user}]}}function c(e){if(e.subtype==="bot_feedback"){var t;return(t=e.botTargetSenderJid)==null?void 0:t.toJid()}if(e.botTargetSenderJid!=null){var n;return(n=o("WAWebLidMigrationUtils").toLid(e.botTargetSenderJid))==null?void 0:n.toJid()}}function d(e){var t=[].concat(o("WAWebBotGating").isRichStructuredResponseEnabled()?[o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_STRUCTURED_RESPONSE,o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_HEADING,o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_SUB_HEADING,o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_TABLE,o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_INLINE_REELS].concat(o("WAWebBotUnifiedResponseGating").isUnifiedResponseSendingEnabled()?[o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_UNIFIED_RESPONSE,o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_LATEX,o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_LATEX_INLINE,o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_UR_INLINE_REELS_ENABLED,o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_UR_IMAGINE].concat(o("WAWebBotGating").isRichResponseReasoningEnabled()?[o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.RICH_RESPONSE_UR_REASONING]:[]):[]):[],o("WAWebBotGating").isAiContinuousSessionTransparencyNoticeEnabled(e)?[o("WAWebProtobufsAICommon.pb").BotCapabilityMetadata$BotCapabilityType.SESSION_TRANSPARENCY_SYSTEM_MESSAGE]:[]);return t.length===0?void 0:{capabilities:t}}function m(e){if(!(e==null||e.length===0)&&o("WAWebBotGating").isAiModeSelectorMessagingEnabled())return{mode:e.map(o("WAWebBotModeSelectionProtoUtils").getProtoModeFromBotSelectionMode)}}l.generateAiThreadInfo=e,l.generateBotMetadata=s,l.generateBotCapabilityMetadata=d,l.generateBotModeSelectionMetadata=m}),98); __d("WAWebGenerateThreadIds",["WAWebE2EProtoUtils","WAWebThreadUtils"],(function(t,n,r,o,a,i,l){"use strict";function e(e){var t=e.threadIds;if(!(t==null||t.length===0))return t.map(function(e){return{threadType:o("WAWebThreadUtils").getThreadsTypeAsE2EValue(e.type),threadKey:o("WAWebE2EProtoUtils").msgKeyToProtobuf(e.key)}})}l.generateThreadIds=e}),98); __d("WAWebE2EProtoGenerator",["WALogger","WATypeUtils","WAWebABPropsSaga","WAWebAssociationProtoUtils","WAWebBackendApi","WAWebBizCoexGatingUtils","WAWebBotGating","WAWebButtonsMessageProtoUtils","WAWebConversionTupleCollection","WAWebE2EProtoUtils","WAWebGenerateBotMetadata","WAWebGenerateThreadIds","WAWebLidMigrationUtils","WAWebMessageAssociation.flow","WAWebMessageAssociationGatingUtils","WAWebMessagePluginGenerateProtobuf","WAWebMessagePluginGenerateReportingTokenContent","WAWebMessagingGatingUtils","WAWebMsgType","WAWebPollCreationUtils","WAWebProtobufsE2E.pb","WAWebThreadsGating","WAWebURLUtils","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","isArrayNullOrEmpty","isEmptyObject","lodash"],(function(t,n,r,o,a,i,l){var e=["messageContextInfo"],s;function u(e,t,n){!t&&!n||(e.messageContextInfo=babelHelpers.extends({},e.messageContextInfo,{deviceListMetadata:{senderKeyHash:t==null?void 0:t.keyHash,senderTimestamp:t==null?void 0:t.timestamp,senderKeyIndexes:t==null?void 0:t.keyIndexes,recipientKeyHash:n==null?void 0:n.keyHash,recipientTimestamp:n==null?void 0:n.timestamp,recipientKeyIndexes:n==null?void 0:n.keyIndexes,senderAccountType:o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()?t==null?void 0:t.senderAccountType:void 0,receiverAccountType:o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()?n==null?void 0:n.receiverAccountType:void 0},deviceListMetadataVersion:2}))}function c(e){return e.type!==o("WAWebMsgType").MSG_TYPE.PROTOCOL?{}:e.subtype==="app_state_sync_key_share"?{protocolMessage:{type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.APP_STATE_SYNC_KEY_SHARE,appStateSyncKeyShare:e.appStateSyncKeyShare}}:e.subtype==="app_state_sync_key_request"?{protocolMessage:{type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.APP_STATE_SYNC_KEY_REQUEST,appStateSyncKeyRequest:e.appStateSyncKeyRequest}}:e.subtype==="app_state_fatal_exception_notification"?{protocolMessage:{type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.APP_STATE_FATAL_EXCEPTION_NOTIFICATION,appStateFatalExceptionNotification:e.appStateFatalExceptionNotification}}:e.subtype==="peer_data_operation_request_message"?{protocolMessage:{type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.PEER_DATA_OPERATION_REQUEST_MESSAGE,peerDataOperationRequestMessage:e.peerDataOperationRequestMessage}}:e.subtype==="peer_data_operation_request_response_message"?{protocolMessage:{type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE,peerDataOperationRequestResponseMessage:e.peerDataOperationRequestResponseMessage}}:{}}function d(e,t){var n,r=_(e);return p(r,t,(n=e.utm)!=null?n:void 0)}function m(e){return p(e)}function p(e,t,n){var a={};if(e.quotedMsg){var i=e.quotedMsg.mentionedJidList,l=e.quotedMsg.groupMentions,s=[],u=[];Array.isArray(i)&&i.length>0&&s.push.apply(s,i.map(o("WAWebE2EProtoUtils").encodeJid)),Array.isArray(l)&&l.length>0&&u.push.apply(u,l.map(function(e){return{groupSubject:e.groupSubject,groupJid:o("WAWebE2EProtoUtils").encodeJid(e.groupJid)}}));var c=s.length>0||u.length>0?{mentionedJid:s,groupMentions:u,statusAttributions:[]}:void 0;a.stanzaId=e.quotedStanzaID,a.remoteJid=o("WAWebE2EProtoUtils").encodeJid(e.quotedRemoteJid),a.participant=o("WAWebE2EProtoUtils").encodeJid(e.quotedParticipant);var d={duration:e.quotedMsg.duration,directPath:e.quotedMsg.directPath,encFilehash:e.quotedMsg.encFilehash,filehash:e.quotedMsg.filehash,height:e.quotedMsg.height,mediaKey:e.quotedMsg.mediaKey,mediaKeyTimestamp:o("WATypeUtils").isNumber(e.quotedMsg.mediaKeyTimestamp)?e.quotedMsg.mediaKeyTimestamp:void 0,mimetype:e.quotedMsg.mimetype,url:e.quotedMsg.clientUrl||e.quotedMsg.deprecatedMms3Url,width:e.quotedMsg.width};a.quotedMessage=f(e.quotedMsg,d,c,void 0,"quoted")}else e.quotedRemoteJid&&e.quotedGroupSubject&&e.quotedParentGroupJid?(a.remoteJid=o("WAWebE2EProtoUtils").encodeJid(e.quotedRemoteJid),a.groupSubject=e.quotedGroupSubject,a.parentGroupJid=o("WAWebE2EProtoUtils").encodeJid(e.quotedParentGroupJid)):e.quotedRemoteJid&&(a.remoteJid=o("WAWebE2EProtoUtils").encodeJid(e.quotedRemoteJid));if(e.mentionedJidList&&e.mentionedJidList.length>0){var m=e.mentionedJidList;a.mentionedJid=m.map(o("WAWebE2EProtoUtils").encodeJid)}if(e.groupMentions&&e.groupMentions.length>0&&(a.groupMentions=e.groupMentions.map(function(e){return{groupSubject:e.groupSubject,groupJid:o("WAWebE2EProtoUtils").encodeJid(e.groupJid)}})),e.conversionTuple&&Object.assign(a,e.conversionTuple),e.isForwarded&&(a.isForwarded=e.isForwarded),e.isQuestion&&(a.isQuestion=e.isQuestion),e.questionReplyQuotedMessage&&(a.questionReplyQuotedMessage={serverQuestionId:e.questionReplyQuotedMessage.questionServerId,quotedQuestion:f(e.questionReplyQuotedMessage.quotedQuestion,void 0,{isQuestion:!0,groupMentions:[],mentionedJid:[],statusAttributions:[]},void 0,"quoted"),quotedResponse:f(e.questionReplyQuotedMessage.quotedResponse,void 0,void 0,void 0,"quoted")}),e.forwardingScore&&(a.forwardingScore=e.forwardingScore),e.nonJidMentions!=null&&(a.nonJidMentions=e.nonJidMentions),e.groupId&&(a.groupId=e.groupId),e.groupIndex&&(a.groupIndex=e.groupIndex),e.groupSize&&(a.groupSize=e.groupSize),e.forwardedNewsletterMessageInfo){var p=e.forwardedNewsletterMessageInfo,_=p.newsletterId,g=p.newsletterName,h=p.serverMessageId;a.forwardedNewsletterMessageInfo={newsletterJid:o("WAWebE2EProtoUtils").encodeJid(_),newsletterName:g,serverMessageId:h}}return e.ephemeralDuration&&(a.expiration=e.ephemeralDuration),e.ephemeralSettingTimestamp&&(a.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp),(e.disappearingModeInitiator||e.disappearingModeTrigger!=null&&e.to.isGroup())&&(a.disappearingMode=o("WAWebE2EProtoUtils").disappearingModeInitiatorToProto(e.disappearingModeInitiator,e.disappearingModeTrigger,e.disappearingModeInitiatedByMe)),e.ctwaContext&&(a.externalAdReply={sourceUrl:e.ctwaContext.sourceUrl,sourceId:e.ctwaContext.sourceId,sourceType:e.ctwaContext.sourceType,body:e.ctwaContext.description,title:e.ctwaContext.title,thumbnailUrl:e.ctwaContext.thumbnailUrl,thumbnail:e.ctwaContext.thumbnail?o("WAWebE2EProtoUtils").encodeBytes(e.ctwaContext.thumbnail):void 0,mediaType:e.ctwaContext.mediaType,mediaUrl:e.ctwaContext.mediaUrl}),n&&(a.utm={utmCampaign:n.campaign!=null?n.campaign:void 0,utmSource:n.source!=null?n.source:void 0}),e.cannotBeRanked&&(a.featureEligibilities={cannotBeRanked:e.cannotBeRanked}),e.limitSharing&&(a.limitSharingV2=e.limitSharing),f(e,t,r("isEmptyObject")(a)?void 0:a)}function _(e){var t=e.id,n=e.toJSON();delete n.status,delete n.mimetype,delete n.height,delete n.width,delete n.recipients,delete n.chat,delete n.broadcast,delete n.ack,delete n.invis,delete n.filehash,delete n.recvFresh,delete n.mediaData,r("WAWebURLUtils").isHttp(e.clientUrl)||delete n.clientUrl,r("WAWebURLUtils").isHttp(e.deprecatedMms3Url)||delete n.deprecatedMms3Url;for(var o in n)n[o]==null&&delete n[o];var a=r("WAWebConversionTupleCollection").get(t.remote);return a&&(n.conversionTuple=a.serialize()),n}function f(e,t,n,a,i){var l,u;t===void 0&&(t={}),n===void 0&&(n=void 0);var c=g(e,t,n,a,i);try{var d=o("WAWebAssociationProtoUtils").getValidatedOutgoingMessageAssociationContextInfo(e.associationType,e.parentMsgKey);d&&(c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,d))}catch(t){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["failed to generate associated message context info for "," of association "," due to error: ",""])),e.type,e.associationType,t).sendLogs("getProtobufMessage: failed to generate associated message context info")}if(!(o("WAWebBotGating").isBotEnabled()&&(l=e.invokedBotWid)!=null&&l.isBot())&&e.messageSecret&&(c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,{messageSecret:e.messageSecret})),o("WAWebBotGating").isBotEnabled()){var m=o("WAWebGenerateBotMetadata").generateBotMetadata(e);c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,{botMetadata:m})}if(!r("isArrayNullOrEmpty")(e.threadIds)&&o("WAWebThreadsGating").isThreadsInfraEnabled()){var p=o("WAWebGenerateThreadIds").generateThreadIds(e);c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,{threadId:p})}if(c=I(c,e,n),o("WAWebMessagingGatingUtils").isReportingTokenSendingEnabled()&&o("WAWebMessagePluginGenerateReportingTokenContent").isMsgTypeReportingTokenCompatible(e.type,e.subtype)){var _,f;c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,{messageSecret:(_=(f=c.messageContextInfo)==null?void 0:f.messageSecret)!=null?_:e.messageSecret})}return e.type===o("WAWebMsgType").MSG_TYPE.COMMENT&&((u=c.messageContextInfo)==null?void 0:u.messageSecret)!=null&&(c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,{messageSecret:null})),e.limitSharing&&(c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,{limitSharingV2:e.limitSharing})),c}function g(e,t,n,r,a){t===void 0&&(t={}),n===void 0&&(n=void 0),r===void 0&&(r={});var i=o("WAWebMessagePluginGenerateProtobuf").generateProtobuf({message:r,msgContext:a,contextInfo:n,json:e,mediaMetadata:t});if(i!=null)return i;switch(e.type){case o("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE:return{conversation:e.body};case"template":return e.subtype==="text"?(e.type="chat",e.title&&(e.body="*"+e.title+"*\n"+e.body)):e.type=e.subtype,f(e,t,n,r)}return r}function h(e,t){return t.type==="ptt"?{viewOnceMessageV2Extension:{message:e}}:{viewOnceMessage:{message:e}}}function y(e){return{documentWithCaptionMessage:{message:e}}}function C(e){return{lottieStickerMessage:{message:e}}}function b(e){return{groupMentionedMessage:{message:e}}}function v(e){return{botInvokeMessage:{message:e}}}function S(e){return{pollCreationMessageV4:{message:e}}}function R(e){return{questionMessage:{message:e}}}function L(e){return{questionReplyMessage:{message:e}}}function E(e){return{associatedChildMessage:{message:babelHelpers.extends({},e,{messageContextInfo:void 0})},messageContextInfo:e.messageContextInfo}}function k(t){var n=t.messageContextInfo,r=babelHelpers.objectWithoutPropertiesLoose(t,e);return{pollCreationOptionImageMessage:{message:r},messageContextInfo:n}}function I(e,t,n){var a,i,l,s,u,c=e;if(t.pollContentType===o("WAWebPollCreationUtils").PollContentType.IMAGE&&(c=S(c)),(n==null?void 0:n.isQuestion)===!0&&(c=R(c)),n!=null&&n.questionReplyQuotedMessage&&(c=L(c)),t.associationType!=null&&(t.associationType===o("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL?c=k(c):o("WAWebMessageAssociationGatingUtils").isFutureproofAssociatedChildEnabled()&&(c=E(c))),t.isViewOnce&&(c=h(c,t)),t.isDynamicReplyButtonsMsg===!0&&(c=o("WAWebButtonsMessageProtoUtils").createDynamicReplyButtonsMessage(c,t,n)),t.type===o("WAWebMsgType").MSG_TYPE.DOCUMENT&&((a=c.documentMessage)!=null&&a.caption)&&(c=y(c)),t.type===o("WAWebMsgType").MSG_TYPE.STICKER&&((i=c.stickerMessage)!=null&&i.isLottie)&&(c=C(c)),n!=null&&(l=n.groupMentions)!=null&&l.length&&(c=b(c)),!((s=t.invokedBotWid)!=null&&s.isFbidBot())&&((u=t.invokedBotWid)!=null&&u.isPnBot()||t.subtype==="bot_request_welcome")&&(c=v(c),o("WAWebBotGating").isBotEnabled())){var d;c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,{messageSecret:t.messageSecret,botMetadata:babelHelpers.extends({},((d=e.messageContextInfo)==null?void 0:d.botMetadata)||{},t.botTargetSenderJid instanceof r("WAWebWid")?{invokerJid:t.botTargetSenderJid.toJid()}:{})})}return c}function T(e){e.imageMessage=void 0,e.videoMessage=void 0,e.documentMessage=void 0,e.audioMessage=void 0,e.stickerMessage=void 0,e.lottieStickerMessage=void 0,e.stickerPackMessage=void 0,e.albumMessage=void 0}function D(e){return e==null?!1:!!(e.imageMessage||e.videoMessage||e.documentMessage||e.audioMessage||e.stickerMessage||e.lottieStickerMessage||e.stickerPackMessage||e.albumMessage)}var x=["deviceSentMessage","viewOnceMessage","ephemeralMessage","documentWithCaptionMessage","viewOnceMessageV2","editedMessage","viewOnceMessageV2Extension","groupMentionedMessage","botInvokeMessage","statusMentionMessage","pollCreationOptionImageMessage","associatedChildMessage","groupStatusMentionMessage","pollCreationMessageV4","statusAddYours","groupStatusMessage","limitSharingMessage","questionMessage","groupStatusMessageV2","botForwardedMessage","questionReplyMessage"];function $(e){var t=e;D(t)&&T(t),x.forEach(function(e){var n,r=(n=t[e])==null?void 0:n.message;r!=null&&D(r)&&T(r)})}function P(e,t,n){var a,i,l,s,u;n===void 0&&(n=!1);var c=r("lodash").cloneDeep(e);n===!0&&$(c),c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,{messageSecret:null}),t&&(c.messageContextInfo=babelHelpers.extends({},c.messageContextInfo,{botMessageSecret:t}));var d=(c==null||(a=c.botInvokeMessage)==null||(a=a.message)==null||(a=a.extendedTextMessage)==null?void 0:a.contextInfo)||(c==null||(i=c.extendedTextMessage)==null?void 0:i.contextInfo);if((d==null?void 0:d.quotedMessage)!=null){var m;d.participant!=null&&((m=o("WAWebWidFactory").createWid(d.participant))==null?void 0:m.isBot())!==!0&&(delete d.quotedMessage,delete d.stanzaId,delete d.remoteJid,delete d.participant)}var p=c==null||(l=c.protocolMessage)==null||(l=l.botFeedbackMessage)==null?void 0:l.messageKey;p!=null&&p.remoteJid!=null&&delete p.remoteJid;var _=(c==null||(s=c.protocolMessage)==null?void 0:s.type)===o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REVOKE?c==null||(u=c.protocolMessage)==null?void 0:u.key:null;return _!=null&&_.remoteJid!=null&&delete _.remoteJid,c}function N(e){var t,n,a,i=e,l=(t=e==null||(n=e.botInvokeMessage)==null||(n=n.message)==null||(n=n.extendedTextMessage)==null||(n=n.contextInfo)==null?void 0:n.participant)!=null?t:e==null||(a=e.extendedTextMessage)==null||(a=a.contextInfo)==null?void 0:a.participant;if(l!=null){var s=o("WAWebWidFactory").createWid(l);if(!s.isBot()){var u,c,d;i=r("lodash").cloneDeep(e);var m=(u=(c=i)==null||(c=c.botInvokeMessage)==null||(c=c.message)==null||(c=c.extendedTextMessage)==null?void 0:c.contextInfo)!=null?u:(d=i)==null||(d=d.extendedTextMessage)==null?void 0:d.contextInfo;if(m!=null){var p=o("WAWebLidMigrationUtils").toLid(s);m.participant=o("WAWebE2EProtoUtils").encodeJid(p)}}}return i}function M(e){var t,n=e,a=e==null||(t=e.protocolMessage)==null||(t=t.key)==null?void 0:t.participant;if(a!=null){var i=o("WAWebWidFactory").createWid(a);if(!i.isBot()&&!i.isLid()){var l;n=r("lodash").cloneDeep(e);var s=(l=n)==null||(l=l.protocolMessage)==null?void 0:l.key;if(s!=null){var u=o("WAWebLidMigrationUtils").toLid(i);s.participant=o("WAWebE2EProtoUtils").encodeJid(u)}}}return n}function w(e){var t=e,n=(e==null?void 0:e.protocolMessage)!=null;if(n){var o,a;t=r("lodash").cloneDeep(e),(o=t.protocolMessage)==null||(o=o.key)==null||delete o.remoteJid,(a=t.protocolMessage)==null||(a=a.key)==null||delete a.participant}return t}function A(e){var t=r("lodash").cloneDeep(e);return t.messageContextInfo=babelHelpers.extends({},t.messageContextInfo,{capiCreatedGroup:!0}),t}function F(e){return O.apply(this,arguments)}function O(){return O=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebBackendApi").frontendSendAndReceive("getDebugInfo",{addLanguageFields:!0,convertFields:!0,addUserAgentDetails:!0});t.sagaKey="saga_v1_enabled";var n=babelHelpers.extends({version:1,debug_information:t},o("WAWebABPropsSaga").getIsSagaV1CarouselEnabled()?{citations_carousel:!0}:{});e.messageContextInfo=babelHelpers.extends({},e.messageContextInfo,{supportPayload:JSON.stringify(n)})}),O.apply(this,arguments)}l.populateMessageContextInfo=u,l.createPeerMsgProtobuf=c,l.createMsgProtobuf=d,l.createAddonProtobuf=m,l.createProtobuf=p,l.getProtobufMessage=f,l.updateBotInvokeMsgProtoCopyForCapi=P,l.updateFbidBotProtobuf=N,l.updateFbidBotInvokeProtobuf=M,l.updateBotProtobuf=w,l.updateGroupMsgProtoWithCapiFlag=A,l.addDebugInfoSupportPayload=F}),98); __d("WAWebApiHistorySyncNotification",["WALogger","WAWebHistorySyncNotificationUtils","WAWebHistorySyncProgress","WAWebProtobufsHistorySync.pb","WAWebSchemaHistorySyncNotification","WAWebSyncGatingUtils","WAWebUserPrefsHistorySync","WAWebUserPrefsTypes","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h=new Set,y={};function C(e,t,n){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(e===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.PUSH_NAME)return!0;if([o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.FULL,o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT].includes(e)&&t===1||o("WAWebSyncGatingUtils").isHistorySyncOnDemandEnabled()&&e===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.ON_DEMAND&&t===0){if(e===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT){var r=yield o("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete();return r===!0}var a=yield o("WAWebUserPrefsHistorySync").getHistorySyncStatus();return!!(a!=null&&a.recentCompleted)}var i=yield o("WAWebUserPrefsHistorySync").getLastHistorySyncedChunk();if(i==null)return!1;var l=i.split("_"),s=l[0],u=l[1];return s===""+e&&u===""+(t-1)?!0:s===""+e&&u===""+t?(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[history sync] isPreviousChunkProcessed: next chunk already processed ","_",", last processed: "," "])),e,t,i).tags("history-sync"),yield L(n,e,t),!1):(o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[history sync] isPreviousChunkProcessed returned false for ","_",", last processed: "," "])),e,t,i).tags("history-sync"),!1)}),b.apply(this,arguments)}function v(e,t,n){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[history sync] check if previous recent sync is processed with optimized logic"]))),t===1){var r=yield o("WAWebUserPrefsHistorySync").getInitialHistorySyncComplete();return r===!0}var a=yield o("WAWebUserPrefsHistorySync").getLastHistoryRecentSyncedChunk();if(a==null)return!1;var i=a.chunkOrder;return i===t-1?!0:i===t?(o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[history sync] isPreviousChunkProcessed: next chunk already processed ","_",", last processed: chunkOrder:"," progress:",""])),e,t,a.chunkOrder,a.progress).tags("history-sync"),yield L(n,e,t),!1):(o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[history sync] isPreviousChunkProcessed returned false for ","_",", last processed: "," "])),e,t,i).tags("history-sync"),!1)}),S.apply(this,arguments)}function R(t){return o("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().equals(["processed"],0,{shouldDecrypt:!1}).then((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n,r=t.filter(function(e){return!h.has(e.msgKey)&&!e.reuploadPending}).sort(function(e,t){return e.syncType!==t.syncType?t.syncType-e.syncType:e.chunkOrder!=null&&t.chunkOrder!=null?e.chunkOrder-t.chunkOrder:0}),a=r.length>0?r[0]:void 0,i=(n=a)==null?void 0:n.chunkOrder;if(i==null){var l;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync] getNextUnProcessedNotification chunkOrder is null, ",""])),(l=a)==null?void 0:l.msgKey).tags("history-sync");return}if(a){var s;if(a.syncType===o("WAWebProtobufsHistorySync.pb").HistorySync$HistorySyncType.RECENT&&o("WAWebSyncGatingUtils").isRecentSyncNextChunkFetchOptimizationEnabled()?s=yield v(a.syncType,i,a.msgKey):s=yield C(a.syncType,i,a.msgKey),o("WAWebHistorySyncProgress").handleChunkProgress(s),!s)return;a=yield o("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().postflightDecryptSingleRecord(a)}return a});return function(e){return t.apply(this,arguments)}})())}function L(e,t,n){return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] remove history sync notification from db with ","_",""])),t,n),h.delete(e),o("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().remove(e).catch(function(e){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[history sync] updateCurrentlyProcessed failed with error ",""])),e).tags("history-sync")})}function E(e){return h.delete(e),o("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().merge(e,{reuploadPending:!0})}function k(e){h.delete(e)}function I(e){var t=o("WAWebHistorySyncNotificationUtils").getHistorySyncBasicChunkInfoString(e.syncType,e.chunkOrder,e.isReupload),n=e.downloadOptions.mediaKey,r=e.downloadOptions.directPath,a=e.downloadOptions.filehash,i=e.downloadOptions.encFilehash;e.downloadOptions.mediaKey="",e.downloadOptions.directPath="",e.downloadOptions.filehash="",e.downloadOptions.encFilehash="";var l=babelHelpers.extends({},e,{chunkEncryptionKey:n,directPath:r,filehash:a,encFilehash:i});return e.processed=0,o("WAWebSchemaHistorySyncNotification").getHistorySyncNotificationTable().createOrMerge(e.msgKey,l)}function T(e,t){return D.apply(this,arguments)}function D(){return D=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){t===void 0&&(t=!1),yield I(e).then(function(){o("WAWebUserPrefsHistorySync").setRecentSyncSingleChunkStatus(e.syncType,o("WAWebUserPrefsTypes").HistorySyncSingleChunkStatusType.NOTIFICATION_STORED,e.chunkOrder)}),t&&h.add(e.msgKey)}),D.apply(this,arguments)}function x(){return $.apply(this,arguments)}function $(){return $=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(h.size>0)return o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[history sync] return null for next history sync chunk due to inFlightChunk.size=",""])),h.size),null;var e=yield R();if(e){var t=o("WAWebHistorySyncNotificationUtils").getHistorySyncBasicChunkInfoString(e==null?void 0:e.syncType,e==null?void 0:e.chunkOrder,e==null?void 0:e.isReupload);e.downloadOptions.mediaKey=e.chunkEncryptionKey,delete e.chunkEncryptionKey,e.downloadOptions.directPath=e.directPath||e.downloadOptions.directPath,delete e.directPath,e.downloadOptions.filehash=e.downloadOptions.filehash===""?e.filehash:e.downloadOptions.filehash,delete e.filehash,e.downloadOptions.encFilehash=e.encFilehash,delete e.encFilehash,h.add(e.msgKey)}else o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[history sync] return null for next history sync chunk due to next=null"])));return e}),$.apply(this,arguments)}l.inFlightChunk=h,l.recentSyncChunkHandlingTriedCount=y,l.updateCurrentlyProcessed=L,l.markChunkForReuploadPending=E,l.removeLocalFailureFromInFlightChunk=k,l.enqueueNotification=T,l.fetchNextHistorySyncChunkForProcessing=x}),98); __d("WAWebSettingsGetters",["WAWebGetters","WAWebGettersCaches"],(function(t,n,r,o,a,i,l){var e=o("WAWebGetters").createGetterFactories({createCache:o("WAWebGettersCaches").createSettingsCache}),s=e.clearCacheFor,u=e.computed,c=e.field,d=s,m=c("archive"),p=u(function(e){var t=e[0];return t.enabled?!t.classic:!1},[m]);l.clearSettingsGetterCacheFor=d,l.getArchive=m,l.getShowArchiveV2=p}),98); __d("WAWebSettingsModel",["WAWebBaseModel","WAWebSettingsGetters"],(function(t,n,r,o,a,i,l){var e={classic:!1,enabled:!1},s={duration:0,settingTimestamp:0},u=(function(t){function n(){for(var e,n=arguments.length,r=new Array(n),a=0;a0&&o("WAWebLabelCollection").LabelCollection.initializeAssociationsFromCache(e)}return(c||(c=n("Promise"))).resolve()}),h.apply(this,arguments)}function y(){return o("WAWebBizGatingUtils").canSendQuickReply()?o("WAWebSchemaQuickReply").getQuickReplyTable().all().then(function(e){o("WAWebQuickReplyCollection").QuickReplyCollection.initializeFromCache(e)}):(c||(c=n("Promise"))).resolve()}function C(){return o("WAWebSchemaRecentStickers").getRecentStickersTable().all().then(function(e){return o("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.initializeFromCache(e)})}function b(){return o("WAWebSchemaFavoriteStickers").getFavoriteStickersTable().all().then(function(e){return o("WAWebFavoriteStickerCollection").FavoriteStickerCollection.initializeFromCache(e)})}function v(){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebUserPrefsMultiDevice").getArchiveV2EnabledSetting(),t=yield o("WAWebUserPrefsMultiDevice").getUnarchiveChatsSetting();e!=null&&(r("WAWebSettingsModel").archive=babelHelpers.extends({},o("WAWebSettingsGetters").getArchive(r("WAWebSettingsModel")),{enabled:e})),t!=null&&(r("WAWebSettingsModel").archive=babelHelpers.extends({},o("WAWebSettingsGetters").getArchive(r("WAWebSettingsModel")),{classic:t}))}),S.apply(this,arguments)}function R(){return o("WAWebSchemaCart").getCartTable().all().then(function(e){o("WAWebCartCollection").CartCollection.initializeFromCache(o("WAWebApiHydrateWidsUtil").hydrateWids(e))})}function L(){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebBizGatingUtils").isMultiDeviceMessageAttributionEnabled()){var e=yield o("WAWebSchemaAgent").getAgentTable().all();o("WAWebAgentCollection").AgentCollection.initializeFromCache(e)}}),E.apply(this,arguments)}function k(){return I.apply(this,arguments)}function I(){return I=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSchemaSubscription").getSubscriptionTable().all();o("WAWebSubscriptionCollection").SubscriptionCollection.initializeFromCache(e)}),I.apply(this,arguments)}function T(){return D.apply(this,arguments)}function D(){return D=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebBizGatingUtils").chatAssignmentEnabled()){var e=yield o("WAWebSchemaChatAssignment").getChatAssignmentTable().all();o("WAWebChatAssignmentCollection").ChatAssignmentCollection.initializeFromCache(e)}}),D.apply(this,arguments)}function x(){return $.apply(this,arguments)}function $(){return $=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSchemaDataSharing3pdLidV2").getDataSharing3pdLidTable().all();o("WAWebDataSharing3pdLidCollection").DataSharing3pdLidCollection.initializeFromCache(e)}),$.apply(this,arguments)}function P(){return N.apply(this,arguments)}function N(){return N=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var e=yield o("WAWebSchemaUnjoinedSubgroupMetadata").getUnjoinedSubgroupMetadataTable().all();e.forEach(function(e){r("WAWebUnjoinedSubgroupMetadataCollection").add({id:o("WAWebWidFactory").createWid(e.id),subject:e.subject,subjectTime:e.subjectTime,defaultSubgroup:e.defaultSubgroup,parentGroupId:o("WAWebWidFactory").createWid(e.parentGroup),size:e.size,generalSubgroup:e.generalSubgroup,membershipApprovalMode:e.membershipApprovalMode,membershipApprovalRequest:e.membershipApprovalRequest,hiddenSubgroup:e.hiddenSubgroup},{merge:!0})})}finally{}}),N.apply(this,arguments)}function M(){var e=r("WAWebGroupMetadataCollection").filter(function(e){return e.isParentGroup}),t=e.map(function(e){return r("WAWebCommunityActivityCollection").syncActivityFor(e.id)});return(c||(c=n("Promise"))).all(t)}function w(){return o("WAWebSchemaNonMessageDataRequest").getNonMessageDataRequestTable().all().then(function(e){o("WAWebNonMessageDataRequestMediaHandlingUtils").initializeMediaUploadResultFromStorage(e)})}function A(){return o("WAWebSchemaStickerDownload").getStickerDownloadTable().all().then(function(e){return o("WAWebStickerDownloadCollection").StickerDownloadCollection.initializeFromCache(e)})}l.restoreImportantMetaData=d,l.restoreBlocklist=p,l.restoreOptOutList=_,l.restoreLabels=f,l.restoreLabelAssociations=g,l.restoreQuickReplies=y,l.restoreRecentStickers=C,l.restoreFavoriteStickers=b,l.restoreArchiveV2Settings=v,l.restoreCarts=R,l.restoreAgents=L,l.restoreSubscriptions=k,l.restoreChatAssignments=T,l.restoreDataSharing3pdLid=x,l.restoreUnjoinedSubgroups=P,l.restoreCommunityActivity=M,l.restoreMediaUploadResult=w,l.restoreStickerDownload=A}),98); __d("WAWebGetPendingMutation",["WAWebRunInTransaction"],(function(t,n,r,o,a,i,l){"use strict";function e(e){return o("WAWebRunInTransaction").runInTransaction({PendingMutationStore:!0},function(t){var n=t.PendingMutationStore;return n.getByCollection(e)})}function s(){return o("WAWebRunInTransaction").runInTransaction({PendingMutationStore:!0},function(e){var t=e.PendingMutationStore;return t.getAll()})}function u(e){return o("WAWebRunInTransaction").runInTransaction({PendingMutationStore:!0},function(t){var n=t.PendingMutationStore;return n.bulkCreate(e)})}l.getSyncPendingMutationsByCollectionInTransaction=e,l.getAllSyncPendingMutationsInTransaction=s,l.bulkCreateSyncPendingMutationsInTransaction=u}),98); __d("WAWebSentinel",["WASyncdConst","WAWebGetPendingMutation","WAWebSentinelMutationSync","WAWebSyncd","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";function e(){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield r("WAWebSentinelMutationSync").getSentinelMutations();return yield o("WAWebGetPendingMutation").bulkCreateSyncPendingMutationsInTransaction(e),o("WAWebSyncd").markCollectionsForSync(Array.from(o("WASyncdConst").CollectionName.members()))}),s.apply(this,arguments)}l.default=e}),98); __d("WAWebGetCollectionVersion",["WACryptoLtHash","WAWebRunInTransaction"],(function(t,n,r,o,a,i,l){"use strict";function e(e){return o("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(t){var n=t.CollectionVersionStore;return n.get(e)})}function s(e,t){var n=e.CollectionVersionStore;return n.get(t).then(function(e){var t;return(t=e==null?void 0:e.ltHash)!=null?t:new ArrayBuffer(o("WACryptoLtHash").KEY_LENGTH_BYTES)})}function u(e){return o("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(t){var n=t.CollectionVersionStore;return s({CollectionVersionStore:n},e)})}function c(e){return o("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(t){var n=t.CollectionVersionStore;return n.bulkGet(e)})}function d(){return o("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(e){var t=e.CollectionVersionStore;return t.getAll()})}function m(e,t,n){return o("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(r){var o=r.CollectionVersionStore;return o.update(e,{version:t,ltHash:n})})}function p(e){return o("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(t){var n=t.CollectionVersionStore;return n.bulkUpdate(e)})}function _(e){return o("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(t){var n=t.CollectionVersionStore;return n.get(e).then(function(e){return e==null?void 0:e.isCollectionInMacMismatchFatal})})}function f(e){return o("WAWebRunInTransaction").runInTransaction({CollectionVersionStore:!0},function(t){var n=t.CollectionVersionStore;return n.update(e,{isCollectionInMacMismatchFatal:!0})})}l.getCollectionVersionInTransaction=e,l.getCollectionVersionLtHashInTransaction=u,l.bulkGetCollectionVersionsInTransaction=c,l.getAllCollectionVersionsInTransaction=d,l.updateCollectionVersionAndLtHashInTransaction=m,l.bulkUpdateCollectionVersionInTransaction=p,l.getIsCollectionInMacMismatchFatalInTransaction=_,l.updateIsCollectionInMacMismatchFatalInTransaction=f}),98); __d("WAWebGetSyncAction",["WASyncdConst","WAWebRunInTransaction"],(function(t,n,r,o,a,i,l){"use strict";function e(){return o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(e){var t=e.SyncActionStore;return t.count()})}function s(e){return o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(t){var n=t.SyncActionStore;return n.get(e)})}function u(e){return o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(t){var n=t.SyncActionStore;return n.getByCollections(e)})}function c(e){return o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(t){var n=t.SyncActionStore;return n.getByIndexMacs(e)})}function d(e){return o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(t){var n=t.SyncActionStore;return n.getByActionStates(e)})}function m(e){return o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(t){var n=t.SyncActionStore;return n.getByModelInfos(e)})}function p(){return o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(e){var t=e.SyncActionStore;return t.getAll()})}function _(e){return o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0},function(t){var n=t.SyncActionStore;return n.getByActionStates([o("WASyncdConst").SyncActionState.Orphan]).then(function(t){return t.filter(function(t){return t.modelType!=null&&o("WASyncdConst").SyncModelType.cast(t.modelType)===e})})})}l.countSyncActionsInTransaction=e,l.getSyncActionInTransaction=s,l.getSyncActionsByCollectionsInTransaction=u,l.getSyncActionsByIndexMacsInTransaction=c,l.getSyncActionsByActionStatesInTransaction=d,l.getSyncActionsByModelInfosInTransaction=m,l.getAllSyncActions=p,l.getOrphanSyncActionsByModelTypeInTransaction=_}),98); __d("WAWebSyncdCollectionsStateMachine",["WALogger","WASyncdConst","WATimeUtils","WAWebGetCollectionVersion","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c=(function(){function t(){}return t.loadStatesFromDb=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=this,t=yield o("WAWebGetCollectionVersion").getAllCollectionVersionsInTransaction();t.forEach(function(t){return e.collectionStates.set(t.collection,{collection:t.collection,state:t.state,finiteFailureStartTime:t.finiteFailureStartTime})})});function t(){return e.apply(this,arguments)}return t})(),t.persistToDb=function(){var t=[];return this.collectionStates.forEach(function(e){return t.push(babelHelpers.extends({},e))}),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: state machine persistToDb. states:"]))),t.forEach(function(e){var t=e.finiteFailureStartTime==null?"":"(failure start: "+e.finiteFailureStartTime+")";o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: ",": "," ",""])),e.collection,e.state,t)}),o("WAWebGetCollectionVersion").bulkUpdateCollectionVersionInTransaction(t)},t.clean=function(){this.collectionStates=new Map},t.getCollectionState=function(t){var e=this.collectionStates.get(t);return e?e.state:(this.moveCollectionsToUpToDate([t]),o("WASyncdConst").CollectionSyncState.UpToDate)},t.getCollectionsInStateDirty=function(){var e=[];return this.collectionStates.forEach(function(t){t.state===o("WASyncdConst").CollectionSyncState.Dirty&&e.push(t.collection)}),e},t.getCollectionsInStateRetry=function(){var e=[];return this.collectionStates.forEach(function(t){t.state===o("WASyncdConst").CollectionSyncState.FailingFiniteRetry&&e.push(t.collection)}),e},t.getCollectionsInStateFatal=function(){var e=[];return this.collectionStates.forEach(function(t){t.state===o("WASyncdConst").CollectionSyncState.Fatal&&e.push(t.collection)}),e},t.getCollectionsInStateBlocked=function(){var e=[];return this.collectionStates.forEach(function(t){t.state===o("WASyncdConst").CollectionSyncState.Blocked&&e.push(t.collection)}),e},t.moveCollectionsToUpToDate=function(t){var e=this;t.forEach(function(t){return e.collectionStates.set(t,{collection:t,state:o("WASyncdConst").CollectionSyncState.UpToDate,finiteFailureStartTime:void 0})})},t.moveCollectionsToDirty=function(t){var e=this;t.forEach(function(t){var n;return e.collectionStates.set(t,{collection:t,state:o("WASyncdConst").CollectionSyncState.Dirty,finiteFailureStartTime:(n=e.collectionStates.get(t))==null?void 0:n.finiteFailureStartTime})})},t.moveCollectionsToFiniteRetry=function(t){var e=this;t.forEach(function(t){var n,r;return e.collectionStates.set(t,{collection:t,state:o("WASyncdConst").CollectionSyncState.FailingFiniteRetry,finiteFailureStartTime:(n=(r=e.collectionStates.get(t))==null?void 0:r.finiteFailureStartTime)!=null?n:o("WATimeUtils").unixTimeMs()})})},t.moveCollectionsToFatal=function(t){var e=this;t.forEach(function(t){return e.collectionStates.set(t,{collection:t,state:o("WASyncdConst").CollectionSyncState.Fatal})})},t.moveCollectionsToBlocked=function(t){var e=this;t.forEach(function(t){var n;return e.collectionStates.set(t,{collection:t,state:o("WASyncdConst").CollectionSyncState.Blocked,finiteFailureStartTime:(n=e.collectionStates.get(t))==null?void 0:n.finiteFailureStartTime})})},t.getExpiredCollections=function(){var e=[];return this.collectionStates.forEach(function(t){if(t.state===o("WASyncdConst").CollectionSyncState.FailingFiniteRetry){var n;t.finiteFailureStartTime==null?(n=1/0,o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Collection "," is in finite retry state with no failure start time"])),t.collection)):n=t.finiteFailureStartTime;var r=n+o("WASyncdConst").FINITE_FAILURE_EXPIRY_DURATION;r= server version (","); will not mark for sync."])),n,e,a),!1)})}),G.apply(this,arguments)}function z(){return j.apply(this,arguments)}function j(){return j=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e,t=yield o("WAWebGetSyncAction").countSyncActionsInTransaction();(e=o("WAWebSyncdWamAppState")).setStoredMutationCount(t);var n=yield o("WAWebGetSyncAction").getSyncActionsByActionStatesInTransaction([o("WASyncdConst").SyncActionState.Malformed]);e.setInvalidActionCount(n.length);var r=yield o("WAWebGetSyncAction").getSyncActionsByActionStatesInTransaction([o("WASyncdConst").SyncActionState.Unsupported]);e.setUnsupportedActionCount(r.length);var a=yield o("WAWebGetMissingKey").getMissingKeyCountTransaction();e.setMissingKeyCount(a)}),j.apply(this,arguments)}function K(){return Q.apply(this,arguments)}function Q(){return Q=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){}),Q.apply(this,arguments)}function X(){return Y.apply(this,arguments)}function Y(){return Y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){}),Y.apply(this,arguments)}function J(){var t=r("WAWebSyncdCollectionsStateMachine").getCollectionsInStateBlocked();return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: sync blocked collections: ",""])),t),r("WAWebSyncdCollectionsStateMachine").moveCollectionsToDirty(t),F=new Set([].concat(Array.from(F),Array.from(A))),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncBlockedCollections:\n moving blocked collections to dirty: [","]\n adding inflight collections to pending: [","]"],["syncd: syncBlockedCollections:\n \\tmoving blocked collections to dirty: [","]\n \\tadding inflight collections to pending: [","]"])),t,Array.from(A)),Z()}function Z(){return ee.apply(this,arguments)}function ee(){return ee=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebSyncdDisabled").isSyncdDisabled())return(P||(P=n("Promise"))).resolve();var e=r("WAWebSyncdCollectionsStateMachine").getCollectionsInStateDirty();o("WALogger").LOG(S||(S=babelHelpers.taggedTemplateLiteralLoose(["syncd: dirty collections: ",""])),e);var t=new Set(e.filter(function(e){return!A.has(e)}));if(t.size===0)return o("WALogger").LOG(R||(R=babelHelpers.taggedTemplateLiteralLoose(["syncd: no collections to sync"]))),(P||(P=n("Promise"))).resolve();var a=[];try{A=new Set([].concat(Array.from(A),Array.from(t))),o("WALogger").LOG(L||(L=babelHelpers.taggedTemplateLiteralLoose(["syncd: initiate server sync"]))),a=yield o("WAWebSyncdServerSync").serverSync(Array.from(t)),o("WALogger").LOG(E||(E=babelHelpers.taggedTemplateLiteralLoose(["syncd: server sync successful"])));var i=a.filter(function(e){return e.state===o("WASyncdConst").CollectionState.ErrorRetry});i.length>0&&(q=i[0].serverBackoff||0,W=0),ie(a)}catch(e){o("WALogger").LOG(k||(k=babelHelpers.taggedTemplateLiteralLoose(["syncd: exception during sync(): ",""])),e),r("WAWebSyncdCollectionsStateMachine").moveCollectionsToFiniteRetry(Array.from(t))}finally{o("WALogger").LOG(I||(I=babelHelpers.taggedTemplateLiteralLoose(["syncd: cleanup after sync()"]))),r("WAWebSyncdCollectionsStateMachine").persistToDb(),A=new Set(Array.from(A).filter(function(e){return!t.has(e)})),ae(),yield o("WAWebSyncdDbCallbacksApi").handleSyncCompleted(a)}}),ee.apply(this,arguments)}function te(){if(!o("WAWebSyncdDisabled").isSyncdDisabled()){var e=new Set(r("WAWebSyncdCollectionsStateMachine").getCollectionsInStateRetry());e.size!==0&&(O=setTimeout(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{B=!0,W+=1,o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: initiate server sync retry"])));var t=yield o("WAWebSyncdServerSync").serverSync(Array.from(e));o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: server sync retry successful"]))),ie(t)}catch(t){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["syncd: exception during handleRetry(): ",""])),t),r("WAWebSyncdCollectionsStateMachine").moveCollectionsToFiniteRetry(Array.from(e))}finally{o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["syncd: cleanup after handleRetry()"]))),yield re(),r("WAWebSyncdCollectionsStateMachine").persistToDb(),B=!1,ae()}}),ne(W,q)))}}function ne(e,t){var n=Math.pow(w,e)*N;return Math.min(Math.max(n,t),M)}function re(){return oe.apply(this,arguments)}function oe(){return oe=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=r("WAWebSyncdCollectionsStateMachine").getExpiredCollections();e.length>0&&(r("WAWebSyncdCollectionsStateMachine").moveCollectionsToFatal(e),yield o("WAWebSyncdDbCallbacksApi").printSyncdLog(),o("WALogger").ERROR(T||(T=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: expired collections"]))).sendLogs("syncd: fatal error: expired collections"),o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.TOO_MANY_INTERNAL_SERVER_ERRORS_IN_7D,{collection:e[0],lidMigrationStage:o("WAWebSyncdAntiTampering").getLidMigrationStage()}))}),oe.apply(this,arguments)}function ae(){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["syncd: state machine tick"]))),r("WAWebSyncdCollectionsStateMachine").getCollectionsInStateDirty().length>0&&(F=new Set(Array.from(F).filter(function(e){return A.has(e)})),Z());var e=r("WAWebSyncdCollectionsStateMachine").getCollectionsInStateRetry();if(e.length>0){if(B){o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["syncd: retry is in flight"])));return}O!=null&&clearTimeout(O),F=new Set(Array.from(F).filter(function(t){return!e.includes(t)})),te()}r("WAWebSyncdCollectionsStateMachine").getCollectionsInStateFatal().length>0&&o("WAWebSyncdDbCallbacksApi").handleSyncdFatal({collections:r("WAWebSyncdCollectionsStateMachine").getCollectionsInStateFatal()})}function ie(e){return e.forEach(function(e){if(e.state===o("WASyncdConst").CollectionState.Success&&!F.has(e.name))return r("WAWebSyncdCollectionsStateMachine").moveCollectionsToUpToDate([e.name]);if(e.state===o("WASyncdConst").CollectionState.ErrorRetry)return o("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(o("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.ENTERED_RETRY_MODE),r("WAWebSyncdCollectionsStateMachine").moveCollectionsToFiniteRetry([e.name]);if(e.state===o("WASyncdConst").CollectionState.ErrorFatal)return r("WAWebSyncdCollectionsStateMachine").moveCollectionsToFatal([e.name]);if(e.state===o("WASyncdConst").CollectionState.Blocked&&!F.has(e.name))return r("WAWebSyncdCollectionsStateMachine").moveCollectionsToBlocked([e.name])})}function le(){return se.apply(this,arguments)}function se(){return se=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(D||(D=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncPendingMutationsAndBlockedCollections"])));var e=yield o("WAWebGetPendingMutation").getAllSyncPendingMutationsInTransaction(),t=r("WAWebSyncdCollectionsStateMachine").getCollectionsInStateBlocked();r("WAWebSyncdCollectionsStateMachine").moveCollectionsToDirty(t);var n=e.map(function(e){return e.collection}).concat(t);n.length>0&&(o("WALogger").LOG(x||(x=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncPendingMutationsAndBlockedCollections: [","]"])),n),U(n))}),se.apply(this,arguments)}function ue(){return r("WAWebSyncdCollectionsStateMachine").loadStatesFromDb().then(function(){return ae()})}function ce(){return de.apply(this,arguments)}function de(){return de=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAWebSyncdOrphan").applyAllOrphansAndUnsupported(),o("WALogger").LOG($||($=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncing pending mutations and blocked collections due to app resume"]))),yield le()}),de.apply(this,arguments)}function me(){return A}function pe(){return F}l.markCollectionsForSync=U,l.reportWam=z,l.logKeysInfoInIntern=X,l.syncBlockedCollections=J,l.initializeStateMachine=ue,l.processOnAppResume=ce,l.getInFlightCollections=me,l.getPendingCollections=pe}),98); __d("WAWebSyncdMutationsCryptoUtils",["WACryptoAesCbc","WACryptoDependencies","WACryptoHmac","WASyncdKeyTypes","WAWebProtobufsServerSync.pb","WAWebSyncdCryptoConst","WAWebSyncdCryptoUtils"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t){var n=o("WASyncdKeyTypes").fromSyncKeyId(t),r=e===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET?o("WAWebSyncdCryptoConst").OPERATION_SET_HEX:e===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE?o("WAWebSyncdCryptoConst").OPERATION_REMOVE_HEX:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})(),a=new Uint8Array([parseInt(r,16)]).buffer,i=new Uint8Array(a.byteLength+n.byteLength);return i.set(new Uint8Array(a)),i.set(new Uint8Array(n),a.byteLength),i.buffer}function s(e,t){var n=Math.max(0,o("WAWebSyncdCryptoConst").MAX_OF_MIN_DATA_LENGTH-e-t),r=new Uint8Array(n);return o("WACryptoDependencies").getCrypto().getRandomValues(r),r.buffer}function u(e,t,n){return o("WACryptoAesCbc").aesCbcEncrypt(t,n,e)}function c(e,t,n){var r=new Uint8Array(o("WAWebSyncdCryptoConst").OCTET_LENGTH);r.set([e.byteLength],r.byteLength-1);var a=o("WAWebSyncdCryptoUtils").combine([e,t,r.buffer]);return o("WACryptoHmac").hmacSha512(n,a,o("WAWebSyncdCryptoConst").MAC_LENGTH)}function d(e,t,n){return o("WACryptoAesCbc").aesCbcDecrypt(t,e,n)}l.generateAssociatedData=e,l.generatePadding=s,l.generateCipherText=u,l.generateMac=c,l.decryptCipherText=d}),98); __d("WAWebSyncdDecryptMutations",["WACryptoUtils","WALogger","WAWebProtobufSyncAction.pb","WAWebSyncdCrypto","WAWebSyncdCryptoConst","WAWebSyncdCryptoUtils","WAWebSyncdDecode","WAWebSyncdError","WAWebSyncdMetricFatalError","WAWebSyncdMutationsCryptoUtils","WAWebSyncdValidateSyncActionProtobuf","asyncToGeneratorRuntime","encodeProtobuf"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u;function c(e,t,n,r,o){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a,i,l){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: decrypting mutation"])));var c=l.index.blob,d=l.value.blob,m=o("WAWebSyncdCrypto").valueMacFromIndexAndValueCipherText(d),p=o("WAWebSyncdCryptoUtils").split(d,o("WAWebSyncdCryptoConst").IV_LENGTH,d.byteLength-o("WAWebSyncdCryptoConst").MAC_LENGTH-o("WAWebSyncdCryptoConst").IV_LENGTH),_=p[0],f=p[1],g=p[2],h=yield o("WAWebSyncdCrypto").generateEncryptionKeys(a),y=h.indexKey,C=h.valueEncryptionKey,b=h.valueMacKey,v=o("WAWebSyncdCryptoUtils").combine([_,f]),S=o("WAWebSyncdMutationsCryptoUtils").generateAssociatedData(i,n),R=yield o("WAWebSyncdMutationsCryptoUtils").generateMac(S,v,b);if(!o("WACryptoUtils").arrayBuffersEqual(g,R))throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: decrypting mutation failed: valueMAC mismatch"]))),o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.DECRYPTION_FAILED,{collection:t}),new(o("WAWebSyncdError")).SyncdFatalError("decryption failure: valueMAC mismatch");var L=yield o("WAWebSyncdMutationsCryptoUtils").decryptCipherText(new Uint8Array(_),C,f),E=o("WAWebSyncdDecode").decodeSyncActionData(t,L),k=r("WAWebSyncdValidateSyncActionProtobuf").validateSyncActionDataProtobuf(t,E),I=yield o("WAWebSyncdCrypto").generateIndexMac(y,k.index);if(!o("WACryptoUtils").arrayBuffersEqual(c,I))throw o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: decrypting mutation failed: indexMAC mismatch"]))),o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.DECRYPTION_FAILED,{collection:t}),new(o("WAWebSyncdError")).SyncdFatalError("decryption failure: indexMAC mismatch");var T=k.index,D=k.value,x=k.version;return{version:x,index:T,value:D?o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,D).readBuffer():null,indexMac:c,valueMac:m,plaintext:L}}),d.apply(this,arguments)}l.syncdDecryptMutation=c}),98); __d("WAWebSyncdEncryptMutations",["WAArrayBufferUtils","WACryptoDependencies","WALogger","WAWebProtobufSyncAction.pb","WAWebSyncdCrypto","WAWebSyncdCryptoConst","WAWebSyncdCryptoUtils","WAWebSyncdError","WAWebSyncdMetricFatalError","WAWebSyncdMutationsCryptoUtils","WAWebSyncdRequestEncode","asyncToGeneratorRuntime","decodeProtobuf"],(function(t,n,r,o,a,i,l){"use strict";var e,s;function u(e,t,n){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: encrypting mutation"])));try{var a,i=t.binarySyncAction,l=t.index,u=t.operation,c=t.version,m=o("WAArrayBufferUtils").stringToArrayBuffer(l),p=yield o("WAWebSyncdCrypto").generateEncryptionKeys(r),_=p.indexKey,f=p.valueEncryptionKey,g=p.valueMacKey,h=yield o("WACryptoDependencies").getCrypto().getRandomValues(new Uint8Array(o("WAWebSyncdCryptoConst").IV_LENGTH)),y=(a=o("WAWebSyncdMutationsCryptoUtils")).generatePadding(m.byteLength,i.byteLength),C=d(m,i,y,c),b=yield a.generateCipherText(h,f,C),v=a.generateAssociatedData(u,n),S=yield a.generateMac(v,b,g),R=o("WAWebSyncdCryptoUtils").combine([b,S]),L=yield o("WAWebSyncdCrypto").generateIndexMac(_,m);return{indexMac:L,indexAndValueCipherText:R}}catch(e){throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: encrypting mutation failed"]))),o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.ENCRYPTION_FAILED),new(o("WAWebSyncdError")).SyncdFatalError("encryption failure")}}),c.apply(this,arguments)}function d(e,t,n,r){return o("WAWebSyncdRequestEncode").encodeSyncActionData({index:e,value:o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,t),padding:n,version:r})}l.syncdEncryptMutation=u}),98); __d("WAWebSyncdEncryptionManager",["WACryptoHmac","WAEncodeString","WAWebSyncdCrypto","WAWebSyncdCryptoUtils","WAWebSyncdDecryptMutations","WAWebSyncdEncryptMutations","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t,n,r){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){var a=yield o("WAWebSyncdCrypto").generateEncryptionKeys(e),i=a.snapshotMacKey,l=o("WAEncodeString").toUtf8(r).buffer,s=o("WAWebSyncdCryptoUtils").to64BitNetworkOrder(n);return o("WACryptoHmac").hmacSha256(i,o("WAWebSyncdCryptoUtils").combine([t,s,l]))}),s.apply(this,arguments)}function u(e,t,n,r,o){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a){var i=yield o("WAWebSyncdCrypto").generateEncryptionKeys(e),l=i.patchMacKey,s=o("WAEncodeString").toUtf8(a).buffer,u=o("WAWebSyncdCryptoUtils").to64BitNetworkOrder(r);return o("WACryptoHmac").hmacSha256(l,o("WAWebSyncdCryptoUtils").combine([t].concat(n,[u,s])))}),c.apply(this,arguments)}var d={encryptMutation:o("WAWebSyncdEncryptMutations").syncdEncryptMutation,decryptMutation:o("WAWebSyncdDecryptMutations").syncdDecryptMutation,generatePatchMac:u,generateSnapshotMac:e};l.WASyncdEncryptionManager=d}),98); __d("WAWebEncryptionManagerSelector",["WASyncdKmpEncryptionManager","WAWebABProps","WAWebSyncdEncryptionManager"],(function(t,n,r,o,a,i,l){"use strict";function e(){return o("WAWebABProps").getABPropConfigValue("kmp_syncd_engine_crypto_enabled")?o("WASyncdKmpEncryptionManager").WASyncdKmpEncryptionManager:o("WAWebSyncdEncryptionManager").WASyncdEncryptionManager}l.syncdEncryptionManager=e}),98); __d("WAWebKeyManagementUtils",["WALogger","WAWebApiDeviceList","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=[],n=o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow();try{var r=yield o("WAWebApiDeviceList").getMyDeviceList();r.devices.forEach(function(e){e.id!==n.getDeviceId()&&t.push(o("WAWebWidFactory").createDeviceWidFromUserAndDevice(n.user,n.server,e.id))})}catch(t){var a=String(t);return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: getPeerDevices: error ",". Future key requests will only be sent to primary device."])),a).sendLogs(a),[o("WAWebWidFactory").createDeviceWidFromUserAndDevice(n.user,n.server,0)]}return t}),u.apply(this,arguments)}l.getPeerDevices=s}),98); __d("WAWebSyncdKeyCache",["WABase64","WASyncdKeyTypes","WAWebGetSyncKey","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e=new Map;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n,r=o("WABase64").encodeB64(o("WASyncdKeyTypes").fromSyncKeyId(t)),a=e.get(r);return a?a.keyData:(a=yield o("WAWebGetSyncKey").getSyncKeyInTransaction_DO_NOT_USE(t),a&&e.set(r,a),(n=a)==null?void 0:n.keyData)}),u.apply(this,arguments)}function c(){e=new Map}l.getKeyData=s,l.clearSyncKeysCache=c}),98); __d("WAWebSyncdAntiTampering",["$InternalEnum","Promise","WACryptoLtHash","WACryptoUtils","WAEncodeString","WAJids","WALogger","WAPromiseEach","WASyncdConst","WASyncdKeyTypes","WATextEncoding","WAWebABProps","WAWebConnModel","WAWebCurrentUser","WAWebEncryptionManagerSelector","WAWebGetCollectionVersion","WAWebGetSyncAction","WAWebKeyManagementUtils","WAWebLid1X1MigrationGating","WAWebProtobufsServerSync.pb","WAWebRunInTransaction","WAWebSyncdCrypto","WAWebSyncdCryptoUtils","WAWebSyncdDb","WAWebSyncdDbCallbacksApi","WAWebSyncdError","WAWebSyncdKeyCache","WAWebSyncdMetricFatalError","WAWebSyncdMetrics","WAWebSyncdSnapshotRecoveryGatingUtils","WAWebUserPrefsTypes","WAWebWamEnumIsPureSyncdSessionEnum","WAWebWamEnumLidMigrationStageEnum","WAWebWamEnumMdSyncdCriticalEventCode","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T,D,x,$,P,N,M,w,A,F,O,B=n("$InternalEnum").Mirrored(["Incoming","Outgoing"]),W=[(O=o("WASyncdConst")).Actions.LocaleSetting,O.Actions.SettingPushName,"generated_wui",O.Actions.Sentinel,O.Actions.PrimaryVersion,O.Actions.TimeFormat,O.Actions.Nux,O.Actions.BotWelcomeRequest,O.Actions.DeviceCapabilities,O.Actions.Archive,O.Actions.LockChat,O.Actions.FavoriteSticker,O.Actions.ChatLockSettings,O.Actions.MarkChatAsRead,O.Actions.NoteEdit,O.Actions.Pin,O.Actions.PinDEPRECATED,O.Actions.RemoveRecentSticker,O.Actions.UnarchiveChatsSetting,O.Actions.AndroidUnsupportedActions];function q(e,t,n){n===void 0&&(n=!0);var r=typeof e=="string"?e:o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(e),a=typeof t=="string"?t:o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(t),i=n?-16:0;return r.slice(i)+":"+a.slice(i)}var U=o("WATextEncoding").newTextDecoder();function V(e,t,n){return H.apply(this,arguments)}function H(){return H=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r){var a=n.keyId,i=n.mac,l=n.records,u=n.version,c=yield o("WAWebSyncdKeyCache").getKeyData(a.id);if(!c)throw new(o("WAWebSyncdError")).SyncdMissingKeyError;var d=new Map(l.map(function(e){return[o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(e.index.blob),o("WAWebSyncdCrypto").valueMacFromIndexAndValueCipherText(e.value.blob)]}));o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd:\n "," snapshot macsToAdd:\n ",""])),r,t,Array.from(d.entries()).map(function(e){var t=e[0],n=e[1];return q(t,n)}).join("\n "));var m=yield o("WACryptoLtHash").LT_HASH_ANTI_TAMPERING.add(o("WACryptoLtHash").EMPTY_LT_HASH,Array.from(d.values())),p=yield o("WAWebSyncdCrypto").generateEncryptionKeys(c),_=p.snapshotMacKey,f=o("WAWebSyncdCryptoUtils").to64BitNetworkOrder(u.version),g=o("WAEncodeString").toUtf8(t).buffer;return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: validating snapshot mac for "," snapshot v",":\n ltHash: ","\n encoded version: ","\n encoded collection: ","\n expected snapshotMAC: ","\n "])),r,t,u.version,o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(m),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(f),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(g),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(i)),yield Q(t,i,c,m,f,g,!0,l.length,n.version.version,null,null,null,null,r),m}),H.apply(this,arguments)}function G(e,t,n,r){return z.apply(this,arguments)}function z(){return z=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: computeLtHashAndValidatePatch for ",""])),r,e);var i=t.keyId,l=t.mutations,s=t.patchMac,m=t.snapshotMac,p=t.version,_=i.id,f=yield o("WAWebSyncdKeyCache").getKeyData(_);if(!f)throw new(o("WAWebSyncdError")).SyncdMissingKeyError;var g=l.map(function(e){return{operation:e.operation,indexMac:e.record.index.blob,valueMac:o("WAWebSyncdCrypto").valueMacFromIndexAndValueCipherText(e.record.value.blob)}}),h=yield o("WAWebGetCollectionVersion").getCollectionVersionLtHashInTransaction(e),y=yield te(e,g,r,a,t.version.version,B.Incoming,h),C=o("WAWebSyncdCryptoUtils").to64BitNetworkOrder(p.version),b=o("WAEncodeString").toUtf8(e).buffer;o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: validating snapshot and patch mac for "," v",":\n expected snapshotMAC: ","\n expected patchMAC: ","\n encoded version: ","\n encoded collection: ","\n key ID: ","\n "])),r,e,p.version,o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(m),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(C),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(b),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(o("WASyncdKeyTypes").fromSyncKeyId(_)));try{yield Y(e,s,f,m,g.map(function(e){return e.valueMac}),l.length,p.version,r),yield Q(e,m,f,y.ltHash,C,b,!1,l.length,p.version,t.clientDebugData,h,y,t.deviceIndex,r)}catch(e){throw yield v(),e}return y.ltHash;function v(){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield ue(e,r,"logErrorDiagnostics",!1),n=new Map(t.map(function(e){var t=e.indexMac,n=e.valueMac;return[o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(t),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(n)]}));o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: error on incoming records:\n ",""],["[","] syncd: error on incoming records:\n \\t",""])),r,g.map(function(e){var t=e.indexMac,r=e.operation,a=e.valueMac;return(r===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET?"set":"remove")+" | "+q(t,a,!1)+" | "+(n.has(o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(t))?"found":"did not find")+" indexMAC in the above logged macs"}).join("\n "))}),S.apply(this,arguments)}}),z.apply(this,arguments)}function j(e,t,n){return K.apply(this,arguments)}function K(){return K=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield o("WAWebGetCollectionVersion").getCollectionVersionInTransaction(e).then(function(e){var t;return(t=e==null?void 0:e.version)!=null?t:0});if(r!==t-1){var a=r>t-1?"greater-than-expected":"less-than-expected";throw o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: "," received patch v"," !== latest local version (v",") + 1"])),n,e,t,r).sendLogs("syncd-version-check-error-local-version-"+a),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+n+"] received patch v"+t+" !== latest local version (v"+r+") + 1"),new(o("WAWebSyncdError")).SyncdRetryableError("syncd-version-check-error-local-version-"+a)}var i=yield o("WAWebGetCollectionVersion").getCollectionVersionLtHashInTransaction(e);if(o("WACryptoUtils").arrayBuffersEqual(i,o("WACryptoLtHash").EMPTY_LT_HASH)&&t!==1)throw o("WALogger").WARN(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: empty local lthash found when processing "," patch v",""])),n,e,t).sendLogs("syncd-empty-lthash-on-mac-mismatch"),new(o("WAWebSyncdError")).SyncdRetryableError("empty lthash")}),K.apply(this,arguments)}function Q(e,t,n,r,o,a,i,l,s,u,c,d,m,p){return X.apply(this,arguments)}function X(){return X=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a,i,l,s,u,c,d,m,p,R){var L,E=!l,k=(L=yield o("WAWebGetCollectionVersion").getIsCollectionInMacMismatchFatalInTransaction(e))!=null?L:!1;if(E&&k){o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: collection "," is already in snapshot mac mismatch so not checking again"])),R,e);return}var I=o("WAWebEncryptionManagerSelector").syncdEncryptionManager().generateSnapshotMac,T=yield I(n,r,u,e),D=o("WACryptoUtils").arrayBuffersEqual(T,t),x=o("WAWebSyncdSnapshotRecoveryGatingUtils").shouldPreformSnapshotRecovery(e,s,new(o("WAWebSyncdError")).SyncdFatalError("probe")),$=!D&&l&&x.shouldPerformRecovery;if(!D){$&&o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: snapshot mac mismatch, will perform recovery for "," v"," with "," mutations"])),R,e,u,s),l||(yield j(e,u,R)),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+R+"] failed validate snapshot mac");var P=yield re(R,e),N=P.isLtHashConsistent,M=P.scratchLtHash,w=l?o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.SNAPSHOT_MAC_MISMATCH_IN_SNAPSHOT:o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.SNAPSHOT_MAC_MISMATCH_IN_PATCH,A=(c==null?void 0:c.collectionName)&&!o("WACryptoUtils").arrayBuffersEqual(i,c==null?void 0:c.collectionName),F=(c==null?void 0:c.newLthash)&&!o("WACryptoUtils").arrayBuffersEqual(r,c==null?void 0:c.newLthash),O=(c==null?void 0:c.patchVersion)&&!o("WACryptoUtils").arrayBuffersEqual(a,c==null?void 0:c.patchVersion),B=(c==null?void 0:c.currentLthash)&&d&&!o("WACryptoUtils").arrayBuffersEqual(d,c==null?void 0:c.currentLthash),W=(c==null?void 0:c.newLthashSubtract)&&(m==null?void 0:m.subtractResult)&&!o("WACryptoUtils").arrayBuffersEqual(m==null?void 0:m.subtractResult,c==null?void 0:c.newLthashSubtract),q=m==null?void 0:m.hasOverride,U=m==null?void 0:m.numAdd,V=m==null?void 0:m.numRemove,H=(c==null?void 0:c.currentLthash)&&M&&!o("WACryptoUtils").arrayBuffersEqual(M,c==null?void 0:c.currentLthash),G=p===0,z=(c==null?void 0:c.numberAdd)!=null&&(m==null?void 0:m.numAdd)!=null&&(m==null?void 0:m.numAdd)!==(c==null?void 0:c.numberAdd),K=(c==null?void 0:c.numberRemove)!=null&&(m==null?void 0:m.numRemove)!=null&&(m==null?void 0:m.numRemove)!==(c==null?void 0:c.numberRemove),Q=m==null?void 0:m.didUseFallback,X=m==null?void 0:m.hasMissingRemove,Y=(yield o("WAWebKeyManagementUtils").getPeerDevices()).length>1;if(o("WAWebSyncdMetricFatalError").reportSyncdFatalError(w,{collection:e,patchSnapshotMutationCount:s,patchVersion:u,isFatal:!E,isLtHashConsistent:N,macFatalCollectionNameMismatch:A,macFatalCurrentLthashMismatch:B,macFatalNewLthashMismatch:F,macFatalPatchVersionMismatch:O,macFatalNewLthashSubtractMismatch:W,macFatalNumberHasOverrideMutation:q,macFatalNumberNumAddMutation:U,macFatalNumberNumRemoveMutation:V,macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch:H,isPatchSenderPrimary:G,macFatalDidUseMacFetchFallback:Q,macFatalHasMissingRemove:X,macFatalNumberAddMismatch:z,macFatalNumberRemoveMismatch:K,isThereAnotherSyncdCompanion:Y,isPureSyncdSession:yield _e(),lidMigrationStage:pe(),recoveryStatus:x.reason},$),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: fatal extra details:\n mdFatalErrorCode: ",",\n collection: ",",\n mutationCount: ",",\n patchVersion: ",",\n isLtHashConsistent: ",",\n macFatalCollectionNameMismatch: ",",\n macFatalCurrentLthashMismatch: ",",\n macFatalNewLthashMismatch: ",",\n macFatalPatchVersionMismatch: ",",\n macFatalNewLthashSubtractMismatch: ",",\n macFatalNumberHasOverrideMutation: ",",\n macFatalNumberNumAddMutation: ",",\n macFatalNumberNumRemoveMutation: ",",\n macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch: ",",\n isPatchSenderPrimary: ",",\n macFatalDidUseMacFetchFallback: ",",\n macFatalHasMissingRemove: ",",\n macFatalNumberAddMismatch: ",",\n macFatalNumberRemoveMismatch: ",",\n isThereAnotherSyncdCompanion: ","\n "])),R,w,e,s,u,N,A,B,F,O,W,q,U,V,H,G,Q,X,z,K,Y),E){yield o("WAWebSyncdDbCallbacksApi").printSyncdLog(e);var J="syncd: unable to validate snapshot mac. collection: "+e;if(o("WAWebCurrentUser").isEmployee())o("WALogger").ERROR(h||(h=babelHelpers.taggedTemplateLiteralLoose(["[","] ",""])),R,J).sendLogs(J,{sampling:1});else if(c!=null){var Z=J+" (additional info)";o("WALogger").ERROR(y||(y=babelHelpers.taggedTemplateLiteralLoose(["[","] ",""])),R,Z).sendLogs(Z,{sampling:1})}else o("WALogger").ERROR(C||(C=babelHelpers.taggedTemplateLiteralLoose(["[","] ",""])),R,J).sendLogs(J,{sampling:.01});if(yield o("WAWebGetCollectionVersion").updateIsCollectionInMacMismatchFatalInTransaction(e),o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: skip fatal after snapshot mac mismatch for collection ",""])),R,e),H===!1&&B===!0){var ee;o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: clientDebugData?.currentLthash: ",",\n scratchLtHash: ",",\n currentLtHash: ",""])),R,o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded((ee=c==null?void 0:c.currentLthash)!=null?ee:new ArrayBuffer(0)).slice(-16),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(M!=null?M:new ArrayBuffer(0)).slice(-16),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(d!=null?d:new ArrayBuffer(0)).slice(-16)),o("WALogger").ERROR(S||(S=babelHelpers.taggedTemplateLiteralLoose(["syncd: snapshot_mac_mismatch_in_patch due to cache mismatch"]))).sendLogs("syncd: snapshot_mac_mismatch_in_patch due to cache mismatch")}return}throw new(o("WAWebSyncdError")).SyncdFatalError("unable to validate snapshot mac")}}),X.apply(this,arguments)}function Y(e,t,n,r,o,a,i,l){return J.apply(this,arguments)}function J(){return J=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a,i,l,s){var u=o("WAWebEncryptionManagerSelector").syncdEncryptionManager().generatePatchMac,c=yield u(n,r,a,l,e),d=o("WACryptoUtils").arrayBuffersEqual(c,t);if(!d)throw yield j(e,l,s),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"failed validate patch mac"),o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MAC_MISMATCH_PATCH,{collection:e,patchSnapshotMutationCount:i,patchVersion:l}),o("WALogger").WARN(R||(R=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: unable to validate patch mac."])),s).sendLogs("syncd: unable to validate patch mac."),new(o("WAWebSyncdError")).SyncdFatalError("unable to validate patch mac")}),J.apply(this,arguments)}function Z(e,t,n,r){return ee.apply(this,arguments)}function ee(){return ee=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){var a=(yield o("WAWebGetCollectionVersion").getCollectionVersionInTransaction(e).then(function(e){var t;return(t=e==null?void 0:e.version)!=null?t:o("WASyncdConst").DEFAULT_COLLECTION_VERSION}))+1,i=o("WAWebSyncdCryptoUtils").to64BitNetworkOrder(a),l=o("WAEncodeString").toUtf8(e).buffer,s=o("WAWebEncryptionManagerSelector").syncdEncryptionManager(),u=yield s.generateSnapshotMac(r,t,a,e),c=yield s.generatePatchMac(r,u,n.map(function(e){return e.valueMac}),a,e),d=yield o("WAWebSyncdCrypto").generateEncryptionKeys(r),m=d.patchMacKey,p=d.snapshotMacKey;return o("WALogger").LOG(L||(L=babelHelpers.taggedTemplateLiteralLoose(["syncd: computing snapshot and patch macs for outgoing patch "," v",":\n encoded version: ","\n encoded collection: ","\n snapshotMAC: ","\n patchMAC: ",""])),e,a,o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(i),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(l),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(u),o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(c)),{snapshotMac:u,patchMac:c}}),ee.apply(this,arguments)}function te(e,t,n,r,o,a,i){return ne.apply(this,arguments)}function ne(){return ne=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a,i,l,s){var u=o("WAWebABProps").getABPropConfigValue("enable_syncd_debug_data_in_patch")||e===o("WASyncdConst").CollectionName.CriticalBlock||l===B.Outgoing,c=s!=null?s:yield o("WAWebGetCollectionVersion").getCollectionVersionLtHashInTransaction(e),d=yield ie(t.map(function(e){return e.indexMac})),m=new Map,p=new Map,_=new Map,f=!1,g=!1;yield o("WAPromiseEach").promiseEach(t,(function(){var a=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n,a){var s=n.indexMac,u=n.operation,c=n.valueMac,h=U.decode(s),y=d.get(h);if(y)u===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE?p.set(o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s),y.valueMac):_.set(o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s),y.valueMac);else if(u===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE){var C=yield S(s);if(C!=null){var b;p.set(o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s),C),g=!0,o("WALogger").WARN(E||(E=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: had to use fallbackQueryForValueMac in collection "," for platform ",": ","\n }"])),r,e,(b=o("WAWebConnModel").Conn.platform)!=null?b:"[empty]",o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s).slice(-16)).tags("non-sad").sendLogs("syncd: fallback query"),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+r+"] used fallback for "+o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s))}else{var v,R,L;f=!0,yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+r+"] incoming REMOVE mutation missing in local snapshot for collection "+e+" version "+((v=i==null?void 0:i.toString())!=null?v:"n/a")+": "+o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s)),yield ue(e,r,"REMOVE missing",!1);var D="\n syncUseMultipleMacQueries: true\n input mutations mac:\n "+t.map(function(e){return(e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET?"SET ":"REMOVE ")+q(e.indexMac,e.valueMac)}).join("\n ")+"\n currentMacs: "+Array.from(d.values()).map(function(e){return q(e.indexMac,e.valueMac)}).join(", ")+"\n ";o("WALogger").LOG(k||(k=babelHelpers.taggedTemplateLiteralLoose(["",""])),D),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"missing remove additional info: "+D),o("WAWebSyncdMetrics").reportSyncdCriticalEvent(o("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.MISSING_MUTATION_TO_REMOVE,e);var x="["+r+"] syncd: missing indexMAC in sync-actions table for REMOVE mutation in collection "+e+" version "+((R=i==null?void 0:i.toString())!=null?R:"n/a")+" direction "+(l||"n/a")+" for platform "+((L=o("WAWebConnModel").Conn.platform)!=null?L:"[empty]")+": "+o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s).slice(-16);e===o("WASyncdConst").CollectionName.CriticalBlock?(yield o("WAWebSyncdDbCallbacksApi").printSyncdLog(e),o("WALogger").ERROR(I||(I=babelHelpers.taggedTemplateLiteralLoose(["",""])),x).sendLogs("syncd: missing indexMAC from REMOVE in collection "+e)):o("WALogger").ERROR(T||(T=babelHelpers.taggedTemplateLiteralLoose(["",""])),x).sendLogs("syncd: missing indexMAC from REMOVE in collection "+e,{sampling:.01})}}u===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET&&m.set(o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s),c)});return function(e,t){return a.apply(this,arguments)}})());var h=yield o("WACryptoLtHash").LT_HASH_ANTI_TAMPERING.subtractThenAdd(c,Array.from(m.values()),Array.from(p.values()).concat(Array.from(_.values()))),y=h.ltHash,C=h.subtractResult,b="["+r+"] syncd: computing ltHash for "+e+":\n mutations length: "+t.length+"\n currentLtHash: "+o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(c).slice(-16)+"\n subtractResult: "+o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(C).slice(-16)+"\n currentMacs length: "+d.size+"\n macsToAdd:\n "+Array.from(m.entries()).map(function(e){var t=e[0],n=e[1];return q(t,n)}).join("\n ")+"\n macsToRemove:\n "+Array.from(p.entries()).map(function(e){var t=e[0],n=e[1];return q(t,n)}).join("\n ")+"\n macsToOverwrite (also remove):\n "+Array.from(_.entries()).map(function(e){var t=e[0],n=e[1];return q(t,n)}).join("\n ")+"\n newLtHash: "+o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(y).slice(-16)+"\n hasMissingRemove: "+f.toString()+"\n didUseFallback: "+g.toString();if(o("WALogger").LOG(D||(D=babelHelpers.taggedTemplateLiteralLoose(["",""])),b),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"generate lthash details 1: "+b),u){var v="\n input mutations mac:\n "+t.map(function(e){return(e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET?"SET ":"REMOVE ")+q(e.indexMac,e.valueMac)}).join("\n ")+"\n currentMacs: "+Array.from(d.values()).map(function(e){return q(e.indexMac,e.valueMac)}).join(", ")+"\n ";o("WALogger").LOG(x||(x=babelHelpers.taggedTemplateLiteralLoose(["",""])),v),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"generate lthash details 2: "+v)}return{ltHash:y,numAdd:m.size,numRemove:p.size,hasOverride:_.size>0,subtractResult:C,hasMissingRemove:f,didUseFallback:g};function S(e){return a==null?(F||(F=n("Promise"))).resolve(null):a(e)}}),ne.apply(this,arguments)}function re(e,t,n){return oe.apply(this,arguments)}function oe(){return oe=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r){var a=o("WAWebCurrentUser").isEmployee()?900:r,i=yield o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,CollectionVersionStore:!0},(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var r=e.CollectionVersionStore,o=e.SyncActionStore,a=t==null?yield r.getAll():[yield r.get(t)];return(F||(F=n("Promise"))).all(a.filter(Boolean).map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.collection,n=e.ltHash,r=yield o.getByCollections([t]);return{collection:t,ltHash:n,mutations:r}});return function(t){return e.apply(this,arguments)}})()))});return function(t){return e.apply(this,arguments)}})()),l=0;if(i.map(function(e){var t=e.collection,n=e.ltHash,r=e.mutations;l+=r.length}),a!==void 0&&l>a)return{isLtHashConsistent:void 0,scratchLtHash:void 0,cachedLtHash:void 0};var s=null,u=null,c=!0;return yield(F||(F=n("Promise"))).all(i.map((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.collection,r=t.ltHash,a=t.mutations,i=yield ae(a);s==null&&(s=i),u==null&&(u=r),o("WACryptoUtils").arrayBuffersEqual(r,i)||l>0&&(c=!1,o("WALogger").ERROR($||($=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: failed LtHash check for ",""])),e,n).verbose())});return function(e){return t.apply(this,arguments)}})())),{isLtHashConsistent:c,scratchLtHash:s,cachedLtHash:u}}),oe.apply(this,arguments)}function ae(e){var t=new Map(e.map(function(e){return[o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(e.indexMac),e.valueMac]}));return o("WACryptoLtHash").LT_HASH_ANTI_TAMPERING.add(o("WACryptoLtHash").EMPTY_LT_HASH,Array.from(t.values()))}function ie(e){return le.apply(this,arguments)}function le(){return le=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebGetSyncAction").getSyncActionsByIndexMacsInTransaction(e);return new Map(t.map(function(e){return[U.decode(e.indexMac),{indexMac:e.indexMac,valueMac:e.valueMac}]}))}),le.apply(this,arguments)}function se(e,t){var n=t.action;if(n&&(o("WAWebCurrentUser").isEmployee()||e===o("WASyncdConst").CollectionName.RegularLow||e===o("WASyncdConst").CollectionName.CriticalBlock||W.includes(n))){if(n===o("WASyncdConst").Actions.DeviceCapabilities){if(o("WAWebCurrentUser").isEmployee())return t.index;var r=t.index.indexOf(":");return"device_capabilities:"+t.index.slice(r-4)}return n}}function ue(e,t,n,r){return ce.apply(this,arguments)}function ce(){return ce=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a){a===void 0&&(a=!0);var i=a?20:1;o("WALogger").LOG(P||(P=babelHelpers.taggedTemplateLiteralLoose(["syncd: logMacs: ",": prepare"])),e);var l=yield o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,CollectionVersionStore:!0},function(t){var r=t.CollectionVersionStore,o=t.SyncActionStore;return(F||(F=n("Promise"))).all([r.get(e).then(function(e){return e==null?void 0:e.version}),o.getByCollections([e])])}),s=l[0],u=l[1];o("WALogger").LOG(N||(N=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: current snapshot "," v"," with "," mutations. context "," mutations:"])),t,e,s,u.length,r);var c=o("WAWebCurrentUser").isEmployee()?200:120;if(a&&u.length>c)return u;var d=u.reduce(function(t,n,r){var o;return r%i===0&&t.push(""),t[t.length-1]+=q(n.indexMac,n.valueMac,a)+(" "+((o=se(e,n))!=null?o:"n/a")+" | "),t},[]);return d.forEach(function(e){return o("WALogger").LOG(M||(M=babelHelpers.taggedTemplateLiteralLoose(["|",""])),e)}),(e===o("WASyncdConst").CollectionName.CriticalBlock||e===o("WASyncdConst").CollectionName.RegularLow||o("WAWebCurrentUser").isEmployee())&&(yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"current local snapshot for "+e+" v"+(s!=null?s:"n/a")+" mutation length "+u.length+" context "+r+": "+d.join("\n"))),u}),ce.apply(this,arguments)}function de(e,t,n,r){return me.apply(this,arguments)}function me(){return me=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){r===void 0&&(r=400);var a=yield re(n,e,r),i=a.cachedLtHash,l=a.isLtHashConsistent,s=a.scratchLtHash,u=s==null?"":o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(s).slice(-16),c=i==null?"":o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(i).slice(-16);if(l===!1){yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+n+"] lthash first time inconsistent. scratchLtHash: "+u+", cachedLtHash: "+c+", context: "+t),yield o("WAWebSyncdDbCallbacksApi").printSyncdLog(e);var d="syncd: lthash inconsistent";return e===o("WASyncdConst").CollectionName.CriticalBlock||o("WAWebCurrentUser").isEmployee()?o("WALogger").ERROR(w||(w=babelHelpers.taggedTemplateLiteralLoose([""," first time for ",""])),d,e).verbose().sendLogs(d):o("WALogger").ERROR(A||(A=babelHelpers.taggedTemplateLiteralLoose([""," first time for ",""])),d,e).verbose().sendLogs(d,{sampling:.01}),!0}else if(l===!0)return yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"lthash consistent. scratchLtHash: "+u+", cachedLtHash: "+c+", context: "+t),!1;yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"lthash unknown if consistent. scratchLtHash: "+u+", cachedLtHash: "+c+", context: "+t)}),me.apply(this,arguments)}function pe(){return o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()?o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.lidMigrationSource()===o("WAWebUserPrefsTypes").LidMigrationSource.PEER?o("WAWebWamEnumLidMigrationStageEnum").LID_MIGRATION_STAGE_ENUM.PEER_MIGRATED:o("WAWebWamEnumLidMigrationStageEnum").LID_MIGRATION_STAGE_ENUM.HISTORY_MIGRATED:o("WAWebWamEnumLidMigrationStageEnum").LID_MIGRATION_STAGE_ENUM.NOT_MIGRATED}function _e(){return fe.apply(this,arguments)}function fe(){return fe=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isPureLidSyncDSession();if(e!=null)return e?o("WAWebWamEnumIsPureSyncdSessionEnum").IS_PURE_SYNCD_SESSION_ENUM.YES:o("WAWebWamEnumIsPureSyncdSessionEnum").IS_PURE_SYNCD_SESSION_ENUM.NO;var t=yield o("WAWebSyncdDb").getSyncActionsRows(["action"],[o("WASyncdConst").Actions.Archive,o("WASyncdConst").Actions.ClearChat,o("WASyncdConst").Actions.DeleteChat,o("WASyncdConst").Actions.DeleteMessageForMe,o("WASyncdConst").Actions.MarkChatAsRead,o("WASyncdConst").Actions.Mute,o("WASyncdConst").Actions.Pin,o("WASyncdConst").Actions.Star]),n=t.find(function(e){return e.index.includes(o("WAJids").WA_USER_DOMAIN)});if(n)return o("WAWebWamEnumIsPureSyncdSessionEnum").IS_PURE_SYNCD_SESSION_ENUM.PROBABLY_NO;var r=t.find(function(e){return e.index.includes(o("WAJids").LID_DOMAIN)});return r?o("WAWebWamEnumIsPureSyncdSessionEnum").IS_PURE_SYNCD_SESSION_ENUM.PROBABLY_YES:o("WAWebWamEnumIsPureSyncdSessionEnum").IS_PURE_SYNCD_SESSION_ENUM.UNKNOWN}),fe.apply(this,arguments)}l.SyncdPatchDirection=B,l.indexAndValueMacToString=q,l.computeLtHashAndValidateSnapshot=V,l.computeLtHashAndValidatePatch=G,l.computeOutgoingSnapshotAndPatchMacs=Z,l.computeLtHash=te,l.checkLtHash=re,l.logMacsInSnapshot=ue,l.reportCollectionInconsistency=de,l.getLidMigrationStage=pe}),98); __d("WAWebSyncdGetActionHandler",["err"],(function(t,n,r,o,a,i,l){"use strict";var e=null,s=null,u=null;function c(e){u=e}function d(t){if(u==null)throw r("err")("Action handlers not initialized");return e==null&&(e=new Map(u.map(function(e){return[e.getAction(),e]}))),e.get(t)}function m(){if(u==null)throw r("err")("Action handlers not initialized");return s==null&&(s=Math.max.apply(Math,u.map(function(e){return e.getVersion()}))),s}l.setActionHandlers=c,l.getActionHandler=d,l.maxSupportedVersion=m}),98); __d("WAWebSyncdRequestBuilderTypesConverter",["WANullthrows","WAWebProtobufSyncAction.pb","decodeProtobuf","encodeProtobuf"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t){return e.map(function(e){var n=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,e.binarySyncData).value,a=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,r("WANullthrows")(n)).readBuffer();return{collection:e.collection,index:e.index,binarySyncAction:a,operation:t,version:e.version,timestamp:e.timestamp,action:e.action}})}l.syncActionsToPendingMutations=e}),98); __d("WAWebSyncdCoreApi",["Promise","WALogger","WASyncdConst","WATypeUtils","WAWebBackendEventBus","WAWebDebounce","WAWebEventsWaitForOfflineDeliveryEnd","WAWebLid1X1MigrationGating","WAWebModelStorageUtils","WAWebProtobufsServerSync.pb","WAWebSchemaChat","WAWebSchemaSyncActions","WAWebSyncd","WAWebSyncdDb","WAWebSyncdDisabled","WAWebSyncdGetActionHandler","WAWebSyncdRequestBuilderTypesConverter","WAWebSyncdUtils","WAWebUserPrefsAppStateSync","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","tryParseJSONMixed"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m=["pending-mutations"];function p(){return o("WAWebSyncdDisabled").isSyncdDisabled()?(d||(d=n("Promise"))).resolve():(_(),o("WAWebEventsWaitForOfflineDeliveryEnd").waitForOfflineDeliveryEnd().then(function(){o("WAWebSyncd").processOnAppResume()}),f(),o("WAWebSyncd").initializeStateMachine())}function _(){var e=6e4,t=r("WAWebDebounce")(o("WAWebSyncd").reportWam,e,{maxWait:e*3});o("WAWebBackendEventBus").BackendEventBus.onAppStateSyncCompleted(t)}function f(){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield o("WAWebUserPrefsAppStateSync").getMdSyncActionsActionSanitized();if(!t){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: sanitizing null 'action' property in sync-actions table"])));var n=yield o("WAWebSchemaSyncActions").getSyncActionsTable().all(),r=n.filter(function(e){return e.action==null}),a=r.map(function(e){var t=o("WAWebSyncdUtils").getMutationNameFromIndex(e.index),n=o("WASyncdConst").Actions.cast(t);return n?babelHelpers.extends({},e,{action:n}):(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: invalid action ",""])),t),babelHelpers.extends({},e))});yield o("WAWebSyncdDb").updateSyncActionRows(a),yield o("WAWebUserPrefsAppStateSync").setMdSyncActionsActionSanitized(!0)}}),g.apply(this,arguments)}function h(e,t,r){var a=[].concat(e,m);o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&a.push("chat","sync-actions");var i=o("WAWebModelStorageUtils").getStorage().lock(a,(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var a=yield y(t);return(d||(d=n("Promise"))).all([o("WAWebSyncdDb").appendPendingMutationsRows(t.concat(a)),r(e)])});return function(t){return e.apply(this,arguments)}})()).then(function(){var e=t.map(function(e){return e.collection});o("WAWebSyncd").markCollectionsForSync(e)});return(d||(d=n("Promise"))).resolve(i)}function y(e){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isSyncdSessionMigrated())return[];var t=(yield(d||(d=n("Promise"))).all(e.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.action!=null){var t=o("WAWebSyncdGetActionHandler").getActionHandler(e.action);if(!(t==null||!t.isChatSyncdAction())){var n=t.chatJidIndex,a=r("tryParseJSONMixed")(e.index);if(!Array.isArray(a)){o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: getPnMutationsForLidCleanup: indexParts is not an array"]))).sendLogs("syncd-lid-cleanup-invalid-index-non-array");return}var i=a[n];if(!o("WATypeUtils").isString(i)){o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: getPnMutationsForLidCleanup: chat JID not a string"]))).sendLogs("syncd-lid-cleanup-invalid-index-non-string-jid");return}if(r("WAWebWid").isStringLid(i)){var l=(yield o("WAWebSchemaChat").getChatTable().equals(["accountLid"],i,{shouldDecrypt:!1}))[0];if(!(l==null||l.accountLid===l.id)){var s=o("WAWebWidFactory").createWid(l.id).toJid(),d=[].concat(a);d[n]=s;var m=JSON.stringify(d);return o("WAWebSchemaSyncActions").getSyncActionsTable().get(m)}}}}});return function(t){return e.apply(this,arguments)}})()))).filter(Boolean).map(o("WAWebSchemaSyncActions").convertToSyncActionFromRow);return o("WAWebSyncdRequestBuilderTypesConverter").syncActionsToPendingMutations(t,o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE)}),C.apply(this,arguments)}l.initialize=p,l.sanitizeActionInSyncActionsRow=f,l.lockForSync=h}),98); __d("WAWebSyncdCriticalBootstrapProcessingApi",["WATimeUtils","WAWebMdBootstrapAppStateCriticalDataProcessingWamEvent","WAWebSyncBootstrap","WAWebSyncdMdSyncFieldstatMeta","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){r("WAWebSyncBootstrap").isSyncDCriticalDataSyncInProcess()&&new(o("WAWebMdBootstrapAppStateCriticalDataProcessingWamEvent")).MdBootstrapAppStateCriticalDataProcessingWamEvent({bootstrapAppStateDataStage:e,mdSessionId:yield o("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId(),mdTimestamp:o("WATimeUtils").unixTimeMs()}).commit()}),s.apply(this,arguments)}l.logCriticalBootstrapStageIfNecessary=e}),98); __d("WAWebSyncdIndexUtils",["WALogger","WASyncdConst","WAWebMsgKey","WAWebSyncdUtils","WAWebUserPrefsMeUser","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","err"],(function(t,n,r,o,a,i,l){var e,s,u,c=/\d(?=)/gm;function d(e){var t=e.toString();if(!e.fromMe||e.remote.isUser())return t;var n=t.lastIndexOf("_");return t.substring(0,n)}function m(t,n,a,i){var l=void 0;if(!r("WAWebWid").isWid(t))return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncKeyToMsgKey: invalid remote value: ",""])),t.replace(c,"#")),null;if(!o("WAWebWidFactory").createWid(t).isUser()){if(a==="0"&&!r("WAWebWid").isWid(i))return o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncKeyToMsgKey: invalid participant value: ",""])),i.replace(c,"#")),null;a==="1"?l=o("WAWebUserPrefsMeUser").getMePnUserOrThrow():l=o("WAWebWidFactory").createWid(i)}return new(r("WAWebMsgKey"))({fromMe:a==="1",remote:o("WAWebWidFactory").createWid(t),id:n,participant:l})}function p(e){var t=JSON.parse(e);if(t.length<5)throw r("err")("[sync-action] star action index malformed, cannot create MsgKey");var n=m(t[1],t[2],t[3],t[4]);if(!n)throw o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[sync-action] star action index data is malformed, , cannot create MsgKey"]))),r("err")("[sync-action] star action index data is malformed, , cannot create MsgKey");return n}function _(e){return o("WAWebSyncdUtils").uploadCriticalEventMetric(o("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA,e),{actionState:o("WASyncdConst").SyncActionState.Malformed}}function f(e){return{actionState:o("WASyncdConst").SyncActionState.Malformed}}l.msgKeyToDbIdWithoutFromMeParticipant=d,l.syncKeyToMsgKey=m,l.getMsgKeyFromStarActionIndex=p,l.malformedActionIndex=_,l.malformedActionValue=f}),98); __d("WAWebSyncdAction",["Promise","WALogger","WASyncdConst","WAWebSyncdIndexUtils","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u=(function(){function t(){}var a=t.prototype;return a.resolveConflicts=function(t,r){var e=r.timestamp;return e>=t.timestamp?(s||(s=n("Promise"))).resolve(o("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal):(s||(s=n("Promise"))).resolve(o("WASyncdConst").ConflictResolutionState.SkipRemote)},a.dropMutationDueToCrossIndexConflict=function(t,r){return(s||(s=n("Promise"))).resolve(!1)},a.getValidatedContent=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){switch(e.operation){case"remove":return this.getValidatedContentRemove(e);case"set":return this.getValidatedContentSet(e)}});function t(t){return e.apply(this,arguments)}return t})(),a.getValidatedContentSet=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){throw r("err")("You must implement getValidatedContent on your handler before using `withValidatedContent`")});function t(t){return e.apply(this,arguments)}return t})(),a.getValidatedContentRemove=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return{result:"unsupported"}});function t(t){return e.apply(this,arguments)}return t})(),a.withValidatedContent=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var r=yield this.getValidatedContent(t),a=this.asSyncdActionHandler();switch(r.result){case"malformed_index":return o("WAWebSyncdIndexUtils").malformedActionIndex(a.collectionName);case"malformed_value":return o("WAWebSyncdIndexUtils").malformedActionValue(a.collectionName);case"unsupported":return{actionState:o("WASyncdConst").SyncActionState.Unsupported};case"ok":return n(r.content).catch(function(t){var n=t instanceof Error?t.message:String(t);return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: withValidatedContent: error while validating content for ",": ",""])),a.getAction(),n),{actionState:o("WASyncdConst").SyncActionState.Failed}})}});function r(e,n){return t.apply(this,arguments)}return r})(),a.asSyncdActionHandler=function(){if(this.isSyncdAction())return this;throw r("err")("Invalid cast to SyncdAction")},a.isSyncdAction=function(){return!0},a.isAccountSyncdAction=function(){return!1},a.isChatSyncdAction=function(){return!1},a.isChatOrContactSyncdAction=function(){return!1},a.isChatMessageRangeSyncdAction=function(){return!1},a.isMessageSyncdAction=function(){return!1},t})(),c=(function(e){function t(){return e.apply(this,arguments)||this}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.isAccountSyncdAction=function(){return!0},n.asAccountSyncdActionHandler=function(){if(this.isAccountSyncdAction())return this;throw r("err")("Invalid cast to AccountSyncdAction")},t})(u),d=(function(e){function t(){return e.apply(this,arguments)||this}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.isChatSyncdAction=function(){return!0},n.asChatSyncdActionHandler=function(){if(this.isChatSyncdAction())return this;throw r("err")("Invalid cast to ChatSyncdAction")},t})(u),m=(function(e){function t(){return e.apply(this,arguments)||this}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.isChatOrContactSyncdAction=function(){return!0},n.asChatOrContactSyncdActionHandler=function(){if(this.isChatOrContactSyncdAction())return this;throw r("err")("Invalid cast to ChatOrContactSyncdAction")},t})(d),p=(function(e){function t(){return e.apply(this,arguments)||this}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.isMessageSyncdAction=function(){return!0},n.asMessageSyncdActionHandler=function(){if(this.isMessageSyncdAction())return this;throw r("err")("Invalid cast to MessageSyncdAction")},t})(d),_=(function(e){function t(){return e.apply(this,arguments)||this}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.isChatMessageRangeSyncdAction=function(){return!0},n.asChatMessageRangeSyncdActionHandler=function(){if(this.isChatMessageRangeSyncdAction())return this;throw r("err")("Invalid cast to ChatMessageRangeSyncdActionBase")},t})(d);l.AccountSyncdActionBase=c,l.ChatSyncdActionBase=d,l.ChatOrContactSyncdActionBase=m,l.MessageSyncdActionBase=p,l.ChatMessageRangeSyncdActionBase=_}),98); __d("WAWebAndroidUnsupportedActionsSync",["Promise","WALogger","WASyncdConst","WAWebSyncdAction","WAWebSyncdIndexUtils","WAWebUserPrefsAppStateSync"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=(function(t){function r(){for(var e,n=arguments.length,r=new Array(n),a=0;a=500?o("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_SERVER:e instanceof o("WAWebMediaHostsErrors").NoMediaHostsError?o("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_MEDIA_CONN:e.name===o("WAAbortError").ABORT_ERROR?o("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_CANCEL:e instanceof o("WAWebHttpErrors").HttpNetworkError?o("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_UPLOAD:o("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_UNKNOWN}function _(e){if(e instanceof o("WAWebMmsClientErrors").MMSThrottleError)return o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_THROTTLE;if(e instanceof o("WAWebMediaHostsErrors").NoMediaHostsError)return o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_MEDIA_CONN;if(e instanceof o("WAWebHttpErrors").HttpNetworkError)return o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_NETWORK;if(e instanceof o("WAWebHttpErrors").HttpStatusCodeError)switch(e.status){case 404:case 410:return o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_TOO_OLD;case 416:return o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_CANNOT_RESUME;case 401:return o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_INVALID_URL;case 429:case 507:return o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_THROTTLE;default:return o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_UNKNOWN}return e.name===o("WAAbortError").ABORT_ERROR?o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_CANCEL:e instanceof o("WAWebHttpErrors").MmsDownloadFilehashMismatchError?o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_ENC_HASH_MISMATCH:e instanceof o("WAWebMiscErrors").MediaDecryptionError&&e.message.includes(o("WAWebMiscErrors").PLAINTEXT_HASH_MISMATCH_ERROR)?o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_HASH_MISMATCH:o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_UNKNOWN}function f(e){if(e instanceof o("WAWebHttpErrors").HttpStatusCodeError)return e.status}function g(){return 1+Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}function h(e,t){if(t!=null){var n;e.overallDownloadResult===o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_UNKNOWN?n=o("WAWebWamEnumWebcMediaOperationCode").WEBC_MEDIA_OPERATION_CODE.DOWNLOAD:e.overallUploadResult===o("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.ERROR_UNKNOWN&&(n=o("WAWebWamEnumWebcMediaOperationCode").WEBC_MEDIA_OPERATION_CODE.UPLOAD),n!=null&&new(o("WAWebWebcMediaErrorUnknownDetailsWamEvent")).WebcMediaErrorUnknownDetailsWamEvent({mediaId:e.mediaId,webcMediaOperation:n,webcMediaErrorName:t.name,webcMediaErrorMessage:t.message}).commit()}}function y(t){if(!t)return o("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE.NON_DIRECT_PATH;switch(t.slice(0,2).toLowerCase()){case"/v":return o("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE.EVERSTORE;case"/o":return o("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE.OIL;case"/m":return o("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE.MANIFOLD}return r("gkx")("26258")?o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Unrecognized direct path type"]))).sendLogs("unrecognized-direct-path-type"):o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Unrecognized direct path type: ",""])),t).sendLogs("unrecognized-direct-path-type"),null}l.getMetricOverallDownloadModeType=c,l.getMetricOverallUploadModeType=d,l.getMetricMediaType=m,l.getMetricUploadErrorResultType=p,l.getMetricDownloadErrorResultType=_,l.getStatusCode=f,l.generateMediaEventId=g,l.logErrorUnknownDetails=h,l.getMetricBackendStore=y}),98); __d("WAWebCreateMediaUploadMetrics",["WAWebABProps","WAWebAppTracker","WAWebHttpErrors","WAWebMapFileOriginToUploadOrigin","WAWebMediaUpload2WamEvent","WAWebMmsMediaTypes","WAWebWamEnumConnectionType","WAWebWamEnumMediaQuality","WAWebWamEnumMediaUploadResultType","WAWebWamEnumNetworkStackType","WAWebWamEnumOverallLastUploadRetryPhaseType","WAWebWamMediaMetricUtils"],(function(t,n,r,o,a,i,l){function e(e,t,n,a,i,l){l===void 0&&(l=!1);var s=o("WAWebWamMediaMetricUtils").generateMediaEventId(),u=new(o("WAWebMediaUpload2WamEvent")).MediaUpload2WamEvent({mediaId:s,connectionType:o("WAWebWamEnumConnectionType").CONNECTION_TYPE.HOSTNAME,overallMediaType:o("WAWebWamMediaMetricUtils").getMetricMediaType(e),overallMmsVersion:4,overallAttemptCount:n,networkStack:o("WAWebWamEnumNetworkStackType").NETWORK_STACK_TYPE.NATIVE,overallUploadMode:o("WAWebWamMediaMetricUtils").getMetricOverallUploadModeType(e),overallIsForward:a,overallUploadOrigin:t,uploadSource:r("WAWebMapFileOriginToUploadOrigin")(t,a),isViewOnce:i,overallUserVisibleT:0});if(o("WAWebAppTracker").AppTracker.start(o("WAWebAppTracker").AppTrackerType.MediaUL),e===o("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE&&o("WAWebABProps").getABPropConfigValue("hqp_log_enabled")){var c=l?o("WAWebWamEnumMediaQuality").MEDIA_QUALITY.HIGHEST_QUALITY:o("WAWebWamEnumMediaQuality").MEDIA_QUALITY.DATA_SAVER;u.set({photoQualitySetting:c})}function d(e){u.set({overallMediaSize:e})}function m(e){e instanceof o("WAWebHttpErrors").HttpStatusCodeError&&u.set({resumeHttpCode:e.status})}function p(){u.set({overallUploadResult:o("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.DUPLICATE,overallIsFinal:!0,resumeHttpCode:200}),u.markOverallCumT(),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.MediaUL),o("WAWebAppTracker").attachWAMAppContext(u,u.overallCumT),u.commit()}function _(e){var t=e.failCount,n=e.hostClass,r=e.hostName;u.set({overallDomain:r,overallConnectionClass:n,overallRetryCount:t})}function f(){u.set({resumeHttpCode:404,overallUploadResult:o("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.OK,overallIsFinal:!0,uploadHttpCode:200,finalizeHttpCode:200}),u.markOverallCumT(),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.MediaUL),o("WAWebAppTracker").attachWAMAppContext(u,u.overallCumT),u.commit()}function g(e){u.set({overallUploadResult:o("WAWebWamMediaMetricUtils").getMetricUploadErrorResultType(e),overallIsFinal:!0});var t=o("WAWebWamMediaMetricUtils").getStatusCode(e);t!=null&&(u.uploadHttpCode=t,u.finalizeHttpCode=t),u.markOverallCumT(),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.MediaUL),o("WAWebAppTracker").attachWAMAppContext(u,u.overallCumT),u.commit(),o("WAWebWamMediaMetricUtils").logErrorUnknownDetails(u,e)}function h(e){u.set({overallT:e})}function y(e,t,n,r){var a=new(o("WAWebMediaUpload2WamEvent")).MediaUpload2WamEvent(u.all),i=o("WAWebWamMediaMetricUtils").getStatusCode(e),l=r===o("WAWebWamEnumOverallLastUploadRetryPhaseType").OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.FINALIZE?i:a.finalizeHttpCode;a.set({mediaId:o("WAWebWamMediaMetricUtils").generateMediaEventId(),overallUploadResult:o("WAWebWamMediaMetricUtils").getMetricUploadErrorResultType(e),overallIsFinal:!1,overallT:t,overallRetryCount:n,overallLastUploadRetryPhase:r,finalizeHttpCode:l}),i!=null&&(u.uploadHttpCode=i),u.markOverallCumT(),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.MediaUL),o("WAWebAppTracker").attachWAMAppContext(u,u.overallCumT),a.commit(),o("WAWebWamMediaMetricUtils").logErrorUnknownDetails(u,e)}function C(){u.startOverallEncryptT()}function b(){u.markOverallEncryptT()}function v(){u.set({uploadIsStreaming:!0})}function S(e){u.set({uploadBytesTransferred:e})}function R(e){e!=null&&u.set({isViewOnce:e}),u.markOverallUserVisibleT()}return{handleStreamUploadStart:v,handleArrayBufferCreated:d,handleCheckExistingError:m,handleCheckExistingSuccess:p,handleUploadHostFound:_,handleUploadSuccess:f,handleUploadError:g,handleUploadAttemptSuccess:h,handleUploadAttemptError:y,mediaId:s,handleEncryptionStart:C,handleEncryptionSuccess:b,handleUploadProgress:S,handleSendMessageStart:R}}l.default=e}),98); __d("WAWebCryptoCalculateStreamingSidecar",["Promise","WAArrayBuffersConcat","WACryptoHmac","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=65536,u=16,c=10;function d(e,t){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r){var a=t instanceof ArrayBuffer?t.byteLength:t.buffer.byteLength,i=a-u,l=Math.ceil(i/s),d=Array.from({length:l},function(e,n){var a=n*s,i=a+u+s,l=t.slice(a,i);return o("WACryptoHmac").hmacSha256(r,l,c)}),m=yield(e||(e=n("Promise"))).all(d);return o("WAArrayBuffersConcat").concatArrayBuffers.apply(void 0,m)}),m.apply(this,arguments)}l.IV_LENGTH=u,l.HMAC_LENGTH=c,l.calculateStreamingSidecar=d}),98); __d("WAWebCryptoCalculateFirstFrameSidecar",["WACryptoHmac","WAWebCryptoCalculateStreamingSidecar"],(function(t,n,r,o,a,i,l){var e=16;function s(t,n,r){var a=Math.ceil(t/e)*e,i=n.slice(0,o("WAWebCryptoCalculateStreamingSidecar").IV_LENGTH+a);return o("WACryptoHmac").hmacSha256(r,i,o("WAWebCryptoCalculateStreamingSidecar").HMAC_LENGTH)}l.default=s}),98); __d("WAWebCryptoCreateMediaKeys",["WABase64","WACryptoHkdf","WALogger","WAWebMiscErrors","WAWebMmsMediaTypes","asyncToGeneratorRuntime","err","gkx"],(function(t,n,r,o,a,i,l){var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var a=c(t),i;try{i=o("WABase64").decodeB64(n)}catch(t){r("gkx")("26258")||o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["decodeB64: invalid base64 string ",""])),n)}if(!n||!a||!i)throw new(o("WAWebMiscErrors")).MediaEncryptionError("createKeys fail: !!mediakey: "+!!n+" info: "+a+" type: "+t);var l=yield o("WACryptoHkdf").extractAndExpand(i,a,112);if(!l||l.byteLength<112)throw new(o("WAWebMiscErrors")).MediaEncryptionError("computeMediaKeys: hkdf error");return{iv:l.slice(0,16),encKey:l.slice(16,48),macKey:l.slice(48,80),refKey:l.slice(80,112)}}),u.apply(this,arguments)}function c(e){e:{if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO)return"WhatsApp Audio Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.DOCUMENT)return"WhatsApp Document Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.GIF)return"WhatsApp Video Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE)return"WhatsApp Image Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.PPIC)throw r("err")("Cannot create media keys for profile pics");if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT)return"WhatsApp Image Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.PTT)return"WhatsApp Audio Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER)return"WhatsApp Image Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.PTV)return"WhatsApp Video Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_DOCUMENT)return"WhatsApp Document Thumbnail Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER_PACK)return"WhatsApp Sticker Pack Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_STICKER_PACK)return"WhatsApp Sticker Pack Thumbnail Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_IMAGE)return"WhatsApp Image Thumbnail Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_VIDEO)return"WhatsApp Video Thumbnail Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.THUMBNAIL_LINK)return"WhatsApp Link Thumbnail Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.TEMPLATE)throw r("err")("Cannot create media keys for template");if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.HISTORY_SYNC)return"WhatsApp History Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.MD_APP_STATE)return"WhatsApp App State Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT_CATALOG_IMAGE)throw r("err")("Cannot create media keys for product catalog image");if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.PAYMENT_BG_IMAGE)return"WhatsApp Payment Background Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NATIVE_AD_IMAGE)return"ads-image";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NATIVE_AD_VIDEO)return"ads-video";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.MUSIC_ARTWORK)return"WhatsApp Music Artwork Keys";if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_AUDIO||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_DOCUMENT||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_GIF||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_IMAGE||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTT||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTV||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_STICKER||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_VIDEO||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_THUMBNAIL_LINK||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_STICKER_PACK||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_MUSIC_ARTWORK||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.WAFFLE_IMAGE||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.WAFFLE_VIDEO)throw r("err")("createKeys: newsletter media is not encrypted: "+e);if(e===o("WAWebMmsMediaTypes").MEDIA_TYPES.GROUP_HISTORY)return"Group History";if(e==="biz-cover-photo"||e==="native_flow"||e==="preview")return;throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)}}l.default=s}),98); __d("WAWebMmsPerformanceExperimentSwitch",["WAWebServerPropConstants"],(function(t,n,r,o,a,i,l){function e(e){return e>o("WAWebServerPropConstants").DEFAULT_MAX_FILE_SIZE_BYTES}l.shouldEncryptInChunks=e}),98); __d("WAWebWebp",["$InternalEnum","WABinary","WALogger","WATypedArraysEqual"],(function(t,n,r,o,a,i,l){var e,s,u=n("$InternalEnum")({VP8X:"VP8X",ANMF:"ANMF",EXIF:"EXIF",XMP:"XMP "}),c=12,d=8,m=4,p=20,_=2,f=125,g=0;function h(e,t){var n=R(t),o=0;for(o+=c;o0;--l)if(i==null&&r[l]===f)i=l;else if(i!=null&&r[l]===g){a=l+1;break}return a==null||i==null?(o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["JSON not found in sticker file"]))),null):{position:n.position+a,size:i-a+1}}function C(e){var t=e.slice(c,c+m);return r("WATypedArraysEqual")(t,R(u.VP8X))}function b(e){var t=new Uint8Array(e);return C(t)&&(_&t[p])!==0}function v(e){return e.reduce(function(e,t,n){return e+(t< "+m(a):"").sendLogs("download-upload-manager-likely-crashed")}),this.$3(),this.hasPerformedInit=!0)},n.reset=function(){this.$4()&&(window.removeEventListener("beforeunload",this.$3),this.$3(),this.hasPerformedInit=!1)},n.mark=function(t,n,r){this.$4()&&(c.has(n)?delete this.storage[String(t)]:this.storage[String(t)]={progressType:n,metadata:r},this.$2())},t})(),_=new p;l.ProgressType=s,l.downloadUploadCrashLogger=_}),98); __d("WAWebUploadManager",["Promise","WAAbortError","WAFilteredCatch","WALogger","WAMemoizeConcurrent","WATimeUtils","WAWebCreateMediaUploadMetrics","WAWebCryptoEncryptMedia","WAWebCryptoRandomMediaKey","WAWebFileUtils","WAWebMediaDebugString","WAWebMmsClient","WAWebMmsClientErrors","WAWebMmsDownloadUploadCrashLogger","WAWebNullFunc","WAWebPonyfillsUrlSearchParams","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C;function b(e){var t=e.mediaKey,n=e.mediaKeyTimestamp;if(t!=null&&n!=null)return{mediaKey:t,mediaKeyTimestamp:n};var o=r("WAWebCryptoRandomMediaKey")(),a=o.key,i=o.timestamp;return{mediaKey:a,mediaKeyTimestamp:i}}var v=(function(){function t(){var t=this;this._checkIfAlreadyUploaded=r("WAMemoizeConcurrent")(function(e){return e.token},(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.encFilehash,a=t.type,i={encFilehash:n,type:a},l=o("WAWebMediaDebugString").getDebugString(n);o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.checkIfAlreadyUploaded: [","] start"])),l);try{var d=yield r("WAWebMmsClient").checkIfUploadExists(t).catch(o("WAFilteredCatch").filteredCatch(o("WAWebMmsClientErrors").MediaNotFoundError,o("WAWebNullFunc").returnNull));return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.checkIfAlreadyUploaded: [","] success"])),l),d}catch(e){throw r("getErrorSafe")(e).name===o("WAAbortError").ABORT_ERROR?o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.checkIfAlreadyUploaded: [","] canceled"])),l):o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.checkIfAlreadyUploaded: [","] error"])),l),e}});return function(e){return t.apply(this,arguments)}})()),this._memoizedUpload=r("WAMemoizeConcurrent")(function(e){return e.token},(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=e.ciphertextHmac,o=e.encFilehash,a=e.generateThumbnailOnServer,i=e.mediaId,l=e.onFinalize,s=e.onProgress,u=e.onStreamUploadStart,c=e.onUploadAttemptError,d=e.onUploadAttemptSuccess,m=e.onUploadHostFound,p=e.onUploadSuccess,_=e.signal,f=e.type,g=yield r("WAWebMmsClient").upload({ciphertextHmac:n,encFilehash:o,type:f,signal:_,onUploadHostFound:m,onUploadAttemptSuccess:d,onUploadAttemptError:c,onProgress:s,byteOffset:(t=e.byteOffset)!=null?t:0,onFinalize:l,onStreamUploadStart:u,mediaId:i,token:e.token,generateThumbnailOnServer:a});return p(),g});return function(t){return e.apply(this,arguments)}})()),this._getExistingOrUpload=r("WAMemoizeConcurrent")(function(e){return e.token},(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n=e.ciphertextHmac,a=e.encFilehash,i=e.generateThumbnailOnServer,l=e.mediaId,s=e.onCheckExistingError,u=e.onCheckExistingSuccess,c=e.onFinalize,f=e.onProgress,g=e.onStreamUploadStart,h=e.onUploadAttemptError,y=e.onUploadAttemptSuccess,C=e.onUploadHostFound,b=e.onUploadSuccess,v=e.signal,S=e.type,R={encFilehash:a,type:S},L=o("WAWebMediaDebugString").getDebugString(a);o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["uploadManager._getExistingOrUpload: [","] start"])),L);try{var E=yield t._checkIfAlreadyUploaded({encFilehash:a,type:S,signal:v,mediaId:l,token:e.token,generateThumbnailOnServer:i}).catch(function(e){throw s(e),e}).then(function(r){return(r==null?void 0:r.complete)===!0?(u(),{directPath:r.directPath,handle:r.handle,url:r.url}):t._memoizedUpload({ciphertextHmac:n,encFilehash:a,type:S,signal:v,onUploadHostFound:C,onUploadAttemptSuccess:y,onUploadAttemptError:h,onUploadSuccess:b,onCheckExistingSuccess:u,onCheckExistingError:s,onProgress:f,onFinalize:c,onStreamUploadStart:g,byteOffset:r==null?void 0:r.resume,mediaId:l,token:e.token,generateThumbnailOnServer:i})});return o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["uploadManager._getExistingOrUpload: [","] success"])),L),E}catch(e){throw r("getErrorSafe")(e).name===o("WAAbortError").ABORT_ERROR?o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["uploadManager._getExistingOrUpload: [","] canceled"])),L):o("WALogger").WARN(_||(_=babelHelpers.taggedTemplateLiteralLoose(["uploadManager._getExistingOrUpload: [","] error"])),L),e}});return function(t){return e.apply(this,arguments)}})()),o("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.init()}var a=t.prototype;return a.encryptAndUpload=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this,a=e.blob,i=e.forwardedFromWeb,l=e.isHdPhoto,s=e.isViewOnce,u=e.onFinalize,c=e.onProgress,d=e.signal,m=e.type,p=e.uploadOrigin,_=e.userUploadAttemptCount,v={type:m};o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.encryptAndUpload: start"])));var S=r("WAWebCreateMediaUploadMetrics")(m,p,_,i,s,l),L=S.handleArrayBufferCreated,E=S.handleCheckExistingError,k=S.handleCheckExistingSuccess,I=S.handleEncryptionStart,T=S.handleEncryptionSuccess,D=S.handleStreamUploadStart,x=S.handleUploadAttemptError,$=S.handleUploadAttemptSuccess,P=S.handleUploadError,N=S.handleUploadHostFound,M=S.handleUploadProgress,w=S.handleUploadSuccess,A=S.mediaId,F=function(t,n){c==null||c(t,n);var e=n+t.loaded;M(e)};o("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(A,o("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_ENCRYPTION_STARTED);try{var O=b(e),B=(C||(C=n("Promise"))).resolve(a).then(function(e){o("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(A,o("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_STARTED,{size:a instanceof Blob?a.size:a.byteLength});var t=e instanceof Blob?o("WAWebFileUtils").blobToArrayBuffer(e):e;return o("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(A,o("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_FINISHED),t}).then(function(e){return L(e.byteLength),I(),r("WAWebCryptoEncryptMedia")({type:m,plaintext:e,mediaKey:O.mediaKey})}).then(function(n){var r,a=n.ciphertextHmac,l=n.firstFrameSidecar,s=n.hash,c=n.sidecar;T(),o("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(A,o("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_ENCRYPTION_FINISHED);var p=e.mediaKey?t._getExistingOrUpload:t._memoizedUpload;return p({ciphertextHmac:a,encFilehash:s,type:m,signal:d,onCheckExistingSuccess:k,onCheckExistingError:E,onUploadHostFound:N,onUploadAttemptSuccess:$,onUploadAttemptError:x,onUploadSuccess:w,onProgress:F,onFinalize:u,onStreamUploadStart:D,mediaId:A,token:(r=e.token)!=null?r:s}).then(function(e){return{directPath:i?R(e.directPath):e.directPath,encFilehash:s,mediaKey:O.mediaKey,mediaKeyTimestamp:O.mediaKeyTimestamp,sidecar:c,firstFrameSidecar:l,url:e.url,handle:e.handle}})}),W=yield B;return o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.encryptAndUpload: success"]))),o("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(A,o("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_FINISHED),e.uploadQpl.endSuccess(),W}catch(t){throw r("getErrorSafe")(t).name===o("WAAbortError").ABORT_ERROR?(o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.encryptAndUpload: canceled"]))),e.uploadQpl.endFailWithError("upload_canceled","aborted")):(o("WALogger").WARN(y||(y=babelHelpers.taggedTemplateLiteralLoose(["uploadManager.encryptAndUpload: error"]))),e.uploadQpl.endFailWithError("upload_failed",r("getErrorSafe")(t).message)),o("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(A,o("WAWebMmsDownloadUploadCrashLogger").ProgressType.UPLOAD_ERROR),P(r("getErrorSafe")(t)),t}});function t(t){return e.apply(this,arguments)}return t})(),a.unencryptedUpload=function(t){var e,n=t.file,o=t.generateThumbnailOnServer,a=t.hash,i=t.isViewOnce,l=t.signal,s=t.type,u=t.uploadOrigin,c=r("WAWebCreateMediaUploadMetrics")(s,u,0,!1,i),d=c.handleCheckExistingError,m=c.handleCheckExistingSuccess,p=c.handleStreamUploadStart,_=c.handleUploadAttemptError,f=c.handleUploadAttemptSuccess,g=c.handleUploadHostFound,h=c.handleUploadProgress,y=c.handleUploadSuccess,C=c.mediaId,b=function(t,n){h(t.loaded+n)},v=(e=t.token)!=null?e:a;return this._getExistingOrUpload({ciphertextHmac:n,encFilehash:a,type:s,signal:l,onCheckExistingSuccess:m,onCheckExistingError:d,onUploadHostFound:g,onUploadAttemptSuccess:f,onUploadAttemptError:_,onUploadSuccess:y,onStreamUploadStart:p,onProgress:b,mediaId:C,token:v,generateThumbnailOnServer:o})},a.uploadCoverPhoto=function(t){var e,n=t.file,o=t.hash,a=t.isViewOnce,i=t.signal,l=t.type,s=t.uploadOrigin,u=r("WAWebCreateMediaUploadMetrics")(l,s,0,!1,a),c=u.handleCheckExistingError,d=u.handleCheckExistingSuccess,m=u.handleStreamUploadStart,p=u.handleUploadAttemptError,_=u.handleUploadAttemptSuccess,f=u.handleUploadHostFound,g=u.handleUploadProgress,h=u.handleUploadSuccess,y=u.mediaId,C=function(t,n){g(t.loaded+n)},b={ciphertextHmac:n,encFilehash:o,type:l,signal:i,onCheckExistingSuccess:d,onCheckExistingError:c,onUploadHostFound:f,onUploadAttemptSuccess:_,onUploadAttemptError:p,onUploadSuccess:h,onStreamUploadStart:m,onProgress:C,mediaId:y,token:(e=t.token)!=null?e:t.hash};return this._memoizedUpload(b)},t})(),S=new v;function R(e){var t=e.split("?"),n=t[0],a=t[1],i=new(r("WAWebPonyfillsUrlSearchParams"))(a),l=o("WATimeUtils").unixTime();return i.set("_nc_hot",String(l)),n+"?"+i.toString()}l.default=S}),98); __d("WAWebSyncdNetCallbacksApi",["WABase64","WALogger","WAWebDownloadManager","WAWebMmsClientErrors","WAWebStartMediaDownloadQpl","WAWebStartMediaUploadQpl","WAWebSyncdError","WAWebSyncdUploadFatalErrorMetric","WAWebUploadManager","WAWebWamEnumDownloadOriginType","WAWebWamEnumMdSyncdFatalErrorCode","WAWebWamEnumUploadOriginType","asyncToGeneratorRuntime","err","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s=function(t){var e=o("WAWebStartMediaUploadQpl").startMediaUploadQpl({entryPoint:"SyncdNetCallbacks"});return r("WAWebUploadManager").encryptAndUpload({blob:t,signal:new AbortController().signal,type:"md-app-state",uploadOrigin:o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.UNKNOWN,userUploadAttemptCount:0,forwardedFromWeb:!1,isViewOnce:!1,uploadQpl:e}).then(function(e){var t=e.directPath,n=e.encFilehash,a=e.handle,i=e.mediaKey;if(a==null)throw r("err")("Missing handle after uploading external patch to mms4");return{mediaKey:o("WABase64").decodeB64(i),directPath:t,encFilehash:o("WABase64").decodeB64(n),handle:a}})},u=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a){var i=t.directPath,l=t.fileEncSha256,s=t.fileSha256,u=t.mediaKey,c={directPath:i,encFilehash:o("WABase64").encodeB64(l),filehash:o("WABase64").encodeB64(s),mediaKey:o("WABase64").encodeB64(u),type:"md-app-state",userDownloadAttemptCount:0,downloadOrigin:o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.MESSAGE_HISTORY_SYNC},d=o("WAWebStartMediaDownloadQpl").startMediaDownloadQpl({entryPoint:"SyncdNetCallbacks"});try{var m=yield o("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt(babelHelpers.extends({signal:new AbortController().signal,downloadQpl:d},c));return d.endSuccess(),m}catch(i){throw d.endFailWithError("download_failed",r("getErrorSafe")(i).message),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: error downloading "," of expected size "," with expected hash b64 length of "," for collection ",""])),n,t.fileSizeBytes,o("WABase64").encodeB64(t.fileEncSha256).length,a),i instanceof o("WAWebMmsClientErrors").MediaNotFoundError?(o("WAWebSyncdUploadFatalErrorMetric").uploadFatalErrorMetric(n==="patch"?o("WAWebWamEnumMdSyncdFatalErrorCode").MD_SYNCD_FATAL_ERROR_CODE.EXTERNAL_PATCH_EXPIRED:o("WAWebWamEnumMdSyncdFatalErrorCode").MD_SYNCD_FATAL_ERROR_CODE.SNAPSHOT_EXPIRED,a),new(o("WAWebSyncdError")).SyncdFatalError("external patch expired")):i}});return function(n,r,o){return t.apply(this,arguments)}})();l.uploadSyncExternalPatch=s,l.downloadSyncBlob=u}),98); __d("WAWebSyncdOrphan",["Promise","WALogger","WASyncdConst","WAWebGetSyncAction","WAWebMiscGatingUtils","WAWebSyncdCollectionHandler","WAWebSyncdDbCallbacksApi","WAWebSyncdDisabled","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p,_,f,g;function h(e,t){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(o("WAWebSyncdDisabled").isSyncdDisabled())return(g||(g=n("Promise"))).resolve();yield(g||(g=n("Promise"))).all([C(e),v(t),o("WAWebSyncdDbCallbacksApi").bulkGetAccountLid(t).then(function(e){return R(e.filter(Boolean))})])}),y.apply(this,arguments)}function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebSyncdDbCallbacksApi").getAdditionalLidMsgKeys(e);yield E(e.concat(t),o("WASyncdConst").SyncModelType.Msg)}),b.apply(this,arguments)}function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield E(e,o("WASyncdConst").SyncModelType.Chat)}),S.apply(this,arguments)}function R(e){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield E(e,o("WASyncdConst").SyncModelType.Account)}),L.apply(this,arguments)}function E(e,t){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(o("WAWebSyncdDisabled").isSyncdDisabled())return(g||(g=n("Promise"))).resolve();var r=yield o("WAWebGetSyncAction").getSyncActionsByModelInfosInTransaction(e.map(function(e){return[e,t,o("WASyncdConst").SyncActionState.Orphan]}));yield o("WAWebSyncdCollectionHandler").applyIndividualMutations(r)}),k.apply(this,arguments)}function I(){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebSyncdDisabled").isSyncdDisabled())return(g||(g=n("Promise"))).resolve();o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: start applyAllOrphansAndUnsupported"])));var t=yield o("WAWebGetSyncAction").getSyncActionsByActionStatesInTransaction([o("WASyncdConst").SyncActionState.Orphan,o("WASyncdConst").SyncActionState.Unsupported]);yield o("WAWebSyncdCollectionHandler").applyIndividualMutations(t),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: end applyAllOrphansAndUnsupported"])))}),T.apply(this,arguments)}function D(e){return x.apply(this,arguments)}function x(){return x=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield E(e,o("WASyncdConst").SyncModelType.Agent)}),x.apply(this,arguments)}function $(e){return P.apply(this,arguments)}function P(){return P=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield E(e,o("WASyncdConst").SyncModelType.ChatAssignment)}),P.apply(this,arguments)}function N(e){return M.apply(this,arguments)}function M(){return M=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield E(e,o("WASyncdConst").SyncModelType.UserStatusMute)}),M.apply(this,arguments)}function w(e,t){return A.apply(this,arguments)}function A(){return A=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: applying all orphans for type ",""])),e),o("WAWebSyncdDisabled").isSyncdDisabled())return(g||(g=n("Promise"))).resolve();var r=yield o("WAWebGetSyncAction").getOrphanSyncActionsByModelTypeInTransaction(e);if(r.length===0){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: no orphans for type "," to apply"])),e);return}t!=null&&!t()||(yield o("WAWebSyncdCollectionHandler").applyIndividualMutations(r),o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["syncd: finished applying all orphans for type ",", count=",""])),e,r.length))}),A.apply(this,arguments)}function F(){return O.apply(this,arguments)}function O(){return O=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["syncd: checkOrphanFavoriteStickers"]))),!o("WAWebMiscGatingUtils").isFavoriteStickersEnabled()){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["syncd: checkOrphanFavoriteStickers: favorite stickers not enabled in primary device"])));return}yield w(o("WASyncdConst").SyncModelType.FavoriteSticker,function(){var e=o("WAWebMiscGatingUtils").isFavoriteStickerSyncAfterPairingEnabled();return o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["syncd: checkOrphanFavoriteStickers: favorite sticker sync after pairing enabled: ",""])),e),e}),o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["syncd: checkOrphanFavoriteStickers: finished"])))}),O.apply(this,arguments)}l.checkOrphanMutations=h,l.checkOrphanMessages=C,l.checkOrphanChats=v,l.applyAllOrphansAndUnsupported=I,l.checkOrphanAgents=D,l.checkOrphanChatAssignments=$,l.checkOrphanUserStatusMutes=N,l.checkOrphanFavoriteStickers=F}),98); __d("WAWebSyncdQpl",["WAQplTypes","WAWebOfflineHandler","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebSyncBootstrap","WAWebSyncdMetrics","err","gkx","justknobx"],(function(t,n,r,o,a,i,l){var e=["source"];function s(t){if((t==null?void 0:t.string)!=null){var n=t.string,r={};Object.keys(t.string).forEach(function(t){e.includes(t)||(r[t]=n[t])}),t.string=r}}function u(t,n){var r;if((n==null||(r=n.string)==null?void 0:r.source)==null)return t;var o=n.string,a=Object.keys(o).filter(function(t){return e.includes(t)});return[a.map(function(e){return o[e]}),t].join("_")}function c(){return r("WAWebSyncBootstrap").isSyncDBootstrapInProcess()?"bootstrap":o("WAWebOfflineHandler").OfflineMessageHandler.isResumeFromRestartComplete()?"online":"offline_resume"}var d=(function(){function e(){this.$3=c(),this.$4=r("gkx")("26259")&&r("justknobx")._("3998")&&(this.$3==="bootstrap"||this.$3==="offline_resume"),this.$4&&(this.$1=o("WAWebQplQuickPerformanceLoggerModule").QPL.getNextMarkerInstanceValue(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.SYNCD))}var t=e.prototype;return t.$5=function(){if(!this.$4)return!1;if(!this.$2)throw r("err")("QPL instance ${this._instanceKey} is not started");return!0},t.start=function(){this.$4&&(o("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.SYNCD,{instanceKey:this.$1}),this.$2=!0,this.annotate({when:this.$3}))},t.annotate=function(t){if(this.$5()){var e=o("WAWebSyncdMetrics").constructAnnotationsFromContext(t);s(e),e&&o("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.SYNCD,e,{instanceKey:this.$1})}},t.mark=function(t,n){if(this.$5()){var e=o("WAWebSyncdMetrics").constructAnnotationsFromContext(n);this.$6(t,e)}},t.markAnnotations=function(t,n){this.$5()&&this.$6(t,n)},t.$6=function(t,n){var e=u(t,n),r=babelHelpers.extends({},n);s(r),o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.SYNCD,e,babelHelpers.extends({},n&&{data:r},{instanceKey:this.$1}))},t.end=function(t){t===void 0&&(t=!1),this.$5()&&(this.$2=!1,o("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.SYNCD,t?o("WAQplTypes").QuickLogActionType.FAIL:o("WAQplTypes").QuickLogActionType.SUCCESS,{instanceKey:this.$1}))},e})();l.SyncdQPL=d}),98); __d("WAWebSyncdResponseParser",["WADeprecatedWapParser","WALogger","WASyncdConst","WAWebSyncdDecode","WAWebSyncdError","WAWebSyncdMetricFatalError"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p,_,f,g=new(r("WADeprecatedWapParser"))("syncResponseParser",function(t){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: start parsing syncd collections"])));var n=[],r=t.child("sync");return r.mapChildrenWithTag("collection",function(e){var t=o("WASyncdConst").CollectionName.cast(e.attrString("name"));if(!t)throw new(o("WAWebSyncdError")).SyncdFatalError("invalid collection name");var r={name:t};r.state=h(e,r.name),e.hasAttr("version")&&(r.version=parseInt(e.attrString("version"),10)),e.hasChild("patches")&&(r.patches=e.child("patches").mapChildrenWithTag("patch",function(e){return o("WAWebSyncdDecode").decodeSyncdPatch(t,e.contentBytes())})),e.hasChild("snapshot")&&(r.snapshot=o("WAWebSyncdDecode").decodeExternalBlobReference(t,e.child("snapshot").contentBytes())),n.push(r),r.version==null&&r.patches==null&&r.snapshot==null&&o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection "," has no version, patches or snapshot"])),t),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: successfully parsed collection ",""])),t)}),n});function h(e,t){if(e.hasAttr("type")&&e.attrString("type")==="error"){var n=e.child("error"),r=n.attrString("code"),a=n.attrString("text");o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection "," got server error: ",""])),t,r);e:{if(r==="409")return e.hasAttr("has_more_patches")?o("WASyncdConst").CollectionState.ConflictHasMore:o("WASyncdConst").CollectionState.Conflict;if(r==="400"){return o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_BAD_REQUEST_FOR_COLLECTION),o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: collection "," throws ",""])),String(t),a).sendLogs("syncd: fatal error 400: collection "+String(t)),o("WASyncdConst").CollectionState.ErrorFatal;break e}if(r==="404"){return o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_NOT_FOUND_FOR_COLLECTION),o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error 404: collection "," throws ",""])),String(t),a).sendLogs("syncd: fatal error: collection "+String(t)),o("WASyncdConst").CollectionState.ErrorFatal;break e}{return o("WALogger").WARN(p||(p=babelHelpers.taggedTemplateLiteralLoose(["syncd: retryable error: collection "," throws ",""])),String(t),a).sendLogs("syncd: retryable error: collection "+String(t)),o("WASyncdConst").CollectionState.ErrorRetry;break e}}}else return e.hasAttr("has_more_patches")?(o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection "," got server code has_more_patches"])),t),o("WASyncdConst").CollectionState.SuccessHasMore):(o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection "," did not get server error"])),t),o("WASyncdConst").CollectionState.Success)}l.syncResponseParser=g}),98); __d("WAWebSyncdServerSync",["Promise","WADeprecatedSendIq","WALogger","WASyncdConst","WAWebGetPendingMutation","WAWebRuntimeEnvironmentUtils","WAWebSyncd","WAWebSyncdCollectionHandler","WAWebSyncdCriticalBootstrapProcessingApi","WAWebSyncdDbCallbacksApi","WAWebSyncdError","WAWebSyncdMetricFatalError","WAWebSyncdMetrics","WAWebSyncdRequestBuilder","WAWebSyncdResponseParser","WAWebSyncdWamAppState","WAWebWamEnumBootstrapAppStateDataStageCode","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p,_,f,g,h,y,C=5,b=500;function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var r=Math.random().toString(36).substr(2,5);yield T(t,r+" start serverSync");for(var a=[],i=[].concat(t),l=0;(l0&&l0&&(yield T(i,"error: max iterations"),o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: reached max iterations for collections: ",""])),i).tags("syncd").sendLogs("syncd: max iteration"),a=a.concat(i.map(function(e){return{state:o("WASyncdConst").CollectionState.ErrorRetry,name:e}}))),a}),S.apply(this,arguments)}function R(e,t){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(e.length===0)return{doneCollections:[],refetchCollections:[]};try{var r=yield E(e,t),a=r.collectionDetails,i=r.collectionsToUpload,l=r.localCollectionVersions;i.length>0&&o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: deferred local mutation upload for ",""])),i),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: local collection versions:"])),t),l.forEach(function(e,t){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["\n "," v",""],["\\n\\t"," v",""])),t,e!=null?e:"(undefined)}")});var f=[],g=[];a.forEach(function(e){switch(e.state){case o("WASyncdConst").CollectionState.ErrorRetry:case o("WASyncdConst").CollectionState.ErrorFatal:case o("WASyncdConst").CollectionState.Blocked:g.push(e);return;default:f.push(e)}(e.state===o("WASyncdConst").CollectionState.Conflict||e.state===o("WASyncdConst").CollectionState.ConflictHasMore)&&o("WAWebSyncdWamAppState").incConflict()}),o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: start apply collections:\n ",""])),t,f.map(function(e){return e.name}));var h=new(o("WAWebSyncdMetrics")).SyncdEventFlow,C=yield(y||(y=n("Promise"))).all(f.map(function(e){return o("WAWebSyncdCollectionHandler").applyAppStateSyncResponse(e,t,l.get(e.name),h)}));h.end(),o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["syncd: end apply collections: ",""])),f.map(function(e){return e.name}));var b=[];return yield y.all(C.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.state===o("WASyncdConst").CollectionState.Conflict){var t=(yield o("WAWebGetPendingMutation").getSyncPendingMutationsByCollectionInTransaction(e.name)).length>0;t?b.push(e.name):(e.state=o("WASyncdConst").CollectionState.Success,g.push(e))}else e.state===o("WASyncdConst").CollectionState.ConflictHasMore||e.state===o("WASyncdConst").CollectionState.SuccessHasMore||e.state===o("WASyncdConst").CollectionState.Success&&i.some(function(t){return t===e.name})?b.push(e.name):g.push(e)});return function(t){return e.apply(this,arguments)}})())),{doneCollections:g,refetchCollections:b}}catch(n){if(n instanceof o("WAWebSyncdError").SyncdFatalError){o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: syncd global throws"]))).catching(n).sendLogs("syncd: fatal error: syncd global throws"),yield T(e,t+" moving to fatal state: "+n.name+" "+n.message+" "+n.stack);var v=e.map(function(e){return{state:o("WASyncdConst").CollectionState.ErrorFatal,name:e}});return{doneCollections:v,refetchCollections:[]}}o("WALogger").WARN(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: retryable error: syncd global throws ",""])),t,n.message).sendLogs("syncd: retryable error: syncd global throws "+n.message),yield T(e,"["+t+"] retryable error: "+n);var S=e.map(function(e){return{state:o("WASyncdConst").CollectionState.ErrorRetry,name:e,serverBackoff:n.errorBackoff}});return{doneCollections:S,refetchCollections:[]}}}),L.apply(this,arguments)}function E(e,t){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield r("WAWebSyncdRequestBuilder")(e,t),a=n.collectionsToSkip,i=n.collectionWithEncryptedMutations,l=n.collectionWithPendingMutationsIds,s=n.localCollectionVersions,u=n.syncIqNode;o("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(o("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.REQUEST_BUILT);var c="["+t+"] syncd: before sendIq for collections:\n "+e.map(function(e){var t,n,r;return"\n \n "+e+" v"+((t=s.get(e))!=null?t:"(undefined)")+" "+(((n=(r=l.get(e))==null?void 0:r.length)!=null?n:0)>0&&s.get(e)!=null?" with local changes":"")}).join(",")+"\n\n in flight: "+Array.from(o("WAWebSyncd").getInFlightCollections()).join(",")+"\n pending: "+Array.from(o("WAWebSyncd").getPendingCollections()).join(",")+"\n is worker? "+o("WAWebRuntimeEnvironmentUtils").isWorker().toString()+"\n ";o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: ",""])),t,c),yield T(e,c);var d=yield o("WADeprecatedSendIq").deprecatedSendIq(u,o("WAWebSyncdResponseParser").syncResponseParser);if(o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: completed network operation for collections:\n ",""])),t,e),o("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(o("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.RESPONSE_RECEIVED),d.success){o("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(o("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.RESPONSE_PARSED_VALID),yield T(e,"["+t+"] after sendIq success");var m=d.result;return o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: received sync response for collections:\n ",""])),t,m.map(function(e){var t="\n"+e.name;return e.version!=null&&(t+="\n updated to version "+e.version),e.snapshot!=null&&(t+="\n contains snapshot"),e.patches!=null&&(t+="\n contains "+e.patches.length+" patches"),t})),m.forEach(function(e){var t=l.get(e.name);t&&(e.syncedPendingMutationsId=t);var n=i.get(e.name);n&&(e.syncedEncryptedMutations=n)}),{collectionDetails:m,localCollectionVersions:s,collectionsToUpload:a}}var p=d.errorBackoff,_=d.errorCode,y=d.errorText;throw I(_,y,p)}),k.apply(this,arguments)}function I(e,t,n){e:{if(e===400){return o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_BAD_REQUEST_GLOBAL_ERROR),new(o("WAWebSyncdError")).SyncdFatalError(t);break e}if(e===404){return o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_NOT_FOUND_GLOBAL_ERROR),new(o("WAWebSyncdError")).SyncdFatalError(t);break e}if(e===405){return o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_BAD_METHOD_GLOBAL_ERROR),new(o("WAWebSyncdError")).SyncdFatalError(t);break e}if(e===406){return o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.XMPP_NOT_ACCEPTABLE_GLOBAL_ERROR),new(o("WAWebSyncdError")).SyncdFatalError(t);break e}return new(o("WAWebSyncdError")).SyncdRetryableError(t,n)}}function T(e,t){return(y||(y=n("Promise"))).all(e.map(function(e){return o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,t)}))}l.serverSync=v}),98); __d("WAWebMessageRangeUtils",["$InternalEnum","WALogger","WALongInt","WASyncdConst","WAWebApiActiveMessageRanges","WAWebDBMessageRange","WAWebProtobufSyncAction.pb","WAWebSchemaActiveMessageRanges","WAWebSyncdCoreApi","WAWebSyncdDb","WAWebSyncdUtils","WAWebTimestampConversionUtils","WAWebWamEnumMdSyncdCriticalEventCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","countWhere","decodeProtobuf"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=n("$InternalEnum").Mirrored(["RangeAEnclosesRangeB","RangeBEnclosesRangeA","RangesAreEqual","RangesNotEnclosing"]);function m(e,t){for(var n=new Set(e.messages.map(function(e){var t;return(t=e.key)==null?void 0:t.id})),r=0;ro("WALongInt").numberOrThrowIfTooLarge(r))&&(m.lastSystemMessageTimestamp=a,o("WAWebDBMessageRange").logMaybeMillisecondTimestamp(m.lastSystemMessageTimestamp,"lastSystemMessageTimestamp")),t.forOutgoingMutation&&m.lastMessageTimestamp==null){var p=yield o("WAWebDBMessageRange").getFirstSystemMessageTimestamp(e);p!=null&&(m.lastMessageTimestamp=p,o("WAWebDBMessageRange").logMaybeMillisecondTimestamp(m.lastMessageTimestamp,"firstSystemMessageTimestamp"),p===a&&(m.lastSystemMessageTimestamp=void 0))}if(t.forOutgoingMutation&&t.mutationIndexJid!=null)for(var _ of m.messages){var f;((f=_.key)==null?void 0:f.remoteJid)!=null&&(_.key.remoteJid=t.mutationIndexJid)}return m}),_.apply(this,arguments)}function f(e,t){var n=m(e,t),r=m(t,e);return n&&r?d.RangesAreEqual:n?d.RangeAEnclosesRangeB:r?d.RangeBEnclosesRangeA:d.RangesNotEnclosing}function g(e,t,n){var r=new Map,a=e.concat(t);return a.forEach(function(e){var t,a,i,l=(t=(a=e.key)==null?void 0:a.id)!=null?t:"";if(o("WALongInt").numberOrThrowIfTooLarge((i=e.timestamp)!=null?i:0)>=n){var s=r.get(l);if(s){var u,c;r.set(l,o("WALongInt").numberOrThrowIfTooLarge((u=s.timestamp)!=null?u:0)l)&&(u.lastSystemMessageTimestamp=m)}return u}var y=[[(c=o("WAWebWamEnumMdSyncdCriticalEventCode")).MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_LAST_SYSTEM_MESSAGE_TIMESTAMP_SET,function(e){var t=e.lastMessageTimestamp,n=e.lastSystemMessageTimestamp;return n!=null&&t!=null&&o("WALongInt").numberOrThrowIfTooLarge(n)1e3}]],C=[[c.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_UNSET,function(e){return e.key==null}],[c.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_UNSET,function(e){var t;return((t=e.key)==null?void 0:t.remoteJid)==null}],[c.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_FROM_ME_UNSET,function(e){var t;return((t=e.key)==null?void 0:t.fromMe)==null}],[c.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_STANZA_ID_UNSET,function(e){var t;return((t=e.key)==null?void 0:t.id)==null}],[c.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_INVALID,function(e){var t;return!o("WAWebWidFactory").isWidlike((t=e.key)==null?void 0:t.remoteJid)}],[c.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_PARTICIPANT_UNSET,function(e){var t,n,o;return r("WAWebWid").isGroup((t=e.key)==null?void 0:t.remoteJid)&&((n=e.key)==null?void 0:n.fromMe)!==!0&&((o=e.key)==null?void 0:o.participant)==null}]];function b(e){if(e==null){o("WAWebSyncdUtils").uploadCriticalEventMetric(o("WAWebWamEnumMdSyncdCriticalEventCode").MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_UNSET);return}for(var t of y){var n=t[0],r=t[1];if(r(e)){o("WAWebSyncdUtils").uploadCriticalEventMetric(n);return}}if(e.messages==null)return e;for(var a of e.messages)for(var i of C){var l=i[0],s=i[1];if(s(a)){o("WAWebSyncdUtils").uploadCriticalEventMetric(l);return}}return e}function v(e,t){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n,r=yield p(e,{forOutgoingMutation:!0,mutationIndexJid:t}),a=yield o("WAWebApiActiveMessageRanges").getActiveMessageRanges(e.toString());a.forEach(function(e){var t=e.actionValue.messageRange;t&&(o("WAWebDBMessageRange").logMaybeMillisecondTimestamp(t.lastMessageTimestamp,"activeRanges"),o("WAWebDBMessageRange").logMaybeMillisecondTimestamp(t.lastSystemMessageTimestamp,"activeRangesSystem"));e:{if(e.action===o("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredDeleteMedia||e.action===o("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatDeleteStarredKeepMedia||e.action===o("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredDeleteMedia||e.action===o("WAWebSchemaActiveMessageRanges").ActiveRangeAction.ClearChatKeepStarredKeepMedia||e.action===o("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatDeleteMedia||e.action===o("WAWebSchemaActiveMessageRanges").ActiveRangeAction.DeleteChatKeepMedia){var n=e.actionValue.messageRange;n&&(r=h(r,n));break e}if(e.action===o("WAWebSchemaActiveMessageRanges").ActiveRangeAction.Archive||e.action===o("WAWebSchemaActiveMessageRanges").ActiveRangeAction.MarkChatAsRead)break e;throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e.action)}}),o("WAWebDBMessageRange").logMaybeMillisecondTimestamp(r.lastMessageTimestamp,"intermediaForwardMovingRange");var i=yield R(e);return r.messages=g(r.messages,i,o("WALongInt").numberOrThrowIfTooLarge((n=r.lastMessageTimestamp)!=null?n:0)),r=o("WAWebDBMessageRange").fixMessageRange(r),o("WAWebDBMessageRange").logMaybeMillisecondTimestamp(r.lastMessageTimestamp,"forwardMovingRange"),r}),S.apply(this,arguments)}function R(e){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=[],r=yield o("WAWebSyncdDb").getSyncActionsRows(["action"],[o("WASyncdConst").Actions.DeleteMessageForMe]);return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: deleteForMeSyncActions length: ",""])),r.length),r.forEach(function(e){var r=t.toString({legacy:!0}),a=JSON.parse(e.index);if(a.length!==5)o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["constructForwardMovingMessageRange: delete for me mutation index malformed ",""])),e.index);else if(r===a[1]&&e.actionState===o("WASyncdConst").SyncActionState.Success){var i,l=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,e.binarySyncData).value,c=l==null||(i=l.deleteMessageForMeAction)==null?void 0:i.messageTimestamp;if(c==null)o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["constructForwardMovingMessageRange: deleteMessageForMeAction malformed"])));else{var d={remoteJid:a[1],id:a[2],fromMe:a[3]==="1",participant:a[4]!=="0"?a[4]:void 0};n.push({key:d,timestamp:o("WAWebTimestampConversionUtils").maybeMillisecondsToSeconds(c)})}}}),n}),L.apply(this,arguments)}function E(e,t){return babelHelpers.extends({},t,{messages:t.messages.map(function(t){return babelHelpers.extends({},t,{key:babelHelpers.extends({},t.key,{remoteJid:e.toString()})})})})}var k=function(t,n,r){return o("WAWebSyncdCoreApi").lockForSync([].concat(t,["message","active-message-ranges"]),n,r)};l.MessageRangeEncloseType=d,l.constructMessageRange=p,l.compareMessageRanges=f,l.mergeMessageRanges=h,l.validateMessageRange=b,l.constructForwardMovingMessageRange=v,l.replaceMessageRangeRemoteJid=E,l.lockForMessageRangeSync=k}),98); __d("WAWebSyncdGetChat",["WALogger","WASyncdConst","WAWebApiContact","WAWebLid1X1MigrationGating","WAWebSchemaChat","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&t.isLid()){var n,r=yield o("WAWebSchemaChat").getChatTable().equals(["accountLid"],t.toString(),{shouldDecrypt:!1});return r.length>0&&(n=r[0]),n==null?{success:!1,orphanModel:{modelId:t.toString(),modelType:o("WASyncdConst").SyncModelType.Account}}:(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: resolveChatForMutationIndex: found chat using accountLid query ",""])),t.toLogString()),{success:!0,chat:n})}var a=yield o("WAWebSchemaChat").getChatTable().get(t.toString(),!1);return a==null?{success:!1,orphanModel:{modelId:t.toString(),modelType:o("WASyncdConst").SyncModelType.Chat}}:(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: resolveChatForMutationIndex: found chat using chatId query ",""])),t.toLogString()),{success:!0,chat:a})}),m.apply(this,arguments)}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!e.isRegularUser())return e.toJid();var t=yield h(e);if(t==null)throw o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: getChatJidMutationIndexForChat: chat not found}"]))).sendLogs("syncd-missing-chat-outgoing-mutation"),r("err")("syncd-missing-chat-outgoing-mutation");return t}),_.apply(this,arguments)}function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!e.isRegularUser())return e.toJid();var t=yield h(e);if(t!=null)return t;var n=o("WAWebApiContact").getCurrentLid(o("WAWebWidFactory").asUserWidOrThrow(e));return n!=null?n.toJid():e.toJid()}),g.apply(this,arguments)}function h(e){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||e.isLid())return e.toJid();var t=yield o("WAWebSchemaChat").getChatTable().get(e.toString(),!1);if(t!=null){var n=t.accountLid;if(n==null)throw o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: getChatJidMutationIndexForChatImpl: accountLid not found in chat row}"]))).sendLogs("syncd-missing-accountLid-outgoing-mutation"),r("err")("syncd-missing-accountLid-outgoing-mutation");return n}}),y.apply(this,arguments)}l.resolveChatForMutationIndex=d,l.getChatJidMutationIndexForChat=p,l.getWidMutationIndexForWid=f}),98); __d("WAWebArchiveChatSync",["Promise","WALogger","WANullthrows","WASyncdConst","WAWebApiActiveMessageRanges","WAWebChatDbUpdatesApi","WAWebMessageRangeUtils","WAWebPinChatSync","WAWebProtobufSyncAction.pb","WAWebProtobufsServerSync.pb","WAWebSchemaChat","WAWebSettingsGetters","WAWebSettingsModel","WAWebSyncdAction","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g;function h(e,t){return t===o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual||t===o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB?{actionState:o("WASyncdConst").SyncActionState.Success}:t===o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA||t===o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing?{actionState:o("WASyncdConst").SyncActionState.Orphan,orphanModel:{modelType:o("WASyncdConst").SyncModelType.Chat,modelId:e.toString()}}:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+t)})()}var y=(function(t){function a(){for(var e,n=arguments.length,r=new Array(n),a=0;a0&&(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[syncd] before archive use case will update chat table"]))),yield o("WAWebChatDbUpdatesApi").setArchive(i),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[syncd] after archive use case updated chat table"])))),l});function a(e){return t.apply(this,arguments)}return a})(),i.$ArchiveChatSync$p_1=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){try{if(!e.isRegularUser())return;var n=yield o("WAWebSchemaChat").getChatTable().get(e.toString());n==null&&o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[syncd][archive-chat]: chat expected to exist ",". context: ",""])),e.toLogString(),t),(n==null?void 0:n.accountLid)==null&&o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[syncd][archive-chat]: chat expected to have accountLid ",". ",""])),e.toLogString(),t)}catch(e){o("WALogger").WARN(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[syncd][archive-chat]: error validating chat exists ",""])),e)}});function t(t,n){return e.apply(this,arguments)}return t})(),i.$ArchiveChatSync$p_2=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a){if(yield o("WAWebApiActiveMessageRanges").removeActiveMessageRange(e.toString(),o("WAWebApiActiveMessageRanges").getActiveRangeAction("archive")),!t)return{updates:{id:e.toString(),archive:t},syncApplyActionResult:{actionState:o("WASyncdConst").SyncActionState.Success}};var i=yield o("WAWebMessageRangeUtils").constructMessageRange(e,{forOutgoingMutation:!1}),l=o("WAWebMessageRangeUtils").compareMessageRanges(i,n),s=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,a).readBuffer(),u=function(){return o("WAWebApiActiveMessageRanges").addActiveMessageRange(e.toString(),o("WAWebApiActiveMessageRanges").getActiveRangeAction("archive"),s)},c=o("WAWebSettingsGetters").getShowArchiveV2(r("WAWebSettingsModel"));switch(l){case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:return yield u(),{updates:{id:e.toString(),archive:t},syncApplyActionResult:h(e,l)};case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:return c?{updates:{id:e.toString(),archive:t},syncApplyActionResult:h(e,l)}:(yield u(),{updates:void 0,syncApplyActionResult:h(e,l)})}});function t(t,n,r,o){return e.apply(this,arguments)}return t})(),i.getArchiveChatMutation=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield o("WAWebSyncdGetChat").getChatJidMutationIndexForChat(n),a={archiveChatAction:{archived:t,messageRange:yield o("WAWebMessageRangeUtils").constructMessageRange(n,{forOutgoingMutation:!0,mutationIndexJid:r})}};return o("WAWebSyncdActionUtils").buildPendingMutation({collection:this.collectionName,indexArgs:[r],value:a,version:this.getVersion(),operation:o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:e,action:this.getAction()})});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.getMutationsForArchive=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r){var a=[this.getArchiveChatMutation(e,t,r)];return t&&a.push(o("WAWebPinChatSync").PinChatSync.getPinMutation(e,!1,r)),(g||(g=n("Promise"))).all(a)});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.resolveConflicts=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,e.binarySyncAction),i=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,t.binarySyncData).value,l=e.timestamp,s=t.timestamp,u=r("WANullthrows")(a.archiveChatAction),c=r("WANullthrows")(i==null?void 0:i.archiveChatAction),d=o("WAWebMessageRangeUtils").compareMessageRanges(r("WANullthrows")(c.messageRange),r("WANullthrows")(u.messageRange));switch(d){case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:return o("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal;case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:return o("WASyncdConst").ConflictResolutionState.SkipRemote;case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:return l<=s?o("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal:o("WASyncdConst").ConflictResolutionState.SkipRemote;case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:{var m,p,g=l<=s?(m=c.archived)!=null?m:!1:(p=u.archived)!=null?p:!1,h=o("WAWebMessageRangeUtils").mergeMessageRanges(r("WANullthrows")(c.messageRange),r("WANullthrows")(u.messageRange)),y={archived:g,messageRange:h},C=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,babelHelpers.extends({},i,{archiveChatAction:y})).readBuffer(),b=babelHelpers.extends({},e,{binarySyncAction:C});return delete b.id,yield o("WAWebMessageRangeUtils").lockForMessageRangeSync(["chat"],[b],n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=JSON.parse(e.index),n=o("WAWebWidFactory").createWid(t[1]);o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[syncd] before update chat table due to conflict"]))),yield o("WAWebApiActiveMessageRanges").addActiveMessageRange(n.toString(),o("WAWebApiActiveMessageRanges").getActiveRangeAction("archive"),C);var r=yield o("WAWebChatDbUpdatesApi").setArchive([{id:n.toString(),archive:g}]);return o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[syncd] after update chat table due to conflict"]))),r})),o("WASyncdConst").ConflictResolutionState.SkipRemoteAndDropLocal}}});function t(t,n){return e.apply(this,arguments)}return t})(),a})(o("WAWebSyncdAction").ChatMessageRangeSyncdActionBase),C=new y;l.default=C}),98); __d("WAWebBotWelcomeRequestSync",["Promise","WALogger","WASyncdConst","WATimeUtils","WAWebChatCollection","WAWebDBUpdateChatTable","WAWebProtobufsServerSync.pb","WAWebSyncdAction","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c=(function(t){function r(){for(var e,n=arguments.length,r=new Array(n),a=0;a0&&(o("WAWebBackendApi").frontendFireAndForget("deleteModelsForLastAddOnPreview",{messagesIds:r}),yield o("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(o("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(e.toString(),r))),n&&n.deleteMessages(r)}else o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[syncd] before use case will update chat table ",""])),e.toLogString()),yield o("WAWebChatDeleteBridge").deleteFromStorage(e),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[syncd] after use case updated chat table ",""])),e.toLogString()),n&&n.delete();n&&o("WAWebBackendApi").frontendFireAndForget("deleteAiThreadsForChat",{chat:n}),o("WAWebNonMessageDataRequestHistorySyncOnDemandUtils").deleteChatFromInitialSyncBoundary(e)});function t(t,n){return e.apply(this,arguments)}return t})(),i.$DeleteChatSync$p_1=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){var a=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,r).readBuffer();yield o("WAWebApiActiveMessageRanges").addActiveMessageRange(e.toString(),o("WAWebApiActiveMessageRanges").getActiveRangeAction("deleteChat",{deleteMedia:n}),a);var i=yield o("WAWebMessageRangeUtils").constructMessageRange(e,{forOutgoingMutation:!1}),l=o("WAWebMessageRangeUtils").compareMessageRanges(i,t);e:{if(l===o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB||l===o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing){yield this.deleteChat(e,t);break e}if(l===o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA||l===o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual){yield this.deleteChat(e);break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+l)}return{actionState:o("WASyncdConst").SyncActionState.Success}});function t(t,n,r,o){return e.apply(this,arguments)}return t})(),i.getDeleteChatMutation=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){r("gkx")("26258")||new(o("WAWebMdSyncdDogfoodingFeatureUsageWamEvent")).MdSyncdDogfoodingFeatureUsageWamEvent({mdSyncdDogfoodingFeature:o("WAWebWamEnumMdFeatureCode").MD_FEATURE_CODE.DELETE_MUTATION}).commit();var a=yield o("WAWebSyncdGetChat").getChatJidMutationIndexForChat(t),i=o("WAWebWidFactory").createWid(a),l=yield o("WAWebMessageRangeUtils").constructForwardMovingMessageRange(t,a),s=o("WAWebSyncdActionUtils").buildIndex(this.getAction(),this.buildDeleteChatIndexArgs(o("WAWebWidFactory").createWid(a),n||!1)),u=yield o("WAWebSyncdDb").getPendingMutationsRowsByIndex(["index"],s);if(u.length){var c,d=u.reduce(function(e,t){return e.timestamp>t.timestamp?e:t}),m=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,d.binarySyncAction),p=(c=m.deleteChatAction)==null?void 0:c.messageRange;p&&(l=o("WAWebMessageRangeUtils").mergeMessageRanges(l,p),o("WAWebDBMessageRange").logMaybeMillisecondTimestamp(l.lastMessageTimestamp,"pendingMutationRange"))}return this.buildDeleteChatMutation({timestamp:e,indexWid:i,mergedRange:l,deleteMediaFiles:n||!1})});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.resolveConflicts=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a=this,i=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,e.binarySyncAction),l=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,t.binarySyncData).value,s=e.timestamp,u=t.timestamp,c=r("WANullthrows")(i.deleteChatAction),p=r("WANullthrows")(l==null?void 0:l.deleteChatAction),_=o("WAWebMessageRangeUtils").compareMessageRanges(r("WANullthrows")(p.messageRange),r("WANullthrows")(c.messageRange));switch(_){case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeAEnclosesRangeB:return o("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal;case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangeBEnclosesRangeA:return o("WASyncdConst").ConflictResolutionState.SkipRemote;case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesAreEqual:return s<=u?o("WASyncdConst").ConflictResolutionState.ApplyRemoteAndDropLocal:o("WASyncdConst").ConflictResolutionState.SkipRemote;case o("WAWebMessageRangeUtils").MessageRangeEncloseType.RangesNotEnclosing:{var f=o("WAWebMessageRangeUtils").mergeMessageRanges(r("WANullthrows")(p.messageRange),r("WANullthrows")(c.messageRange)),g={messageRange:f},h=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionValueSpec,babelHelpers.extends({},l,{deleteChatAction:g})).readBuffer(),y=babelHelpers.extends({},e,{binarySyncAction:h});return delete y.id,yield o("WAWebMessageRangeUtils").lockForMessageRangeSync(["message-association","chat"],[y],n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=JSON.parse(e.index),n=o("WAWebWidFactory").createWid(t[1]);o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[syncd] before update chat table due to conflict"]))),yield o("WAWebApiActiveMessageRanges").addActiveMessageRange(n.toString(),o("WAWebApiActiveMessageRanges").getActiveRangeAction("deleteChat",{deleteMedia:t[2]==="1"}),h);var r=yield a.deleteChat(n,f);return o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[syncd] after update chat table due to conflict"]))),r})),o("WASyncdConst").ConflictResolutionState.SkipRemoteAndDropLocal}}});function t(t,n){return e.apply(this,arguments)}return t})(),i.buildDeleteChatMutation=function(t){var e=t.deleteMediaFiles,n=t.indexWid,r=t.mergedRange,a=t.timestamp,i={deleteChatAction:{messageRange:r}};return o("WAWebSyncdActionUtils").buildPendingMutation({collection:this.collectionName,indexArgs:this.buildDeleteChatIndexArgs(n,e),value:i,version:this.getVersion(),operation:o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:a,action:this.getAction()})},i.buildDeleteChatIndexArgs=function(t,n){return[t.toJid(),n?"1":"0"]},a})(o("WAWebSyncdAction").ChatMessageRangeSyncdActionBase),f=new _;l.default=f}),98); __d("WAWebDBFavoriteDatabaseApi",["WAWebLidMigrationDbUtils","WAWebSchemaFavorite","WAWebUserPrefsFavoritesLidMigration","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()?yield C(e):e;yield o("WAWebSchemaFavorite").getFavoriteTable().bulkCreateOrReplace(t)}),s.apply(this,arguments)}function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()?yield C(e):e;yield o("WAWebSchemaFavorite").getFavoriteTable().clear(),yield o("WAWebSchemaFavorite").getFavoriteTable().bulkCreateOrReplace(t)}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()?[].concat(yield h(e),e):e;yield o("WAWebSchemaFavorite").getFavoriteTable().bulkRemove(t)}),m.apply(this,arguments)}function p(){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSchemaFavorite").getFavoriteTable().all();if(e.length===0)return 0;var t=Math.max.apply(Math,e.map(function(e){var t=e.orderIndex;return t}));return t+1}),_.apply(this,arguments)}function f(){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSchemaFavorite").getFavoriteTable().all();return o("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()?v(e):e}),g.apply(this,arguments)}function h(e){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebLidMigrationDbUtils").findAccountLidsForPnChatIds(e);return e.map(function(e){var n;return(n=t.get(e))!=null?n:e})}),y.apply(this,arguments)}function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebLidMigrationDbUtils").findAccountLidsForPnChatIds(e.map(function(e){return e.id}));return e.map(function(e){var n;return babelHelpers.extends({},e,{id:(n=t.get(e.id))!=null?n:e.id})})}),b.apply(this,arguments)}function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebLidMigrationDbUtils").findChatIdsForAccountLids(e.map(function(e){return e.id}));return e.map(function(e){var n;return babelHelpers.extends({},e,{id:(n=t.get(e.id))!=null?n:e.id})})}),S.apply(this,arguments)}l.addOrEditFavorites=e,l.setFavorites=u,l.removeFavorites=d,l.getNextFavoriteOrderIndex=p,l.getAllFavorites=f}),98); __d("WAWebFavoritesSync",["Promise","WALogger","WASyncdConst","WAWebApiContact","WAWebDBFavoriteDatabaseApi","WAWebFavoriteCollection","WAWebLid1X1MigrationGating","WAWebProtobufsServerSync.pb","WAWebSyncdAction","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=(function(t){function r(){for(var e,n=arguments.length,r=new Array(n),a=0;ai.timestamp)&&(i=t),{actionState:o("WASyncdConst").SyncActionState.Success})}),d=(a=i)==null||(a=a.value.favoritesAction)==null?void 0:a.favorites;if(d!=null){var m=0,p=d.reduce(function(e,t){var n=t.id;return n!=null&&e.push({id:n,orderIndex:m++}),e},[]),_=0,f=yield(c||(c=n("Promise"))).all(p.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebSyncdGetChat").resolveChatForMutationIndex(o("WAWebWidFactory").createWid(e.id));if(t.success===!0)return _++,{orderIndex:e.orderIndex,id:t.chat.id};t.success;var n=o("WAWebWidFactory").createWid(e.id);if(o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&n.isLid()){var r=o("WAWebApiContact").getPhoneNumber(n);if(r!=null)return{orderIndex:e.orderIndex,id:r.toString()}}return{orderIndex:e.orderIndex,id:e.id}});return function(t){return e.apply(this,arguments)}})()));yield o("WAWebDBFavoriteDatabaseApi").setFavorites(f),o("WAWebFavoriteCollection").FavoriteCollection.set(f.map(function(e){return{id:e.id,orderIndex:e.orderIndex}})),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Favorites sync: successfully set favorites. Resolved chats: "," of total ",""])),_,f.length)}return l});function r(e){return t.apply(this,arguments)}return r})(),a.getFavoritesMutation=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var r=e.map(function(e){return{orderIndex:e.orderIndex,wid:o("WAWebWidFactory").createWid(e.id)}}),a=yield(c||(c=n("Promise"))).all(r.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return babelHelpers.extends({},e,{mutationIndex:yield o("WAWebSyncdGetChat").getWidMutationIndexForWid(e.wid)})});return function(t){return e.apply(this,arguments)}})()));return o("WAWebSyncdActionUtils").buildPendingMutation({collection:this.collectionName,indexArgs:[],operation:o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET,version:this.getVersion(),timestamp:t,action:this.getAction(),value:{favoritesAction:{favorites:a.sort(function(e,t){return e.orderIndex-t.orderIndex}).map(function(e){var t=e.mutationIndex;return{id:t}})}}})});function t(t,n){return e.apply(this,arguments)}return t})(),r})(o("WAWebSyncdAction").AccountSyncdActionBase),m=new d;l.default=m}),98); __d("WAWebListItemParentType",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum").Mirrored(["Chat","Contact","Msg"]);i.LabelItemParentType=e}),66); __d("WAWebLabelJidSync",["Promise","WALogger","WASyncdConst","WATimeUtils","WAWebApiContact","WAWebBizGatingUtils","WAWebBizLabelUtils","WAWebCTWAConstants","WAWebContactSystemMsg","WAWebDBLabelAssociationDatabaseApi","WAWebHandleSingleMsg","WAWebLid1X1MigrationGating","WAWebListItemParentType","WAWebMsgType","WAWebProtobufsServerSync.pb","WAWebSchemaChat","WAWebSchemaLabel","WAWebSchemaLabelAssociation","WAWebSyncdAction","WAWebSyncdActionUtils","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebUserPrefsGeneral","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c=(function(t){function a(){for(var e,n=arguments.length,r=new Array(n),a=0;a0&&fo("WATimeUtils").unixTimeMs()?y=Math.floor(h/1e3):h>0?y=0:y=h);var C={muteExpiration:g};r("WAWebWid").isGroup(o("WAWebWidFactory").createWid(_))&&y!=null&&(C.mentionAllMuteExpiration=y),yield o("WAWebSchemaChat").getChatTable().merge(_,C);var b={id:o("WAWebWidFactory").createWid(_),expiration:g};return r("WAWebWid").isGroup(o("WAWebWidFactory").createWid(_))&&y!=null&&(b.mentionAllMuteExpiration=y),o("WAWebMuteCollection").MuteCollection.add(b,{merge:!0}),{actionState:o("WASyncdConst").SyncActionState.Success}}return o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["mute chat sync: operation not supported"]))),{actionState:o("WASyncdConst").SyncActionState.Unsupported}}catch(e){return{actionState:o("WASyncdConst").SyncActionState.Failed}}});return function(e){return a.apply(this,arguments)}})()))},i.generateMuteMutation=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a=t!==void 0&&t!==0,i=o("WATimeUtils").unixTimeMs(),l=t;l!==c&&(l*=1e3);var s={muted:a,muteEndTimestamp:l};r("WAWebWid").isGroup(e)&&n!=null&&o("WAWebABProps").getABPropConfigValue("enable_mention_everyone_syncd_sender")&&(n>0?s.muteEveryoneMentionEndTimestamp=n*1e3:s.muteEveryoneMentionEndTimestamp=n);var u={muteAction:s};return o("WAWebSyncdActionUtils").buildPendingMutation({collection:this.collectionName,indexArgs:[yield o("WAWebSyncdGetChat").getChatJidMutationIndexForChat(e)],operation:o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET,version:this.getVersion(),value:u,timestamp:i,action:this.getAction()})});function t(t,n,r){return e.apply(this,arguments)}return t})(),a})(o("WAWebSyncdAction").ChatSyncdActionBase),m=new d;l.default=m}),98); __d("WAWebPinChatSync",["$InternalEnum","Promise","WALogger","WALongInt","WANullthrows","WASyncdConst","WATimeUtils","WAWebAndroidUnsupportedActionsSync","WAWebArchiveChatSync","WAWebChatGetExistingBridge","WAWebChatPinBridge","WAWebMdSyncdDogfoodingFeatureUsageWamEvent","WAWebProtobufSyncAction.pb","WAWebProtobufsServerSync.pb","WAWebSchemaChat","WAWebSyncdAction","WAWebSyncdActionUtils","WAWebSyncdCoreApi","WAWebSyncdDb","WAWebSyncdGetChat","WAWebSyncdIndexUtils","WAWebWamEnumMdFeatureCode","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","compactMap","decodeProtobuf","gkx"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m=3,p=r("gkx")("20621")?20:m,_=2;function f(e){return e===g.Chat?function(e){return!r("WAWebWid").isNewsletter(e)}:e===g.Newsletter?function(e){return r("WAWebWid").isNewsletter(e)}:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}var g=n("$InternalEnum").Mirrored(["Chat","Newsletter"]),h=(function(t){function a(){for(var e,n=arguments.length,r=new Array(n),a=0;a0}).map(function(e){return[e.id,r("WANullthrows")(e.pin)]})}),a=o("WAWebSyncdDb").getSyncActionsRows(["action"],[o("WASyncdConst").Actions.Pin]).then(function(e){var t=e.filter(function(e){return e.actionState===o("WASyncdConst").SyncActionState.Orphan});return r("compactMap")(t,function(e){var t,n=JSON.parse(e.index);if(n.length<2)return null;var r=n[1],a=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,e.binarySyncData).value;return(a==null?void 0:a.pinAction)==null||(a==null?void 0:a.pinAction.pinned)!==!0?null:[r,o("WALongInt").numberOrThrowIfTooLarge((t=a.timestamp)!=null?t:0)]})}),i=yield(d||(d=n("Promise"))).all([t,a]),l=i[0],s=i[1],u=f(e);return[].concat(l,s).filter(function(e){var t=e[0];return u(t)}).map(function(e){var t=e[0],n=e[1];return{chatId:o("WAWebWidFactory").createWid(t),timestamp:n}})});function t(t){return e.apply(this,arguments)}return t})(),i.unpinAllChats=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return this.$PinChatSyncImpl$p_2(yield this.getLocalChatPins())});function t(){return e.apply(this,arguments)}return t})(),i.unpinAllNewsletters=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return this.$PinChatSyncImpl$p_2(yield this.getLocalNewsletterPins())});function t(){return e.apply(this,arguments)}return t})(),i.$PinChatSyncImpl$p_2=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this,r=o("WATimeUtils").unixTimeMs(),a=yield(d||(d=n("Promise"))).all(e.map(function(e){var n=e.chatId;return t.getPinMutation(r,!1,n)}));return o("WAWebSyncdCoreApi").lockForSync(["chat"],a,function(){return(d||(d=n("Promise"))).resolve()}).then(function(){return t.applyUpdates(e.map(function(e){var t=e.chatId;return{wid:t,pinned:!1,timestamp:r}}))})});function t(t){return e.apply(this,arguments)}return t})(),i.getMutationsForPin=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){r("gkx")("26258")||new(o("WAWebMdSyncdDogfoodingFeatureUsageWamEvent")).MdSyncdDogfoodingFeatureUsageWamEvent({mdSyncdDogfoodingFeature:o("WAWebWamEnumMdFeatureCode").MD_FEATURE_CODE.PIN_MUTATION}).commit();var a=[yield this.getPinMutation(e,t,n)];return t&&a.push(yield r("WAWebArchiveChatSync").getArchiveChatMutation(e,!1,n)),a});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.getPinMutation=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r={pinAction:{pinned:t}};return o("WAWebSyncdActionUtils").buildPendingMutation({collection:this.collectionName,indexArgs:[yield o("WAWebSyncdGetChat").getChatJidMutationIndexForChat(n)],value:r,version:this.getVersion(),operation:o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET,timestamp:e,action:this.getAction()})});function t(t,n,r){return e.apply(this,arguments)}return t})(),a})(o("WAWebSyncdAction").ChatSyncdActionBase),y=new h;l.MAX_PINNED_CHATS=m,l.MAX_PINNED_CHATS_AURA=p,l.MAX_PINNED_NEWSLETTERS=_,l.PinChatSync=y}),98); __d("WAWebSentinelMutationSync",["Promise","WALogger","WASyncdConst","WATagsLogger","WATimeUtils","WAWebGetSyncKey","WAWebProtobufsServerSync.pb","WAWebSyncdAction","WAWebSyncdActionUtils","WAWebSyncdIndexUtils","WAWebSyncdKeyManagement","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p=o("WATagsLogger").TAGS(["syncd","SentinelMutationSync"]),_=(function(t){function r(){for(var e,n=arguments.length,r=new Array(n),a=0;a0&&l)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.PATCH_WITH_BOTH_INLINE_AND_EXTERNAL_MUTATIONS,{collection:n}),new(o("WAWebSyncdError")).SyncdFatalError("patch with both inline and external mutations");if(!d)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_PATCH_SNAPSHOT_MAC,{collection:n}),new(o("WAWebSyncdError")).SyncdFatalError("missing patch snapshot mac");if(!c)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_PATCH_MAC,{collection:n}),new(o("WAWebSyncdError")).SyncdFatalError("missing patch mac");var _=e.validateKeyIdProtobuf(n,s,o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_PATCH_KEY_ID),f=void 0;if(t!=null&&(f=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").PatchDebugDataSpec,t)),l){var g=e.validateExternalBlobReference(n,l);return{version:{version:o("WALongInt").numberOrThrowIfTooLarge(p)},mutations:void 0,externalMutations:g,snapshotMac:d,patchMac:c,keyId:_,deviceIndex:a,clientDebugData:f}}var h=u.map(function(t){return e.validateMutationProtobuf(n,t)});return{version:{version:o("WALongInt").numberOrThrowIfTooLarge(p)},mutations:h,externalMutations:void 0,exitCode:i,snapshotMac:d,patchMac:c,keyId:_,deviceIndex:a,clientDebugData:f}},e.validateExternalBlobReference=function(t,n){var e=n.directPath,r=n.fileEncSha256,a=n.fileSha256,i=n.fileSizeBytes,l=n.handle,s=n.mediaKey;if(!s)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_MEDIA_KEY,{collection:t}),new(o("WAWebSyncdError")).SyncdFatalError("missing external blob reference media key");if(e==null)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_DIRECT_PATH,{collection:t}),new(o("WAWebSyncdError")).SyncdFatalError("missing external blob reference direct path");if(!a)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_SHA256,{collection:t}),new(o("WAWebSyncdError")).SyncdFatalError("missing external blob reference file SHA256");if(!r)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_ENC_SHA256,{collection:t}),new(o("WAWebSyncdError")).SyncdFatalError("missing external blob reference file enc SHA256");return{mediaKey:s,directPath:e,handle:l,fileSizeBytes:i,fileSha256:a,fileEncSha256:r}},e.validateMutationProtobuf=function(n,r){var t=r.operation,a=r.record;if(t==null)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_OPERATION,{collection:n}),new(o("WAWebSyncdError")).SyncdFatalError("missing mutation operation");if(!a)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_RECORD,{collection:n}),new(o("WAWebSyncdError")).SyncdFatalError("missing mutation record");var i=e.validateRecordProtobuf(n,a);return{operation:t,record:i}},e.validateRecordProtobuf=function(n,r){var t=r.index,a=r.keyId,i=r.value,l=t==null?void 0:t.blob,s=i==null?void 0:i.blob;if(!t||!l)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_INDEX,{collection:n}),new(o("WAWebSyncdError")).SyncdFatalError("missing mutation index");if(!i||!s)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_VALUE,{collection:n}),new(o("WAWebSyncdError")).SyncdFatalError("missing mutation value");var u=e.validateKeyIdProtobuf(n,a,o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.MISSING_MUTATION_KEY_ID);return{index:{blob:l},value:{blob:s},keyId:u}},e.validateKeyIdProtobuf=function(t,n,r){var e=n==null?void 0:n.id;if(!n||!e)throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(r,{collection:t}),new(o("WAWebSyncdError")).SyncdFatalError("missing mutation key id");return{id:o("WASyncdKeyTypes").toSyncKeyId(e)}},e})();l.default=e}),98); __d("WAWebWamEnumMutationBundleType",[],(function(t,n,r,o,a,i){var e=Object.freeze({SNAPSHOT:0,PATCH:1});i.MUTATION_BUNDLE_TYPE=e}),66); __d("WAWebWamEnumMutationDirectionType",[],(function(t,n,r,o,a,i){var e=Object.freeze({INCOMING:0,OUTGOING:1});i.MUTATION_DIRECTION_TYPE=e}),66); __d("WAWebWamEnumMutationOperationType",[],(function(t,n,r,o,a,i){var e=Object.freeze({SET:0,REMOVE:1});i.MUTATION_OPERATION_TYPE=e}),66); __d("WAWebWamEnumSyncdCollectionType",[],(function(t,n,r,o,a,i){var e=Object.freeze({REGULAR:1,REGULAR_LOW:2,REGULAR_HIGH:3,CRITICAL_BLOCK:4,CRITICAL_UNBLOCK_LOW:5});i.SYNCD_COLLECTION_TYPE=e}),66); __d("WAWebMdSyncdMutationWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMutationBundleType","WAWebWamEnumMutationDirectionType","WAWebWamEnumMutationOperationType","WAWebWamEnumSyncdCollectionType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({MdSyncdMutation:[5970,{appSessionId:[1,e.TYPES.STRING],companionSessionIds:[2,e.TYPES.STRING],contentLength:[3,e.TYPES.INTEGER],isInBootstrap:[4,e.TYPES.BOOLEAN],isUsingLid:[5,e.TYPES.BOOLEAN],mutationBundle:[6,o("WAWebWamEnumMutationBundleType").MUTATION_BUNDLE_TYPE],mutationDirection:[7,o("WAWebWamEnumMutationDirectionType").MUTATION_DIRECTION_TYPE],mutationMac:[8,e.TYPES.STRING],mutationName:[9,e.TYPES.STRING],mutationOperation:[10,o("WAWebWamEnumMutationOperationType").MUTATION_OPERATION_TYPE],patchMac:[15,e.TYPES.STRING],seqNumber:[11,e.TYPES.INTEGER],syncdCollection:[12,o("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE],syncdKeyhash:[13,e.TYPES.STRING],syncdKeyid:[14,e.TYPES.STRING]},[1,1,1],"regular"]},{MdSyncdMutation:[]});l.MdSyncdMutationWamEvent=s}),98); __d("WAWebSyncdWamReportingUtils",["WALogger","WASyncdConst","WAWebABProps","WAWebMdSyncdMutationWamEvent","WAWebWamEnumMutationBundleType","WAWebWamEnumMutationDirectionType","WAWebWamEnumMutationOperationType","WAWebWamEnumSyncdCollectionType","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return e===o("WASyncdConst").CollectionName.RegularHigh?o("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.REGULAR_HIGH:e===o("WASyncdConst").CollectionName.RegularLow?o("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.REGULAR_LOW:e===o("WASyncdConst").CollectionName.Regular?o("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.REGULAR:e===o("WASyncdConst").CollectionName.CriticalBlock?o("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.CRITICAL_BLOCK:e===o("WASyncdConst").CollectionName.CriticalUnblockLow?o("WAWebWamEnumSyncdCollectionType").SYNCD_COLLECTION_TYPE.CRITICAL_UNBLOCK_LOW:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}function u(e,t,n,r,o,a,i,l,s){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r,a,i,l,u,c,d){try{var m=o("WAWebABProps").getABPropConfigValue("syncd_mutation_and_bundle_logging");if(!m)return;var p=JSON.parse(m);if(!p||!p.allowlist||!p.allowlist.includes(t))return;new(o("WAWebMdSyncdMutationWamEvent")).MdSyncdMutationWamEvent({appSessionId:"",companionSessionIds:c,contentLength:0,isInBootstrap:!1,isUsingLid:!1,mutationBundle:u?o("WAWebWamEnumMutationBundleType").MUTATION_BUNDLE_TYPE.PATCH:o("WAWebWamEnumMutationBundleType").MUTATION_BUNDLE_TYPE.SNAPSHOT,mutationDirection:r?o("WAWebWamEnumMutationDirectionType").MUTATION_DIRECTION_TYPE.INCOMING:o("WAWebWamEnumMutationDirectionType").MUTATION_DIRECTION_TYPE.OUTGOING,mutationMac:a,mutationName:i,mutationOperation:l?o("WAWebWamEnumMutationOperationType").MUTATION_OPERATION_TYPE.REMOVE:o("WAWebWamEnumMutationOperationType").MUTATION_OPERATION_TYPE.SET,seqNumber:n,syncdCollection:s(t),syncdKeyhash:"",syncdKeyid:"",patchMac:d!=null?d:""}).commit()}catch(t){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncReportMutationToWam: ",""])),t).sendLogs("syncReportMutationToWam failed")}}),c.apply(this,arguments)}l.syncReportMutationToWam=u}),98); __d("WAWebSyncdCollectionHandler",["Promise","WABase64","WACryptoDependencies","WACryptoUtils","WALogger","WALongInt","WANullthrows","WASyncdConst","WASyncdKeyTypes","WATimeUtils","WAWebABProps","WAWebCurrentUser","WAWebGetCollectionVersion","WAWebGetMissingKey","WAWebGetPendingMutation","WAWebGetSyncAction","WAWebProtobufSyncAction.pb","WAWebProtobufsServerSync.pb","WAWebRequestSyncdSnapshotRecovery","WAWebRunInTransaction","WAWebSyncdAntiTampering","WAWebSyncdCollectionHandlerTypesConverter","WAWebSyncdCollectionUtils","WAWebSyncdCriticalBootstrapProcessingApi","WAWebSyncdCryptoUtils","WAWebSyncdDbCallbacksApi","WAWebSyncdDecryptMutationsWrapper","WAWebSyncdError","WAWebSyncdGetActionHandler","WAWebSyncdHandleMissingKeys","WAWebSyncdMMSDownload","WAWebSyncdMdSyncFieldstatMeta","WAWebSyncdMetricCriticalBootstrapStage","WAWebSyncdMetricFatalError","WAWebSyncdMetrics","WAWebSyncdResolveConflict","WAWebSyncdSnapshotRecoveryGatingUtils","WAWebSyncdUtils","WAWebSyncdValidateMutations","WAWebSyncdValidateServerSyncProtobuf","WAWebSyncdWamAppState","WAWebSyncdWamReportingUtils","WAWebWamEnumBootstrapAppStateDataStageCode","asyncToGeneratorRuntime","compactMap","decodeProtobuf","err","getErrorSafe","gkx","sumBy"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T,D,x,$,P,N,M,w,A,F,O,B,W,q,U,V,H,G,z,j,K,Q,X,Y,J,Z,ee,te,ne,re,oe,ae,ie,le,se,ue,ce,de,me,pe,_e,fe,ge,he,ye,Ce,be,ve,Se,Re,Le=0,Ee=new ArrayBuffer(128),ke=null;function Ie(){return Te.apply(this,arguments)}function Te(){return Te=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{if(ke!=null)return ke;var e=yield o("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId(),t=o("WABase64").decodeB64(e),n=yield o("WACryptoDependencies").getCrypto().subtle.digest({name:"SHA-1"},t),r=o("WABase64").encodeB64UrlSafe(n);return ke=r.slice(-6),ke}catch(e){return o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["getShortMdSessionId: ",""])),e).sendLogs("getShortMdSessionId failed"),""}}),Te.apply(this,arguments)}function De(e){return xe.apply(this,arguments)}function xe(){return xe=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.length===0)return(Re||(Re=n("Promise"))).resolve();var t=Math.random().toString(36).substr(2,5),r=e.sort(function(e,t){return e.timestamp-t.timestamp});o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["syncd: start applyIndividualMutations"])));var a=o("WAWebSyncdCollectionHandlerTypesConverter").syncActionsToDecryptedMutation(r),i=a.reduce(function(e,t){var n,r=(n=e.get(t.collection))!=null?n:[];return r.push(t),e.set(t.collection,r),e},new Map),l=Array.from(i.keys(),(function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(r){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose([""," syncd: apply individual mutations for collection ",""])),t,r);var a=i.get(r);if(a!==void 0){var l=yield Ze(r,a,o("WASyncdConst").SyncDataType.Local,t,null,null),s=l.pendingSetMutationsToDrop,u=l.setMutationsToPersist,c=u.map(function(e){return{actionState:e.actionState,index:e.index,modelId:e.modelId,modelType:e.modelType}}),d=c;o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: filter individual mutations for collection ",", mutations: ",", mutationsWithoutMacs: ",""])),t,r,e.length,c.length),d=c.filter(function(t){var n=e.find(function(e){return e.index===t.index});return n==null?(o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["syncd: could not find original individual mutation"]))).sendLogs("syncd: could not find original individual mutation"),!0):t.actionState!==n.actionState||t.modelId!==n.modelId||t.modelType!==n.modelType}),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: end apply individual mutations for collection ",""])),t,r),yield o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,PendingMutationStore:!0},(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.PendingMutationStore,n=e.SyncActionStore;d.length>0&&(yield n.bulkUpdate(d)),s.length>0&&(yield t.bulkRemove(s))});return function(t){return e.apply(this,arguments)}})()),o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose([""," syncd: end update db after apply individual mutations for collection ",""])),t,r)}});return function(e){return r.apply(this,arguments)}})());yield(Re||(Re=n("Promise"))).all(l),o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose([""," syncd: end applyIndividualMutations"])),t)}),xe.apply(this,arguments)}function $e(e,t,n,r){return Pe.apply(this,arguments)}function Pe(){return Pe=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a){var i=e.name,l=e.patches,s=e.snapshot,u=e.syncedEncryptedMutations,c=e.syncedPendingMutationsId,d=e.version;o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: start applying collection ",""])),t,i);try{var m,p;a==null||a.mark("external_mutations_download_start",{patchCount:(m=e.patches)==null?void 0:m.length,snapshotSizeBytes:(p=e.snapshot)==null?void 0:p.fileSizeBytes});var _=yield Be(i,l,s,n),f=_[0],g=_[1];a==null||a.mark("external_mutations_download_end",{patchesWithMutationsCount:g==null?void 0:g.length,snapshotRecordsCount:f==null?void 0:f.records.length});var h=performance.now();if(f!=null)yield Ve(i,f,g,a,t),o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: "," snapshot and patches applied successfully"])),t,i);else if(g!=null){var y=Math.min.apply(Math,g.map(function(e){return e.version.version})),$=n!=null&&y>n+1&&g.length>0;if($){yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(i,t+" has missing patches");var P=yield o("WAWebGetMissingKey").getAllMissingKeysInTransaction();throw o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose([""," syncd: missing keys: [","]"])),t,P.map(function(e){return e.keyHex+":"+e.timestamp})),o("WALogger").LOG(S||(S=babelHelpers.taggedTemplateLiteralLoose([""," syncd: has missing patches. collection: ",", localVersion: ",",\n minPatch: ",""])),t,i,n,y),yield Ne(i,g[0]),yield o("WAWebSyncdDbCallbacksApi").printSyncdLog(i),o("WALogger").ERROR(R||(R=babelHelpers.taggedTemplateLiteralLoose([""," syncd: has missing patches. collection: ",""])),t,i).sendLogs("syncd: has missing patches"),o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.SERVER_DID_NOT_SEND_ALL_PATCHES,{collection:i,patchVersion:n!=null?n:0}),new(o("WAWebSyncdError")).SyncdFatalError("syncd: has missing patches")}yield je(i,g,a,t),o("WALogger").LOG(L||(L=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: "," patches applied successfully"])),t,i)}else if(d!=null){var N=u.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}).length,M=u.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE}).length,w=Array.from(new Set(u.map(function(e){return e.index}))).length;yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(i,t+" start upload patch. version: "+d+". mutation count: "+u.length+",\n numSet: "+N+", numRemove: "+M+", numUniqueIndex: "+w),yield we(i,d,c,u,t);var A=yield Ie();u.forEach(function(e){var t=o("WAWebSyncdUtils").getMutationNameFromIndex(e.index);o("WAWebSyncdWamReportingUtils").syncReportMutationToWam(i,d,!1,o("WABase64").encodeB64UrlSafe(e.indexMac),t,e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE,!0,A,e.patchMac?o("WABase64").encodeB64UrlSafe(e.patchMac):void 0)}),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(i,t+" end upload patches"),o("WALogger").LOG(E||(E=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: "," v"," uploaded successfully"])),t,i,d)}else o("WAWebSyncdCollectionUtils").isBootstrap(n)&&(yield o("WAWebGetCollectionVersion").updateCollectionVersionAndLtHashInTransaction(i,Le,Ee)),o("WALogger").LOG(k||(k=babelHelpers.taggedTemplateLiteralLoose(["syncd: sync "," but there are no updates"])),i);var F=Math.floor(performance.now()-h);if(o("WALogger").LOG(I||(I=babelHelpers.taggedTemplateLiteralLoose(["syncd: applyAppStateSyncResponse: finished applying "," in ","ms"])),i,F),(g||f)&&o("WAWebSyncdCollectionUtils").isBootstrap(n)&&!o("WAWebSyncdCollectionUtils").isCriticalCollection(i)){var O=f!=null;o("WAWebSyncdMetrics").reportSyncdBootstrapDataApplied(i,O?o("WAWebSyncdMetrics").SyncdBootstrapDataAppliedSnapshotUsed.SNAPSHOT_USED:o("WAWebSyncdMetrics").SyncdBootstrapDataAppliedSnapshotUsed.SNAPSHOT_NOT_USED,F)}return e}catch(e){var B=r("getErrorSafe")(e).message;return yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(i,"error (maybe retryable): "+B),e instanceof o("WAWebSyncdError").SyncdMissingKeyError?(o("WALogger").WARN(T||(T=babelHelpers.taggedTemplateLiteralLoose(["syncd: key error: "," missing keys"])),i),{name:i,state:o("WASyncdConst").CollectionState.Blocked}):e instanceof o("WAWebSyncdError").SyncdFatalError?(o("WALogger").ERROR(D||(D=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error: "," throws ",""])),i,B).sendLogs("syncd: fatal error: "+String(i)+" throws "+B),{name:i,state:o("WASyncdConst").CollectionState.ErrorFatal}):(o("WALogger").WARN(x||(x=babelHelpers.taggedTemplateLiteralLoose(["syncd: retryable error: "," throws ",""])),i,B).sendLogs("syncd: retryable error: "+String(i)+" throws "+B),{name:i,state:o("WASyncdConst").CollectionState.ErrorRetry})}}),Pe.apply(this,arguments)}function Ne(e,t){return Me.apply(this,arguments)}function Me(){return Me=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){try{var n=yield o("WAWebSyncdDecryptMutationsWrapper").tryDecryptPatch(e,t),r=n.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}),a=o("WAWebSyncdValidateMutations").validateAndTypeSetMutations(e,r),i=a.length>0?a[0].timestamp:null,l=i==null?null:o("WATimeUtils").daysDiff(o("WATimeUtils").unixTimeMs(),i);yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"max timestamp in first patch: "+(l!=null?l:"n/a")+" days ago")}catch(e){o("WALogger").WARN($||($=babelHelpers.taggedTemplateLiteralLoose(["syncd: could not log max timestamp: ",""])),e)}}),Me.apply(this,arguments)}function we(e,t,n,r,o){return Ae.apply(this,arguments)}function Ae(){return Ae=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a,i){var l,s=a.map(function(e){return{indexMac:e.indexMac,valueMac:e.valueMac,operation:e.operation}});yield Fe(i,e,a,s);var u=yield o("WAWebSyncdAntiTampering").computeLtHash(e,s,i,null,t,o("WAWebSyncdAntiTampering").SyncdPatchDirection.Outgoing),c=u.ltHash,d=o("WAWebSyncdCollectionHandlerTypesConverter").encryptedUploadMutationsToSyncActions(a.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}),o("WASyncdConst").SyncActionState.Success);yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+i+"] set mutation during upload: "+d.map(function(e){return o("WAWebSyncdAntiTampering").indexAndValueMacToString(e.indexMac,e.valueMac)}).join("\n "));var m=new Set(d.map(function(e){return e.index})),p=a.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE&&!m.has(e.index)}).map(function(e){return e.index});yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+i+"] count removed during upload: "+p.length);var _=(l=yield o("WAWebGetCollectionVersion").getCollectionVersionInTransaction(e).then(function(e){return e==null?void 0:e.version}))!=null?l:0;t!==_+1&&o("WALogger").ERROR(P||(P=babelHelpers.taggedTemplateLiteralLoose(["syncd: _uploadSuccessful: unexpected server version (",") after patch upload, expected ",""])),t,_+1).sendLogs("syncd: unexpected server version after patch upload"),o("WALogger").LOG(N||(N=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: _uploadSuccessful: write to db for ",""])),i,e),yield o("WAWebSyncdAntiTampering").logMacsInSnapshot(e,i,"pre-processing outgoing patch v"+t),yield o("WAWebSyncdAntiTampering").reportCollectionInconsistency(e,"pre-processing outgoing patch "+t+".",i),yield Qe(e,t,a,i);var f=null;if(yield o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,PendingMutationStore:!0,CollectionVersionStore:!0},(function(){var a=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n){var a=n.CollectionVersionStore,l=n.PendingMutationStore,s=n.SyncActionStore;f=yield st(e,t,"outgoing patch",a,i),f==null?(yield s.bulkRemove(p),yield s.bulkSet(d),yield l.bulkRemove(r),yield a.update(e,{version:t,ltHash:c})):o("WALogger").LOG(M||(M=babelHelpers.taggedTemplateLiteralLoose(["syncd: [","] skip applying syncd old version ",""])),i,t)});return function(e){return a.apply(this,arguments)}})()),f!=null){var g=f;yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,g),yield o("WAWebSyncdDbCallbacksApi").printSyncdLog(e),o("WALogger").ERROR(w||(w=babelHelpers.taggedTemplateLiteralLoose(["",""])),g).sendLogs("syncd: processing old version for "+e)}o("WALogger").LOG(A||(A=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: end _uploadSuccessful for ",""])),i,e)}),Ae.apply(this,arguments)}function Fe(e,t,n,r){return Oe.apply(this,arguments)}function Oe(){return Oe=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a){try{var i=yield(Re||(Re=n("Promise"))).all([(yield Re.all(r.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE}).map(function(e){return o("WAWebGetSyncAction").getSyncActionInTransaction(e.index)}))).filter(Boolean),(yield Re.all(r.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}).map(function(e){return o("WAWebGetSyncAction").getSyncActionInTransaction(e.index)}))).filter(Boolean),(yield Re.all(r.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}).map(function(e){return o("WAWebGetSyncAction").getSyncActionsByIndexMacsInTransaction([e.indexMac])}))).filter(Boolean)]),l=i[0],s=i[1],u=i[2],c=null;s.length===1&&u.length===1&&u[0].length===1&&(c=s[0].index===u[0][0].index);var d="["+e+"] patch uploaded with mutations mac for "+t+":\n\n SET: "+a.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}).map(function(e){return o("WAWebSyncdAntiTampering").indexAndValueMacToString(e.indexMac,e.valueMac)}).join("\n ")+"\n REMOVE: "+a.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE}).map(function(e){return o("WAWebSyncdAntiTampering").indexAndValueMacToString(e.indexMac,e.valueMac)}).join("\n ")+"\n\n REMOVE fetch by index: "+l.map(function(e){return e.collection+":"+o("WAWebSyncdAntiTampering").indexAndValueMacToString(e.indexMac,e.valueMac)+":"+o("WAWebSyncdUtils").getMutationNameFromIndex(e.index)}).join("\n ")+"\n SET fetch by index: "+s.map(function(e){return e.collection+":"+o("WAWebSyncdAntiTampering").indexAndValueMacToString(e.indexMac,e.valueMac)+":"+o("WAWebSyncdUtils").getMutationNameFromIndex(e.index)}).join("\n ")+"\n SET fetch by mac: "+u.map(function(e){return e.map(function(e){return e.collection+":"+o("WAWebSyncdAntiTampering").indexAndValueMacToString(e.indexMac,e.valueMac)+":"+o("WAWebSyncdUtils").getMutationNameFromIndex(e.index)})}).join("\n ")+"\n isSameIndex: "+(c==null?"n/a":c.toString())+"\n ";o("WALogger").LOG(F||(F=babelHelpers.taggedTemplateLiteralLoose(["syncd: "," "])),d),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(t,d)}catch(e){o("WALogger").LOG(O||(O=babelHelpers.taggedTemplateLiteralLoose(["syncd: failed to debug upload: ",""])),e)}}),Oe.apply(this,arguments)}function Be(e,t,n,r){return We.apply(this,arguments)}function We(){return We=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i){var l=(Re||(Re=n("Promise"))).resolve(),s=0,u=o("WATimeUtils").unixTimeMs();if(a!=null){var c,d=r("WAWebSyncdValidateServerSyncProtobuf").validateExternalBlobReference(e,a);s+=o("WALongInt").numberOrThrowIfTooLarge((c=d.fileSizeBytes)!=null?c:0),o("WALogger").LOG(B||(B=babelHelpers.taggedTemplateLiteralLoose(["syncd: download snapshot for ",""])),e),l=o("WAWebSyncdMMSDownload").downloadSnapshot(e,d)}var m=Re.resolve();if(t!=null&&t.length>0){var p=t.map(function(t){return r("WAWebSyncdValidateServerSyncProtobuf").validatePatchProtobuf(e,t)});m=(Re||(Re=n("Promise"))).all(p.map((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.mutations||[],r=t.externalMutations;if(r){var a;o("WALogger").LOG(W||(W=babelHelpers.taggedTemplateLiteralLoose(["syncd: download patch for ",""])),e),n=yield o("WAWebSyncdMMSDownload").downloadExternalPatch(e,r),o("WALogger").LOG(q||(q=babelHelpers.taggedTemplateLiteralLoose(["syncd: ","'s external patch downloaded"])),e),s+=o("WALongInt").numberOrThrowIfTooLarge((a=r.fileSizeBytes)!=null?a:0)}return{mutations:n,version:t.version,snapshotMac:t.snapshotMac,patchMac:t.patchMac,keyId:t.keyId,exitCode:t.exitCode,deviceIndex:t.deviceIndex,clientDebugData:t.clientDebugData}});return function(e){return t.apply(this,arguments)}})()))}var _,f;try{var g=yield(Re||(Re=n("Promise"))).all([l,m]);_=g[0],f=g[1],o("WAWebSyncdCollectionUtils").isBootstrap(i)&&o("WAWebSyncdMetrics").reportSyncdBootstrapAppStateDownloadMetric({collection:e,downloadStartTs:u,downloadSize:s,isSuccess:"success"})}catch(t){throw o("WAWebSyncdCollectionUtils").isBootstrap(i)&&o("WAWebSyncdMetrics").reportSyncdBootstrapAppStateDownloadMetric({collection:e,downloadStartTs:u,downloadSize:s,isSuccess:"failure"}),t}return[_,f]}),We.apply(this,arguments)}function qe(e,t){var r=(function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n,r){e==null||e.mark("anti_tampering_start",{source:o("WASyncdConst").SyncDataType.Snapshot});var a=yield o("WAWebSyncdAntiTampering").computeLtHashAndValidateSnapshot(n,r,t);return e==null||e.mark("anti_tampering_end",{source:o("WASyncdConst").SyncDataType.Snapshot}),a});return function(t,n){return r.apply(this,arguments)}})(),a=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){e==null||e.mark("decryption_start",{source:o("WASyncdConst").SyncDataType.Snapshot});var r=yield o("WAWebSyncdDecryptMutationsWrapper").tryDecryptSnapshot(t,n);return e==null||e.mark("decryption_end",{source:o("WASyncdConst").SyncDataType.Snapshot}),r});return function(n,r){return t.apply(this,arguments)}})();return{measuredComputeLtHashAndValidateSnapshot:r,measuredTryDecryptSnapshot:a}}function Ue(e){var t=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r,a){e==null||e.mark("anti_tampering_start",{source:o("WASyncdConst").SyncDataType.Patch});var i=yield o("WAWebSyncdAntiTampering").computeLtHashAndValidatePatch(t,n,r,a);return e==null||e.mark("anti_tampering_end",{source:o("WASyncdConst").SyncDataType.Patch}),i});return function(n,r,o,a){return t.apply(this,arguments)}})(),r=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){e==null||e.mark("decryption_start",{source:o("WASyncdConst").SyncDataType.Patch});var r=yield o("WAWebSyncdDecryptMutationsWrapper").tryDecryptPatch(t,n);return e==null||e.mark("decryption_end",{source:o("WASyncdConst").SyncDataType.Patch}),r});return function(n,r){return t.apply(this,arguments)}})();return{measuredComputeLtHashAndValidatePatch:t,measuredTryDecryptPatch:r}}function Ve(e,t,n,r,o){return He.apply(this,arguments)}function He(){return He=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i,l){yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+l+"] start _applySnapshotAndPatches. mutation count: "+t.records.length+", version: "+t.version.version);var s=!1;try{var u=qe(i,l),c=u.measuredComputeLtHashAndValidateSnapshot,d=u.measuredTryDecryptSnapshot;i==null||i.mark("apply_start",{source:o("WASyncdConst").SyncDataType.Snapshot,snapshotRecordsCount:t.records.length}),o("WALogger").LOG(U||(U=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: start validate ","'s snapshot"])),l,e);var m=new ArrayBuffer(0),p=null;try{m=yield c(e,t)}catch(n){var _=o("WAWebSyncdSnapshotRecoveryGatingUtils").shouldPreformSnapshotRecovery(e,t.records.length,n);if(_.shouldPerformRecovery)s=!0,yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+l+"] attempt to recovery failed validate snapshot mac"),o("WALogger").LOG(V||(V=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: "," failed validate snapshot mac, attempt to recovery"])),l,e);else throw n}o("WALogger").LOG(H||(H=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: collection ","'s snapshot validated"])),l,e);var f=[];if(!s)f=yield d(e,t),o("WALogger").LOG(G||(G=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: collection ","'s snapshot decrypted"])),l,e);else{o("WALogger").LOG(z||(z=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd recovery: "," requesting recovery from primary"])),l,e),r("gkx")("26258")||o("WALogger").ERROR(j||(j=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd recovery: "," requesting recovery from primary"])),l,e).sendLogs("syncd-recover-fatal");var g=o("WATimeUtils").unixTimeMs(),h=yield o("WAWebRequestSyncdSnapshotRecovery").SyncdSnapshotRecoveryModule.requestRecoveryWithTimeout(e);o("WALogger").LOG(K||(K=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd recovery: "," recovery request resolved"])),l,e);var y=o("WATimeUtils").unixTimeMs()-g;if(h==null)throw o("WAWebSyncdMetricFatalError").flushDeferredFatalError(y),new(o("WAWebSyncdError")).SyncdFatalError("unable to validate snapshot mac");o("WAWebSyncdMetricFatalError").flushDeferredFatalError(y,!1),f=h.decryptedMutations,m=h.collectionLthash,p=h.version}var C=yield Ie();s||(f.forEach(function(n){var r=o("WAWebSyncdUtils").getMutationNameFromIndex(n.index);o("WAWebSyncdWamReportingUtils").syncReportMutationToWam(e,t.version.version,!0,o("WABase64").encodeB64UrlSafe(n.indexMac),r,n.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE,!1,C,o("WABase64").encodeB64UrlSafe(t.mac))}),yield Qe(e,t.version.version,f,l),o("WAWebSyncdWamAppState").addMutationCount(t.records.length),o("WAWebSyncdMetricCriticalBootstrapStage").reportSyncdDecryptedMutations(f),o("WAWebSyncdValidateMutations").validateNoSameIndexForMultipleMutations(e,f,o("WASyncdConst").SyncDataType.Snapshot));var b=s&&p!=null?p:t.version.version,v=yield Ze(e,f,o("WASyncdConst").SyncDataType.Snapshot,l,i,b),S=v.pendingSetMutationsToDrop,R=v.setMutationsToPersist;o("WALogger").LOG(Q||(Q=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: processed "," mutations in snapshot of collection "," v",""])),l,f.length,e,b),o("WALogger").LOG(X||(X=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: collection ","'s snapshot v"," applied"])),l,e,b);var L=null;if(i==null||i.mark("update_DB_start",{source:o("WASyncdConst").SyncDataType.Snapshot,setMutationsToPersistCount:R.length,pendingMutationsToDropCount:S.length}),yield o("WAWebRunInTransaction").runInTransaction({SyncActionStore:!0,PendingMutationStore:!0,CollectionVersionStore:!0},(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.CollectionVersionStore,r=t.PendingMutationStore,a=t.SyncActionStore;L=yield st(e,b,"snapshot",n,l),L==null?(yield a.bulkSet(R),yield r.bulkRemove(S),yield n.update(e,{version:b,ltHash:m})):o("WALogger").LOG(Y||(Y=babelHelpers.taggedTemplateLiteralLoose(["syncd: [","] skip applying syncd old version ",""])),l,b)});return function(e){return t.apply(this,arguments)}})()),i==null||i.mark("update_DB_end",{source:o("WASyncdConst").SyncDataType.Snapshot}),L!=null){var E=L;yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,E),yield o("WAWebSyncdDbCallbacksApi").printSyncdLog(e),o("WALogger").ERROR(J||(J=babelHelpers.taggedTemplateLiteralLoose(["",""])),E).sendLogs("syncd: processing old version for "+e)}o("WALogger").LOG(Z||(Z=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: completed applying snapshot for ",""])),l,e),i==null||i.mark("apply_end",{source:o("WASyncdConst").SyncDataType.Snapshot,decryptedMutationsCount:f.length})}catch(n){throw yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"exception "+r("getErrorSafe")(n).message),n instanceof o("WAWebSyncdError").SyncdMissingKeyError&&(yield o("WAWebSyncdHandleMissingKeys").handleMissingKeysInSnapshot(e,t)),n}yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+l+"] done applying snapshot"),a&&!s&&(i==null||i.mark("apply_start",{source:o("WASyncdConst").SyncDataType.Patch,patchCount:a.length}),yield je(e,a,i,l),i==null||i.mark("apply_end",{source:o("WASyncdConst").SyncDataType.Patch,patchCount:a.length}))}),He.apply(this,arguments)}function Ge(e){return ze.apply(this,arguments)}function ze(){return ze=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebABProps").getABPropConfigValue("web_syncd_max_mutations_to_process_during_resume");if(e>t){var n=Date.now();o("WALogger").LOG(ee||(ee=babelHelpers.taggedTemplateLiteralLoose(["syncd: patches have "," mutations, wait for UI unblock"])),e),yield o("WAWebSyncdDbCallbacksApi").handleSyncDelayApplyingPatchUntilUIUnblocks(),o("WALogger").LOG(te||(te=babelHelpers.taggedTemplateLiteralLoose(["syncd: UI is unblocked, waited for ","ms"])),Date.now()-n)}}),ze.apply(this,arguments)}function je(e,t,n,r){return Ke.apply(this,arguments)}function Ke(){return Ke=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i){var l=t.length===0?"n/a":t[t.length-1].version.version;if(yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"["+i+"] start apply patches. count: "+t.length+", last patch version: "+l),t.length===0)return o("WALogger").LOG(ne||(ne=babelHelpers.taggedTemplateLiteralLoose(["[","] syncd: no patches for collection ",""])),i,e),(Re||(Re=n("Promise"))).resolve();o("WAWebSyncdValidateMutations").validateNoDuplicatePatchVersionInCollection(e,t),t.sort(function(e,t){return e.version.version>t.version.version?1:-1});try{var s=r("sumBy")(t,function(e){return e.mutations.length});yield Ge(s);for(var u=0;uo("WAWebSyncdGetActionHandler").maxSupportedVersion())return{unsupported:t};var n=lt(t.collection,t.index),r=o("WASyncdConst").Actions.cast(n[0]);if(!r)return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: invalid action ",""])),n[0]),{unsupported:t};var a=o("WAWebSyncdGetActionHandler").getActionHandler(r);if(!a)return o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: no handler for action ",""])),r),{unsupported:t};var i={collection:t.collection,index:t.index,indexMac:t.indexMac,keyId:t.keyId,binarySyncData:t.binarySyncData,valueMac:t.valueMac,version:t.version,indexArr:n,actionName:r,actionHandler:a};return{supported:i}}),r=[],a=[];return n.map(function(e){var t=e.supported,n=e.unsupported;t!=null?r.push(t):n!=null&&a.push(n)}),{supportedMutations:r,unsupportedMutations:a}}function ot(e){var t=e.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}),n=new Set(t.map(function(e){return e.index})),r=e.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE});return r.forEach(function(e){n.has(e.index)||t.push(e)}),t}function at(e,t){var n=t.map(function(t){if(t.version>o("WAWebSyncdGetActionHandler").maxSupportedVersion())return{unsupported:t};var n=lt(e,t.index),r=o("WASyncdConst").Actions.cast(n[0]);if(!r)return o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: invalid action ",""])),n[0]),{unsupported:t};var a=o("WAWebSyncdGetActionHandler").getActionHandler(r);return a?{supported:{collection:t.collection,index:t.index,indexMac:t.indexMac,keyId:t.keyId,timestamp:t.timestamp,binarySyncData:t.binarySyncData,valueMac:t.valueMac,version:t.version,indexArr:n,actionName:r,actionHandler:a}}:(o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: no handler for action ",""])),r),{unsupported:t})}),r=[],a=[];return n.map(function(e){var t=e.supported,n=e.unsupported;t!=null?r.push(t):n!=null&&a.push(n)}),{supportedMutations:r,unsupportedMutations:a}}function it(e){return e.reduce(function(e,t){return e.length!==0&&t.actionName===e[e.length-1][0].actionName?e[e.length-1].push(t):e.push([t]),e},[])}function lt(e,t){try{var n=JSON.parse(t);if(n.length<1)throw r("err")("");return n}catch(t){throw o("WAWebSyncdMetricFatalError").reportSyncdFatalError(o("WAWebSyncdMetricFatalError").SyncdFatalErrorType.INVALID_ACTION_INDEX,{collection:e}),new(o("WAWebSyncdError")).SyncdFatalError("invalid action index")}}function st(e,t,n,r,o){return ut.apply(this,arguments)}function ut(){return ut=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,o){var a=yield r.get(e);if(a!=null&&a.version>=t)return"["+o+"] syncd: processing old version for "+e+". processing: "+t+" already persisted: "+a.version+". context: "+n}),ut.apply(this,arguments)}l.applyIndividualMutations=De,l.applyAppStateSyncResponse=$e}),98); __d("WAWebSyncdDecryptMutationsWrapper",["Promise","WALogger","WASyncdKeyTypes","WATextEncoding","WAWebEncryptionManagerSelector","WAWebProtobufsServerSync.pb","WAWebSyncdCryptoUtils","WAWebSyncdDbCallbacksApi","WAWebSyncdError","WAWebSyncdKeyCache","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d=o("WATextEncoding").newTextDecoder();function m(e,t){return _(t.records.map(function(e){return{record:e,operation:o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}}),e)}function p(e,t){return _(t.mutations,e)}function _(e,t){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r){return(c||(c=n("Promise"))).all(t.map(function(e){return h(r,e.operation,e.record)})).catch(function(n){throw n instanceof o("WAWebSyncdError").SyncdFatalError&&o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error decrypting patch for ",":\n SET: ","\n REMOVE: ",""])),r,t.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}).map(g),t.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE}).map(g)),n})}),f.apply(this,arguments)}function g(e){var t=o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(e.record.index.blob).slice(-16),n=o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(o("WASyncdKeyTypes").fromSyncKeyId(e.record.keyId.id));return"[keyId: "+n+", mac: "+t+"]"}function h(e,t,n){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=o("WAWebEncryptionManagerSelector").syncdEncryptionManager().decryptMutation,a=n.keyId.id,i=yield o("WAWebSyncdKeyCache").getKeyData(a);if(!i){if(t===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE){var l=o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(n.index.blob).slice(-16),c=o("WAWebSyncdCryptoUtils").arrayBufferToHexPadded(o("WASyncdKeyTypes").fromSyncKeyId(a));throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: no key data for remove mutation with key id "," and index mac ",""])),c,l),yield o("WAWebSyncdDbCallbacksApi").writeSyncdLog(e,"exception: no key data for remove mutations"),new(o("WAWebSyncdError")).SyncdFatalError("no key data for remove mutations")}throw new(o("WAWebSyncdError")).SyncdMissingKeyError}try{var m=yield r(e,a,i,t,n),p=m.index,_=m.indexMac,f=m.plaintext,g=m.valueMac,h=m.version;return{index:d.decode(p),action:null,version:h,keyId:a,operation:t,indexMac:_,valueMac:g,collection:e,binarySyncData:f}}catch(e){var y=e instanceof Error?e.message:String(e);throw o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: decryption failed: ",""])),y).sendLogs("syncd: decryption failed"),e}}),y.apply(this,arguments)}l.tryDecryptSnapshot=m,l.tryDecryptPatch=p}),98); __d("WAWebSyncdMMSDownload",["WAWebSyncdDecode","WAWebSyncdNetCallbacksApi","WAWebSyncdValidateServerSyncProtobuf","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WAWebSyncdNetCallbacksApi").downloadSyncBlob(t,"snapshot",e),a=o("WAWebSyncdDecode").decodeSyncdSnapshot(e,n);return r("WAWebSyncdValidateServerSyncProtobuf").validateSnapshotProtobuf(e,a)}),s.apply(this,arguments)}function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WAWebSyncdNetCallbacksApi").downloadSyncBlob(t,"patch",e),a=o("WAWebSyncdDecode").decodeSyncdMutations(e,n).mutations;return a.map(function(t){return r("WAWebSyncdValidateServerSyncProtobuf").validateMutationProtobuf(e,t)})}),c.apply(this,arguments)}l.downloadSnapshot=e,l.downloadExternalPatch=u}),98); __d("WAWebKeyManagementSendKeyRequestApi",["Promise","WALogger","WASyncdKeyTypes","WAWebApiPeerMessageStore","WAWebKeyManagementUtils","WAWebMsgKey","WAWebMsgType","WAWebSendAppStateSyncMsgJob","WAWebSyncdCriticalBootstrapProcessingApi","WAWebSyncdCryptoUtils","WAWebUserPrefsMeUser","WAWebWamEnumBootstrapAppStateDataStageCode","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=yield o("WAWebKeyManagementUtils").getPeerDevices(),i=t.map(function(e){return{keyId:o("WASyncdKeyTypes").fromSyncKeyId(e)}}),l={keyIds:i},u=a.map(function(e){var t=new(r("WAWebMsgKey"))({fromMe:!0,remote:o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),id:r("WAWebMsgKey").newId_DEPRECATED()});return{id:t,to:e,type:"protocol",subtype:"app_state_sync_key_request",kind:o("WAWebMsgType").MsgKind.PeerMessage,appStateSyncKeyRequest:l}}),c=a.map(function(e){return e.getDeviceId()}),d=t.map(function(e){return o("WAWebSyncdCryptoUtils").syncKeyIdToHex(e)});return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: send key request key id "," to peer deviceIds ",""])),d,c),yield o("WAWebApiPeerMessageStore").storePeerMessages(u),yield(s||(s=n("Promise"))).all(u.map(function(e){return o("WAWebSendAppStateSyncMsgJob").encryptAndSendKeyMsg({msg:e})})),o("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(o("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.MISSING_KEYS_REQUESTED),c}),c.apply(this,arguments)}l.sendAppStateSyncKeyRequest=u}),98); __d("WAWebKeyManagementSendKeyShareApi",["Promise","WALogger","WASyncdKeyTypes","WAWebApiPeerMessageStore","WAWebKeyManagementUtils","WAWebMsgKey","WAWebMsgType","WAWebSendAppStateSyncMsgJob","WAWebSyncdCryptoUtils","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a,i;if(t.type==="key_rotation"?(a=d(t.keys),i=yield o("WAWebKeyManagementUtils").getPeerDevices()):t.type==="missing_key"&&(a=d(t.keys,t.orphanKeys),i=[t.peerDeviceId]),i==null)return(s||(s=n("Promise"))).resolve();var l=i,u=l.map(function(e){var t=new(r("WAWebMsgKey"))({fromMe:!0,remote:o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),id:r("WAWebMsgKey").newId_DEPRECATED()});return{id:t,to:e,type:"protocol",subtype:"app_state_sync_key_share",kind:o("WAWebMsgType").MsgKind.PeerMessage,appStateSyncKeyShare:a}}),c=l.map(function(e){return e.getDeviceId()}),m=t.keys.map(function(e){return o("WAWebSyncdCryptoUtils").syncKeyIdToHex(e.keyId)});o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: send key share key id "," to peer deviceIds "," due to ",""])),m,c,t.type),yield o("WAWebApiPeerMessageStore").storePeerMessages(u),yield(s||(s=n("Promise"))).all(u.map(function(e){return o("WAWebSendAppStateSyncMsgJob").encryptAndSendKeyMsg({msg:e})}))}),c.apply(this,arguments)}function d(e,t){var n=e.map(function(e){return{keyId:{keyId:o("WASyncdKeyTypes").fromSyncKeyId(e.keyId)},keyData:{keyData:o("WASyncdKeyTypes").fromSyncKeyData(e.keyData),fingerprint:{rawId:e.fingerprint.rawId,currentIndex:e.fingerprint.currentIndex,deviceIndexes:e.fingerprint.deviceIndexes},timestamp:e.timestamp}}});if(t){var r=t.map(function(e){return{keyId:{keyId:o("WASyncdKeyTypes").fromSyncKeyId(e)},keyData:void 0}});n=n.concat(r)}return{keys:n}}l.sendAppStateSyncKeyShare=u}),98); __d("WAWebSyncdHandleMissingKeys",["Promise","WALogger","WASyncdKeyTypes","WAWebGetMissingKey","WAWebGetSyncKey","WAWebOfflineHandler","WAWebSyncdCryptoUtils","WAWebSyncdError","WAWebSyncdKeyCallbacksApi","WAWebSyncdStoreMissingKeys","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p,_,f=o("WASyncdKeyTypes").toSyncKeyId(new ArrayBuffer(0));function g(e,t){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var r=new Set,a=(yield o("WAWebGetSyncKey").getAllSyncKeysInTransaction()).map(function(e){return o("WAWebSyncdCryptoUtils").syncKeyIdToHex(e.keyId)});n.records.forEach(function(e){var t=e.keyId.id;if(o("WAWebSyncdCryptoUtils").syncKeyIdsEqual(t,f))throw new(o("WAWebSyncdError")).SyncdFatalError("snapshot has empty key");var n=o("WAWebSyncdCryptoUtils").syncKeyIdToHex(t);a.includes(n)||r.add(n)}),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection ","'s snapshot has missing keys ",""])),t,Array.from(r)),yield b(r)}),h.apply(this,arguments)}function y(e,t){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=new Set,r=(yield o("WAWebGetSyncKey").getAllSyncKeysInTransaction()).map(function(e){return o("WAWebSyncdCryptoUtils").syncKeyIdToHex(e.keyId)});t.forEach(function(e){var t=e.keyId.id;if(o("WAWebSyncdCryptoUtils").syncKeyIdsEqual(t,f))throw new(o("WAWebSyncdError")).SyncdFatalError("syncd: patch has empty key. patch device id: ${p.deviceIndex}");var a=o("WAWebSyncdCryptoUtils").syncKeyIdToHex(t);r.includes(a)||(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: handleMissingKeysInPatches: missing key: keyId: ",", patch version: ",", patch device id: ",""])),a,e.version.version,e.deviceIndex),n.add(a))}),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: collection ","'s patches has missing keys ",""])),e,Array.from(n)),yield b(n)}),C.apply(this,arguments)}function b(e){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebOfflineHandler").OfflineMessageHandler.isResumeFromRestartComplete()?"idle":"processing";if(t!=="idle"){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: _handleMissingKeys: skipping due to resume from restart in progress"])));return}var r=Array.from(e);o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["syncd: _handleMissingKeys: missing keys [","]"])),r);var a=new Set((yield o("WAWebGetMissingKey").bulkGetMissingKeysInTransaction(r)).filter(Boolean).map(function(e){return e.keyHex})),i=r.filter(function(e){return!a.has(e)});if(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["syncd: _handleMissingKeys: missing keys after filter: [","]"])),i),i.length===0)return(_||(_=n("Promise"))).resolve();var l=i.map(function(e){return o("WASyncdKeyTypes").toSyncKeyId(o("WAWebSyncdCryptoUtils").hexToUint8Array(e).buffer)}),s=yield o("WAWebSyncdKeyCallbacksApi").sendSyncdKeyRequest(l);yield o("WAWebSyncdStoreMissingKeys").addMissingKeys(l,s)}),v.apply(this,arguments)}function S(){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebGetMissingKey").getAllMissingKeysInTransaction();o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["syncd: requestAllMissingKeys: missing keys: [","]"])),e.map(function(e){return e.keyHex})),e.length!==0&&(yield o("WAWebSyncdKeyCallbacksApi").sendSyncdKeyRequest(e.map(function(e){return e.keyId})))}),R.apply(this,arguments)}l.handleMissingKeysInSnapshot=g,l.handleMissingKeysInPatches=y,l.requestAllMissingKeys=S}),98); __d("WAWebSyncdRotateKey",["WAArrayBuffersConcat","WABaseGlobals","WAByteArray","WACryptoDependencies","WAJids","WASyncdKeyManagementUtils","WASyncdKeyTypes","WATimeUtils","WAWebSyncdGatingUtils","equalsSet"],(function(t,n,r,o,a,i,l){"use strict";var e=1,s=90;function u(t){var n=t.timestamp,r=Math.min(s,Math.max(e,o("WAWebSyncdGatingUtils").getSyncdKeyMaxUseDays())),a=r*o("WATimeUtils").DAY_MILLISECONDS,i=o("WATimeUtils").unixTimeMs()-n;return i>a}function c(e,t){for(var n=e.fingerprint,o=t.currentIndex,a=t.deviceIndexes,i=t.rawId,l=new Set(n.deviceIndexes),s=n.currentIndex+1;s<=o;s++)l.add(s);return n.rawId!==i||!r("equalsSet")(l,new Set(a))}function d(e,t){var n=m(t),r=n.keyEpoch,a=n.keyId,i=p(),l=o("WATimeUtils").unixTimeMs();return{keyId:a,keyEpoch:r,keyData:i,fingerprint:e,timestamp:l}}function m(e){var t;if(e==null){var n=new Uint8Array(16);o("WACryptoDependencies").getCrypto().getRandomValues(n),t=o("WASyncdKeyManagementUtils").generateNewKeyEpoch(o("WASyncdKeyTypes").toSyncKeyId(n.buffer))}else t=o("WASyncdKeyManagementUtils").generateNewKeyEpoch(e.keyId);var r=o("WAJids").interpretAsNumber(o("WAJids").extractDeviceId(o("WABaseGlobals").getMyDeviceJid()));return{keyId:o("WASyncdKeyTypes").toSyncKeyId(new Uint8Array(o("WAArrayBuffersConcat").concatArrayBuffers(o("WAByteArray").intToBytes(2,r).buffer,o("WAByteArray").intToBytes(4,t).buffer)).buffer),keyEpoch:t}}function p(){return o("WASyncdKeyTypes").toSyncKeyData(o("WACryptoDependencies").getCrypto().getRandomValues(new Uint8Array(32)).buffer)}l.hasKeyExpired=u,l.hasADeviceBeenRemoved=c,l.rotateKey=d}),98); __d("WAWebSyncdKeyManagement",["WALogger","WAPromiseQueue","WASyncdKeyManagementUtils","WAWebGetSyncKey","WAWebSyncdCryptoUtils","WAWebSyncdKeyCallbacksApi","WAWebSyncdMetrics","WAWebSyncdRotateKey","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d=new(o("WAPromiseQueue")).PromiseQueue;function m(e){return e===void 0&&(e=!0),d.enqueue(function(){return p(e)})}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){t===void 0&&(t=!0);var n=yield f(),a=yield o("WAWebSyncdKeyCallbacksApi").getDeviceFingerprint(),i=!1,l=!1;if(n!=null){if(i=o("WAWebSyncdRotateKey").hasKeyExpired(n),l=o("WAWebSyncdRotateKey").hasADeviceBeenRemoved(n,a),!t||!i&&!l)return{keyId:n.keyId,keyData:n.keyData}}else throw r("err")("syncd: No sync key available");var d=o("WAWebSyncdRotateKey").rotateKey(a,n);return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: stored key rotation key id ",""])),o("WAWebSyncdCryptoUtils").syncKeyIdToHex(d.keyId)),yield o("WAWebGetSyncKey").setSyncKeyInTransaction(d),yield o("WAWebSyncdKeyCallbacksApi").sendSyncdKeyRotation([d]),i&&(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: key rotation due to key expiry"]))),o("WAWebSyncdMetrics").reportSyncdKeyRotationEvent(o("WAWebSyncdMetrics").SyncdKeyRotationEventType.APP_STATE_SYNC_KEY_EXPIRY)),l&&(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: key rotation due to device removal"]))),o("WAWebSyncdMetrics").reportSyncdKeyRotationEvent(o("WAWebSyncdMetrics").SyncdKeyRotationEventType.DEVICE_DEREGISTERATION)),n==null&&(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: key rotation due to no key present"]))),o("WAWebSyncdMetrics").reportSyncdKeyRotationEvent(o("WAWebSyncdMetrics").SyncdKeyRotationEventType.NO_KEYS)),p(t)}),_.apply(this,arguments)}function f(){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebGetSyncKey").getAllSyncKeysInTransaction();if(e.length===0)return null;var t=e.map(function(e){return o("WASyncdKeyManagementUtils").getKeyEpoch(e.keyId)}),n=Math.max.apply(Math,t),r=e.filter(function(e){return o("WASyncdKeyManagementUtils").getKeyEpoch(e.keyId)===n}),a=r.map(function(e){return o("WASyncdKeyManagementUtils").getKeyDeviceId(e.keyId)}),i=Math.min.apply(Math,a),l=a.indexOf(i);return r[l]}),g.apply(this,arguments)}l.getActiveKey=m,l.getNewestKeyPair=f}),98); __d("WAWebSyncdRequestBuilderUtils",[],(function(t,n,r,o,a,i){"use strict";function e(e){return l(e.reverse(),function(e){return e.index}).reverse()}function l(e,t){var n=new Set;return e.filter(function(e){var r=t(e);return n.has(r)?!1:(n.add(r),!0)})}i.compactPatch=e}),66); __d("WAWebSyncdRequestBuilder",["Promise","WAWebGetPendingMutation","WAWebSyncdRequestBuilderBuild","WAWebSyncdRequestBuilderUtils","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){"use strict";var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a){var i=new Map,l=new Map;yield(e||(e=n("Promise"))).all(t.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebGetPendingMutation").getSyncPendingMutationsByCollectionInTransaction(e),n=r("compactMap")(t,function(e){return e.id});l.set(e,n);var a=o("WAWebSyncdRequestBuilderUtils").compactPatch(t);i.set(e,a)});return function(t){return e.apply(this,arguments)}})()));var s=yield o("WAWebSyncdRequestBuilderBuild").buildSyncIqNode(i,a);return{syncIqNode:s.syncIqNode,collectionWithPendingMutationsIds:l,collectionWithEncryptedMutations:s.collectionWithEncryptedMutations,localCollectionVersions:s.localCollectionVersions,collectionsToSkip:s.collectionsToSkip}}),u.apply(this,arguments)}l.default=s}),98); __d("WAWebSyncdEncryptMutationsWrapper",["WALogger","WAWebEncryptionManagerSelector","WAWebGetSyncAction","WAWebProtobufsServerSync.pb","WAWebSyncdCrypto","WAWebSyncdError","WAWebSyncdKeyCache","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var r=o("WAWebEncryptionManagerSelector").syncdEncryptionManager().encryptMutation,a=t.index,i=t.operation,l=n.keyId,s=n.keyData,u;e:{if(i===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET)break e;if(i===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE){if(u=yield o("WAWebGetSyncAction").getSyncActionInTransaction(a),!u)throw new(o("WAWebSyncdError")).SyncdFatalError("no corresponding set mutation");var c=u.keyId,d=yield o("WAWebSyncdKeyCache").getKeyData(c);if(d==null)throw new(o("WAWebSyncdError")).SyncdFatalError("no key data for corresponding mutation");l=c,s=d;break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+i)}try{var m=yield r(t,l,s),p=m.indexAndValueCipherText,_=m.indexMac,f=o("WAWebSyncdCrypto").valueMacFromIndexAndValueCipherText(p);return babelHelpers.extends({},t,{keyId:l,keyData:s,indexMac:_,indexAndValueCipherText:p,valueMac:f})}catch(t){var g=t instanceof Error?t.message:String(t);throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: encryption failed: ",""])),g).sendLogs("syncd: encryption failed"),t}}),u.apply(this,arguments)}l.encryptMutation=s}),98); __d("WAWebSyncdMMSUpload",["WAWebSyncdGatingUtils"],(function(t,n,r,o,a,i,l){"use strict";var e=100,s=2e3,u=10,c=100;function d(t){var n=Math.min(s,Math.max(o("WAWebSyncdGatingUtils").getSyncdInlineMutationsMaxCount(),e));return t.length>n}function m(e){var t=Math.min(c,Math.max(o("WAWebSyncdGatingUtils").getSyncdPatchProtobufMaxSize(),u))*1e3;return e.byteLength>t}l.exceedInlineMutationCount=d,l.exceedPatchProtobufSize=m}),98); __d("WAWebSyncdRequestBuilderBuild",["Promise","WABase64","WABaseGlobals","WAJids","WALogger","WAMediaCalculateFilehash","WASyncdConst","WASyncdKeyManagementUtils","WASyncdKeyTypes","WAWap","WAWebABProps","WAWebBrokerGlobalAppState","WAWebGetCollectionVersion","WAWebGetSyncAction","WAWebProtobufSyncAction.pb","WAWebProtobufsServerSync.pb","WAWebSyncdAntiTampering","WAWebSyncdCryptoUtils","WAWebSyncdEncryptMutationsWrapper","WAWebSyncdError","WAWebSyncdKeyManagement","WAWebSyncdMMSUpload","WAWebSyncdNetCallbacksApi","WAWebSyncdRequestBuilderTypesConverter","WAWebSyncdRequestEncode","WAWebSyncdUtils","WAWebSyncdWamAppState","asyncToGeneratorRuntime","encodeProtobuf","sortBy"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p=5;function _(e,t){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield h(e,t),r=n.collectionNodes,a=n.collectionsToSkip,i=n.collectionWithEncryptedMutations,l=n.localCollectionVersions,s=g(o("WAWap").wap("sync",null,r));return{syncIqNode:s,collectionWithEncryptedMutations:i,localCollectionVersions:l,collectionsToSkip:a}}),f.apply(this,arguments)}function g(e){return o("WAWap").wap("iq",{id:o("WAWap").generateId(),to:o("WAWap").S_WHATSAPP_NET,type:"set",xmlns:"w:sync:app:state"},e)}function h(e,t){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: start _buildCollectionNodes"])));var a=[],i=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WAWebGetCollectionVersion").getCollectionVersionInTransaction(e).then(function(e){return e==null?void 0:e.version}),i,l;if(t!=null&&t.length>0)if(n==null)o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: skipping "," in sync iq patch because initial full sync\n is incomplete"])),e),a.push(e);else{var u=yield C(e,t,r),c=u.encryptedMutations,d=u.patchNode;i=d,l=c}return{collection:e,version:n,patchNode:i,encryptedMutations:l}});return function(n,r){return e.apply(this,arguments)}})(),l=new Map,c=new Map,d=[];t.forEach(function(e,t){return d.push(i(t,e))});var p=yield(m||(m=n("Promise"))).all(d),_=p.map(function(e){var t=e.collection,n=e.encryptedMutations,r=e.patchNode,a=e.version;return n&&c.set(t,n),l.set(t,a),o("WAWap").wap("collection",{name:o("WAWap").CUSTOM_STRING(t),return_snapshot:a===void 0?"true":"false",version:o("WAWap").INT(a!=null?a:o("WASyncdConst").DEFAULT_COLLECTION_VERSION)},r)});return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: end _buildCollectionNodes"]))),{collectionNodes:_,collectionWithEncryptedMutations:c,localCollectionVersions:l,collectionsToSkip:a}}),y.apply(this,arguments)}function C(e,t,n){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r){var a=yield o("WAWebSyncdKeyManagement").getActiveKey(!R(t)),i=yield x(e,t,a),l=i.map(function(e,t){return o("WAWebSyncdEncryptMutationsWrapper").encryptMutation(e,a).catch(function(e){throw o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: encryption failed for idx ",""])),t),e})}),s=yield(m||(m=n("Promise"))).all(l).catch((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){throw t instanceof o("WAWebSyncdError").SyncdFatalError&&(yield v(i,e)),t});return function(e){return t.apply(this,arguments)}})()),u=s.map(function(e){return{indexMac:e.indexMac,valueMac:e.valueMac,operation:e.operation}}),d=yield o("WAWebSyncdAntiTampering").computeLtHash(e,u,r),p=d.ltHash,_=yield o("WAWebSyncdAntiTampering").computeOutgoingSnapshotAndPatchMacs(e,p,s,a.keyData),f=_.patchMac,g=_.snapshotMac;s.map(function(e){e.patchMac=f});var h=s.map(function(e){return D(e.keyId,e.operation,e.indexMac,e.indexAndValueCipherText)}),y=T(h),C=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSyncdNetCallbacksApi").uploadSyncExternalPatch(y),t=yield L(e,y);return k(t,a.keyId,g,f)});return function(){return e.apply(this,arguments)}})(),b;o("WAWebSyncdMMSUpload").exceedInlineMutationCount(h)?b=yield C():(b=I(h,a.keyId,g,f),o("WAWebSyncdMMSUpload").exceedPatchProtobufSize(b)&&(b=yield C()));var S=o("WAWap").wap("patch",null,b);return{patchNode:S,encryptedMutations:s}}),b.apply(this,arguments)}function v(e,t){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=e.map(function(e,t){return{mutation:e,idx:t}}),r=n.filter(function(e){return e.mutation.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}),a=n.filter(function(e){return e.mutation.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE}),i=r.map(function(e){var t=a.map(function(t){return t.mutation.index===e.mutation.index?"same":"different"});return"["+t.join(",")+"]"}),l=r.map(function(e){var t=e.idx,n=e.mutation,r=n.action!=null?n.action:"",o=n.id!=null;return r+"("+t+") - "+(o?"stored":"not stored")}),s=a.map(function(e){var t=e.idx,n=e.mutation,r=n.action!=null?n.action:"",o=n.id!=null;return r+"("+t+") - "+(o?"stored":"not stored")});o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["syncd: fatal error encrypting patch for ",":\n SET: ","\n REMOVE: ","\n Is same index? ",""])),t,l,s,i.join(","))}),S.apply(this,arguments)}function R(e){return r("WAWebBrokerGlobalAppState").isLogoutInProgress&&e.some(function(e){return o("WAWebSyncdUtils").getMutationNameFromIndex(e.index)===o("WASyncdConst").Actions.Sentinel})}function L(e,t){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=e.directPath,r=e.encFilehash,a=e.handle,i=e.mediaKey,l=yield o("WAMediaCalculateFilehash").calculateFilehash(t);return{mediaKey:i,directPath:n,handle:a,fileSizeBytes:t.byteLength,fileSha256:o("WABase64").decodeB64(l),fileEncSha256:r}}),E.apply(this,arguments)}function k(e,t,n,r){var a=o("WAJids").extractDeviceId(o("WABaseGlobals").getMyDeviceJid());return o("WAWebSyncdRequestEncode").encodeSyncdPatch({keyId:{id:o("WASyncdKeyTypes").fromSyncKeyId(t)},externalMutations:e,snapshotMac:n,patchMac:r,deviceIndex:a})}function I(e,t,n,r){var a=o("WAJids").extractDeviceId(o("WABaseGlobals").getMyDeviceJid()),i=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufSyncAction.pb").PatchDebugDataSpec,{isSenderPrimary:!1,senderPlatform:o("WAWebProtobufSyncAction.pb").PatchDebugData$Platform.WEB}).readBuffer();return o("WAWebSyncdRequestEncode").encodeSyncdPatch({keyId:{id:o("WASyncdKeyTypes").fromSyncKeyId(t)},mutations:e,snapshotMac:n,patchMac:r,deviceIndex:a,clientDebugData:i})}function T(e){return o("WAWebSyncdRequestEncode").encodeSyncdMutations({mutations:e})}function D(e,t,n,r){return{operation:t,record:{keyId:{id:o("WASyncdKeyTypes").fromSyncKeyId(e)},index:{blob:n},value:{blob:r}}}}function x(e,t,n){return $.apply(this,arguments)}function $(){return $=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield o("WAWebGetSyncAction").getSyncActionsByCollectionsInTransaction([e]),a=t,i=P(r,t,n.keyId);a=a.concat(i);var l=N(r,a,n.keyId);return o("WAWebSyncdWamAppState").addKeyRotationRemoveCount(l.length),a=a.concat(l),a}),$.apply(this,arguments)}function P(e,t,n){var a=e.filter(function(e){return!t.map(function(e){return e.index}).includes(e.index)&&!o("WAWebSyncdCryptoUtils").syncKeyIdsEqual(e.keyId,n)});a=r("sortBy")(a,function(e){return o("WASyncdKeyManagementUtils").getKeyEpoch(e.keyId)});var i=Math.min(p,o("WAWebABProps").getABPropConfigValue("syncd_additional_mutations_count"));return a=a.slice(0,i),o("WAWebSyncdRequestBuilderTypesConverter").syncActionsToPendingMutations(a,o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET)}function N(e,t,n){var r=t.filter(function(e){return e.operation===o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET}).map(function(e){return e.index}),a=e.filter(function(e){return r.includes(e.index)}),i=a.filter(function(e){return!o("WAWebSyncdCryptoUtils").syncKeyIdsEqual(e.keyId,n)});return o("WAWebSyncdRequestBuilderTypesConverter").syncActionsToPendingMutations(i,o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.REMOVE)}l.buildSyncIqNode=_,l._generateMutationsToUpload=x}),98); __d("WAWebSyncdMetricCriticalBootstrapStage",["$InternalEnum","WALogger","WAWebCollectionHandlerWamMutation","WAWebProtobufSyncAction.pb","WAWebSyncdCriticalBootstrapProcessingApi","WAWebWamEnumBootstrapAppStateDataStageCode","decodeProtobuf"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u=n("$InternalEnum").Mirrored(["ABOUT_TO_APPLY_MUTATIONS","APPLIED_MUTATIONS","MUTATIONS_DECRYPTED","REQUEST_BUILT","RESPONSE_RECEIVED","RESPONSE_PARSED_VALID","ENTERED_RETRY_MODE","MISSING_KEYS_RECEIVED"]),c=n("$InternalEnum").Mirrored(["PATCH_MUTATIONS","SNAPSHOT_MUTATIONS"]);function d(e){o("WAWebSyncdCriticalBootstrapProcessingApi").logCriticalBootstrapStageIfNecessary(o("WAWebWamEnumBootstrapAppStateDataStageCode").BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.MUTATIONS_DECRYPTED),e.forEach(function(e){var t=e.binarySyncData,n=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,t),r=n.value;if(r!=null){var a;r.archiveChatAction?a=r.archiveChatAction.messageRange:r.markChatAsReadAction?a=r.markChatAsReadAction.messageRange:r.clearChatAction?a=r.clearChatAction.messageRange:r.deleteChatAction&&(a=r.deleteChatAction.messageRange),a!=null&&o("WAWebCollectionHandlerWamMutation").logMetricsForMutationLength(a.messages.length)}})}function m(t){var n,r=t==null||(n=t.string)==null?void 0:n.criticalBootstrapStage;if(r==null)return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing bootstrap stage for critical bootstrap stage"]))),null;var a=u.cast(r);return a==null?(o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown bootstrap stage: "," for critical bootstrap stage"])),r),null):{type:a}}l.SyncdCriticalBootstrapStageType=u,l.SyncdDecryptMutationsType=c,l.reportSyncdDecryptedMutations=d,l.convertSyncdCriticalBootstrapStageFromAnnotations=m}),98); __d("WAWebCollectionHandlerWamSyncUtil",["WALongInt","WASyncdConst","WATimeUtils","WAWebMdBootstrapAppStateDataDownloadedWamEvent","WAWebSyncdMdSyncFieldstatMeta","WAWebWamEnumMdBootstrapPayloadType","WAWebWamEnumMdBootstrapStepResult","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=[o("WASyncdConst").CollectionName.CriticalBlock,o("WASyncdConst").CollectionName.CriticalUnblockLow];function s(e,t,n,r){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r,a){var i=new(o("WAWebMdBootstrapAppStateDataDownloadedWamEvent")).MdBootstrapAppStateDataDownloadedWamEvent({mdBootstrapPayloadType:e.includes(t)?o("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE.CRITICAL:o("WAWebWamEnumMdBootstrapPayloadType").MD_BOOTSTRAP_PAYLOAD_TYPE.NON_CRITICAL,mdTimestamp:o("WATimeUtils").unixTimeMs(),mdBootstrapStepDuration:o("WATimeUtils").unixTimeMs()-n,mdBootstrapStepResult:a==="success"?o("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.SUCCESS:o("WAWebWamEnumMdBootstrapStepResult").MD_BOOTSTRAP_STEP_RESULT.FAILURE,mdSessionId:yield o("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getMdSessionId()}),l=yield o("WAWebSyncdMdSyncFieldstatMeta").MdSyncFieldStatsMeta.getStorageEstimation();l.mdStorageQuotaBytes!==o("WAWebSyncdMdSyncFieldstatMeta").STORAGE_QUOTA_UNAVAILABLE&&(i.mdStorageQuotaUsedBytes=l.mdStorageQuotaUsedBytes,i.mdStorageQuotaBytes=l.mdStorageQuotaBytes);try{var s=o("WALongInt").maybeNumberOrThrowIfTooLarge(r);s!=null&&(i.mdBootstrapPayloadSize=s)}catch(e){}i.commit()}),u.apply(this,arguments)}l.commitBootstrapAppStateDownloadMetric=s}),98); __d("WAWebSyncdMetrics",["$InternalEnum","WALogger","WASyncdConst","WAWebAppTracker","WAWebCollectionHandlerWamMutation","WAWebCollectionHandlerWamSyncUtil","WAWebMdAppStateKeyRotationWamEvent","WAWebSyncdQpl","WAWebSyncdUtils","WAWebWamEnumMdAppStateKeyRotationReasonCode","isEmptyObject"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d=n("$InternalEnum").Mirrored(["MISSING_MUTATION_TO_REMOVE"]),m=n("$InternalEnum").Mirrored(["SNAPSHOT_USED","SNAPSHOT_NOT_USED"]),p=n("$InternalEnum").Mirrored(["APP_STATE_SYNC_KEY_EXPIRY","DEVICE_DEREGISTERATION","NO_KEYS"]);function _(e){o("WAWebCollectionHandlerWamSyncUtil").commitBootstrapAppStateDownloadMetric(e.collection,e.downloadStartTs,e.downloadSize,e.isSuccess)}function f(e,t,n){o("WAWebCollectionHandlerWamMutation").logMetricsForDataApplied(e,t,n)}function g(e,t){o("WAWebSyncdUtils").uploadCriticalEventMetric(e,t)}function h(e){new(o("WAWebMdAppStateKeyRotationWamEvent")).MdAppStateKeyRotationWamEvent({mdAppStateKeyRotationReason:y(e)}).commit()}function y(e){return e===p.APP_STATE_SYNC_KEY_EXPIRY?o("WAWebWamEnumMdAppStateKeyRotationReasonCode").MD_APP_STATE_KEY_ROTATION_REASON_CODE.APP_STATE_SYNC_KEY_EXPIRY:e===p.DEVICE_DEREGISTERATION?o("WAWebWamEnumMdAppStateKeyRotationReasonCode").MD_APP_STATE_KEY_ROTATION_REASON_CODE.DEVICE_DEREGISTERATION:e===p.NO_KEYS?o("WAWebWamEnumMdAppStateKeyRotationReasonCode").MD_APP_STATE_KEY_ROTATION_REASON_CODE.NO_KEYS:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}function C(t){var n,r,a=t==null||(n=t.string)==null?void 0:n.criticalEventCode;if(a==null)return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing error code for critical event"]))),null;var i=d.cast(a);return i==null?(o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown error code: "," for critical event"])),a),null):{type:i,collection:o("WASyncdConst").CollectionName.cast(t==null||(r=t.string)==null?void 0:r.collection)}}function b(e){var t,n=e==null||(t=e.string)==null?void 0:t.keyRotationEventCode;if(n==null)return o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["syncd: missing error code for key rotation event"]))),null;var r=p.cast(n);return r==null?(o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["syncd: unknown error code: "," for key rotation event"])),n),null):{type:r}}function v(e){var t={};return Object.keys(e).forEach(function(n){typeof e[n]=="number"?(t.int==null&&(t.int={}),t.int[n]=e[n]):typeof e[n]=="string"&&(t.string==null&&(t.string={}),t.string[n]=e[n])}),r("isEmptyObject")(t)?void 0:t}var S=(function(){function e(){this.syncdQpl=new(o("WAWebSyncdQpl")).SyncdQPL,this.syncdQpl.start(),o("WAWebAppTracker").AppTracker.start(o("WAWebAppTracker").AppTrackerType.SyncD)}var t=e.prototype;return t.end=function(t){t===void 0&&(t=!1),this.syncdQpl.end(t),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.SyncD)},t.mark=function(t,n){this.syncdQpl.markAnnotations(t,v(n))},e})();l.SyncdCriticalEventType=d,l.SyncdBootstrapDataAppliedSnapshotUsed=m,l.SyncdKeyRotationEventType=p,l.reportSyncdBootstrapAppStateDownloadMetric=_,l.reportSyncdBootstrapDataApplied=f,l.reportSyncdCriticalEvent=g,l.reportSyncdKeyRotationEvent=h,l.convertSyncdCriticalEventFromAnnotations=C,l.convertSyncdKeyRotationEventFromAnnotations=b,l.constructAnnotationsFromContext=v,l.SyncdEventFlow=S}),98); __d("WAWebSyncdUploadFatalErrorMetric",["WATimeUtils","WAWebABProps","WAWebAppTracker","WAWebMdFatalErrorWamEvent","WAWebProtobufSyncAction.pb","WAWebSchemaSyncActions","WAWebSyncBootstrap","WAWebSyncdCollectionsStateMachine","WAWebSyncdUploadFatalErrorMetricEmitter","WAWebSyncdUtils","WAWebUserPrefsAppStateSync","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime","decodeProtobuf"],(function(t,n,r,o,a,i,l){var e=o("WATimeUtils").unixTime();function s(){o("WAWebSyncdUploadFatalErrorMetricEmitter").listenForUploadFatalErrorMetric(function(){u.apply(void 0,arguments)})}function u(e,t,n,r,o,a,i,l,s,u,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T,D,x,$){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a,i,l,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T,D,x,$,P,N){var M={mdFatalErrorCode:t,collection:n?o("WAWebSyncdUtils").collectionNameToMetric(n):void 0,isBootstrap:r("WAWebSyncBootstrap").isSyncDCriticalDataSyncInProcess()},w=o("WAWebUserPrefsMultiDevice").getPairingTimestamp(),A=w!=null?(o("WATimeUtils").unixTime()-w)*1e3:void 0;if(M=babelHelpers.extends({},M,{timeSinceRefreshMs:(o("WATimeUtils").unixTime()-e)*1e3,timeSincePairingMs:A,patchSnapshotMutationCount:a,patchVersion:i,isFatal:l,isWebLthashConsistent:s,macFatalCollectionNameMismatch:u,macFatalCurrentLthashMismatch:c,macFatalNewLthashMismatch:d,macFatalPatchVersionMismatch:m,macFatalNewLthashSubtractMismatch:p,macFatalNumberHasOverrideMutation:_,macFatalNumberNumAddMutation:f,macFatalNumberNumRemoveMutation:g,macFatalSenderCurrentLthashToLocalCalculatedCurrentLthashMismatch:h,isPatchSenderPrimary:y,macFatalDidUseMacFetchFallback:C,macFatalHasMissingRemove:b,macFatalNumberAddMismatch:v,macFatalNumberRemoveMismatch:S,macFatalDidPreviousPatchFailPostSaveValidation:R,macFatalPreviousPatchNewLthashToCurrentPatchCurrentLthash:L,isPreviousPatchAnIncomingPatch:E,isPreviousPatchSenderPrimary:k,isSenderIndexSameAsPreviousSenderIndex:I,didBootstrapFromSnapshot:T,isThereAnotherSyncdCompanion:D,isPureSyncdSession:x,lidMigrationStage:$,recoveryRequestDurationMs:P,recoveryStatus:N}),M=babelHelpers.extends({},M,{appContext:o("WAWebAppTracker").AppTracker.getAppContext()}),o("WAWebABProps").getABPropConfigValue("web_syncd_fatal_fields_from_L1104589PRV2")){var F=yield o("WAWebUserPrefsMultiDevice").getRecentMailboxAgeDays(),O=yield o("WAWebUserPrefsAppStateSync").getLastPeriodicAppStateSyncTs(),B=r("WAWebSyncdCollectionsStateMachine").getCollectionMinFailureTime();M=babelHelpers.extends({},M,{mailboxAgeDays:F==null?void 0:F,daysSinceLastPeriodicSync:O==null?void 0:Math.trunc((o("WATimeUtils").unixTime()-O)/60/60/24),hoursSinceFirstFiniteFailure:B==null?void 0:Math.trunc((o("WATimeUtils").unixTimeMs()-B)/1e3/60/60)});var W=yield o("WAWebSchemaSyncActions").getSyncActionsTable().get('["primary_version","current"]'),q=yield o("WAWebSchemaSyncActions").getSyncActionsTable().get('["primary_version","session_start"]');if(W||q){var U,V,H,G,z=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,W==null?void 0:W.binarySyncData).value,j=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,q==null?void 0:q.binarySyncData).value;M=babelHelpers.extends({},M,{currentPrimaryAppVersion:(U=z==null||(V=z.primaryVersionAction)==null?void 0:V.version)!=null?U:void 0,sessionStartPrimaryAppVersion:(H=j==null||(G=j.primaryVersionAction)==null?void 0:G.version)!=null?H:void 0})}}yield new(o("WAWebMdFatalErrorWamEvent")).MdFatalErrorWamEvent(M).commitAndWaitForFlush(!0)}),c.apply(this,arguments)}l.initialiseFatalErrorMetricUploading=s,l.uploadFatalErrorMetric=u}),98); __d("WAWebRequestSyncdSnapshotRecovery",["Promise","WALogger","WANullthrows","WAPromiseTimeout","WAResolvable","WASyncdConst","WASyncdKeyTypes","WATextEncoding","WATimeUtils","WAWebProtobufSyncAction.pb","WAWebProtobufsE2E.pb","WAWebProtobufsServerSync.pb","WAWebSendNonMessageDataRequest","WAWebSyncdCrypto","WAWebSyncdKeyCache","asyncToGeneratorRuntime","encodeProtobuf","err"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m=o("WATextEncoding").newTextDecoder(),p=6e4,_=(function(){function t(){this.recoveryPromise=new Map,this.recoveryInflight=null}var a=t.prototype;return a.requestRecoveryWithTimeout=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){try{var n=yield o("WAPromiseTimeout").promiseTimeout(this.requestRecoveryFromPrimary(t),p);return n}catch(t){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[syncd recovery] error occured during recovery request ",""])),t),null}});function r(e){return t.apply(this,arguments)}return r})(),a.requestRecoveryFromPrimary=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=null;try{this.recoveryInflight!=null&&(yield this.recoveryInflight.promise),this.recoveryInflight=new(o("WAResolvable")).Resolvable,this.recoveryPromise.has(e)||this.recoveryPromise.set(e,new(o("WAResolvable")).Resolvable),yield o("WAWebSendNonMessageDataRequest").sendPeerDataOperationRequest(o("WAWebProtobufsE2E.pb").Message$PeerDataOperationRequestType.COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY,{collectionName:e,timestamp:o("WATimeUtils").unixTime()});var n=yield r("WANullthrows")(this.recoveryPromise.get(e)).promise;if(n==null||String(n==null?void 0:n.collectionName)!==String(e))throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[syncd recovery] Null response or collection name missmatch. Collection name: ",", expected: ",""])),n==null?void 0:n.collectionName,e),r("err")("syncd recovery: null or collection name missmatch");t=yield this.convertSyncdSnapshotRecoveryResponseToSnapshot(n)}catch(e){o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[syncd recovery] error occured during response processing ",""])),e)}return this.recoveryInflight!=null&&this.recoveryInflight.resolve(),this.recoveryPromise.set(e,new(o("WAResolvable")).Resolvable),t});function t(t){return e.apply(this,arguments)}return t})(),a.convertSyncdSnapshotRecoveryResponseToSnapshot=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.collectionLthash,a=e.collectionName,i=e.mutationRecords,l=e.version;if(l==null)throw r("err")("syncd recovery: syncdVersion is null");var s=yield(d||(d=n("Promise"))).all(i.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.keyId,n=e.mac,i=e.value;if(i==null||t==null)throw r("err")("syncd recovery: unexpected null value in mutation record");var l=i.index,s=i.version;if(l==null||s==null||n==null)throw r("err")("syncd recovery: unexpected null value in mutation value");var u=null;try{u=yield o("WAWebSyncdKeyCache").getKeyData(o("WASyncdKeyTypes").toSyncKeyId(t))}catch(e){o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[syncd recovery] error occured during key data retrieval. error: ",""])),e instanceof Error&&e.name).sendLogs("syncd-recovery-key-data-error")}var d=yield o("WAWebSyncdCrypto").generateEncryptionKeys(r("WANullthrows")(u)),p=d.indexKey,_=yield o("WAWebSyncdCrypto").generateIndexMac(r("WANullthrows")(p),r("WANullthrows")(l)),f=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufSyncAction.pb").SyncActionDataSpec,i).readBuffer(),g=o("WASyncdConst").CollectionName.cast(a);if(g==null)throw r("err")("syncd recovery: invalid collection name");var h={index:m.decode(l),action:null,binarySyncData:f,operation:o("WAWebProtobufsServerSync.pb").SyncdMutation$SyncdOperation.SET,version:s,keyId:o("WASyncdKeyTypes").toSyncKeyId(t),indexMac:_,valueMac:n,collection:g};return h});return function(t){return e.apply(this,arguments)}})()));return{collectionLthash:r("WANullthrows")(t),version:Number(l.version),decryptedMutations:s}});function t(t){return e.apply(this,arguments)}return t})(),a.resolveRecoveryPromise=function(t,n){var e=this.recoveryPromise.get(t);e!=null&&e.resolve(n)},t})(),f=new _;l.SyncdSnapshotRecoveryModule=f}),98); __d("WAWebApiPrivacyDisallowedList",["WALogger","WAWebSchemaPrivacyDisallowedList","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var t=yield o("WAWebSchemaPrivacyDisallowedList").getPrivacyDisallowedListTable().all();return c(t)}catch(t){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["privacy_settings_drawer: get all privacy disallowed lists failed"]))).verbose().sendLogs("privacy_settings_drawer: get all privacy disallowed lists failed"),{about:null,groupadd:null,last:null,profile:null}}}),u.apply(this,arguments)}function c(e){var t={about:null,groupadd:null,last:null,profile:null};return e.forEach(function(e){e:{if(e.id===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.About){t.about=e;break e}if(e.id===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.GroupAdd){t.groupadd=e;break e}if(e.id===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.LastSeen){t.last=e;break e}if(e.id===o("WAWebSchemaPrivacyDisallowedList").PrivacyDisallowedListType.ProfilePicture){t.profile=e;break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e.id)}}),t}l.queryDisallowedLists=s,l.disallowedRowsToLists=c}),98); __d("WAWebApiPrivacyEphemerality",["WALogger","WAWebABProps","WAWebSchemaChat","WAWebSchemaGroupMetadata","asyncToGeneratorRuntime","countWhere"],(function(t,n,r,o,a,i,l){var e;function s(){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var t=yield o("WAWebSchemaChat").getChatTable().greaterThan(["ephemeralDuration"],0,{shouldDecrypt:!1}),n=t.length,a=r("countWhere")(t,function(e){return e.disappearingModeInitiatedByMe===!0}),i=yield o("WAWebSchemaGroupMetadata").getGroupMetadataTable().greaterThan(["ephemeralDuration"],0),l=o("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_groups")?r("countWhere")(i,function(e){return e.disappearingModeInitiatedByMe===!0}):0,s=a+l;return{isEphemeralMessagingUser:s>0,countEphemeralThreadsEnabledByMe:s,countEphemeralThreads:n}}catch(t){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["ephemerality_daily_logs: retrieving current ephemerality information failed"]))).verbose().sendLogs("ephemerality_daily_logs: retrieving current ephemerality information failed"),{isEphemeralMessagingUser:null,countEphemeralThreadsEnabledByMe:null,countEphemeralThreads:null}}}),u.apply(this,arguments)}l.queryEphemeralityDailyLogInfo=s}),98); __d("WAWebEstimateFtsStorageApi",["Promise","WANullthrows","WAWebDbUsageApiUtils","WAWebIndexedDB","WAWebScanDbRowApi","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s="fts-storage",u=15e3;function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=t===void 0?{sampleRows:u}:t,i=a.sampleRows,l=Date.now(),c=i,d=r("WANullthrows")(r("WAWebIndexedDB")),m=yield o("WAWebDbUsageApiUtils").getDatabase(d,s),p=m.transaction(m.objectStoreNames,"readonly"),_=0,f=0,g=function*(t){var e=p.objectStore(t),n=yield o("WAWebDbUsageApiUtils").promisifyRequest(e.count());if(n===0)return 1;var r=Math.min(c,n);f=r;var a=0;yield o("WAWebDbUsageApiUtils").objectStoreIterator(e,function(e){return a+=o("WAWebScanDbRowApi").estimateSize(e,t),f--,f>0});var i=Math.round(a*(n/(r-f)));_+=i};for(var h of p.objectStoreNames)yield*g(h);var y=Date.now()-l;return(e||(e=n("Promise"))).resolve(_)}),d.apply(this,arguments)}l.getEstimatedFTSDbSize=c}),98); __d("WAWebInactiveGroupLidMigration",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(t,n,r,o,a,i,l){"use strict";function e(){return r("WAWebUserPrefsStore").get(o("WAWebUserPrefsKeys").UserPrefs.InactiveGroupLidMigrationComplete)===!0}function s(){r("WAWebUserPrefsStore").set(o("WAWebUserPrefsKeys").UserPrefs.InactiveGroupLidMigrationComplete,!0)}l.isInactiveGroupLidMigrationComplete=e,l.setInactiveGroupLidMigrationComplete=s}),98); __d("WAWebWamEnumLidMigrationSourceType",[],(function(t,n,r,o,a,i){var e=Object.freeze({PEER:1,HISTORY:2});i.LID_MIGRATION_SOURCE_TYPE=e}),66); __d("WAWebLidMigrationDailyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumLidMigrationSourceType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({LidMigrationDaily:[5842,{completedMigrations:[1,e.TYPES.STRING],lidMigrationSource:[7,o("WAWebWamEnumLidMigrationSourceType").LID_MIGRATION_SOURCE_TYPE],numberOfChatsWithClientAssignedLid:[8,e.TYPES.INTEGER],numberOfDeprecatedChats:[9,e.TYPES.INTEGER],numberOfLidBroadcastLists:[10,e.TYPES.INTEGER],numberOfLidGroups:[11,e.TYPES.INTEGER],numberOfPnBroadcastLists:[12,e.TYPES.INTEGER],numberOfPnChatsWithoutMapping:[5,e.TYPES.INTEGER],numberOfPnGroups:[13,e.TYPES.INTEGER],numberOfPnhCtwaThreadsKnownMapping:[2,e.TYPES.INTEGER],numberOfPnhCtwaThreadsMissingMapping:[3,e.TYPES.INTEGER],numberOfSplitThreads:[4,e.TYPES.INTEGER],numberOfUserChatsWithoutAccountLid:[6,e.TYPES.INTEGER]},[1,1,1],"regular"]},{LidMigrationDaily:[]});l.LidMigrationDailyWamEvent=s}),98); __d("WAWebWamEnumInAppNotificationAlertStyle",[],(function(t,n,r,o,a,i){var e=Object.freeze({NONE:1,BANNERS:2,ALERTS:3});i.IN_APP_NOTIFICATION_ALERT_STYLE=e}),66); __d("WAWebWamEnumNotificationSoundTone",[],(function(t,n,r,o,a,i){var e=Object.freeze({DEFAULT:1,CUSTOM:2});i.NOTIFICATION_SOUND_TONE=e}),66); __d("WAWebWamEnumUnreadBadgeSettingType",[],(function(t,n,r,o,a,i){var e=Object.freeze({CURRENT_UNREAD_COUNT:0,CLEAR_ON_APP_OPEN:1});i.UNREAD_BADGE_SETTING_TYPE=e}),66); __d("WAWebNotificationSettingWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumInAppNotificationAlertStyle","WAWebWamEnumNotificationSoundTone","WAWebWamEnumUnreadBadgeSettingType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({NotificationSetting:[3684,{groupReactionNotification:[1,e.TYPES.BOOLEAN],groupShowNotification:[2,e.TYPES.BOOLEAN],groupSoundTone:[3,o("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE],inAppNotificationAlertStyle:[4,o("WAWebWamEnumInAppNotificationAlertStyle").IN_APP_NOTIFICATION_ALERT_STYLE],inAppNotificationSound:[5,e.TYPES.BOOLEAN],inAppNotificationVibrate:[6,e.TYPES.BOOLEAN],messageReactionNotification:[7,e.TYPES.BOOLEAN],messageShowNotification:[8,e.TYPES.BOOLEAN],messageSoundTone:[9,o("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE],offlineNotification:[11,e.TYPES.BOOLEAN],recommendedChannelsNotificationSetting:[19,e.TYPES.BOOLEAN],showPreview:[10,e.TYPES.BOOLEAN],statusNotificationPriority:[14,e.TYPES.BOOLEAN],statusNotificationVibration:[15,e.TYPES.BOOLEAN],statusReactionNotification:[16,e.TYPES.BOOLEAN],statusReminderNotification:[12,e.TYPES.BOOLEAN],statusShowNotification:[18,e.TYPES.BOOLEAN],statusSoundTone:[17,o("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE],unreadBadgeSetting:[13,o("WAWebWamEnumUnreadBadgeSettingType").UNREAD_BADGE_SETTING_TYPE]},[1,1,1],"regular"]},{NotificationSetting:[]});l.NotificationSettingWamEvent=s}),98); __d("WAWebPnhDailyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumTypeOfGroupEnum"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({PnhDaily:[3806,{communityId:[1,e.TYPES.STRING],mappingMissing:[7,e.TYPES.INTEGER],pnhIndicatorClicksChat:[2,e.TYPES.INTEGER],pnhIndicatorClicksInfoScreen:[3,e.TYPES.INTEGER],reactionDeleteCount:[4,e.TYPES.INTEGER],reactionOpenTrayCount:[5,e.TYPES.INTEGER],totalContacts:[8,e.TYPES.INTEGER],typeOfGroup:[6,o("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM]},[1,1,1],"regular"]},{PnhDaily:[]});l.PnhDailyWamEvent=s}),98); __d("WAWebWamEnumPrivacyHighlightCategoryEnum",[],(function(t,n,r,o,a,i){var e=Object.freeze({E2EE:0});i.PRIVACY_HIGHLIGHT_CATEGORY_ENUM=e}),66); __d("WAWebWamEnumPrivacyHighlightSurfaceEnum",[],(function(t,n,r,o,a,i){var e=Object.freeze({GOLDEN_BOX_CONTACT:0,GOLDEN_BOX_GROUP:1,GOLDEN_BOX_BROADCAST:2,INFO_SCREEN_CONTACT:3,INFO_SCREEN_GROUP:4,INFO_SCREEN_BROADCAST:5,CALLS_LIST:6,CHATS_LIST:7,STATUS_LIST:8,LINKED_DEVICES_SCREEN:9,CALLING_SCREEN_AUDIO:10,CALLING_SCREEN_VIDEO:11,SPLIT_VIEW_HOME_PLACEHOLDER:12});i.PRIVACY_HIGHLIGHT_SURFACE_ENUM=e}),66); __d("WAWebPrivacyHighlightDailyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPrivacyHighlightCategoryEnum","WAWebWamEnumPrivacyHighlightSurfaceEnum"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({PrivacyHighlightDaily:[3522,{dialogAppearCount:[1,e.TYPES.INTEGER],dialogSelectCount:[2,e.TYPES.INTEGER],narrativeAppearCount:[3,e.TYPES.INTEGER],privacyHighlightCategory:[4,o("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM],privacyHighlightSurface:[5,o("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM]},[1,1,1],"regular"]},{PrivacyHighlightDaily:[]});l.PrivacyHighlightDailyWamEvent=s}),98); __d("WAWebPttDailyWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({PttDaily:[2938,{pttCancelBroadcast:[9,e.TYPES.INTEGER],pttCancelGroup:[8,e.TYPES.INTEGER],pttCancelIndividual:[7,e.TYPES.INTEGER],pttCancelInterop:[42,e.TYPES.INTEGER],pttCancelNewsletter:[32,e.TYPES.INTEGER],pttDraftReviewBroadcast:[15,e.TYPES.INTEGER],pttDraftReviewGroup:[14,e.TYPES.INTEGER],pttDraftReviewIndividual:[13,e.TYPES.INTEGER],pttDraftReviewInterop:[43,e.TYPES.INTEGER],pttDraftReviewNewsletter:[33,e.TYPES.INTEGER],pttFastplaybackBroadcast:[21,e.TYPES.INTEGER],pttFastplaybackGroup:[20,e.TYPES.INTEGER],pttFastplaybackIndividual:[19,e.TYPES.INTEGER],pttFastplaybackInterop:[44,e.TYPES.INTEGER],pttFastplaybackNewsletter:[34,e.TYPES.INTEGER],pttLockBroadcast:[12,e.TYPES.INTEGER],pttLockGroup:[11,e.TYPES.INTEGER],pttLockIndividual:[10,e.TYPES.INTEGER],pttLockInterop:[45,e.TYPES.INTEGER],pttLockNewsletter:[35,e.TYPES.INTEGER],pttOutOfChatBroadcast:[29,e.TYPES.INTEGER],pttOutOfChatGroup:[30,e.TYPES.INTEGER],pttOutOfChatIndividual:[31,e.TYPES.INTEGER],pttOutOfChatInterop:[46,e.TYPES.INTEGER],pttOutOfChatNewsletter:[36,e.TYPES.INTEGER],pttPausedRecordBroadcast:[22,e.TYPES.INTEGER],pttPausedRecordGroup:[23,e.TYPES.INTEGER],pttPausedRecordIndividual:[24,e.TYPES.INTEGER],pttPausedRecordInterop:[47,e.TYPES.INTEGER],pttPausedRecordNewsletter:[37,e.TYPES.INTEGER],pttPlaybackBroadcast:[18,e.TYPES.INTEGER],pttPlaybackGroup:[17,e.TYPES.INTEGER],pttPlaybackIndividual:[16,e.TYPES.INTEGER],pttPlaybackInterop:[48,e.TYPES.INTEGER],pttPlaybackNewsletter:[38,e.TYPES.INTEGER],pttRecordBroadcast:[3,e.TYPES.INTEGER],pttRecordGroup:[2,e.TYPES.INTEGER],pttRecordIndividual:[1,e.TYPES.INTEGER],pttRecordInterop:[49,e.TYPES.INTEGER],pttRecordNewsletter:[39,e.TYPES.INTEGER],pttSendBroadcast:[6,e.TYPES.INTEGER],pttSendGroup:[5,e.TYPES.INTEGER],pttSendIndividual:[4,e.TYPES.INTEGER],pttSendInterop:[50,e.TYPES.INTEGER],pttSendNewsletter:[40,e.TYPES.INTEGER],pttStopTapBroadcast:[25,e.TYPES.INTEGER],pttStopTapGroup:[26,e.TYPES.INTEGER],pttStopTapIndividual:[27,e.TYPES.INTEGER],pttStopTapInterop:[51,e.TYPES.INTEGER],pttStopTapNewsletter:[41,e.TYPES.INTEGER]},[1,1,1],"regular"]},{PttDaily:[]});l.PttDailyWamEvent=s}),98); __d("WAWebScreenLockSettingsDataWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({ScreenLockSettingsData:[4802,{screenAutoLockDuration:[1,o("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{ScreenLockSettingsData:[]});l.ScreenLockSettingsDataWamEvent=e}),98); __d("WAWebChatLockDailyWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({ChatLockDaily:[4214,{folderChatsCount:[1,e.TYPES.INTEGER],folderOpenCount:[2,e.TYPES.INTEGER],lockFolderHidden:[5,e.TYPES.BOOLEAN],newAddChatCount:[3,e.TYPES.INTEGER],newRemoveChatCount:[4,e.TYPES.INTEGER],secretCodeActive:[6,e.TYPES.BOOLEAN]},[1,1,1],"regular"]},{ChatLockDaily:[]});l.ChatLockDailyWamEvent=s}),98); __d("WAWebSubmitChatLockDailyStats",["WAWebChatLockDailyWamEvent"],(function(t,n,r,o,a,i,l){"use strict";function e(e){var t=e.chatLockFolderChatsCount,n=e.chatLockFolderOpenCount,r=e.chatLockLockFolderHidden,a=e.chatLockNewAddChatCount,i=e.chatLockNewRemoveChatCount,l=e.chatLockSecretCodeActive;if(!(t===0||n===0||a===0||i===0)){var s=new(o("WAWebChatLockDailyWamEvent")).ChatLockDailyWamEvent({folderChatsCount:t,folderOpenCount:n,newAddChatCount:a,newRemoveChatCount:i});r!=null&&s.set({lockFolderHidden:r}),l!=null&&s.set({secretCodeActive:l}),s.commit()}}l.submitChatLockDailyStats=e}),98); __d("WAWebUserPrefsContactManagement",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(t,n,r,o,a,i,l){var e=1;function s(){var e=r("WAWebUserPrefsStore").getUser(o("WAWebUserPrefsKeys").UserPrefs.SyncContactToAddressbookCounts),t=typeof e=="object"?e:null,n=typeof(t==null?void 0:t.enabledCount)=="number"?t.enabledCount:0,a=typeof(t==null?void 0:t.disabledCount)=="number"?t.disabledCount:0;return{enabledCount:n,disabledCount:a}}function u(e){r("WAWebUserPrefsStore").setUser(o("WAWebUserPrefsKeys").UserPrefs.SyncContactToAddressbookCounts,e)}function c(t){var n=s(),r=d();r!==t?t?(n.enabledCount++,n.enabledCount>=e&&(n.disabledCount=0)):(n.disabledCount++,n.disabledCount>=e&&(n.enabledCount=0)):!t&&n.enabledCount=e}l.setSyncToAddressbookLastSetting=c,l.getSyncToAddressbookDefaultSetting=d}),98); __d("WAWebWaFsSingleEmojiMessageDailyWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({WaFsSingleEmojiMessageDaily:[5602,{animatedEmojiEnabled:[1,e.TYPES.BOOLEAN],animatedEmojiReceiveCnt:[2,e.TYPES.INTEGER],animatedEmojiSendCnt:[3,e.TYPES.INTEGER],emojiClickCnt:[4,e.TYPES.INTEGER],emojiReplyCount:[5,e.TYPES.INTEGER],pauseAnimationCnt:[6,e.TYPES.INTEGER],replayAnimationCnt:[7,e.TYPES.INTEGER],singleEmojiReceiveCnt:[8,e.TYPES.INTEGER],singleEmojiSendCnt:[9,e.TYPES.INTEGER]},[1,1,1],"regular"]},{WaFsSingleEmojiMessageDaily:[]});l.WaFsSingleEmojiMessageDailyWamEvent=s}),98); __d("WAWebWamEnumPsTestEnumField",[],(function(t,n,r,o,a,i){var e=Object.freeze({TEST_VALUE1:1,TEST_VALUE2:2});i.PS_TEST_ENUM_FIELD=e}),66); __d("WAWebTestAnonymousDailyIdWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPsTestEnumField"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({TestAnonymousDailyId:[2958,{psTestEnumField:[1,o("WAWebWamEnumPsTestEnumField").PS_TEST_ENUM_FIELD],psTestFloatField:[2,o("WAWebWamCodegenUtils").TYPES.NUMBER]},[1,1,1],"private",248614979]},{TestAnonymousDailyId:[]});l.TestAnonymousDailyIdWamEvent=e}),98); __d("WAWebTestAnonymousDailyWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({TestAnonymousDaily:[2328,{},[1,1,1],"private",113760892]},{TestAnonymousDaily:[]});l.TestAnonymousDailyWamEvent=e}),98); __d("WAWebTestAnonymousIdLessWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({TestAnonymousIdLess:[3004,{psTimeSinceLastEventInMin:[1,o("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"private",0]},{TestAnonymousIdLess:[]});l.TestAnonymousIdLessWamEvent=e}),98); __d("WAWebTestAnonymousMonthlyIdWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({TestAnonymousMonthlyId:[2960,{},[1,20,1e3],"private",191000728]},{TestAnonymousMonthlyId:[]});l.TestAnonymousMonthlyIdWamEvent=e}),98); __d("WAWebTestAnonymousWeeklyIdWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({TestAnonymousWeeklyId:[2956,{psTestBooleanField:[2,e.TYPES.BOOLEAN],psTestStringField:[3,e.TYPES.STRING],psTimeSinceLastEventInMin:[1,e.TYPES.INTEGER]},[1,1,1],"private",42196056]},{TestAnonymousWeeklyId:[]});l.TestAnonymousWeeklyIdWamEvent=s}),98); __d("WAWebWamPrivateStatsUtils",["WAWebTestAnonymousDailyIdWamEvent","WAWebTestAnonymousDailyWamEvent","WAWebTestAnonymousIdLessWamEvent","WAWebTestAnonymousMonthlyIdWamEvent","WAWebTestAnonymousWeeklyIdWamEvent"],(function(t,n,r,o,a,i,l){function e(){new(o("WAWebTestAnonymousDailyWamEvent")).TestAnonymousDailyWamEvent().commit(),new(o("WAWebTestAnonymousWeeklyIdWamEvent")).TestAnonymousWeeklyIdWamEvent().commit(),new(o("WAWebTestAnonymousIdLessWamEvent")).TestAnonymousIdLessWamEvent().commit()}function s(){new(o("WAWebTestAnonymousDailyIdWamEvent")).TestAnonymousDailyIdWamEvent().commit(),new(o("WAWebTestAnonymousMonthlyIdWamEvent")).TestAnonymousMonthlyIdWamEvent().commit()}l.logDailyPrivateStatsTestEvents=e,l.logUiActionShadowPrivateStatsTestEvents=s}),98); __d("WAWebWebDynamicSamplingTestEventWithSamplingWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({WebDynamicSamplingTestEventWithSampling:[5320,{},[100,100,1e4],"regular"]},{WebDynamicSamplingTestEventWithSampling:[]});l.WebDynamicSamplingTestEventWithSamplingWamEvent=e}),98); __d("WAWebWebDynamicSamplingTestEventWithoutSamplingWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({WebDynamicSamplingTestEventWithoutSampling:[5322,{},[1,1,1],"regular"]},{WebDynamicSamplingTestEventWithoutSampling:[]});l.WebDynamicSamplingTestEventWithoutSamplingWamEvent=e}),98); __d("WAWebWebcFtsStorageWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({WebcFtsStorage:[3642,{ftsTotalSize:[1,o("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{WebcFtsStorage:[]});l.WebcFtsStorageWamEvent=e}),98); __d("WAWebTasksDailyStatsTask",["Promise","WALogger","WAStorageEstimator","WATimeUtils","WAWebABProps","WAWebABPropsGlobals","WAWebApiContact","WAWebApiPrivacyDisallowedList","WAWebApiPrivacyEphemerality","WAWebBackendApi","WAWebBlocklistMigration","WAWebChatThreadLoggingUtils","WAWebCommunityHomeActionWamEvent","WAWebCommunityTabActionWamEvent","WAWebContactCollection","WAWebContactManagementGating","WAWebCurrentUser","WAWebDailyAggregatedStatsCollection","WAWebDailyWamEvent","WAWebEphemeralityResolver","WAWebEstimateFtsStorageApi","WAWebInactiveGroupLidMigration","WAWebKeepInChatNotifWamEvent","WAWebLid1X1MigrationGating","WAWebLidAwareContactsDB","WAWebLidMigrationDailyWamEvent","WAWebLidMigrationUtils","WAWebLidStatusMigrationGating","WAWebMediaStore","WAWebMuteCollection","WAWebNotificationConstants","WAWebNotificationEngagementWamEvent","WAWebNotificationSettingWamEvent","WAWebPnhDailyWamEvent","WAWebPrivacyHighlightDailyWamEvent","WAWebPttDailyWamEvent","WAWebSchemaChat","WAWebSchemaGroupMetadata","WAWebScreenLockSettingsDataWamEvent","WAWebSubmitChatLockDailyStats","WAWebUserPrefsCartLidMigration","WAWebUserPrefsContactManagement","WAWebUserPrefsFavoritesLidMigration","WAWebUserPrefsGeneral","WAWebUserPrefsLabelAssociationsLidMigration","WAWebUserPrefsMultiDevice","WAWebUserPrefsNotifications","WAWebUserPrefsPhoneNumberHidingThreadPromotionMigration","WAWebUserPrefsScreenLock","WAWebUserPrefsTypes","WAWebUserPrefsUsername","WAWebUsernameTypes","WAWebWaFsSingleEmojiMessageDailyWamEvent","WAWebWamEnumLidMigrationSourceType","WAWebWamEnumNotificationSettingType","WAWebWamEnumNotificationSoundTone","WAWebWamEnumPrivacyHighlightCategoryEnum","WAWebWamEnumPrivacyHighlightSurfaceEnum","WAWebWamEnumPrivacySettingsContactsBuckets","WAWebWamEnumPrivacySettingsValueType","WAWebWamEnumTypeOfGroupEnum","WAWebWamEnumUsernameState","WAWebWamPrivateStatsUtils","WAWebWebDynamicSamplingTestEventWithSamplingWamEvent","WAWebWebDynamicSamplingTestEventWithoutSamplingWamEvent","WAWebWebcFtsStorageWamEvent","WAWebWebcStorageStatWamEvent","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","countWhere","cr:7293","gkx","isStringNullOrEmpty","justknobx","nullthrows"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h=(e=n("cr:7293"))!=null?e:{},y=h.getNotificationToneGroupSetting,C=h.getNotificationToneSetting,b=h.getNotificationToneStatusSetting;function v(e){if(e.goldenBoxContactNarrativeAppearCount>0||e.goldenBoxContactDialogAppearCount>0||e.goldenBoxContactDialogSelectCount>0){var t=new(o("WAWebPrivacyHighlightDailyWamEvent")).PrivacyHighlightDailyWamEvent({privacyHighlightCategory:o("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:o("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.GOLDEN_BOX_CONTACT,narrativeAppearCount:e.goldenBoxContactNarrativeAppearCount,dialogAppearCount:e.goldenBoxContactDialogAppearCount,dialogSelectCount:e.goldenBoxContactDialogSelectCount});t.commit()}if(e.goldenBoxGroupNarrativeAppearCount>0||e.goldenBoxGroupDialogAppearCount>0||e.goldenBoxGroupDialogSelectCount>0){var n=new(o("WAWebPrivacyHighlightDailyWamEvent")).PrivacyHighlightDailyWamEvent({privacyHighlightCategory:o("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:o("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.GOLDEN_BOX_GROUP,narrativeAppearCount:e.goldenBoxGroupNarrativeAppearCount,dialogAppearCount:e.goldenBoxGroupDialogAppearCount,dialogSelectCount:e.goldenBoxGroupDialogSelectCount});n.commit()}if(e.infoScreenGroupNarrativeAppearCount>0||e.infoScreenGroupDialogAppearCount>0||e.infoScreenGroupDialogSelectCount>0){var r=new(o("WAWebPrivacyHighlightDailyWamEvent")).PrivacyHighlightDailyWamEvent({privacyHighlightCategory:o("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:o("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.INFO_SCREEN_GROUP,narrativeAppearCount:e.infoScreenGroupNarrativeAppearCount,dialogAppearCount:e.infoScreenGroupDialogAppearCount,dialogSelectCount:e.infoScreenGroupDialogSelectCount});r.commit()}if(e.chatsListNarrativeAppearCount>0||e.chatsListDialogAppearCount>0||e.chatsListDialogSelectCount>0){var a=new(o("WAWebPrivacyHighlightDailyWamEvent")).PrivacyHighlightDailyWamEvent({privacyHighlightCategory:o("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:o("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.CHATS_LIST,narrativeAppearCount:e.chatsListNarrativeAppearCount,dialogAppearCount:e.chatsListDialogAppearCount,dialogSelectCount:e.chatsListDialogSelectCount});a.commit()}if(e.statusListNarrativeAppearCount>0||e.statusListDialogAppearCount>0||e.statusListDialogSelectCount>0){var i=new(o("WAWebPrivacyHighlightDailyWamEvent")).PrivacyHighlightDailyWamEvent({privacyHighlightCategory:o("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:o("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.STATUS_LIST,narrativeAppearCount:e.statusListNarrativeAppearCount,dialogAppearCount:e.statusListDialogAppearCount,dialogSelectCount:e.statusListDialogSelectCount});i.commit()}if(e.callingScreenAudioNarrativeAppearCount>0||e.callingScreenAudioDialogAppearCount>0||e.callingScreenAudioDialogSelectCount>0){var l=new(o("WAWebPrivacyHighlightDailyWamEvent")).PrivacyHighlightDailyWamEvent({privacyHighlightCategory:o("WAWebWamEnumPrivacyHighlightCategoryEnum").PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:o("WAWebWamEnumPrivacyHighlightSurfaceEnum").PRIVACY_HIGHLIGHT_SURFACE_ENUM.CALLING_SCREEN_AUDIO,narrativeAppearCount:e.callingScreenAudioNarrativeAppearCount,dialogAppearCount:e.callingScreenAudioDialogAppearCount,dialogSelectCount:e.callingScreenAudioDialogSelectCount});l.commit()}}function S(){var e=!o("WAWebMuteCollection").MuteCollection.globalReactionsMute(),t=!!o("WAWebUserPrefsNotifications").getIgnoreNondirectGroupMsg(),n=o("WAWebABProps").getABPropConfigValue("wa_web_enable_granular_notifications"),r=new(o("WAWebNotificationSettingWamEvent")).NotificationSettingWamEvent;if(n){var a=void 0,i=void 0,l=void 0;C&&y&&b?(a=C(),i=y(),l=b()):(o("WAWebMuteCollection").MuteCollection.getGlobalSoundsEnabled()&&(a=o("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE.DEFAULT),o("WAWebMuteCollection").MuteCollection.getGlobalGroupSoundsEnabled()&&(i=o("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE.DEFAULT),o("WAWebMuteCollection").MuteCollection.getGlobalStatusSoundsEnabled()&&(l=o("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE.DEFAULT)),r.set({groupReactionNotification:o("WAWebMuteCollection").MuteCollection.getGlobalGroupNotificationReactionsEnabled(),groupShowNotification:o("WAWebMuteCollection").MuteCollection.getGlobalGroupNotificationsEnabled(),groupSoundTone:i,messageReactionNotification:o("WAWebMuteCollection").MuteCollection.getGlobalNotificationReactionsEnabled(),messageShowNotification:o("WAWebMuteCollection").MuteCollection.getGlobalNotificationsEnabled(),messageSoundTone:a,statusReactionNotification:o("WAWebMuteCollection").MuteCollection.getGlobalStatusNotificationReactionsEnabled(),statusShowNotification:o("WAWebMuteCollection").MuteCollection.getGlobalStatusNotificationsEnabled(),statusSoundTone:l,showPreview:o("WAWebUserPrefsNotifications").getGlobalPreviews(),offlineNotification:o("WAWebUserPrefsNotifications").getGlobalOfflineNotifications()})}else r.set({groupReactionNotification:t&&e,groupShowNotification:t,groupSoundTone:o("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE.DEFAULT,inAppNotificationSound:o("WAWebUserPrefsNotifications").getGlobalSounds(),messageReactionNotification:e,messageShowNotification:o("WAWebUserPrefsNotifications").getGlobalNotifications(),messageSoundTone:o("WAWebWamEnumNotificationSoundTone").NOTIFICATION_SOUND_TONE.DEFAULT,showPreview:o("WAWebUserPrefsNotifications").getGlobalPreviews(),offlineNotification:o("WAWebUserPrefsNotifications").getGlobalOfflineNotifications()});r.commit()}function R(){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WAWebABPropsGlobals").logClientExposurePulseEventFromDailyStatsTask();var e=yield(g||(g=n("Promise"))).all([E(),D(),M(),A(),O(),H(),U()]),t=e[0],a=e[1],i=e[2],l=e[3],s=e[4],u=e[5],c=e[6],d=F(),m=babelHelpers.extends({},t,a,i,d,s,u,c),p=new(o("WAWebDailyWamEvent")).DailyWamEvent;p.set(m),p.commit(),S();var _=yield I();new(o("WAWebLidMigrationDailyWamEvent")).LidMigrationDailyWamEvent(_).commit();var f=new(o("WAWebWebcFtsStorageWamEvent")).WebcFtsStorageWamEvent;f.set({ftsTotalSize:l}),f.commit();var h=new(o("WAWebScreenLockSettingsDataWamEvent")).ScreenLockSettingsDataWamEvent;h.set(W()),h.commit();var y=o("WAWebUserPrefsMultiDevice").getPairingTimestamp(),C=new(o("WAWebWebcStorageStatWamEvent")).WebcStorageStatWamEvent;C.set({webcStorageQuota:i.storageTotalSize,webcStorageUsage:i.storageUsed,webcAgeOfStorage:y!=null?o("WATimeUtils").unixTimeWithoutClockSkewCorrection()-y:-1,webcPackingEnabled:!1}),C.commit();var b=yield o("WAWebUserPrefsGeneral").getOfflineNotificationEngagement();if(b){var R,L;new(o("WAWebNotificationEngagementWamEvent")).NotificationEngagementWamEvent({isWebBackgroundSyncNotif:!0,totalNotifShown:(R=b.totalNotifShown)!=null?R:0,totalNotifTapToOpen:(L=b.totalNotifTapToOpen)!=null?L:0}).commit(),o("WAWebUserPrefsGeneral").clearOfflineNotificationContentEngagement()}var k=yield o("WAWebUserPrefsGeneral").getNotificationEngagement();if(k){var T,x;new(o("WAWebNotificationEngagementWamEvent")).NotificationEngagementWamEvent({totalNotifShown:(T=k.totalNotifShown)!=null?T:0,totalNotifTapToOpen:(x=k.totalNotifTapToOpen)!=null?x:0}).commit(),o("WAWebUserPrefsGeneral").clearNotificationContentEngagement()}o("WAWebWamPrivateStatsUtils").logDailyPrivateStatsTestEvents();var $=o("WAWebDailyAggregatedStatsCollection").DailyAggregatedStatsCollection.toArray().filter(function(e){return e.shouldBeSubmitted()});o("WAWebDailyAggregatedStatsCollection").DailyAggregatedStatsCollection.remove($),$.forEach(function(e){var t=new(o("WAWebPttDailyWamEvent")).PttDailyWamEvent({pttCancelBroadcast:e.pttCancelBroadcast,pttCancelGroup:e.pttCancelGroup,pttCancelIndividual:e.pttCancelIndividual,pttCancelNewsletter:e.pttCancelNewsletter,pttDraftReviewBroadcast:e.pttDraftReviewBroadcast,pttDraftReviewGroup:e.pttDraftReviewGroup,pttDraftReviewIndividual:e.pttDraftReviewIndividual,pttDraftReviewNewsletter:e.pttDraftReviewNewsletter,pttFastplaybackBroadcast:e.pttFastplaybackBroadcast,pttFastplaybackGroup:e.pttFastplaybackGroup,pttFastplaybackIndividual:e.pttFastplaybackIndividual,pttFastplaybackNewsletter:e.pttFastplaybackNewsletter,pttLockBroadcast:e.pttLockBroadcast,pttLockGroup:e.pttLockGroup,pttLockIndividual:e.pttLockIndividual,pttLockNewsletter:e.pttLockNewsletter,pttOutOfChatBroadcast:e.pttOutOfChatBroadcast,pttOutOfChatGroup:e.pttOutOfChatGroup,pttOutOfChatIndividual:e.pttOutOfChatIndividual,pttOutOfChatNewsletter:e.pttOutOfChatNewsletter,pttPlaybackBroadcast:e.pttPlaybackBroadcast,pttPlaybackGroup:e.pttPlaybackGroup,pttPlaybackIndividual:e.pttPlaybackIndividual,pttPlaybackNewsletter:e.pttPlaybackNewsletter,pttRecordBroadcast:e.pttRecordBroadcast,pttRecordGroup:e.pttRecordGroup,pttRecordIndividual:e.pttRecordIndividual,pttRecordNewsletter:e.pttRecordNewsletter,pttSendBroadcast:e.pttSendBroadcast,pttSendGroup:e.pttSendGroup,pttSendIndividual:e.pttSendIndividual,pttSendNewsletter:e.pttSendNewsletter,pttPausedRecordBroadcast:e.pttPausedRecordBroadcast,pttPausedRecordGroup:e.pttPausedRecordGroup,pttPausedRecordIndividual:e.pttPausedRecordIndividual,pttPausedRecordNewsletter:e.pttPausedRecordNewsletter});t.commit(),v(e),new(o("WAWebCommunityTabActionWamEvent")).CommunityTabActionWamEvent({communityTabGroupNavigations:e.communityTabGroupNavigations,communityTabToHomeViews:e.communityTabToHomeViews,communityTabViews:e.communityTabViews,communityTabViewsViaContextMenu:e.communityTabViewsViaContextMenu}).commit(),e.communityHome!=null&&Object.keys(e.communityHome).forEach(function(t){var n=r("WAWebWid").user(t);if(n!=null){var a=e.communityHome[t],i=a.communityHomeGroupDiscoveries,l=a.communityHomeGroupJoins,s=a.communityHomeGroupNavigations,u=a.communityHomeViews;new(o("WAWebCommunityHomeActionWamEvent")).CommunityHomeActionWamEvent({communityHomeId:n,communityHomeGroupDiscoveries:i,communityHomeGroupJoins:l,communityHomeGroupNavigations:s,communityHomeViews:u}).commit()}}),e.pnhCagActions!=null&&Object.keys(e.pnhCagActions).forEach(function(t){var n=e.pnhCagActions[t],r=n.pnhIndicatorClicksChat,a=n.pnhIndicatorClicksInfoScreen,i=n.reactionDeleteCount,l=n.reactionOpenTrayCount;new(o("WAWebPnhDailyWamEvent")).PnhDailyWamEvent({communityId:t,pnhIndicatorClicksChat:r,pnhIndicatorClicksInfoScreen:a,reactionDeleteCount:i,reactionOpenTrayCount:l,typeOfGroup:o("WAWebWamEnumTypeOfGroupEnum").TYPE_OF_GROUP_ENUM.DEFAULT_SUBGROUP}).commit()});var n=new(o("WAWebKeepInChatNotifWamEvent")).KeepInChatNotifWamEvent({kicGroupNotificationTaps:e.kicGroupNotificationTaps,kicGroupNotifications:e.kicGroupNotifications,kicNotificationTaps:e.kicNotificationTaps,kicNotifications:e.kicNotifications});n.commit(),o("WAWebABProps").getABPropConfigValue("single_emoji_logging_enabled")&&new(o("WAWebWaFsSingleEmojiMessageDailyWamEvent")).WaFsSingleEmojiMessageDailyWamEvent({animatedEmojiSendCnt:e.animatedEmojiSend,emojiReplyCount:e.emojiReply,singleEmojiSendCnt:e.singleEmojiSend}).commit(),o("WAWebSubmitChatLockDailyStats").submitChatLockDailyStats(e)}),new(o("WAWebWebDynamicSamplingTestEventWithoutSamplingWamEvent")).WebDynamicSamplingTestEventWithoutSamplingWamEvent().commit(),new(o("WAWebWebDynamicSamplingTestEventWithSamplingWamEvent")).WebDynamicSamplingTestEventWithSamplingWamEvent().commit()}),L.apply(this,arguments)}function E(){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebBackendApi").frontendSendAndReceive("getDeviceInfo",void 0);return{languageCode:e.lg,locationCode:e.lc,osBuildNumber:e.osBuild,simMcc:parseInt(e.mcc,10),simMnc:parseInt(e.mnc,10)}}),k.apply(this,arguments)}function I(){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e,t,n,a,i=[];i.push("con"),i.push("id"),i.push("ss"),i.push("sk"),o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()&&i.push("ch_jid"),o("WAWebLidStatusMigrationGating").getLidStatusSendEnabled()&&i.push("st_lid"),o("WAWebUserPrefsFavoritesLidMigration").isFavoritesMigrationComplete()&&i.push("fav"),o("WAWebUserPrefsCartLidMigration").isCartLidMigrationComplete()&&i.push("cart"),o("WAWebUserPrefsLabelAssociationsLidMigration").isLabelAssociationsMigrationComplete()&&i.push("lab");var l=o("WAWebUserPrefsPhoneNumberHidingThreadPromotionMigration").isPhoneNumberHidingThreadPromotionMigrationComplete();l&&i.push("pnh_lid"),o("WAWebBlocklistMigration").isBlocklistMigrated()&&i.push("bl_lid"),o("WAWebInactiveGroupLidMigration").isInactiveGroupLidMigrationComplete()&&i.push("inactg");var f=yield o("WAWebSchemaChat").getChatTable().all(),g=yield o("WAWebSchemaGroupMetadata").getGroupMetadataTable().all(),h,y,C;try{if(h=f.filter(function(e){var t=o("WAWebWidFactory").createWid(e.id);return t.isRegularUser()&&o("WAWebLidMigrationUtils").toLid(t)==null}),y=f.filter(function(e){var t=o("WAWebWidFactory").createWid(e.id);return t.isRegularUser()&&e.accountLid==null}),o("WAWebCurrentUser").isEmployee()){var b=function(t){var e,n,r=o("WAWebWidFactory").createWid(t.id);return"chat id: "+r.toLogString()+", account lid: "+(t.accountLid==null?"null":o("WAWebWidFactory").createWid(t.accountLid).toLogString())+", mapping: "+((e=(n=o("WAWebLidMigrationUtils").toLid(r))==null?void 0:n.toLogString())!=null?e:"null")};o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["getLidMigrationStatus: PN chat without mapping: ",""])),h.slice(0,5).map(b).join(",")),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["getLidMigrationStatus: chats without account_lid: ",""])),y.slice(0,5).map(b).join(","))}if(r("justknobx")._("5315")){var v=0,S=0;f.forEach(function(e){var t=o("WAWebWidFactory").createWid(e.id);t.isLid()&&e.lidOriginType===o("WAWebUsernameTypes").LidOriginType.PNH_CTWA&&(o("WAWebLidMigrationUtils").toPn(t)==null?S++:v++)}),C={numberOfPnhCtwaThreadsKnownMapping:v,numberOfPnhCtwaThreadsMissingMapping:S},l&&(S>0||v>0)&&(o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["getLidMigrationStatus: switching back PNH thread migration to unmigrated. Found "," threads with missing mapping and "," threads with known mapping"])),S,v),o("WAWebUserPrefsPhoneNumberHidingThreadPromotionMigration").setPhoneNumberHidingThreadPromotionMigrationState("unmigrated"))}}catch(e){o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["getLidMigrationStatus: ",""])),e)}var R=o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.lidMigrationSource()===o("WAWebUserPrefsTypes").LidMigrationSource.HISTORY?o("WAWebWamEnumLidMigrationSourceType").LID_MIGRATION_SOURCE_TYPE.HISTORY:o("WAWebWamEnumLidMigrationSourceType").LID_MIGRATION_SOURCE_TYPE.PEER,L=0,E=0;try{for(var k of g)k.isLidAddressingMode===!0?E++:L++;o("WAWebCurrentUser").isEmployee()&&(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["getLidMigrationStatus: numberOfPnGroups: ",""])),L),o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["getLidMigrationStatus: numberOfLidGroups: ",""])),E))}catch(e){o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["getLidMigrationStatus: error counting groups: ",""])),e)}return babelHelpers.extends({completedMigrations:i.join(","),numberOfPnChatsWithoutMapping:(e=(t=h)==null?void 0:t.length)!=null?e:-1,numberOfUserChatsWithoutAccountLid:o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()?(n=(a=y)==null?void 0:a.length)!=null?n:-1:void 0,lidMigrationSource:R,numberOfPnGroups:L,numberOfLidGroups:E},C)}),T.apply(this,arguments)}function D(){return x.apply(this,arguments)}function x(){return x=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e,t,n,r;o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["getPrivacySettings"])));var a=o("WAWebUserPrefsGeneral").getUserPrivacySettings(),i={receiptsEnabled:a.readReceipts!=="none"},l=yield o("WAWebApiPrivacyDisallowedList").queryDisallowedLists();i.privacySettingsAbout=$(a.about),i.privacySettingsAboutExceptNum=a.about==="contact_blacklist"?P((e=l.about)==null?void 0:e.disallowedList.length):null,i.privacySettingsGroups=$(a.groupAdd),i.privacySettingsGroupsExceptNum=a.groupAdd==="contact_blacklist"?P((t=l.groupadd)==null?void 0:t.disallowedList.length):null,i.privacySettingsLastSeen=$(a.lastSeen),i.privacySettingsLastSeenExceptNum=a.lastSeen==="contact_blacklist"?P((n=l.last)==null?void 0:n.disallowedList.length):null,i.privacySettingsProfilePhoto=$(a.profilePicture),i.privacySettingsProfilePhotoExceptNum=a.profilePicture==="contact_blacklist"?P((r=l.profile)==null?void 0:r.disallowedList.length):null;var s=o("WAWebEphemeralityResolver").getEphemeralDurationForUser(o("WAWebContactCollection").ContactCollection.getMeContact());if(i.defaultDisappearingDuration=s!=null?s:0,i.defenseMode=N(a.defenseMode),o("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_daily_logs")){i.isDefaultDisappearingMessagingUser=i.defaultDisappearingDuration!==0;var u=yield o("WAWebApiPrivacyEphemerality").queryEphemeralityDailyLogInfo(),c=u.countEphemeralThreads,d=u.countEphemeralThreadsEnabledByMe,m=u.isEphemeralMessagingUser;i.isEphemeralMessagingUser=m,i.countEphemeralThreads=c,i.countEphemeralThreadsEnabledByMe=d}return i}),x.apply(this,arguments)}function $(e){return e==null?null:e==="all"?o("WAWebWamEnumPrivacySettingsValueType").PRIVACY_SETTINGS_VALUE_TYPE.EVERYONE:e==="contacts"?o("WAWebWamEnumPrivacySettingsValueType").PRIVACY_SETTINGS_VALUE_TYPE.MY_CONTACTS:e==="contact_blacklist"?o("WAWebWamEnumPrivacySettingsValueType").PRIVACY_SETTINGS_VALUE_TYPE.MY_CONTACTS_EXCEPT:e==="none"?o("WAWebWamEnumPrivacySettingsValueType").PRIVACY_SETTINGS_VALUE_TYPE.NOBODY:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}function P(e){return e==null?null:e===0?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B0:e<5?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B1:e<10?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B5:e<15?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B10:e<20?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B15:e<30?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B20:e<40?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B30:e<50?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B40:e<60?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B50:e<70?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B60:e<80?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B70:e<90?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B80:e<100?o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B90:o("WAWebWamEnumPrivacySettingsContactsBuckets").PRIVACY_SETTINGS_CONTACTS_BUCKETS.B100}function N(e){if(e==null)return-1;switch(e){case"off":return 0;case"on_standard":return 1}}function M(){return w.apply(this,arguments)}function w(){return w=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=r("WAWebLidAwareContactsDB").equals(["isAddressBookContact"],1).then(function(e){return r("countWhere")(e,function(e){return!r("WAWebWid").isStringLid(e.id)})}),t=o("WAStorageEstimator").estimateStorage(),a=o("WAWebMediaStore").LruMediaStore.count(),i=r("WAWebLidAwareContactsDB").count(),l=o("WAWebContactCollection").ContactCollection.getFilteredContacts({}).length,s=yield(g||(g=n("Promise"))).all([t,e,a,i]),u=s[0],c=s[1],d=s[2],m=s[3],p=0,_=0,f=0;if(u.success){var h=u.value,y=h.quota,C=h.usage;p=y-C,_=y,f=C}return{addressbookWhatsappSize:q(c,10),storageAvailSize:q(p,100),storageTotalSize:q(_,100),storageUsed:q(f,100),mediaFolderFileCount:d,webcContactsTableSize:q(m,10),webcFilteredContactsSize:l}}),w.apply(this,arguments)}function A(){return o("WAWebEstimateFtsStorageApi").getEstimatedFTSDbSize()}function F(){var e=o("WAWebWamEnumNotificationSettingType").NOTIFICATION_SETTING_TYPE.UNKNOWN;if(window.Notification!=null)switch(window.Notification.permission){case o("WAWebNotificationConstants").PERMISSION_ALLOWED:e=o("WAWebWamEnumNotificationSettingType").NOTIFICATION_SETTING_TYPE.ALLOWED;break;case o("WAWebNotificationConstants").PERMISSION_DENIED:e=o("WAWebWamEnumNotificationSettingType").NOTIFICATION_SETTING_TYPE.BLOCKED;break;default:e=o("WAWebWamEnumNotificationSettingType").NOTIFICATION_SETTING_TYPE.UNKNOWN}var t;return o("WAWebContactManagementGating").contactManagementEnabled()&&(t=o("WAWebUserPrefsContactManagement").getSyncToAddressbookDefaultSetting()),{osNotificationSetting:e,isContactSyncToOsDefaultOn:t}}function O(){return B.apply(this,arguments)}function B(){return B=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=[],t=[],n=window.navigator.mediaCapabilities;if(n!=null){var r={width:800,height:600,bitrate:1e4,framerate:30},o={type:"record"},a={type:"file"},i={contentType:'video/mp4; codecs="avc1.42000a"'},l={contentType:'video/mp4; codecs="hev1.1.6.L93.B0"'},s={contentType:'video/mp4; codecs="av01.0.00M.08"'},u={contentType:'video/mp4; codecs="vp09.00.51.08.01.01.01.01.00"'},c=babelHelpers.extends({},o,{video:babelHelpers.extends({},i,r)}),d=babelHelpers.extends({},o,{video:babelHelpers.extends({},l,r)}),m=babelHelpers.extends({},o,{video:babelHelpers.extends({},s,r)}),p=babelHelpers.extends({},o,{video:babelHelpers.extends({},u,r)}),_=babelHelpers.extends({},a,{video:babelHelpers.extends({},i,r)}),f=babelHelpers.extends({},a,{video:babelHelpers.extends({},l,r)}),g=babelHelpers.extends({},a,{video:babelHelpers.extends({},s,r)}),h=babelHelpers.extends({},a,{video:babelHelpers.extends({},u,r)});if(n.encodingInfo!=null){try{(yield n.encodingInfo(c)).supported&&e.push("avc")}catch(e){}try{(yield n.encodingInfo(d)).supported&&e.push("hevc")}catch(e){}try{(yield n.encodingInfo(m)).supported&&e.push("av1")}catch(e){}try{(yield n.encodingInfo(p)).supported&&e.push("vp9")}catch(e){}}if(n.decodingInfo!=null){try{(yield n.decodingInfo(_)).supported&&t.push("avc")}catch(e){}try{(yield n.decodingInfo(f)).supported&&t.push("hevc")}catch(e){}try{(yield n.decodingInfo(g)).supported&&t.push("av1")}catch(e){}try{(yield n.decodingInfo(h)).supported&&t.push("vp9")}catch(e){}}}return{supportedEncoders:e.join(","),supportedDecoders:t.join(",")}}),B.apply(this,arguments)}function W(){return{screenAutoLockDuration:o("WAWebUserPrefsScreenLock").getScreenLockDurationForLogging()}}function q(e,t){return r("gkx")("26258")?Math.round(e/t)*t:e}function U(){return V.apply(this,arguments)}function V(){return V=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield(g||(g=n("Promise"))).all([o("WAWebChatThreadLoggingUtils").getMeHasUsername(),o("WAWebChatThreadLoggingUtils").getMeHasUsernamePin()]),t=e[0],r=e[1],a=o("WAWebUserPrefsUsername").getUsernameState(),i;return a==="ACTIVE"?i=o("WAWebWamEnumUsernameState").USERNAME_STATE.ACTIVATED:a==="RESERVED"&&(i=o("WAWebWamEnumUsernameState").USERNAME_STATE.RESERVED),{hasUsername:t,hasUsernamePin:r,usernameState:i}}),V.apply(this,arguments)}function H(){return G.apply(this,arguments)}function G(){return G=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield r("WAWebLidAwareContactsDB").all(),t=e.filter(function(e){return r("WAWebWid").isStringLid(e.id)}),n=new Set,a=0,i=new Set,l=0;for(var s of t){var u=o("WAWebWidFactory").createUserLidOrThrow(s.id),c=o("WAWebApiContact").getLatestLid(u);c!=null&&!u.equals(c)&&n.add(s.id),s.isUsernameContact===!0&&!n.has(s.id)&&a++,!r("isStringNullOrEmpty")(s.phoneNumber)&&!r("isStringNullOrEmpty")(s.username)&&i.add(r("nullthrows")(s.phoneNumber)),s.isContactSyncCompleted===0&&l++}return{usernameOnlyContactsSize:a,deprecatedContactsSize:n.size,uniquePhoneNumberContactsSizeWithUsername:i.size,contactsRequiringSyncBeforeDisplaySize:l}}),G.apply(this,arguments)}l.logDailyStats=R,l.getLidMigrationStatus=I}),98); __d("WAWebApiTextStatus",["Promise","WATimeUtils","WAWebLidAwareContactsDB","WAWebModelStorageUtils","WAWebTextStatusGatingUtils","WAWebTextStatusUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(){var t=o("WATimeUtils").unixTime();return o("WAWebTextStatusGatingUtils").receiveTextStatusEnabled()?o("WAWebModelStorageUtils").getStorage().lock(["contact"],n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield r("WAWebLidAwareContactsDB").lessThan(["textStatusExpiryTs"],t);if(!(!e||e.length===0)){var n=e.map(function(e){return{id:e.id,textStatusString:void 0,textStatusEmoji:void 0,textStatusExpiryTs:void 0,textStatusEphemeralDuration:void 0,textStatusLastUpdateTime:o("WAWebTextStatusUtils").CLEAR_TEXT_STATUS_LAST_UPDATE_TIME_VAL}});return r("WAWebLidAwareContactsDB").bulkCreateOrMerge(n,"ApiTextStatus.updateExpiredTextStatusOfContact")}})):(e||(e=n("Promise"))).resolve()}l.updateExpiredTextStatusOfContact=s}),98); __d("WAWebUtmBizPrefs",["WAWebUserPrefsKeys","WAWebUserPrefsStore"],(function(t,n,r,o,a,i,l){function e(e,t){var n=c(),a=Date.now();n[e]=babelHelpers.extends({addedTime:a},t),r("WAWebUserPrefsStore").setUser(o("WAWebUserPrefsKeys").KEYS.CHAT_UTM,JSON.stringify(n))}function s(e){var t=c();delete t[e],r("WAWebUserPrefsStore").setUser(o("WAWebUserPrefsKeys").KEYS.CHAT_UTM,JSON.stringify(t))}function u(e){var t=r("WAWebUserPrefsStore").getUser(o("WAWebUserPrefsKeys").KEYS.CHAT_UTM);if(t==null)return null;try{return JSON.parse(t)[e]}catch(e){return null}}function c(){var e=r("WAWebUserPrefsStore").getUser(o("WAWebUserPrefsKeys").KEYS.CHAT_UTM);if(e==null)return{};try{var t;return(t=JSON.parse(e))!=null?t:{}}catch(e){return{}}}function d(){r("WAWebUserPrefsStore").setUser(o("WAWebUserPrefsKeys").KEYS.CHAT_UTM,JSON.stringify({}))}l.persistUtmtoLocalStorage=e,l.removeUtmFromLocalStorage=s,l.getUtmFromLocalStorage=u,l.getAllUtmsFromLocalStorage=c,l.clearAllUtmFromLocalStorage=d}),98); __d("WAWebUtmBizUtils",["WAWebBizGatingUtils","WAWebMsgGetters","WAWebStateUtils"],(function(t,n,r,o,a,i,l){function e(e,t){return e.contact.isEnterprise&&!c(t)&&!s(e,t)}function s(e,t){var n=u(e);if(n==null||n.t==null)return!1;var r=n.t*1e3;return r>t.addedTime}function u(e){for(var t=o("WAWebStateUtils").unproxy(e),n=t.msgs.length-1;n>=0;n--){var r=t.msgs.at(n);if(r&&!o("WAWebMsgGetters").getIsSentByMe(r))return r}}function c(e){var t=Date.now(),n=o("WAWebBizGatingUtils").utmTrackingExpirationInHours()*60*60*1e3;return e.addedTime+n<=t}l.isUtmValid=e,l.hasUtmExpired=c}),98); __d("WAWebCleanUtmJob",["WAJobOrchestratorTypes","WAPromiseCallSync","WAWebOrchestratorNonPersistedJob","WAWebUtmBizPrefs","WAWebUtmBizUtils"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("cleanExpiredUtm",function(){return s()},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT}).waitUntilCompleted()}function s(){return o("WAPromiseCallSync").promiseCallSync(function(){var e=o("WAWebUtmBizPrefs").getAllUtmsFromLocalStorage();Object.keys(e).forEach(function(t){var n=e[t];o("WAWebUtmBizUtils").hasUtmExpired(n)&&o("WAWebUtmBizPrefs").removeUtmFromLocalStorage(t)})})}l.cleanExpiredUtmJob=e}),98); __d("WAWebDBPurgeExpiredRecords",["Promise","WAWeb-moment","WAWebDBMapOrphansToProviders","WAWebDBOrphanDbSerialization","WAWebMsgType","WAWebSchemaMessage","WAWebSchemaMessageOrphans","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a){var i=r("WAWeb-moment")().subtract(t,"days").unix(),l=r("WAWeb-moment")().subtract(a,"days").unix(),s=yield o("WAWebSchemaMessageOrphans").getMessageOrphanTable().between(["t"],0,i),u=new Set(s.map(function(e){return e.parentMsgKey})),c=yield o("WAWebSchemaMessage").getMessageTable().bulkGet(Array.from(u)),d=new Set(c.filter(function(e){return e&&e.type===o("WAWebMsgType").MSG_TYPE.UNKNOWN}).map(function(e){return e==null?void 0:e.id})),m=s.filter(function(e){return!d.has(e.parentMsgKey)||e.t0){if(e==="app-launch"){o("WAWebFetchQuickPromotions").fetchQuickPromotions().then(function(){o("WATaskScheduler").rescheduleNow(o("WAWebTasksTaskType").TaskType.FETCH_QUICK_PROMOTIONS)});return}if(e==="fetch-success")return}}o("WAWebBackendApi").frontendFireAndForget("loadedQuickPromotions",{promotions:n})})})}l.loadQuickPromotions=e}),98); __d("WAWebJobUpdateQPSurfaces",["Promise","WALogger","WATimeUtils","WAWebCTWAConstants","WAWebJobLoadQuickPromotions","WAWebModelStorageUtils","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e){var t,n,r,o,a,i=(t=e.qpConfigPacing)==null?void 0:t.userInfo;return{impressions:(n=i==null?void 0:i.impressionCount)!=null?n:0,primaryClicks:(r=i==null?void 0:i.primaryClickCount)!=null?r:0,secondaryClicks:(o=i==null?void 0:i.secondaryClickCount)!=null?o:0,dismisses:(a=i==null?void 0:i.dismissClickCount)!=null?a:0}}function d(e,t){var n,r,o,a,i,l=e.tracking,s=(n=t.qpConfigPacing)==null?void 0:n.userInfo,u=c(t),d=l.dismisses-((r=s==null?void 0:s.dismissClickCount)!=null?r:0),m=l.primaryClicks-((o=s==null?void 0:s.primaryClickCount)!=null?o:0),p=l.secondaryClicks-((a=s==null?void 0:s.secondaryClickCount)!=null?a:0),_=l.impressions-((i=s==null?void 0:s.impressionCount)!=null?i:0);d>0&&(u.dismisses+=d),m>0&&(u.primaryClicks+=m),p>0&&(u.secondaryClicks+=p),_>0&&(u.impressions+=_);var f=l.lastDismissTs,g=l.lastImpressionTs,h=l.lastPrimaryClickTs,y=l.lastSecondaryClickTs;return g!=null&&(u.lastImpressionTs=g),h!=null&&(u.lastPrimaryClickTs=h),y!=null&&(u.lastSecondaryClickTs=y),f!=null&&(u.lastDismissTs=f),u}function m(e,t,n){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r,a){if(t.length===0)return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["updateQPSurfaces: no surfaces"]))),(u||(u=n("Promise"))).resolve();var i=t.map(function(e){return e.id}),l=new Set(i);if(l.size!==i.length)return o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["updateQPSurfaces: found duplicated surface"]))),(u||(u=n("Promise"))).resolve();var m=new Map;t.forEach(function(e){o("WAWebCTWAConstants").KNOWN_QP_SURFACES.has(e.id)&&e.promotions.forEach(function(t){m.set(t.id,{promotion:t,surfaceId:e.id})})}),yield o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateQPSurfaces",function(){return o("WAWebModelStorageUtils").getStorage().lock(["quick-promotions"],(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e[0],o=yield t.anyOf(["surfaceId"],i),l=a==null?void 0:a.locale,s=o.map(function(e){var n=e.id,o=m.get(n);if(o==null)return t.remove(n);var a=d(e,o.promotion),i={data:o.promotion,ts:r,tracking:a};return l!=null&&(i.locale=l),m.delete(n),t.merge(n,i)});yield(u||(u=n("Promise"))).all(s);var p=Array.from(m.values()),_=p.map(function(e){var t=e.promotion,n=e.surfaceId,o={id:t.id,surfaceId:n,data:t,ts:r,tracking:c(t)};return l!=null&&(o=babelHelpers.extends({},o,{locale:l})),o});yield t.bulkCreate(_)});return function(t){return e.apply(this,arguments)}})())}).waitUntilCompleted(),yield o("WAWebJobLoadQuickPromotions").loadQuickPromotions("fetch-success")}),p.apply(this,arguments)}function _(e,t){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){return m(e,t)}),f.apply(this,arguments)}function g(e,t){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WATimeUtils").unixTime();return m(e,n,{locale:t})}),h.apply(this,arguments)}l.updateQPSurfacesFromNotification=_,l.updateQPSurfacesFromGraphQLFetch=g}),98); __d("WAWebCommonCTWAQplHelpers",["WAWebGraphQLServerError","WAWebQplQuickPerformanceLoggerModule"],(function(t,n,r,o,a,i,l){function e(e){var t=e.error,n=e.errorAnnotationName,r=e.errorMessageAnnotationName,a=e.markerId;if(t instanceof o("WAWebGraphQLServerError").GraphQLServerError){var i,l;o("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(a,{string:(l={},l[n]=(i=t.name)!=null?i:"UNKNOWN",l[r]=t.source.errors.map(function(e){var t;return"["+e.code+"] "+((t=e.message)!=null?t:"")}).join("|"),l)})}else if(t instanceof Error){var s,u,c;o("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(a,{string:(c={},c[n]=(s=t.name)!=null?s:"UNKNOWN",c[r]=(u=t.message)!=null?u:"",c)})}else{var d;o("WAWebQplQuickPerformanceLoggerModule").QPL.markerAnnotate(a,{string:(d={},d[n]=String(t),d[r]="",d)})}}l.qplAnnotateGraphQLError=e}),98); __d("WAWebFetchQuickPromotionsQuery_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="23863939843202957"}),null); __d("WAWebFetchQuickPromotionsQuery.graphql",["WAWebFetchQuickPromotionsQuery_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"nux_ids"},{defaultValue:null,kind:"LocalArgument",name:"trigger_context"}],t=[{kind:"Literal",name:"include_holdouts",value:!0},{kind:"Literal",name:"supports_client_side_filters",value:!0},{kind:"Variable",name:"surface_nux_ids",variableName:"nux_ids"},{kind:"Variable",name:"trigger_context",variableName:"trigger_context"}],r={alias:null,args:null,kind:"ScalarField",name:"surface_nux_id",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"client_ttl_seconds",storageKey:null},a={alias:null,args:null,kind:"ScalarField",name:"priority",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"is_holdout",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"log_eligibility_waterfall",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"start",storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"end",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"promotion_id",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"is_server_force_pass",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"ab_prop_name",storageKey:null},p={alias:null,args:null,kind:"ScalarField",name:"surface_delay_in_seconds",storageKey:null},_={alias:null,args:null,kind:"ScalarField",name:"encrypted_logging_data",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"client_side_dry_run",storageKey:null},g=[{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null}],h=[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPText",selections:g,args:null,argumentDefinitions:[]}],y={alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"title",plural:!1,selections:h,storageKey:null},C={alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},b=[{alias:null,args:null,kind:"ScalarField",name:"jpeg_thumbnail",storageKey:null}],v={alias:null,args:null,concreteType:"WAQPMediaDetails",kind:"LinkedField",name:"wa_light_mode_media_details",plural:!1,selections:b,storageKey:null},S={alias:null,args:null,concreteType:"WAQPMediaDetails",kind:"LinkedField",name:"wa_dark_mode_media_details",plural:!1,selections:b,storageKey:null},R={alias:null,args:null,kind:"ScalarField",name:"accessibility_text_for_image",storageKey:null},L={alias:null,args:null,kind:"ScalarField",name:"is_dismissible",storageKey:null},E={alias:null,args:null,concreteType:"QPContentAttributeDescriptor",kind:"LinkedField",name:"content_attributes",plural:!1,selections:[{alias:null,args:null,concreteType:"WhatsappQPColors",kind:"LinkedField",name:"wa_banner_background_color",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"light_mode_highlight_color",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dark_mode_highlight_color",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"light_mode_background_color",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dark_mode_background_color",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"wa_primary_cta_alternative_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"wa_eligible_duration_after_impression_in_seconds",storageKey:null}],storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null},I={alias:null,args:null,concreteType:"WAQPContentAttribute",kind:"LinkedField",name:"wa_qp_content_attributes_do_not_use",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},k],storageKey:null},T={alias:null,args:null,kind:"ScalarField",name:"clause_type",storageKey:null},D=[{alias:null,args:null,kind:"ScalarField",name:"filter_name",storageKey:null},{alias:null,args:null,concreteType:"QPFilterParameter",kind:"LinkedField",name:"parameters",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},k],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"passes_if_client_not_supported",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"filter_result",storageKey:null}],x={kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPWAFilterClause",selections:[T,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilter",kind:"LinkedField",name:"filters",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPWAFilter",selections:D,args:null,argumentDefinitions:[]}],storageKey:null}],args:null,argumentDefinitions:[]},$={alias:null,args:null,concreteType:"QPUserInteractionInfo",kind:"LinkedField",name:"user_interaction_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"impression_max_instances",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"impression_count_for_user",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dismiss_max_instances",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dismiss_click_count_for_user",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primary_click_max_instances",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primary_click_count_for_user",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"secondary_click_count_for_user",storageKey:null}],storageKey:null},P={alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"title",plural:!1,selections:g,storageKey:null},N={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},M={alias:null,args:null,concreteType:"QuickPromotionFlattenedFilter",kind:"LinkedField",name:"filters",plural:!0,selections:D,storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebFetchQuickPromotionsQuery",selections:[{alias:null,args:t,concreteType:"QuickPromotionBatchFetchSurface",kind:"LinkedField",name:"quick_promotion_batch_fetch_root",plural:!0,selections:[r,{alias:null,args:null,concreteType:"QuickPromotionSurfaceEligiblePromotionsConnection",kind:"LinkedField",name:"eligible_promotions",plural:!1,selections:[{alias:null,args:null,concreteType:"QuickPromotionSurfaceEligiblePromotionsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{kind:"RequiredField",field:o,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.client_ttl_seconds"},{kind:"RequiredField",field:a,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.priority"},{kind:"RequiredField",field:i,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.is_holdout"},{kind:"RequiredField",field:l,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.log_eligibility_waterfall"},{kind:"RequiredField",field:{alias:null,args:null,concreteType:"TimeRange",kind:"LinkedField",name:"time_range",plural:!1,selections:[{kind:"RequiredField",field:s,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.time_range.start"},{kind:"RequiredField",field:u,action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.time_range.end"}],storageKey:null},action:"LOG",path:"quick_promotion_batch_fetch_root.eligible_promotions.edges.time_range"},{alias:null,args:null,concreteType:"QuickPromotion",kind:"LinkedField",name:"node",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QuickPromotion",selections:[c,d,m,p,_,f,{alias:null,args:null,concreteType:"QuickPromotionCreative",kind:"LinkedField",name:"creatives",plural:!0,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPCreative",selections:[y,{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"content",plural:!1,selections:h,storageKey:null},{alias:null,args:null,concreteType:"QuickPromotionAction",kind:"LinkedField",name:"primary_action",plural:!1,selections:[{kind:"InlineDataFragmentSpread",name:"WAWebFetchQuickPromotionsQuery_QPAction",selections:[y,C],args:null,argumentDefinitions:[]}],storageKey:null},v,S,R,L],args:null,argumentDefinitions:[]}],storageKey:null},E,I,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"contextual_filters_for_wa_do_not_use",plural:!1,selections:[x,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[x,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[x,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[x],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},$],args:null,argumentDefinitions:[]}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebFetchQuickPromotionsQuery",selections:[{alias:null,args:t,concreteType:"QuickPromotionBatchFetchSurface",kind:"LinkedField",name:"quick_promotion_batch_fetch_root",plural:!0,selections:[r,{alias:null,args:null,concreteType:"QuickPromotionSurfaceEligiblePromotionsConnection",kind:"LinkedField",name:"eligible_promotions",plural:!1,selections:[{alias:null,args:null,concreteType:"QuickPromotionSurfaceEligiblePromotionsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[o,a,i,l,{alias:null,args:null,concreteType:"TimeRange",kind:"LinkedField",name:"time_range",plural:!1,selections:[s,u],storageKey:null},{alias:null,args:null,concreteType:"QuickPromotion",kind:"LinkedField",name:"node",plural:!1,selections:[c,d,m,p,_,f,{alias:null,args:null,concreteType:"QuickPromotionCreative",kind:"LinkedField",name:"creatives",plural:!0,selections:[P,{alias:null,args:null,concreteType:"TextWithEntities",kind:"LinkedField",name:"content",plural:!1,selections:g,storageKey:null},{alias:null,args:null,concreteType:"QuickPromotionAction",kind:"LinkedField",name:"primary_action",plural:!1,selections:[P,C],storageKey:null},v,S,R,L,N],storageKey:null},E,I,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"contextual_filters_for_wa_do_not_use",plural:!1,selections:[T,M,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[T,M,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[T,M,{alias:null,args:null,concreteType:"QuickPromotionFlattenedFilterClause",kind:"LinkedField",name:"clauses",plural:!0,selections:[T,M],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},$,N],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:n("WAWebFetchQuickPromotionsQuery_facebookRelayOperation"),metadata:{},name:"WAWebFetchQuickPromotionsQuery",operationKind:"query",text:null}}})();a.exports=e}),null); __d("WAWebFetchQuickPromotionsQuery_QPAction.graphql",[],(function(t,n,r,o,a,i){"use strict";var e={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPAction"};a.exports=e}),null); __d("WAWebFetchQuickPromotionsQuery_QPCreative.graphql",[],(function(t,n,r,o,a,i){"use strict";var e={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPCreative"};a.exports=e}),null); __d("WAWebFetchQuickPromotionsQuery_QPText.graphql",[],(function(t,n,r,o,a,i){"use strict";var e={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPText"};a.exports=e}),null); __d("WAWebFetchQuickPromotionsQuery_QPWAFilter.graphql",[],(function(t,n,r,o,a,i){"use strict";var e={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPWAFilter"};a.exports=e}),null); __d("WAWebFetchQuickPromotionsQuery_QPWAFilterClause.graphql",[],(function(t,n,r,o,a,i){"use strict";var e={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QPWAFilterClause"};a.exports=e}),null); __d("WAWebFetchQuickPromotionsQuery_QuickPromotion.graphql",[],(function(t,n,r,o,a,i){"use strict";var e={kind:"InlineDataFragment",name:"WAWebFetchQuickPromotionsQuery_QuickPromotion"};a.exports=e}),null); __d("WAWebProtobufsQuickPromotionSurfaces.pb",["$InternalEnum","WAProtoConst"],(function(t,n,r,o,a,i,l){var e,s=n("$InternalEnum")({TRUE:1,FALSE:2,UNKNOWN:3}),u=n("$InternalEnum")({PASS_BY_DEFAULT:1,FAIL_BY_DEFAULT:2}),c=n("$InternalEnum")({AND:1,OR:2,NOR:3}),d={},m={},p={},_={};d.name="QP",d.internalSpec={},m.name="QP$FilterClause",m.internalSpec={clauseType:[1,(e=o("WAProtoConst")).FLAGS.REQUIRED|e.TYPES.ENUM,c],clauses:[2,e.FLAGS.REPEATED|e.TYPES.MESSAGE,m],filters:[3,e.FLAGS.REPEATED|e.TYPES.MESSAGE,p]},p.name="QP$Filter",p.internalSpec={filterName:[1,e.FLAGS.REQUIRED|e.TYPES.STRING],parameters:[2,e.FLAGS.REPEATED|e.TYPES.MESSAGE,_],filterResult:[3,e.TYPES.ENUM,s],clientNotSupportedConfig:[4,e.FLAGS.REQUIRED|e.TYPES.ENUM,u]},_.name="QP$FilterParameters",_.internalSpec={key:[1,e.TYPES.STRING],value:[2,e.TYPES.STRING]},l.QP$FilterResult=s,l.QP$FilterClientNotSupportedConfig=u,l.QP$ClauseType=c,l.QPSpec=d,l.QP$FilterClauseSpec=m,l.QP$FilterSpec=p,l.QP$FilterParametersSpec=_}),98); __d("WAWebFetchQuickPromotions",["Promise","WABase64","WACustomError","WALogger","WAPromiseRetryLoop","WAPromiseTimeout","WAQplTypes","WAWebBackendApi","WAWebBizGatingUtils","WAWebBuildConstants","WAWebCTWAConstants","WAWebCommonCTWAQplHelpers","WAWebFetchAdAccountToken","WAWebFetchQuickPromotionsQuery.graphql","WAWebFetchQuickPromotionsQuery_QPAction.graphql","WAWebFetchQuickPromotionsQuery_QPCreative.graphql","WAWebFetchQuickPromotionsQuery_QPText.graphql","WAWebFetchQuickPromotionsQuery_QPWAFilter.graphql","WAWebFetchQuickPromotionsQuery_QPWAFilterClause.graphql","WAWebFetchQuickPromotionsQuery_QuickPromotion.graphql","WAWebJobUpdateQPSurfaces","WAWebL10NCountryCodes","WAWebNetworkStatus","WAWebOrchestratorNonPersistedJob","WAWebProtobufsQuickPromotionSurfaces.pb","WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule","WAWebRelayClient","WAWebUserPrefsMeUser","WAWebWebp","compactMap","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R={type:"error"},L=1,E=1e3,k=3e3,I=e!==void 0?e:e=n("WAWebFetchQuickPromotionsQuery.graphql"),T=s!==void 0?s:s=n("WAWebFetchQuickPromotionsQuery_QuickPromotion.graphql"),D=u!==void 0?u:u=n("WAWebFetchQuickPromotionsQuery_QPCreative.graphql"),x=c!==void 0?c:c=n("WAWebFetchQuickPromotionsQuery_QPAction.graphql"),$=d!==void 0?d:d=n("WAWebFetchQuickPromotionsQuery_QPText.graphql"),P=m!==void 0?m:m=n("WAWebFetchQuickPromotionsQuery_QPWAFilterClause.graphql"),N=p!==void 0?p:p=n("WAWebFetchQuickPromotionsQuery_QPWAFilter.graphql");function M(e){o("WAWebCommonCTWAQplHelpers").qplAnnotateGraphQLError({error:e,markerId:o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,errorAnnotationName:"fetch_promotions_error",errorMessageAnnotationName:"fetch_promotions_error_message"})}function w(){return o("WAWebBizGatingUtils").qpGraphQLEnabled()?o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("fetchQuickPromotions",function(){return o("WAWebBackendApi").frontendSendAndReceive("getUserLocale").then(function(e){return A(e)})}).waitUntilCompleted():(S||(S=n("Promise"))).resolve({type:"not-enabled"})}function A(e){return r("WAWebNetworkStatus").waitIfOffline().then(function(){return o("WAPromiseTimeout").promiseTimeout(F(e),G()).then(function(t){return t.type==="success"?(o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: success"]))),o("WAWebJobUpdateQPSurfaces").updateQPSurfacesFromGraphQLFetch(t.quickPromotions,e).then(function(){return o("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,o("WAQplTypes").QuickLogActionType.SUCCESS),t}).catch(function(e){return o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: failed while saving to the DB: ",""])),String(e)),M(e),o("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,o("WAQplTypes").QuickLogActionType.FAIL),{type:"error"}})):(t.type,o("WALogger").WARN(g||(g=babelHelpers.taggedTemplateLiteralLoose(['fetchQuickPromotions: failed as "','"'])),t.type),t)}).catch(function(e){if(e instanceof o("WACustomError").TimeoutError)return o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,"fetch_promotions_end"),o("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,o("WAQplTypes").QuickLogActionType.ABORTED),o("WALogger").WARN(h||(h=babelHelpers.taggedTemplateLiteralLoose(['fetchQuickPromotions: failed as "timeout"']))),{type:"timeout"};throw e})})}function F(e){return o("WAWebQplQuickPerformanceLoggerModule").QPL.markerStart(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS),o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,"fetch_promotions_start"),o("WAWebFetchAdAccountToken").fetchToken().then(function(t){return t.type==="success"?O(t.token,e).then(function(e){return e.type==="success"?(o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,"fetch_promotions_end"),e):(o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,"fetch_promotions_end"),o("WAWebQplQuickPerformanceLoggerModule").QPL.markerEnd(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.FETCH_QUICK_PROMOTIONS,o("WAQplTypes").QuickLogActionType.FAIL),e.type==="auth-failure"?o("WAWebFetchAdAccountToken").markTokenAsInvalid():e.type,e)}):(t.type,t)})}function O(e,t){var n=L,r=function(o){return B(e,t).then(function(e){if(e.type==="success")o(e);else{var t=n>0;n--,t||o(e)}}).catch(function(e){var t=n>0;if(n--,!t)throw e})},a=new(o("WAPromiseRetryLoop")).PromiseRetryLoop({name:"fetchQuickPromotions",timer:{algo:{type:"exponential",first:E},max:k},code:r});return a.start(),a.promise()}function B(e,t){var r,a=Array.from(o("WAWebBizGatingUtils").qpSurfaceIdsUsingGraphQL());if(a.length===0)return(S||(S=n("Promise"))).resolve({type:"not-enabled"});var i=(r=o("WAWebUserPrefsMeUser").getMaybeMePnUser())==null?void 0:r.user;if(i==null)return(S||(S=n("Promise"))).resolve({type:"error"});var l=o("WAWebL10NCountryCodes").getCountryShortcodeByPhone(i),s;return o("WAWebRelayClient").fetchQuery(I,{nux_ids:a,trigger_context:{wa_smb_trigger_context:{is_from_wa_smb:!0,app_version:o("WAWebBuildConstants").VERSION_BASE,country:l,locale:t}}},{environmentType:"facebook",accessToken:e,getInlineDataReader:function(t){s=t}}).then(function(e){if(e==null)return R;var t=e.quick_promotion_batch_fetch_root,n=new Map,r=[];a.forEach(function(e){var t=H(e);if(t==null){r.length<3&&r.push(e);return}n.set(e,{id:t,promotions:[]})}),r.length>0&&o("WALogger").ERROR(y||(y=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: could not find "," nuxIds in reverse mapping => ",""])),r.length,r).sendLogs("quick-promotions-graphql-missing-surface");var i=[];return t.forEach(function(e){var t=e.eligible_promotions,r=e.surface_nux_id;if(!(r==null||t==null)){var a=n.get(r);if(a==null){i.length<3&&i.push(r);return}var l=t.edges;l.forEach(function(e){if(e!=null){var t=e.client_ttl_seconds,n=e.is_holdout,r=e.log_eligibility_waterfall,i=e.node,l=e.priority,u=e.time_range;if(i!=null){var c=s(T,i),d=c.ab_prop_name,m=c.client_side_dry_run,p=c.content_attributes,_=c.contextual_filters_for_wa_do_not_use,f=c.creatives,g=c.encrypted_logging_data,h=c.is_server_force_pass,y=c.promotion_id,v=c.surface_delay_in_seconds,S=c.user_interaction_info,R=c.wa_qp_content_attributes_do_not_use;if(!(y==null||h==null||p==null||v==null)){var L=p.wa_banner_background_color,E=p.wa_eligible_duration_after_impression_in_seconds,k=p.wa_primary_cta_alternative_url;if(E!=null){var I=f.map(function(e){return s(D,e)}),P=I[0],N,M,w,A,F;if(P!=null){var O=P.accessibility_text_for_image,B=P.content,W=P.primary_action,q=P.title,V=P.wa_dark_mode_media_details,H=P.wa_light_mode_media_details;if(q==null||B==null)return;if(M=s($,q).text,w=s($,B).text,W!=null){var G=s(x,W),z=G.title,j=G.url;if(z!=null){var K=s($,z);K.text!=null&&(N={text:K==null?void 0:K.text,deepLink:j,universalLink:k})}}if(A=P.is_dismissible,O!=null){var Q;try{(H==null?void 0:H.jpeg_thumbnail)!=null&&(Q={elementValue:new Uint8Array(o("WABase64").decodeB64(H.jpeg_thumbnail))})}catch(e){o("WALogger").ERROR(C||(C=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: failed to decode base64 for light mode media details"])))}var X;try{(V==null?void 0:V.jpeg_thumbnail)!=null&&(X={elementValue:new Uint8Array(o("WABase64").decodeB64(V.jpeg_thumbnail))})}catch(e){o("WALogger").ERROR(b||(b=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: failed to decode base64 for dark mode media details"])))}F={description:O,light:Q,dark:X}}}if(!(M==null||w==null||A==null)){var Y=L!=null?{lightHighlight:L.light_mode_highlight_color,lightBackground:L.light_mode_background_color,darkHighlight:L.dark_mode_highlight_color,darkBackground:L.dark_mode_background_color}:void 0,J=R.reduce(function(e,t){var n=t.name,r=t.value;return n==null||r==null||e.push({key:n,value:r}),e},[]),Z;if(S!=null){var ee=S.dismiss_click_count_for_user,te=S.dismiss_max_instances,ne=S.impression_count_for_user,re=S.impression_max_instances,oe=S.primary_click_count_for_user,ae=S.primary_click_max_instances,ie=S.secondary_click_count_for_user;if(ne==null||oe==null||ie==null||ee==null||re==null||ae==null||te==null)return;Z={promotionConfig:{maxImpressions:re,maxDismisses:te,maxPrimaryClicks:ae,maxSecondaryClicks:0},userInfo:{impressionCount:ne,primaryClickCount:oe,secondaryClickCount:ie,dismissClickCount:ee}}}var le=_!=null?U(_,s):void 0,se=g!=null?{elementValue:o("WAWebWebp").stringToUint8(g)}:void 0,ue={id:y,qpConfigPriority:l,qpConfigDismissable:A?"true":"false",qpConfigEligibilityDurationMs:E*1e3,qpConfigEndTimeSeconds:u.end,qpConfigExperimentKey:d,qpConfigExposureHoldout:n?"true":"false",qpConfigForcePass:h?"true":"false",qpConfigLogEligibilityWaterfall:r?"true":"false",qpConfigStartTimeSeconds:u.start,qpConfigSurfaceDelayTimeSeconds:v,qpConfigTtlSeconds:t,qpConfigClientSideDryRun:m===!0?"true":"false",titleElementValue:M,textElementValue:w,colors:Y,contentAttributes:{attribute:J},image:F,primaryAction:N,qpConfigPacing:Z,qpConfigFilterRules:le,header:void 0,instanceId:void 0,qpConfigDeterministic:"true",qpConfigImpressionCooldown:-1,qpConfigInstanceLogData:se,qpConfigMaxImpressions:-1,qpConfigTemplateName:"whatsapp_banner",qpConfigTriggersTrigger:[],secondaryAction:void 0};a.promotions.push(ue)}}}}}})}}),i.length>0&&o("WALogger").ERROR(v||(v=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: received "," unexpected nux IDs => ",""])),i.length,i),{type:"success",quickPromotions:Array.from(n.values(),function(e){var t=e.id,n=e.promotions;return{id:t,promotions:[].concat(n)}})}}).catch(function(e){return M(e),o("WAWebFetchAdAccountToken").hasGraphQLAuthError(e)?{type:"auth-failure"}:R})}function W(e){switch(e){case"AND_TYPE":return o("WAWebProtobufsQuickPromotionSurfaces.pb").QP$ClauseType.AND;case"OR_TYPE":return o("WAWebProtobufsQuickPromotionSurfaces.pb").QP$ClauseType.OR;case"NOR_TYPE":return o("WAWebProtobufsQuickPromotionSurfaces.pb").QP$ClauseType.NOR;default:throw r("err")("Unexpected future filter clause type")}}function q(e){switch(e){case"PASS":return o("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterResult.TRUE;case"FAIL":return o("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterResult.FALSE;case"UNKNOWN":return o("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterResult.UNKNOWN;default:throw r("err")("Unexpected future filter result")}}function U(e,t){var n=t(P,e),o=n.clause_type,a=n.filters,i=e.clauses;if(o!=null){var l=i!=null?r("compactMap")(i,function(e){return U(e,t)}):[],s=r("compactMap")(a,function(e){return V(e,t)}),u={clauseType:W(o),clauses:l,filters:s};return u}}function V(e,t){var n=t(N,e),r=n.filter_name,a=n.filter_result,i=n.parameters,l=n.passes_if_client_not_supported;if(r!=null){var s=i.reduce(function(e,t){var n=t.key,r=t.value;return n==null||r==null||e.push({key:n,value:r}),e},[]),u={filterName:r,parameters:s,clientNotSupportedConfig:l===!0?o("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterClientNotSupportedConfig.PASS_BY_DEFAULT:o("WAWebProtobufsQuickPromotionSurfaces.pb").QP$FilterClientNotSupportedConfig.FAIL_BY_DEFAULT,filterResult:a!=null?q(a):void 0};return u}}function H(e){for(var t of o("WAWebCTWAConstants").KNOWN_QP_SURFACES.entries()){var n=t[0],r=t[1];if(r===e)return n}}function G(){return o("WAWebFetchAdAccountToken").getMaximumAdAccountFetchTimeoutSeconds()*1e3+o("WAWebCTWAConstants").QP_FETCH_TIMEOUT_MS*(L+1)}l.fetchQuickPromotions=w}),98); __d("WAWebWamEnumWebcWindowNavigatorWebdriverType",[],(function(t,n,r,o,a,i){var e=Object.freeze({FALSE:0,TRUE:1,UNDEFINED:2});i.WEBC_WINDOW_NAVIGATOR_WEBDRIVER_TYPE=e}),66); __d("WAWebBrowserFeatures",["WAMd5","WAPlatformEstimate"],(function(t,n,r,o,a,i,l){"use strict";function e(){return navigator.plugins.length}function s(){var e,t;return(e=(t=navigator.mimeTypes)==null?void 0:t.length)!=null?e:0}function u(){return"Notification"in window&&Notification.permission!=="denied"}function c(){return"pdfViewerEnabled"in navigator&&navigator.pdfViewerEnabled===!0}function d(){var e,t;return screen.height!==((e=screen)==null?void 0:e.availHeight)||screen.width!==((t=screen)==null?void 0:t.availWidth)}function m(){return"share"in navigator&&"canShare"in navigator}function p(){return"chrome"in window}function _(){return window.history.length}function f(){return window.innerWidth+"x"+window.innerHeight}function g(){try{var e=document.createElement("canvas"),t=e.getContext("2d");return t==null?"":(e.width=120,e.height=20,t.font="14px 'Arial'",t.fillStyle="#fff",t.fillRect(0,0,120,20),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText("whatsapp web",2,15),o("WAMd5").md5(e.toDataURL()))}catch(e){return""}}function h(){return{pluginCount:e(),mimeTypeCount:s(),hasNotificationPermission:u(),isPDFViewerEnabled:c(),hasTaskbar:d(),hasWebShare:m(),hasChrome:p(),platformEstimate:r("WAPlatformEstimate")(),historyLength:_(),viewPortSize:f(),canvasFingerprint:g()}}l.default=h}),98); __d("WAWebWamFingerprint",["WAExternalInjectedSources","WAFPUtils","WAWebBrowserFeatures","WAWebDeviceFeatures"],(function(t,n,r,o,a,i,l){function e(){return babelHelpers.extends({webdriver:self.navigator.webdriver,browserEngine:o("WAFPUtils").DETECTED_BROWSER_ENGINE},r("WAWebBrowserFeatures")(),r("WAExternalInjectedSources")(),r("WAWebDeviceFeatures")())}l.default=e}),98); __d("WAWebWebcFingerprintWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumBrowserEngineName","WAWebWamEnumPlatformName","WAWebWamEnumWebcWindowNavigatorWebdriverType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({WebcFingerprint:[1704,{browserEngine:[26,o("WAWebWamEnumBrowserEngineName").BROWSER_ENGINE_NAME],connectionRtt:[37,e.TYPES.INTEGER],cpuMake:[38,e.TYPES.STRING],deviceMemory:[39,e.TYPES.STRING],extentionIds:[27,e.TYPES.STRING],externalSources:[36,e.TYPES.STRING],gpuMake:[40,e.TYPES.STRING],hasChrome:[28,e.TYPES.BOOLEAN],hasTaskbar:[29,e.TYPES.BOOLEAN],hasWebShare:[30,e.TYPES.BOOLEAN],historyLength:[41,e.TYPES.INTEGER],mimeTypeCount:[31,e.TYPES.INTEGER],notificationPermission:[32,e.TYPES.BOOLEAN],pdfViewerEnabled:[33,e.TYPES.BOOLEAN],peripherals:[42,e.TYPES.STRING],platformEstimate:[34,o("WAWebWamEnumPlatformName").PLATFORM_NAME],pluginCount:[35,e.TYPES.INTEGER],screenResolution:[43,e.TYPES.STRING],sessionStorageLength:[44,e.TYPES.INTEGER],timezone:[45,e.TYPES.STRING],touchPresence:[46,e.TYPES.BOOLEAN],viewportSize:[47,e.TYPES.STRING],waUlCookie:[48,e.TYPES.STRING],webcCanvasFingerprint:[25,e.TYPES.STRING],webcWebglFingerprint:[24,e.TYPES.STRING],webcWebglRenderer:[23,e.TYPES.STRING],webcWebglVendor:[22,e.TYPES.STRING],webcWindowNavigatorWebdriver:[21,o("WAWebWamEnumWebcWindowNavigatorWebdriverType").WEBC_WINDOW_NAVIGATOR_WEBDRIVER_TYPE]},[1,1,1],"regular"]},{WebcFingerprint:[]});l.WebcFingerprintWamEvent=s}),98); __d("WAWebWamFingerprintReporter",["WAWebWamEnumWebcWindowNavigatorWebdriverType","WAWebWamFingerprint","WAWebWebcFingerprintWamEvent"],(function(t,n,r,o,a,i,l){function e(){var e=r("WAWebWamFingerprint")(),t={webcWindowNavigatorWebdriver:e.webdriver===!0?o("WAWebWamEnumWebcWindowNavigatorWebdriverType").WEBC_WINDOW_NAVIGATOR_WEBDRIVER_TYPE.TRUE:e.webdriver===!1?o("WAWebWamEnumWebcWindowNavigatorWebdriverType").WEBC_WINDOW_NAVIGATOR_WEBDRIVER_TYPE.FALSE:o("WAWebWamEnumWebcWindowNavigatorWebdriverType").WEBC_WINDOW_NAVIGATOR_WEBDRIVER_TYPE.UNDEFINED,browserEngine:e.browserEngine,hasChrome:e.hasChrome,hasTaskbar:e.hasTaskbar,hasWebShare:e.hasWebShare,mimeTypeCount:e.mimeTypeCount,notificationPermission:e.hasNotificationPermission,pdfViewerEnabled:e.isPDFViewerEnabled,pluginCount:e.pluginCount,platformEstimate:e.platformEstimate,extentionIds:e.extensionIds,externalSources:e.externalSources,historyLength:e.historyLength,viewportSize:e.viewPortSize,cpuMake:e.cpuPlatform,deviceMemory:e.deviceMemory,screenResolution:e.screenResolution,connectionRtt:e.connectionRoundTripTime,touchPresence:e.touchPresence,sessionStorageLength:e.sessionStorageLength,webcCanvasFingerprint:e.canvasFingerprint},n=new(o("WAWebWebcFingerprintWamEvent")).WebcFingerprintWamEvent(t);n.commit()}l.logFingerprintToWam=e}),98); __d("WAWebFingerprintJob",["Promise","WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebWamFingerprintReporter"],(function(t,n,r,o,a,i,l){var e;function s(){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("collectWebFingerprints",function(){return o("WAWebWamFingerprintReporter").logFingerprintToWam(),(e||(e=n("Promise"))).resolve()},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.LOW}).waitUntilCompleted()}l.sendWamFingerprintJob=s}),98); __d("WAWebInactiveGroupLidMigrationJob",["WAJids","WALogger","WAWebABProps","WAWebABPropsCache","WAWebGroupsParticipantsApi","WAWebInactiveGroupLidMigration","WAWebNetworkStatus","WAWebQueryAndUpdateGroupMetadataJob","WAWebSchemaGroupMetadata","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f;function g(){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAWebABPropsCache").waitForABPropConfigsReady();var t=o("WAWebABProps").getABPropConfigValue("enable_inactive_group_lid_migration");if(!t){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[lid-inactive-group-migration] ABProp not enabled, skipping migration"])));return}var n=o("WAWebInactiveGroupLidMigration").isInactiveGroupLidMigrationComplete();if(n){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[lid-inactive-group-migration] Migration already completed, skipping"])));return}yield r("WAWebNetworkStatus").waitIfOffline(),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[lid-inactive-group-migration] Starting inactive group migration to LID"])));try{var a=yield y();if(a.length===0)o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[lid-inactive-group-migration] No inactive (PN-addressed) groups found, marking migration as complete"]))),o("WAWebInactiveGroupLidMigration").setInactiveGroupLidMigrationComplete();else{o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[lid-inactive-group-migration] Found "," inactive (PN-addressed) groups"])),a.length),yield o("WAWebQueryAndUpdateGroupMetadataJob").queryAndUpdateAllGroupMetadata({batchQueryArgs:{groupJids:a.map(function(e){return o("WAJids").toGroupJid(e.id)}),queryContext:"inactive_group_migration"}}),o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[lid-inactive-group-migration] Successfully queried and updated groups"])));var i=yield y();i.length===0?(o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[lid-inactive-group-migration] No inactive (PN-addressed) groups remaining, marking migration as complete"]))),o("WAWebInactiveGroupLidMigration").setInactiveGroupLidMigrationComplete()):o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[lid-inactive-group-migration] Completed batch processing, "," inactive (PN-addressed) groups remaining, will re-run on next scheduled run"])),i.length).sendLogs("lid-inactive-group-migration-incomplete",{sampling:.1})}}catch(e){throw o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[lid-inactive-group-migration] Failed to complete migration: ",""])),e instanceof Error?e.message:String(e)).sendLogs("lid-inactive-group-migration-failed"),e}}),h.apply(this,arguments)}function y(){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSchemaGroupMetadata").getGroupMetadataTable().all(),t=e.filter(function(e){return e.isLidAddressingMode!==!0}),n=yield o("WAWebGroupsParticipantsApi").bulkCheckMyMembership(t.map(function(e){return o("WAWebWidFactory").createWid(e.id)})),r=[];return t.forEach(function(e,t){var o=n[t];o&&!e.suspended&&!e.terminated&&r.push(e)}),r}),C.apply(this,arguments)}l.migrateInactiveGroupsToLid=g}),98); __d("WAWebMetaAiHistoricalThreadMigrationJob",["WAJobOrchestratorTypes","WALogger","WATimeUtils","WAWebAiThreadCreationUtils","WAWebAiThreadTypeUtils","WAWebBotUtils","WAWebDBMessageUtils","WAWebModelStorageUtils","WAWebOrchestratorNonPersistedJob","WAWebSchemaMessage","WAWebThreadMetadataBulkJob","WAWebUserPrefsBot","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p,_,f,g,h,y=100;function C(){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("migrateMetaAiMessagesToHistoricalThread",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: Starting migration"])));try{yield b(y)}catch(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: Error migrating messages: ",""])),e).tags("ai-threads").sendLogs("migrateMetaAiMessagesToHistoricalThread: Error migrating messages")}o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: Migration completed"])))}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT}).fireAndForget()}function b(e){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield R(e);if(t.length===0){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: No messages to migrate for ",""])),o("WAWebBotUtils").META_BOT_PN_WID.toString());return}o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: Found "," messages to process"])),t.length);var r=t.filter(function(e){return e.internalThreadIDs==null||e.internalThreadIDs.length===0});if(r.length===0){o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: All messages already have thread IDs"]))),yield L(t);return}o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: "," messages need migration"])),r.length);var a=S(r),i=a.messageUpdates,l=a.threadUpdates;yield o("WAWebModelStorageUtils").getStorage().lock(["message","thread-metadata"],(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e[0],n=e[1];yield t.bulkCreateOrMerge(i),yield o("WAWebThreadMetadataBulkJob").bulkCreateOrUpdateThreadsMetadata(l)});return function(t){return e.apply(this,arguments)}})()),yield L(t),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: Successfully migrated "," messages"])),r.length)}),v.apply(this,arguments)}function S(e){var t=o("WAWebAiThreadCreationUtils").getHistoricalMetaAiThreadId(),n={aiThreadType:o("WAWebAiThreadTypeUtils").AiThreadType.Default},r=e.map(function(e){var n,r=(n=e.internalThreadIDs)!=null?n:[],a=e.internalId!=null?o("WAWebDBMessageUtils").getInChatMsgId(e.internalId):0,i=o("WAWebDBMessageUtils").craftInternalThreadId(a,t);return{id:e.id,internalThreadIDs:[].concat(r,[i])}}),a=e[0],i=e[e.length-1];if((a==null?void 0:a.t)!=null&&(i==null?void 0:i.t)!=null){var l=[{threadId:t,chatId:o("WAWebBotUtils").META_BOT_PN_WID,creationTimestamp:o("WATimeUtils").castToUnixTime(a.t),lastMessageTimestamp:o("WATimeUtils").castToUnixTime(i.t),aiThreadInfo:n}];return{messageUpdates:r,threadUpdates:l}}return o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: Messages missing timestamp (t) values"]))),{messageUpdates:r,threadUpdates:[]}}function R(e){var t,n=o("WAWebUserPrefsBot").getMetaAIThreadMigrationState(),r=(t=n==null?void 0:n.lastConvertedMessageInternalId)!=null?t:o("WAWebDBMessageUtils").beginningOfChat(o("WAWebBotUtils").META_BOT_PN_WID),a=o("WAWebDBMessageUtils").endOfChat(o("WAWebBotUtils").META_BOT_PN_WID);return o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: Fetching messages for "," from ",""])),o("WAWebBotUtils").META_BOT_PN_WID.toString(),r),o("WAWebSchemaMessage").getMessageTable().between(["internalId"],r,a,{lowerInclusive:!1,upperInclusive:!1,limit:e})}function L(e){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e[e.length-1];(t==null?void 0:t.internalId)!=null?yield o("WAWebUserPrefsBot").setMetaAIThreadMigrationState({lastConvertedMessageInternalId:t.internalId}):o("WALogger").WARN(h||(h=babelHelpers.taggedTemplateLiteralLoose(["[migrateMetaAiMessagesToHistoricalThread]: Last message has no internalId"])))}),E.apply(this,arguments)}l.migrateMetaAiMessagesToHistoricalThread=C,l.migrateMessagesForMetaAiBot=b}),98); __d("WAWebReportDbVerionsJob",["WAJobOrchestratorTypes","WAWebLocalSchemaVersions","WAWebOrchestratorNonPersistedJob","WAWebSchemaVersions","WAWebWebDbVersionNonAnonymousWamEvent","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("reportDbVersions",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebLocalSchemaVersions").getLocalSchemaVersions();e.forEach(function(e,t){new(o("WAWebWebDbVersionNonAnonymousWamEvent")).WebDbVersionNonAnonymousWamEvent({webDbName:o("WAWebSchemaVersions").convertDBName(t),webDbVersionNumber:e}).commit()})}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,maxTimeoutMs:1e3*30}).waitUntilCompleted()}l.reportDbVersionsJob=e}),98); __d("WAWebSyncdWamUtils",["WABase64","WASyncdConst","WATimeUtils","WAWebGetSyncKey","WAWebSchemaSyncActions","WAWebSyncdUtils","WAWebWamEnumMutationCountBucket","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){function e(){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=new Map,t=yield o("WAWebSchemaSyncActions").getSyncActionsTable().all();return t.map(function(t){var n,r=o("WAWebSyncdUtils").getMutationNameFromIndex(t.index),a=(n=e.get(r))!=null?n:{action:r,applied:0,invalid:0,orphan:0,unsupported:0,failed:0};e:{if(t.actionState===o("WASyncdConst").SyncActionState.Success||t.actionState===o("WASyncdConst").SyncActionState.Skipped){a.applied++;break e}if(t.actionState===o("WASyncdConst").SyncActionState.Malformed){a.invalid++;break e}if(t.actionState===o("WASyncdConst").SyncActionState.Orphan){a.orphan++;break e}if(t.actionState===o("WASyncdConst").SyncActionState.Unsupported){a.unsupported++;break e}if(t.actionState===o("WASyncdConst").SyncActionState.Failed){a.failed++;break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+t.actionState)}e.set(r,a)}),e}),s.apply(this,arguments)}function u(e){if(e<0)throw r("err")("cannot convert negative number to a bucket");return e===0?o("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.ZERO:e===1?o("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.ONE:e<10?o("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT10:e<100?o("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT100:e<500?o("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT500:e<1e3?o("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT1K:e<5e3?o("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.LT5K:o("WAWebWamEnumMutationCountBucket").MUTATION_COUNT_BUCKET.GTE5K}function c(){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSchemaSyncActions").getSyncActionsTable().get('["primary_version","session_start"]');return e==null?void 0:e.timestamp}),d.apply(this,arguments)}function m(){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebGetSyncKey").getAllSyncKeysInTransaction(),t=yield o("WAWebSchemaSyncActions").getSyncActionsTable().all(),n=yield c(),r=n==null?void 0:Math.round((o("WATimeUtils").unixTimeMs()-n)/(1e3*3600*24));return _(e,t,r)}),p.apply(this,arguments)}function _(e,t,n){var r=t.map(function(e){return o("WABase64").encodeB64(e.keyId)}),a=Array.from(new Set(r)),i=new Map;for(var l of r)i.set(l,(i.get(l)||0)+1);var s=Array.from(i.values()).sort(),u=s.length,c=Math.floor(u*.8)-1,d=Math.floor(u*.95)-1;return{totalKeyCount:e.length,keysUsedInSnapshotCount:a.length,p80MuationsPerKey:s[c],p95MuationsPerKey:s[d],syncdSessionLengthDays:n}}l.generateActionStatCounts=e,l.convertToBucket=u,l.getKeyStats=m,l.getKeyStatsInternal=_}),98); __d("WAWebSyncdReportKeyStatsJob",["WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebSyncdKeyCountWamEvent","WAWebSyncdWamUtils","asyncToGeneratorRuntime","gkx"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("reportSyncdKeyStats",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!r("gkx")("26258")){var e=yield o("WAWebSyncdWamUtils").getKeyStats(),t={keysUsedInSnapshotCount:e.keysUsedInSnapshotCount,p80MuationsPerKey:e.p80MuationsPerKey,p95MuationsPerKey:e.p95MuationsPerKey,totalKeyCount:e.totalKeyCount};e.syncdSessionLengthDays!=null&&(t.syncdSessionLengthDays=e.syncdSessionLengthDays),new(o("WAWebSyncdKeyCountWamEvent")).SyncdKeyCountWamEvent(t).commit()}}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,maxTimeoutMs:1e3*30}).waitUntilCompleted()}l.reportSyncdKeyStatsJob=e}),98); __d("WAWebSyncdReportSyncdStatJob",["WAJobOrchestratorTypes","WAWebMdAppStateSyncMutationStatsWamEvent","WAWebOrchestratorNonPersistedJob","WAWebSyncdWamUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("reportSyncdStats",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebSyncdWamUtils").generateActionStatCounts();for(var t of e.values()){var n;new(o("WAWebMdAppStateSyncMutationStatsWamEvent")).MdAppStateSyncMutationStatsWamEvent({syncdAction:t.action,applied:(n=o("WAWebSyncdWamUtils")).convertToBucket(t.applied),invalid:n.convertToBucket(t.invalid),orphan:n.convertToBucket(t.orphan),unsupported:n.convertToBucket(t.unsupported),failed:n.convertToBucket(t.failed)}).commit()}}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.BEST_EFFORT,maxTimeoutMs:1e3*30}).waitUntilCompleted()}),s.apply(this,arguments)}l.reportSyncdStatsJob=e}),98); __d("WAWebTasksDefinitions",["Promise","WALogger","WATaskScheduler","WATimeUtils","WAWebABProps","WAWebABPropsLocalStorage","WAWebAbPropsSyncJob","WAWebAccountLinkingGatingUtils","WAWebAccountLinkingScheduledJobs","WAWebApiChat","WAWebApiParticipantStore","WAWebApiTasksScheduledTime","WAWebApiTextStatus","WAWebBizGatingUtils","WAWebBotGating","WAWebCanonicalTokenRefreshJob","WAWebCleanUtmJob","WAWebContactSyncBridge","WAWebDBPurgeExpiredRecords","WAWebDBReportingTokenUtils","WAWebDownloads3PDSignalsDatabaseApi","WAWebFalcoStorageClearJob","WAWebFetchQuickPromotions","WAWebFingerprintJob","WAWebGalaxyFlowsUtils","WAWebInactiveGroupLidMigrationJob","WAWebLogDailyStatsJob","WAWebLogHistorySyncStatusAfterPairingJob","WAWebMessagingGatingUtils","WAWebMetaAiHistoricalThreadMigrationJob","WAWebMobilePlatforms","WAWebNewsletterCleanupTasks","WAWebNonAddressBookContactsJob","WAWebNonMessageDataRequestMediaHandlingUtils","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebReportDbVerionsJob","WAWebRestartRecentSyncJob","WAWebSyncContactsJob","WAWebSyncdAntiTampering","WAWebSyncdReportKeyStatsJob","WAWebSyncdReportSyncdStatJob","WAWebSyncdRequestAllSyncdMissingKeysJob","WAWebSyncdSyncAllCollectionsJob","WAWebTasksTaskType","WAWebUserPrefsHistorySync","WAWebUserPrefsMultiDevice","WAWebViewerContextAuthUtils","asyncToGeneratorRuntime","cr:4857","cr:4940","gkx"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T=[(I=o("WAWebTasksTaskType")).TaskType.CANONICAL_ENT_TOKEN_REFRESH,I.TaskType.CLEAN_TC_TOKENS,I.TaskType.LOG_DAILY_STATS,I.TaskType.ROTATE_KEY,I.TaskType.SYNC_AB_PROPS,I.TaskType.SYNC_CONTACTS,I.TaskType.REPORT_SYNCD_ACTION_STAT,I.TaskType.LT_HASH_CHECK,I.TaskType.REQUEST_ALL_SYNCD_MISSING_KEYS,I.TaskType.REPORT_SYNCD_KEY_STATS,I.TaskType.SYNCD_SYNC_ALL_COLLECTIONS,I.TaskType.CLEAN_ORPHAN_ADD_ONS,I.TaskType.CLEAN_EXPIRED_UTM,I.TaskType.SEND_NON_MESSAGE_DATA_REQUEST,I.TaskType.LOG_HISTORY_SYNC_STATUS_AFTER_PAIRING,I.TaskType.DELETE_NEWSLETTER_PREVIEW_CHATS,I.TaskType.REPORT_DB_VERSIONS,I.TaskType.UPDATE_EXPIRED_TEXT_STATUS,I.TaskType.RESTART_RECENT_SYNC,I.TaskType.CLEANUP_REPORTING_TABLE,I.TaskType.WAFFLE_SCHEDULED_TASKS,I.TaskType.CLEAR_GALAXY_FLOWS_CACHE,I.TaskType.CLEAR_FALCO_BUFFER,I.TaskType.SEND_WAM_FINGERPRINT,I.TaskType.INACTIVE_GROUP_LID_MIGRATION,I.TaskType.MIGRATE_META_AI_MESSAGES_TO_HISTORICAL_THREAD],D=[I.TaskType.FETCH_QUICK_PROMOTIONS,I.TaskType.CLEANUP_3PD_SIGNALS_TABLE],x=[I.TaskType.LOG_DB_ROW_COUNTS,I.TaskType.MONITOR_DB_STORAGE];function $(t){return t===o("WAWebTasksTaskType").TaskType.MONITOR_DB_STORAGE?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(r("gkx")("26258"))return o("WATaskScheduler").DO_NOT_RESCHEDULE;var t=yield n("cr:4857")==null?void 0:n("cr:4857").shouldMonitorDbStorageUsageJob();return t?o("WATimeUtils").HOUR_SECONDS:o("WATaskScheduler").DO_NOT_RESCHEDULE});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.CLEAN_TC_TOKENS?(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(t)o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["CleanTcToken skip first run"])));else try{yield o("WAWebApiChat").pruneExpiredTcTokens(),yield o("WAWebApiChat").pruneExpiredOrphanTcTokens()}catch(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Failed to delete the expired TcTokens with error: ",""])),e).verbose()}return o("WATimeUtils").DAY_SECONDS});return function(e){return t.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.UPDATE_EXPIRED_TEXT_STATUS?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e)o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Update expired text status skip first run"])));else try{yield o("WAWebApiTextStatus").updateExpiredTextStatusOfContact()}catch(e){o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Failed to update the expired text status of contacts with error: ",""])),e).verbose()}return o("WATimeUtils").DAY_SECONDS});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.LOG_DAILY_STATS?function(){return o("WAWebLogDailyStatsJob").logDailyStatsJob().catch(function(e){o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Failed to log daily stats: ",""])),e).verbose()}).then(function(){return o("WATimeUtils").DAY_SECONDS})}:t===o("WAWebTasksTaskType").TaskType.LOG_DB_ROW_COUNTS?(function(){if(!r("gkx")("26258")){var e=120,t=7200;return function(){return self.setTimeout(function(){n("cr:4940")==null||n("cr:4940").logStorageTableRowCounts().catch(function(e){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["Failed to log table row counts from a task: ",""])),e).verbose()})},e*1e3),(k||(k=n("Promise"))).resolve(t)}}return function(){return(k||(k=n("Promise"))).resolve(o("WATaskScheduler").DO_NOT_RESCHEDULE)}})():t===o("WAWebTasksTaskType").TaskType.ROTATE_KEY?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return e?o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["RotateKeyTask skip first run"]))):yield o("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(o("WAWebPersistedJobDefinitions").jobSerializers.rotateKey()),27*o("WATimeUtils").DAY_SECONDS});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.SYNC_AB_PROPS?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return e||(yield o("WAWebAbPropsSyncJob").syncABPropsTask()),o("WAWebABPropsLocalStorage").getRefresh()});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.SYNC_CONTACTS?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!e){try{yield o("WAWebNonAddressBookContactsJob").getNonAddressBookContactsAndMarkAllContactsDirty()}catch(e){o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["Failed to sync non-address book contacts with error: ",""])),e).verbose()}try{yield o("WAWebContactSyncBridge").doFullContactSync()}catch(e){o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["syncContacts: contact sync failed, error: ",""])),e).verbose().tags("non-sad","contact-sync").sendLogs("syncContacts: contact sync failed")}}return o("WAWebSyncContactsJob").getContactSyncRefreshSeconds()});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.REPORT_SYNCD_ACTION_STAT?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return e||(yield o("WAWebSyncdReportSyncdStatJob").reportSyncdStatsJob()),o("WATimeUtils").DAY_SECONDS});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.LT_HASH_CHECK?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebABProps").getABPropConfigValue("lthash_check_hours");return t===0?24*o("WATimeUtils").HOUR_SECONDS:(e||(yield o("WAWebSyncdAntiTampering").checkLtHash("abc")),t*o("WATimeUtils").HOUR_SECONDS)});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.REQUEST_ALL_SYNCD_MISSING_KEYS?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return e||(yield o("WAWebSyncdRequestAllSyncdMissingKeysJob").requestAllSyncdMissingKeysJob()),o("WATimeUtils").HOUR_SECONDS*6});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.REPORT_SYNCD_KEY_STATS?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return e||(yield o("WAWebSyncdReportKeyStatsJob").reportSyncdKeyStatsJob()),r("gkx")("26258")?o("WATimeUtils").DAY_SECONDS*3:o("WATimeUtils").DAY_SECONDS});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.SYNCD_SYNC_ALL_COLLECTIONS?(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebABProps").getABPropConfigValue("syncd_periodic_sync_days");return t===0?(o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["syncd: syncdPeriodicSyncDays is 0, skipping sync"]))),o("WATimeUtils").DAY_SECONDS):(e||(yield o("WAWebSyncdSyncAllCollectionsJob").syncdSyncAllCollectionsJob()),o("WATimeUtils").DAY_SECONDS*t)});return function(t){return e.apply(this,arguments)}})():t===o("WAWebTasksTaskType").TaskType.CLEAN_ORPHAN_ADD_ONS?(function(){var e=30,t=90;return n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield o("WAWebDBPurgeExpiredRecords").purgeExpiredOrphanRecords(e,t)}catch(e){o("WALogger").ERROR(h||(h=babelHelpers.taggedTemplateLiteralLoose(["Failed to delete the expired orphan add-on messages with error: ",""])),e).verbose()}return o("WATimeUtils").DAY_SECONDS})})():t===o("WAWebTasksTaskType").TaskType.CLEAN_PAST_PARTICIPANTS?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield o("WAWebApiParticipantStore").pruneExpiredPastParticipants()}catch(e){o("WALogger").ERROR(y||(y=babelHelpers.taggedTemplateLiteralLoose(["Failed to delete the expired orphan reactions with error: ",""])),e).verbose()}return o("WATimeUtils").DAY_SECONDS}):t===o("WAWebTasksTaskType").TaskType.CLEAN_EXPIRED_UTM?function(){return o("WAWebBizGatingUtils").isUtmTrackingEnabled()?o("WAWebCleanUtmJob").cleanExpiredUtmJob().catch(function(e){o("WALogger").ERROR(C||(C=babelHelpers.taggedTemplateLiteralLoose(["Failed to clean expired UTM: ",""])),e).verbose()}).then(function(){return o("WATimeUtils").DAY_SECONDS}):(k||(k=n("Promise"))).resolve(o("WATaskScheduler").DO_NOT_RESCHEDULE)}:t===o("WAWebTasksTaskType").TaskType.SEND_NON_MESSAGE_DATA_REQUEST?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield o("WAWebNonMessageDataRequestMediaHandlingUtils").retryNonMessageDataRequestJob(),o("WATimeUtils").HOUR_SECONDS*23}):t===o("WAWebTasksTaskType").TaskType.DELETE_NEWSLETTER_PREVIEW_CHATS?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield o("WAWebNewsletterCleanupTasks").deletePreviewNewsletters(),o("WATimeUtils").HOUR_SECONDS*4}):t===o("WAWebTasksTaskType").TaskType.REPORT_DB_VERSIONS?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield o("WAWebReportDbVerionsJob").reportDbVersionsJob(),o("WATimeUtils").DAY_SECONDS*3}):t===o("WAWebTasksTaskType").TaskType.LOG_HISTORY_SYNC_STATUS_AFTER_PAIRING?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WAWebUserPrefsMultiDevice").getPairingTimestamp();if(e!=null){var t,n=(t=yield o("WAWebUserPrefsHistorySync").getHistorySyncStatusAfterPairingLoggingCount())!=null?t:0;return n>=5?(o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["[history sync] do not schedule job for logging history sync status as we've logged for more than 4 times."]))),o("WATaskScheduler").DO_NOT_RESCHEDULE):(yield o("WAWebLogHistorySyncStatusAfterPairingJob").logHistorySyncStatusAfterPairingJob(e,n),n===0?o("WATimeUtils").MINUTE_SECONDS*5:o("WATimeUtils").MINUTE_SECONDS*10)}return 10}):t===o("WAWebTasksTaskType").TaskType.RESTART_RECENT_SYNC?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WAWebUserPrefsMultiDevice").getPairingTimestamp();if(e!=null){var t=(o("WATimeUtils").unixTime()-e)/60;return t>=5&&(yield o("WAWebRestartRecentSyncJob").restartRecentSyncJob()),o("WATimeUtils").MINUTE_SECONDS*5}return 10}):t===o("WAWebTasksTaskType").TaskType.CLEANUP_REPORTING_TABLE?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{yield o("WAWebDBReportingTokenUtils").cleanupReportingTable(o("WAWebMessagingGatingUtils").getReportingTagCleanupDays()),yield o("WAWebDBReportingTokenUtils").cleanupReportingTokenAndContent(o("WAWebMessagingGatingUtils").getReportingTokenCleanupDays())}catch(e){o("WALogger").ERROR(v||(v=babelHelpers.taggedTemplateLiteralLoose(["Failed to cleanup reporting token table: ",""])),e).tags("messaging","wa-ice","report-token")}return o("WATimeUtils").DAY_SECONDS}):t===o("WAWebTasksTaskType").TaskType.CLEANUP_3PD_SIGNALS_TABLE?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{o("WAWebABProps").getABPropConfigValue("ctwa_download_3pd_signals")&&(yield o("WAWebDownloads3PDSignalsDatabaseApi").cleanup3PDSignalsTable())}catch(e){o("WALogger").ERROR(S||(S=babelHelpers.taggedTemplateLiteralLoose(["Failed to cleanup 3PD Signals table: ",""])),e).tags("3pd-signals")}return o("WATimeUtils").DAY_SECONDS}):t===o("WAWebTasksTaskType").TaskType.FETCH_QUICK_PROMOTIONS?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WALogger").LOG(R||(R=babelHelpers.taggedTemplateLiteralLoose(["fetchQuickPromotions: fetching quick promotions"]))),yield o("WAWebFetchQuickPromotions").fetchQuickPromotions(),o("WAWebBizGatingUtils").qpGraphQLFetchIntervalMinutes()*o("WATimeUtils").MINUTE_SECONDS}):t===o("WAWebTasksTaskType").TaskType.WAFFLE_SCHEDULED_TASKS?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebAccountLinkingGatingUtils").accountLinkingEnabled()&&(yield o("WAWebAccountLinkingScheduledJobs").scheduledWaffleJobs()),o("WATimeUtils").DAY_SECONDS}):t===o("WAWebTasksTaskType").TaskType.CLEAR_GALAXY_FLOWS_CACHE?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield o("WAWebGalaxyFlowsUtils").clearGalaxyFlowsCache(),7*o("WATimeUtils").DAY_SECONDS}):t===o("WAWebTasksTaskType").TaskType.CLEAR_FALCO_BUFFER?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield o("WAWebFalcoStorageClearJob").clearFalcoBufferJob(),o("WATimeUtils").DAY_SECONDS}):t===o("WAWebTasksTaskType").TaskType.SEND_WAM_FINGERPRINT?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return yield o("WAWebFingerprintJob").sendWamFingerprintJob(),o("WATimeUtils").DAY_SECONDS*2}):t===o("WAWebTasksTaskType").TaskType.INACTIVE_GROUP_LID_MIGRATION?n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WAWebUserPrefsMultiDevice").getPairingTimestamp();if(e!=null){var t=o("WATimeUtils").unixTime()-e,n=o("WATimeUtils").MINUTE_SECONDS;if(t2)}function s(e){if(!e)return!1;var t=o("WAWebStateUtils").unproxy(e);return o("WAWebChatGetters").getIsGroup(t)&&(o("WAWebFrontendChatGetters").getIsCAG(t)||t.getParticipantCount()>2)&&o("WAWebABProps").getABPropConfigValue("elevated_push_names_v2_m2_enabled")}function u(e){if(e==null)return!1;var t=o("WAWebStateUtils").unproxy(e),n=o("WAWebContactGetters").getNotifyName(t);return o("WAWebFrontendContactGetters").getFormattedName(t)===o("WAWebFrontendContactGetters").getFormattedUsernameOrPhone(t)&&n!=null&&n!==""}l.elevatedPushNamesEnabled=e,l.elevatedPushNamesM2Enabled=s,l.pushNameCanBeUsed=u}),98); __d("WAWebMediaMetadata",["WALogger","WAWebMediaCryptoEligibilityUtils","err"],(function(t,n,r,o,a,i,l){var e,s;function u(t){var n=t.mediaObject;if(!n)throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""])),t.id.toString(),t.type).sendLogs("media-fault: mediaMetadata msg without mediaObject"),r("err")("msg.mediaMetadata with no mediaObject");var a=o("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(t)?n.entries.getEntryByEncFilehash({encFilehash:t.encFilehash,deprecatedMms3Url:t.deprecatedMms3Url}):n.entries.getUnencryptedEntry(t.filehash,t.directPath);if(!a)throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""])),t.id.toString(),t.type).sendLogs("media-fault: mediaMetadata no entry"),r("err")("msg.mediaMetadata with entry mismatch");var i=t.mediaData;return{url:o("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(t)?a.deprecatedMms3Url:null,directPath:a.directPath,encFilehash:a.getEncfilehash(),mediaKey:a.getMediaKey(),mediaKeyTimestamp:a.getMediaKeyTimestamp(),filehash:t.filehash,type:i.type,mimetype:i.mimetype,filename:i.filename,duration:i.duration,width:i.fullWidth,height:i.fullHeight,firstFrameLength:i.firstFrameLength,isAnimated:i.isAnimated,isLottie:i.isLottie,thumbnailDirectPath:t.thumbnailDirectPath,thumbnailSha256:t.thumbnailSha256,thumbnailEncSha256:t.thumbnailEncSha256,thumbnailHeight:t.thumbnailHeight,thumbnailWidth:t.thumbnailWidth,metadataUrl:t.metadataUrl,waveform:t.waveform,staticUrl:t.staticUrl}}l.mediaMetadata=u}),98); __d("WAWebMediaProduct",["$InternalEnum","WAWebFileUtils","WAWebMmsMediaTypes","WAWebSMBUserJourneyLogger","WAWebUploadManager","WAWebWamEnumMediaUploadResultType","WAWebWamEnumSmbFeatureNameEnum","WAWebWamEnumSmbUserActionTypeEnum","WAWebWamEnumSurfaceType","WAWebWamEnumUploadOriginType","WAWebWamMediaMetricUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=n("$InternalEnum")({ImageUpload:"image_upload"});function s(t,n){o("WAWebSMBUserJourneyLogger").SMBUserJourneyLogger.log({userActionType:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.API,surface:t?o("WAWebWamEnumSurfaceType").SURFACE_TYPE.ADD_ITEM:o("WAWebWamEnumSurfaceType").SURFACE_TYPE.EDIT_ITEM,featureName:o("WAWebWamEnumSmbFeatureNameEnum").SMB_FEATURE_NAME_ENUM.CATALOG,userActionTarget:e.ImageUpload,extraAttributes:n})}function u(e,t,n,r){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a){var i=yield o("WAWebFileUtils").blobToArrayBuffer(e.forceToBlob()).then(function(e){return r("WAWebUploadManager").unencryptedUpload({file:e,hash:t,signal:new AbortController().signal,type:o("WAWebMmsMediaTypes").MEDIA_TYPES.PRODUCT_CATALOG_IMAGE,uploadOrigin:o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.PRODUCT_CATALOG,isViewOnce:!1,generateThumbnailOnServer:!1}).then(function(e){return s(a,{media_upload_result:o("WAWebWamEnumMediaUploadResultType").MEDIA_UPLOAD_RESULT_TYPE.OK,media_upload_index:n}),e}).catch(function(e){throw s(a,{media_upload_result:o("WAWebWamMediaMetricUtils").getMetricUploadErrorResultType(e),media_upload_index:n}),e})});return new URL(i.directPath,"https://mmg.whatsapp.net").toString()}),c.apply(this,arguments)}l.uploadProductImage=u}),98); __d("WAWebMediaVideoStreaming",[],(function(t,n,r,o,a,i){function e(e){var t=e.mediaObject;return t?t.videoStreamingInfo(e.id.toString()):null}i.videoStreamingInfo=e}),66); __d("WAWebMedia",["WAWebCheckMediaExistence","WAWebClearMediaForChat","WAWebDownloadProgressiveJpegThumbnail","WAWebDownloadStatusThumbnail","WAWebDownloadVideoThumbnail","WAWebManuallySetMedia","WAWebMediaCancelDownloadMsg","WAWebMediaCancelUploadMsg","WAWebMediaDownloadMsg","WAWebMediaForwardMediaMsg","WAWebMediaMetadata","WAWebMediaMsgRegistration","WAWebMediaPrep","WAWebMediaProduct","WAWebMediaResumeUploadMsg","WAWebMediaStickers","WAWebMediaVideoStreaming","WAWebPrepRawMedia"],(function(t,n,r,o,a,i){var e=importNamespace("WAWebDownloadVideoThumbnail").downloadVideoThumbnail,l=importNamespace("WAWebMediaPrep").MediaPrep,s=importNamespace("WAWebCheckMediaExistence").checkMediaExistence,u=importNamespace("WAWebClearMediaForChat").clearMediaForChat,c=importNamespace("WAWebMediaDownloadMsg").downloadMsg,d=importNamespace("WAWebDownloadProgressiveJpegThumbnail").downloadProgressiveJpegThumbnail,m=importNamespace("WAWebDownloadStatusThumbnail").downloadStatusThumbnail,p=importNamespace("WAWebMediaForwardMediaMsg").forwardMediaMsg,_=importNamespace("WAWebManuallySetMedia").manuallySetMedia,f=importNamespace("WAWebPrepRawMedia").prepRawMedia,g=importNamespace("WAWebMediaResumeUploadMsg").resumeUploadMsg;Object.keys(importNamespace("WAWebMediaCancelDownloadMsg")).forEach(function(e){e==="default"||e==="__esModule"||(i[e]=importNamespace("WAWebMediaCancelDownloadMsg")[e])}),Object.keys(importNamespace("WAWebMediaCancelUploadMsg")).forEach(function(e){e==="default"||e==="__esModule"||(i[e]=importNamespace("WAWebMediaCancelUploadMsg")[e])}),Object.keys(importNamespace("WAWebMediaMetadata")).forEach(function(e){e==="default"||e==="__esModule"||(i[e]=importNamespace("WAWebMediaMetadata")[e])}),Object.keys(importNamespace("WAWebMediaMsgRegistration")).forEach(function(e){e==="default"||e==="__esModule"||(i[e]=importNamespace("WAWebMediaMsgRegistration")[e])}),Object.keys(importNamespace("WAWebMediaProduct")).forEach(function(e){e==="default"||e==="__esModule"||(i[e]=importNamespace("WAWebMediaProduct")[e])}),Object.keys(importNamespace("WAWebMediaStickers")).forEach(function(e){e==="default"||e==="__esModule"||(i[e]=importNamespace("WAWebMediaStickers")[e])}),Object.keys(importNamespace("WAWebMediaVideoStreaming")).forEach(function(e){e==="default"||e==="__esModule"||(i[e]=importNamespace("WAWebMediaVideoStreaming")[e])}),i.downloadVideoThumbnail=e,i.MediaPrep=l,i.checkMediaExistence=s,i.clearMediaForChat=u,i.downloadMsg=c,i.downloadProgressiveJpegThumbnail=d,i.downloadStatusThumbnail=m,i.forwardMediaMsg=p,i.manuallySetMedia=_,i.prepRawMedia=f,i.resumeUploadMsg=g}),66); __d("WAWebWamEnumWebcRmrReasonCode",[],(function(t,n,r,o,a,i){var e=Object.freeze({OTHER:0,MSG_CLICK:1,STICKER_PANEL_ICON:2,MEDIA_VIEWER:3,VIDEO_STREAMING:4,STATUS_V3:5,MULTI_SELECT_DOWNLOAD:6,DOCUMENT_DOWNLOAD:7,PIP:8,STICKER_PANEL_STICKER:9,SEND_TO_CHAT:10,UPLOAD:11,MSG_INIT:12,MSG_UPDATE:13,MSG_DELETE:14,MSG_RENDER:15});i.WEBC_RMR_REASON_CODE=e}),66); __d("WAWebMediaAutoDownloadQueue",["$InternalEnum","WAConcurrentPriorityPromiseQueue","WALogger","WAWebMedia","WAWebMediaDownloadMmsThumbnail","WAWebMiscGatingUtils","WAWebMsgGetters","WAWebMsgModelPropUtils","WAWebMsgModelUtils","WAWebMsgType","WAWebStickerMimeUtils","WAWebStickerModel","WAWebUserPrefsGeneral","WAWebWamEnumWebcRmrReasonCode","asyncToGeneratorRuntime","gkx"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=n("$InternalEnum")({MEDIA:"media",MMS_THUMBNAIL:"mms_thumbnail"}),m=32*1024*1024,p=512*1024,_=5,f=512,g=500*1024;function h(e){var t=e.type===o("WAWebMsgType").MSG_TYPE.STICKER&&e.mimetype===o("WAWebStickerMimeUtils").WhatsAppLottieStickerMimeType&&e.isLottie===!0&&e.isAnimated===!0;return t||o("WAWebMsgModelPropUtils").isTrusted(e.unsafe())}function y(e){switch(e.type){case o("WAWebMsgType").MSG_TYPE.AUDIO:case o("WAWebMsgType").MSG_TYPE.PTT:return o("WAWebUserPrefsGeneral").getAutoDownloadAudio();case o("WAWebMsgType").MSG_TYPE.STICKER:case o("WAWebMsgType").MSG_TYPE.IMAGE:return o("WAWebUserPrefsGeneral").getAutoDownloadPhotos();case o("WAWebMsgType").MSG_TYPE.VIDEO:case o("WAWebMsgType").MSG_TYPE.PTV:return e.isGif&&e.size0)},n.isDownloadable=function(){if(this.isViewOnce)return!1;var e=this.renderableUrl!=null;if(e)return!0;var t=o("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.has(this.filehash);if(t)return!0;var n=this.mediaStage===o("WAWebMediaTypes").MediaDataStage.EXISTS||this.mediaStage===o("WAWebMediaTypes").MediaDataStage.PROGRESSIVE_READY;return!!n},t})(o("WAWebBaseModel").BaseModel);e.Proxy="mediaData";var s=o("WAWebBaseModel").defineModel(e);s.TYPE=o("WAWebMediaTypes").OUTWARD_TYPES;var u=s;function c(e){if(e.filename&&e.type===s.TYPE.DOCUMENT){var t=o("WAWebMediaCleanFileName").cleanFilename(e.filename);return babelHelpers.extends({},e,{filename:t,caption:t})}return e}l.default=u}),98); __d("WAWebMediaOpaqueData",["Promise","WABase64","WALogger","WANullthrows","WAShiftTimer","WAWebFileUtils","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_=[],f=new(o("WAShiftTimer")).ShiftTimer(h),g=(function(){function t(){this._retainCount=1,this._inAutoreleasePool=!1,this.released=!1,this._b64=void 0,this.blob=void 0,this._url=void 0,this._mimetype=void 0,this._released=void 0}var a=t.prototype;return a.retain=function(){if(this.released)throw o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["OpaqueData:retain called on released OpaqueData"]))),r("err")("OpaqueData:retain called on released OpaqueData");this._retainCount++},a.autorelease=function(){this.released?o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["OpaqueData:autorelease called on released object"]))):this._retainCount===0?o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["OpaqueData:autorelease too many release calls"]))):this._retainCount===1?(this._retainCount=0,this._inAutoreleasePool||(this._inAutoreleasePool=!0,_.push(this),f.onOrBefore(1e3))):this._retainCount--},a.autoreleaseWhenPromiseCompletes=function(t){var e=this,n=function(){e.autorelease()};t.then(n,n)},a.throwIfReleased=function(t){if(this.released)throw o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose([""," called on released OpaqueData"])),t),r("err")(t+" called on released OpaqueData");this._retainCount===0&&o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose([""," called on unretained OpaqueData"])),t)},a.url=function(){return this.throwIfReleased("OpaqueData:url"),this._url!=null&&this._url!==""?this._url:this._b64!=null&&this._b64!==""?(this._url="data:image/jpeg;base64,"+this._b64,this._url):(this._url=window.URL.createObjectURL(r("WANullthrows")(this.blob,"unexpected empty blob")),this._url)},a.getBlob=function(){return this.blob},a.getBase64=function(){return this._b64},a.validate=function(){return this._released===!0?(p||(p=n("Promise"))).resolve(!1):this.blob?o("WAWebFileUtils").validateBlob(this.blob):(p||(p=n("Promise"))).resolve(!0)},a.size=function(){return this.throwIfReleased("OpaqueData:size"),this.blob?this.blob.size:this._b64!=null?o("WABase64").sizeWhenB64Decoded(this._b64):(o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["OpaqueData:size returned 0"]))).sendLogs("opaque-data-size-0"),0)},a.formData=function(t){return this.throwIfReleased("OpaqueData:formData"),this.forceToBlob()},a.type=function(){return this.throwIfReleased("OpaqueData:type"),this._mimetype!=null&&this._mimetype!==""?this._mimetype:"undefined"},a.forceToBlob=function(){this.throwIfReleased("OpaqueData:forceToBlob");var e=this.blob;if(e)return e;var t=this._b64;if(t!=null&&t!==""){this._b64=void 0,this._url=void 0;var n=this._mimetype;return this.blob=new Blob([o("WABase64").decodeB64(t)],n!=null&&n!==""?{type:n}:void 0)}throw r("err")("OpaqueData:forceToBlob no b64 or blob")},a._releaseImpl=function(){this._mimetype=void 0;var e=this.blob;e?(this.blob=void 0,this._url!=null&&this._url!==""&&(window.URL.revokeObjectURL(this._url),this._url=void 0)):(this._b64=void 0,this._url=void 0)},a.isBlobEqual=function(t){return t?this.blob===t.blob:!this.blob},t})();g.createFromBase64Jpeg=function(e){return new(p||(p=n("Promise")))(function(t){var n=new g;return n._b64=e,n._mimetype="image/jpeg",t(n)})},g.createFromData=function(e,t){return new(p||(p=n("Promise")))(function(n){var r=new g;return r.blob=e instanceof Blob&&e.type===t?e:new Blob([e],{type:t}),r._mimetype=t,n(r)})};function h(){var e=_;_=[];for(var t=0;t0?I.consolidate({parsedVcards:b}):o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).tags("non-sad").sendLogs("vcard_over_mms:Failed to parse vcard over mms contents")}}catch(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Failed to retrieve blob text contents"]))).catching(e).tags("non-sad").sendLogs("vcard_over_mms:blobToText failed with error")}if(o("WAWebMediaDataUtils").shouldUseMediaCache(T)&&o("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.canFitFile(Q.size)){var k=V(I,T);(k!=null&&k.shouldStoreInMemory||W)&&(o("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.put(q,Q),yield o("WAWebMediaDataUtils").gatherAndSetMetadataNoOpaque(I,Q))}else{var P=yield r("WAWebMediaOpaqueData").createFromData(Q,Q.type);yield o("WAWebMediaDataUtils").gatherAndSetMetadata(I,P)}return I.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.RESOLVED}),I.clearDownloadPromise(T),I.resolveWhenConsolidated()});return function(){return u.apply(this,arguments)}})(),U=O().catch((F=o("WAFilteredCatch")).filteredCatch(o("WAWebMmsClientErrors").MediaNotFoundError,(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!K||(K.markWhetherOnServer(!1),!i))throw e;return yield o("WAWebDownloadManager").downloadManager.rmr({mediaObject:I,signal:new AbortController().signal,rmrReason:M,rmrData:N}),I.clearDownloadPromise(T),P({mimetype:D,mediaObject:I,downloadEvenIfExpensive:!1,mediaType:T,rmrReason:M,rmrData:N,downloadOrigin:l,isFinalRmrRetry:!0,isVcardOverMmsDocument:S,mode:$,isAutoDownload:b,chatWid:a})});return function(t){return e.apply(this,arguments)}})())).catch(F.filteredCatch(o("WAWebMiscErrors").MediaUnsupportedError,function(e){if(I.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.ERROR_UNSUPPORTED}),o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: media unsupported error: ",", ",", ",""])),e.name,e.message,D||""),o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).catching(e).tags("non-sad").sendLogs("downloadMedia: media unsupported error:"),B)throw e})).catch(F.filteredCatch(o("WAWebDownloadManagerErrors").MediaNotOnPhone,function(e){if(I.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.ERROR_MISSING}),B)throw e})).catch(F.filteredCatch([R,L],function(e){if(I.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.ERROR_MISSING}),!(e===R&&T===o("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER)&&(o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Unexpected download error: ",""])),e.name),o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).tags("non-sad").sendLogs("unexpected download error: "+e.name),B))throw e})).catch(F.filteredCatch([o("WAWebMiscErrors").MediaDecryptionError,o("WAWebMiscErrors").MediaHashMismatch],function(e){var t=I.progressiveStage;if(X.abort(),I.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.NEED_POKE,progressiveStage:null}),I.notifyMsgsAsync(),I.delete(),o("WAWebCryptoImageStreamer").deleteFromInMemoryMediaBlobCache(q,t),B)throw e})).catch(function(e){if(I.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.NEED_POKE}),e instanceof o("WAWebMiscErrors").MediaLoadError){if(o("WALogger").WARN(p||(p=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: media unsupported error: ",", ",", ",""])),e.name,e.message,D||""),o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).catching(e).tags("non-sad").sendLogs("downloadMedia: media load error:",{sampling:0}),B)throw e;return}if(e instanceof o("WAWebMiscErrors").TranscodeBlobTooLargeError){if(o("WALogger").WARN(f||(f=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: error: ",", ",""])),e.message,D||""),o("WALogger").ERROR(g||(g=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).catching(e).tags("non-sad").sendLogs("downloadMedia: transcode blob too large",{sampling:0}),B)throw e;return}if(e instanceof o("WAWebMiscErrors").UnableToPlayVideoError){if(o("WALogger").WARN(h||(h=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: error: ",", ",""])),e.message,D||""),o("WALogger").ERROR(y||(y=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).catching(e).tags("non-sad").sendLogs("downloadMedia: unable to play video",{sampling:0}),B)throw e;return}if(e.name===o("WAAbortError").ABORT_ERROR){if(B)throw e;return}if(o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["downloadMedia: error"]))),B)throw e}).finally(function(){I.clearDownloadPromise(T)});return k.set(U,{abort:function(){X.abort()},shouldStoreInMemory:((w=V(I,T))==null?void 0:w.shouldStoreInMemory)||W}),I.setDownloadPromise(U,T),U})}}}}),N.apply(this,arguments)}var M=function(t){var e=/animation\/animation.json$/,n=Object.keys(t).find(function(t){return e.test(t)});return n!=null?t[n]:void 0};function w(e,t){return A.apply(this,arguments)}function A(){return A=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){try{var n=new(o("WAWebStickerLatencyWamEvent")).StickerLatencyWamEvent({size:e.size,stickerLatencyAction:o("WAWebWamEnumStickerLatencyAction").STICKER_LATENCY_ACTION.DECOMPRESSION}),a=self.performance.now(),i=yield o("WABlobToArrayBuffer").blobToArrayBuffer(e),l=new Uint8Array(i),s=o("fflate").unzipSync(l),u=M(s);if(!u)throw r("err")("animationContents missing");if(u){var c=new TextDecoder("utf-8").decode(u),d=yield o("WAWebStickerUtils").isLottieStickerFirstParty(s,c);if(!d)throw o("WALogger").ERROR(b||(b=babelHelpers.taggedTemplateLiteralLoose(["[extractLottieJSON] Lottie sticker is not first party"]))),r("WAWebODS")==null||r("WAWebODS").incr("web.stickers.lottie_sticker_not_first_party"),r("err")("Lottie sticker is not first party");return n.stickerLatencyTtAction=Math.ceil(self.performance.now()-a),n.commit(),c}}catch(e){new(o("WAWebStickerErrorWamEvent")).StickerErrorWamEvent({stickerErrorType:o("WAWebWamEnumStickerErrorType").STICKER_ERROR_TYPE.DECOMPRESSION}).commit(),o("WALogger").ERROR(v||(v=babelHelpers.taggedTemplateLiteralLoose(["Failed to extract Lottie Sticker zip file"]))).catching(e).tags("non-sad").sendLogs("lottie_sticker:Failed to extract Lottie Sticker zip file")}}),A.apply(this,arguments)}function F(e){return O.apply(this,arguments)}function O(){return O=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.mediaObject,n=e.mediaType,a=e.mimetype,i=t.filehash;if(!r("isStringNullOrEmpty")(i)&&t.downloadStage===o("WAWebMediaTypes").DownloadStage.INIT&&!(yield q(t))){var l=o("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.get(i),s=new AbortController;if(l){t.downloadStage===o("WAWebMediaTypes").DownloadStage.INIT&&t.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.EXISTS});return}var u=t.entries.getDownloadEntry(o("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(n));if(!u){t.downloadStage===o("WAWebMediaTypes").DownloadStage.INIT&&t.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.NEED_POKE});return}if(!(u instanceof o("WAWebMediaEntry").UnencryptedMediaEntry)){var c=u.getEncfilehash();if(r("isStringNullOrEmpty")(c)){u.markWhetherOnServer(!1),t.downloadStage===o("WAWebMediaTypes").DownloadStage.INIT&&t.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.NEED_POKE});return}try{r("isStringNullOrEmpty")(u.staticUrl)&&(yield o("WAWebDownloadManager").downloadManager.checkExistence({directPath:u.directPath,encFilehash:c,signal:s.signal,type:n})),t.downloadStage===o("WAWebMediaTypes").DownloadStage.INIT&&t.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.EXISTS})}catch(e){t.downloadStage===o("WAWebMediaTypes").DownloadStage.INIT&&t.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.NEED_POKE}),o("WALogger").LOG(S||(S=babelHelpers.taggedTemplateLiteralLoose(["checkExistence: error"])))}}}}),O.apply(this,arguments)}function B(e,t){return!!(e&&t&&e.length>=2&&e.length*10===t.byteLength)}function W(e){var t=e.mediaObject,n=e.mimetype,a=e.scanLengths,i=e.scansSidecar,l=e.signal;if(!B(a,i))return null;var s=new(o("WAWebWebcProgressiveImageWamEvent")).WebcProgressiveImageWamEvent({webcFirstRenderScans:0});return{mimetype:n,scansSidecar:r("WANullthrows")(i),scanLengths:r("WANullthrows")(a),onProgressiveUpdate:function(n){l.aborted||t.downloadStage!==o("WAWebMediaTypes").DownloadStage.RESOLVED&&(t.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.PROGRESSIVE_READY,progressiveStage:n}),s.webcFirstRenderScans||(s.webcFirstRenderScans=n,s.markWebcFirstRenderT()),n>=E.MID&&!s.webcMidQualityT&&s.markWebcMidQualityT(),n===E.FULL&&!s.webcFullQualityT&&(s.markWebcFullQualityT(),s.commit()))}}}function q(e){return U.apply(this,arguments)}function U(){return U=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!e.mediaBlob)return!1;var t=yield e.mediaBlob.validate();return t?(e.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.RESOLVED}),!0):(e.clearBlob(),e.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.NEED_POKE}),e.notifyMsgsAsync(),!1)}),U.apply(this,arguments)}function V(e,t){var n=e.getDownloadPromise(t);return n?k.get(n):null}function H(e){return e===o("WAWebMmsMediaTypes").MEDIA_TYPES.PTT||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_PTT||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO||e===o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_AUDIO}l.NoEntryAfterRMR=R,l.MissingEncFilehash=L,l.cancelDownloadMedia=I,l.manuallySetMedia=T,l.downloadMedia=P,l.getContentsOfLottieJSONFile=M,l.extractLottieJSON=w,l.checkExistence=F}),98); __d("WAWebHDMediaUtils",["WAWebABProps"],(function(t,n,r,o,a,i,l){function e(e,t){var n=Math.max(e,t);return n>=o("WAWebABProps").getABPropConfigValue("original_quality_image_min_edge")}function s(e,t){if(!o("WAWebABProps").getABPropConfigValue("hd_video_label_enabled"))return!1;var n=[Math.max(e,t),Math.min(e,t)],r=n[0],a=n[1];return a>=o("WAWebABProps").getABPropConfigValue("hd_video_definition_min_edge")?!0:r>o("WAWebABProps").getABPropConfigValue("hd_video_definition_max_edge")&&a>=o("WAWebABProps").getABPropConfigValue("hd_video_definition_min_edge_with_max_edge")}l.isHdPhoto=e,l.isHdVideo=s}),98); __d("WAWebMediaGetDownloadOriginFromUploadOrigin",["WAWebWamEnumDownloadOriginType","WAWebWamEnumUploadOriginType"],(function(t,n,r,o,a,i,l){function e(e){return e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.CHAT_PERSONAL?o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_PERSONAL:e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.CHANNEL?o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHANNEL:e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.COMMUNITY?o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.COMMUNITY:e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.UNKNOWN||e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.CHAT_GROUP||e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.STATUS_USER||e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.PRODUCT_CATALOG||e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.STICKER_WEB||e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.PAYMENTS_KYC||e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.MESSAGE_HISTORY_SYNC||e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.BROADCAST||e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.MULTI_CHAT||e===o("WAWebWamEnumUploadOriginType").UPLOAD_ORIGIN_TYPE.INTEROP?o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_GROUP:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}l.getDownloadOriginFromUploadOrigin=e}),98); __d("WAWebMediaMmsV4Upload",["Promise","WAAbortError","WAFilteredCatch","WALogger","WAMediaCalculateFilehash","WAWebCreateMediaUploadMetrics","WAWebDownloadManagerErrors","WAWebEnvironment","WAWebFileUtils","WAWebHDMediaUtils","WAWebMediaCryptoEligibilityUtils","WAWebMediaDataUtils","WAWebMediaEntry","WAWebMediaGatingUtils","WAWebMediaGetDownloadOriginFromUploadOrigin","WAWebMediaInMemoryBlobCache","WAWebMediaLoad","WAWebMediaMmsV4Download","WAWebMediaStore","WAWebMediaTypes","WAWebMiscErrors","WAWebMmsClientErrors","WAWebMmsConst","WAWebMmsMediaTypes","WAWebStartMediaUploadQpl","WAWebUploadManager","WAWebWamEnumWebcRmrReasonCode","asyncToGeneratorRuntime","err","lodash"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p=new WeakMap;function _(e){e.getUploadPromises().forEach(function(e){if(e!=null){var t=p.get(e);t!=null&&(p.delete(e),t())}})}var f={SUCCESS:"success",CANCELLATION:"cancellation",ERROR:"error",TIMEOUT:"timeout"};function g(e){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n,a=e.blob,i=e.canEnableFastForward,l=i===void 0?!0:i,s=e.earlyUpload,u=e.forwardedFromWeb,c=e.isViewOnce,d=e.mediaKeyInfo,m=e.mediaObject,p=e.mediaType,_=e.signal,f=e.uploadEntry,g=e.uploadOrigin;if(f instanceof o("WAWebMediaEntry").EncryptedMediaEntry&&f!=null&&f.canReuseMediaKey()&&l)return r("WAWebCreateMediaUploadMetrics")(p,g,0,u,c).handleCheckExistingSuccess(),f;var h=yield s;if(h!=null)return m.entries.addEntry({deprecatedMms3Url:h.url,mediaKey:h.mediaKey,mediaKeyTimestamp:h.mediaKeyTimestamp,encFilehash:h.encFilehash,type:p,sidecar:h.sidecar,directPath:h.directPath,firstFrameSidecar:h.firstFrameSidecar,debugHint:"upload"});var y=function(){m.consolidate({uploadStage:o("WAWebMediaTypes").UploadStage.FINALIZING})},C=r("lodash").throttle(function(e,t){var n=e.loaded+t;Number.isFinite(n)&&m.consolidate({loadedSize:n})},o("WAWebMmsConst").FILE_PROGRESS_THROTTLE_WAIT_MS),b=d?d.key:f==null?void 0:f.getMediaKey(),v=d?d.timestamp:f==null?void 0:f.getMediaKeyTimestamp(),S=o("WAWebStartMediaUploadQpl").startMediaUploadQpl({entryPoint:"MediaUpload"}),R=yield r("WAWebUploadManager").encryptAndUpload({blob:a,mediaKey:b,mediaKeyTimestamp:v,type:p,signal:_,userUploadAttemptCount:m.userUploadAttemptCount,forwardedFromWeb:u,uploadOrigin:g,onProgress:C,onFinalize:y,isViewOnce:c,isHdPhoto:p===o("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE&&o("WAWebHDMediaUtils").isHdPhoto((t=m.contentInfo.fullHeight)!=null?t:0,(n=m.contentInfo.fullWidth)!=null?n:0),uploadQpl:S}),L=R.directPath,E=R.encFilehash,k=R.firstFrameSidecar,I=R.mediaKey,T=R.mediaKeyTimestamp,D=R.sidecar,x=R.url;return m.entries.addEntry({deprecatedMms3Url:x,mediaKey:I,mediaKeyTimestamp:T,encFilehash:E,type:p,sidecar:D,directPath:L,firstFrameSidecar:k,debugHint:"upload"})}),h.apply(this,arguments)}function y(e){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.blob,n=e.calculateToken,a=e.isViewOnce,i=e.mediaObject,l=e.mediaType,s=e.signal,u=e.uploadOrigin,c=yield o("WAWebFileUtils").blobToArrayBuffer(t),d=yield o("WAMediaCalculateFilehash").calculateFilehash(c),m=yield r("WAWebUploadManager").unencryptedUpload({file:c,isViewOnce:a,signal:s,type:l,uploadOrigin:u,hash:d,token:yield n==null?void 0:n(d),generateThumbnailOnServer:o("WAWebMediaGatingUtils").isThumbnailGenerationOnServerEnabledForMediaType(l)});return i.entries.addUnencryptedEntry({directPath:m.directPath,debugHint:"upload",filehash:d,type:l,handle:m.handle,metadataUrl:m.metadataUrl,thumbnailDirectPath:m.thumbnailDirectPath,thumbnailSha256:m.thumbnailSha256,fbid:m.fbid})}),C.apply(this,arguments)}function b(e){return S(e,g)}function v(e){return S(e,y)}function S(t,a){var i=t.calculateToken,l=t.canEnableFastForward,_=l===void 0?!0:l,g=t.earlyUpload,h=t.forwardedFromWeb,y=t.isViewOnce,C=t.mediaKeyInfo,b=t.mediaObject,v=t.mediaType,S=t.mimetype,L=t.uploadOrigin,E=C,k=b.getUploadPromise(v);if(k)return k;var I=new AbortController,T=I.signal,D=(m||(m=n("Promise"))).resolve().then(function(){b.consolidate({uploadStage:o("WAWebMediaTypes").UploadStage.UPLOADING})}).then(function(){return R({mediaObject:b,mimetype:S,mediaType:v,abortSignal:T,uploadOrigin:L})}).then((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n;if(_&&(n=b.entries.getUploadEntry(o("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMediaType(v))),n instanceof o("WAWebMediaEntry").EncryptedMediaEntry&&E&&n.mediaKey!==E.key){var l,u,c=E;o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["uploadEntry.mediaKey and mediaKeyInfo.mediaKey should be the same, mediaType: ",""])),v).sendLogs("media-keys-not-the-same-"+v);var d=!b.entries.entries.some(function(e){return e.getMediaKey()===c.key});if(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[_uploadMediaAndManageErrors]: isNewEntry: "," uploadEntry.mediaKey length "," - mediaKeyInfo.mediaKey length ",""])),d,(l=n.mediaKey)==null?void 0:l.length,(u=c.key)==null?void 0:u.length),v===o("WAWebMmsMediaTypes").MEDIA_TYPES.STICKER)E=null;else throw r("err")("uploadEntry.mediaKey and mediaKeyInfo.mediaKey should be the same")}var m=yield a({blob:t,canEnableFastForward:_,forwardedFromWeb:h,mediaKeyInfo:E,mediaObject:b,mediaType:v,signal:T,uploadEntry:n,uploadOrigin:L,isViewOnce:y,earlyUpload:g,calculateToken:i});if(!m)throw r("err")("could not create media entry");if((v===o("WAWebMmsMediaTypes").MEDIA_TYPES.PTT||v===o("WAWebMmsMediaTypes").MEDIA_TYPES.AUDIO)&&!o("WAWebMediaDataUtils").canPlayOgg())if(o("WAWebMediaDataUtils").shouldUseMediaCache(v)){var p=b.filehash;if(p&&b.mediaBlob){var f=yield o("WAWebMediaLoad").transcode(b.mediaBlob.formData());o("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.put(p,f)}}else b.mediaBlob&&(yield o("WAWebMediaDataUtils").gatherAndSetMetadata(b,b.mediaBlob));var C=b.filehash;if(r("WAWebEnvironment").isWindows&&C!=null){var S=yield o("WAWebFileUtils").blobToArrayBuffer(t);yield o("WAWebMediaStore").LruMediaStore.put(C,S)}return m});return function(e){return t.apply(this,arguments)}})()).then(function(e){if(T.aborted)throw new(o("WAAbortError")).AbortError;return b.consolidate({uploadStage:o("WAWebMediaTypes").UploadStage.UPLOADED}),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["MediaAlgo.uploadMedia: success"]))),{kind:f.SUCCESS,mediaEntry:e}}).catch(function(e){throw e.name===o("WAAbortError").ABORT_ERROR?o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["MediaAlgo.uploadMedia: canceled"]))):o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["MediaAlgo.uploadMedia: ",""])),e),e}).finally(function(){b.clearUploadPromise(v)}).catch(o("WAFilteredCatch").filteredCatch(o("WAWebMiscErrors").FileNotReadableError,function(){return b.consolidate({uploadStage:o("WAWebMediaTypes").UploadStage.ERROR_FILE_NOT_READABLE}),{kind:f.ERROR}})).catch(o("WAFilteredCatch").filteredCatch(o("WAWebDownloadManagerErrors").MediaNotOnPhone,function(){return b.consolidate({uploadStage:o("WAWebMediaTypes").UploadStage.ERROR_MISSING}),{kind:f.ERROR}})).catch(o("WAFilteredCatch").filteredCatch(o("WAWebMmsClientErrors").MediaTooLargeError,function(){return b.consolidate({uploadStage:o("WAWebMediaTypes").UploadStage.ERROR_TOO_LARGE}),{kind:f.ERROR}})).catch(function(e){return b.consolidate({uploadStage:o("WAWebMediaTypes").UploadStage.NEED_UPLOAD}),e.name===o("WAAbortError").ABORT_ERROR?{kind:f.CANCELLATION}:{kind:f.ERROR}});return p.set(D,function(){I.abort()}),b.setUploadPromise(D,v),D}function R(e){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.abortSignal,n=e.chatWid,a=e.mediaObject,i=e.mediaType,l=e.mimetype,s=e.uploadOrigin,u=E(a);if(u)return u;if(yield o("WAWebMediaMmsV4Download").downloadMedia({mimetype:l,mediaObject:a,downloadEvenIfExpensive:!0,mediaType:i,signal:t,rmrReason:o("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.UPLOAD,downloadOrigin:o("WAWebMediaGetDownloadOriginFromUploadOrigin").getDownloadOriginFromUploadOrigin(s),mode:"manual",chatWid:n}),a.downloadStage===o("WAWebMediaTypes").DownloadStage.ERROR_MISSING)throw new(o("WAWebDownloadManagerErrors")).MediaNotOnPhone;var c=E(a);if(c)return c;throw r("err")("cant upload media w/out mediaBlob after download")}),L.apply(this,arguments)}function E(e){var t=e.mediaBlob;if(t)return t.formData();if(e.filehash)return o("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.get(e.filehash)}l.cancelUploadMedia=_,l.UploadMediaResultKind=f,l.uploadMedia=b,l.uploadUnencryptedMedia=v,l.getOrDownloadBlob=R,l.getBlobFromMediaObject=E}),98); __d("WAWebMediaObject",["Promise","WALogger","WANullthrows","WAShiftTimer","WAWebAck","WAWebCryptoCreateMediaKeys","WAWebInteractiveMessageHeaderMediaType","WAWebMedia","WAWebMediaCryptoEligibilityUtils","WAWebMediaDataUtils","WAWebMediaEntry","WAWebMediaOpaqueData","WAWebMediaTypes","WAWebMmsMediaTypes","WAWebMsgType","WAWebRequestMediaReuploadBridge","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h=(function(){function t(){var e=this;this.msgs=[],this.$1=new(o("WAShiftTimer")).ShiftTimer(function(){S(e),$(e)}),this.callOnConsolidate=null,this.$2=null,this.$3=0,this.saveMedia=null,this.stickers=[],this.stickerPacks=[],this.entries=new(o("WAWebMediaEntry")).MediaEntryList,this.downloadStage=o("WAWebMediaTypes").DownloadStage.INIT,this.uploadStage=o("WAWebMediaTypes").UploadStage.INIT,this.userUploadAttemptCount=0,this.userDownloadAttemptCount=0,this.$4=null,this.$5=null,this.$6=null,this.$7=null,this.mediaBlob=null,this.size=void 0,this.loadedSize=void 0,this.filehash=void 0,this.contentInfo={},this.progressiveStage=void 0,this.parsedVcards=null,this.extractedLottieSticker=null}var a=t.prototype;return a.encryptedDownloadPromise_TESTONLY=function(){return this.$4},a.unencryptedDownloadPromise_TESTONLY=function(){return this.$5},a.consolidate=function(n){if(n.downloadStage){var t;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[","] mediaObject.downloadStage: ",""])),(t=this.filehash)==null?void 0:t.slice(0,10),String(n.downloadStage))}return y(this,n)?(this.notifyMsgsAsync(),!0):!1},a.clearBlob=function(t){var e=this.mediaBlob;e&&(this.mediaBlob=null,e.autorelease()),(t==null?void 0:t.reset)===!0&&this.$8()},a.$8=function(){this.consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.INIT})},a.contentFields=function(){var e=this.type||o("WAWebMediaTypes").TYPE.DOCUMENT;return o("WAWebMediaTypes").FIELDS[e]},a.resolveWhenConsolidated=function(){var e=this;return this.$1.ts?new(g||(g=n("Promise")))(function(t){e.callOnConsolidate?e.callOnConsolidate.push(t):e.callOnConsolidate=[t]}):(g||(g=n("Promise"))).resolve()},a.notifyMsgsAsync=function(){this.$1.debounce(0)},a.addMsg=function(t){for(var e=this.msgs,n=0;n0){var a=this.associatedMsgs().filter(function(e){return e!=null});if(a.length===0)return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["The sticker associated message has been deleted."]))),(g||(g=n("Promise"))).resolve(200)}var i=this.msgs.find(function(e){var t=e[0],n=e[1];return!n&&!t.isUnsentPhoneMsg()})||[null],l=i[0];if(!l)return o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).sendLogs("media-fault: rmr called on MediaObject with no msg"),(g||(g=n("Promise"))).reject(r("err")("rmr called on MediaObject with no msg"));e.onMsgSelect(l);var s=yield r("WAWebRequestMediaReuploadBridge")(l);if(s.status===200){var m=l.mediaData.type;if(m==="unknown")return(g||(g=n("Promise"))).reject(r("err")("rmr called on MediaData with unknown type"));var p=s.isMD?this.entries.updateEntry({deprecatedMms3Url:l.deprecatedMms3Url,encFilehash:l.encFilehash,directPath:s.directPath}):this.entries.addEntry({deprecatedMms3Url:s.url,mediaKey:s.mediaKey||r("WANullthrows")(l.mediaKey),mediaKeyTimestamp:s.mediaKeyTimestamp,encFilehash:s.encFilehash,type:m,directPath:s.directPath,debugHint:"rmr"});p||o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).sendLogs("media-fault: rmr entry can not be found"),p==null||p.markWhetherOnServer(!0)}return s.status});function t(t){return e.apply(this,arguments)}return t})(),a.msgProps=function(t){var e={};R(e,this,o("WAWebMediaTypes").FIELDS.RAW),R(e,this.contentInfo,this.contentFields()),R(e,t,o("WAWebMediaTypes").MSG_SPECIFIC_FIELDS),e.preview=this.contentInfo._preview;var n={};for(var r in e){var a=o("WAWebMediaTypes").MEDIA_TO_MSG[r];a&&(n[a]=e[r])}return n},a.delete=function(){this.saveMedia=null,o("WAWebMedia").cancelDownloadMedia(this),o("WAWebMedia").cancelUploadMedia(this),this.clearBlob()},a.runProcessIfNotRunBefore=function(t,r,o){var e=this,a=this.$2;a||(a=this.$2={}),!Object.prototype.hasOwnProperty.call(a,t)&&(this.$3++,a[t]=(g||(g=n("Promise"))).resolve(o).then(r).then(function(t){return void e.consolidate(t)}).finally(function(){e.$3--,e.$3===0&&e.notifyMsgsAsync()}))},a.getPendingProcess=function(t){return this.$3===0||!this.$2||!Object.prototype.hasOwnProperty.call(this.$2,t)?(g||(g=n("Promise"))).resolve():this.$2[t]},a.videoStreamingInfo=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(this.type!==o("WAWebMediaTypes").TYPE.VIDEO){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["type: ",""])),String(this.type)).sendLogs("media-fault: media streaming info request for non-video type");return}var t=this.entries.getDownloadEntry(!0);if(!t||!t.sidecar||!(t instanceof o("WAWebMediaEntry").EncryptedMediaEntry))return null;var a=yield(g||(g=n("Promise"))).all([r("WAWebCryptoCreateMediaKeys")(o("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO,t.mediaKey),t.url()]),i=a[0],l=a[1];return{cryptoKeys:babelHelpers.extends({},i,{cipherKey:i.encKey,sidecar:t.sidecar}),streamData:{clientUrl:l,size:this.size,msgKey:e}}});function t(t){return e.apply(this,arguments)}return t})(),a.addStickerPack=function(t){for(var e=this.stickerPacks,n=0;n=0;m--)n[m][1]&&n.splice(m,1);var p=e.callOnConsolidate;p&&(e.callOnConsolidate=null,p.forEach(function(e){return void e()})),e.saveMedia&&e.saveMedia(e)}function R(e,t,n){for(var r=0;r1?{width:t,height:Math.max(t/e,1)}:{width:Math.max(t*e,1),height:t}}function l(e,t,n){var r=t!=null?t:n,o=e!=null?e:n;return r>o?r>n&&(o*=n/r,r=n):o>n&&(r*=n/o,o=n),{width:Math.max(r,1),height:Math.max(o,1)}}i.aspectRatioScaled=e,i.boundHeightWidth=l}),66); __d("WAWebCanvasUtils",["Promise","WAWebABProps","WAWebDataUrlToBlob","WAWebEncodeRgbaToWebp","WAWebImageGeometry","WAWebMediaOpaqueData","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){var t=e.getContext("2d"),n=t.getImageData(0,0,e.width,e.height);return r("WAWebEncodeRgbaToWebp")(n.data,e.width,e.height,{ensureExtendedFormat:!0})}function u(t,r){if(r===void 0&&(r="image/jpeg"),Object.prototype.hasOwnProperty.call(HTMLCanvasElement.prototype,"toBlob")){var a=r==="image/jpeg"?o("WAWebABProps").getABPropConfigValue("web_jpeg_quality")/100:void 0;return new(e||(e=n("Promise")))(function(e){t.toBlob(e,r,a)})}return(e||(e=n("Promise"))).resolve(o("WAWebDataUrlToBlob").dataURLtoBlob(t.toDataURL(r)))}function c(e,t,n){t===void 0&&(t="image/jpeg");var r=e.toDataURL(t),a=o("WAWebDataUrlToBlob").dataURLtoBlob(r);if(a.size<=n)return e.toDataURL(t);for(var i=.9;i>=.1;i-=.1){var l=e.toDataURL(t,i),s=o("WAWebDataUrlToBlob").dataURLtoBlob(l);if(s.size<=n)return l}return null}function d(e,t,n){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){for(var o,a,i=n||{},l=(o=i.mimetype)!=null?o:"image/jpeg",s=(a=i.maxAttempts)!=null?a:10,c=.5,d=e,m=yield u(d,l),p=0;pe.width&&r>e.height)return e;var i=document.createElement("canvas"),l=i.getContext("2d");return i.width=a,i.height=r,l.drawImage(e,0,0,a,r),i}function C(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n}function b(e){var t=C(e.width,e.height),n=t.getContext("2d");return n.drawImage(e,0,0),t}function v(e){var t=e.getContext("2d"),n=t.getImageData(0,0,e.width,e.height),r=n.data.length/4,o;for(o=0;oi&&(i=c),dl&&(l=d)}}return{left:o,top:a,right:i,bottom:l}}function R(e){if(!v(e)){var t=S(e),n=t.bottom,r=t.left,o=t.right,a=t.top,i=n-a,l=o-r,s=e.getContext("2d"),u=s.getImageData(r,a,l,i),c=C(l,i),d=c.getContext("2d");return d.putImageData(u,0,0),c}}function L(e,t,n){n===void 0&&(n="white");var r=document.createElement("canvas"),o=r.getContext("2d"),a=document.createElement("canvas"),i=a.getContext("2d"),l=t*2;r.width=a.width=e.width+l*2,r.height=a.height=e.height+l*2,o.drawImage(e,l,l),i.shadowColor=n,i.shadowBlur=1;for(var s=0;s=e)throw new(r("WAWebMediaFileTooLargeError"))(c,e,s);if(!u&&s>m)throw new(r("WAWebMediaFileTooLargeError"))(c,m,s);if(s<=0)throw new(o("WAWebMiscErrors")).MediaFileEmpty;var p;a.gifAttribution!=null?p=a.gifAttribution:a.asGif===!0&&(p=0);var _;e:{if(c==="image"){var f;_=yield o("WAWebMediaDataUtils").processRawImage(t,{maxDimension:(f=a.maxDimension)!=null?f:o("WAWebABProps").getABPropConfigValue("web_image_max_edge"),minDimension:a.minDimension,transparency:a.transparency},a.fileOrigin);break e}if(c==="sticker"){_=yield o("WAWebMediaDataUtils").processRawSticker(t);break e}if(c==="video"||c==="audio"){if(_=yield o("WAWebMediaDataUtils").processRawAudioVideo(t,!!a.isPtt,a.precomputedFields,a.asGif,p,t.type(),a.accessibilityLabel,a.setProgressPercentage,a.setMediaPreview,a.resetMediaPreview,a.setMimeType),u&&c==="video"&&_.size!=null&&_.size>m)throw new(r("WAWebMediaFileTooLargeError"))(c,m,_.size);break e}if(c==="document"||c==="sticker-pack"){_=yield o("WAWebMediaDataUtils").processRawDocument(t,a.filename,d,a.documentPageCount,c);break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+c)}return _}finally{t.autorelease()}}),u.apply(this,arguments)}l.processRawMedia=s}),98); __d("WAWebRequestMediaReuploadManager",["Promise","WALogger","WANullthrows","WAWebMiscErrors","WAWebMmsMediaTypes","WAWebMsgGetters","WAWebSendServerErrorReceiptJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u=(function(){function t(){var t=this;this.$1=new Map,this.requestMediaReupload=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var a=e.id.id;if(o("WAWebMsgGetters").getIsNewsletterMsg(e))throw new(o("WAWebMiscErrors")).RMRNotSupportedOnNewsletterMessagesError(o("WAWebMmsMediaTypes").getMsgMediaType(e));var i=t.$1.get(a);if(i)return r("WANullthrows")(i.request);var l=new(s||(s=n("Promise")))(function(n,r){t.$1.set(a,{resolve:n,reject:r,msg:e})});return r("WANullthrows")(t.$1.get(a)).request=l,yield r("WAWebSendServerErrorReceiptJob")(e),l});return function(t){return e.apply(this,arguments)}})(),this.resolveMediaReupload=function(n){var r=n.directPath,a=n.msgId,i=n.result,l=t.$1.get(a);l!=null?(l.resolve({result:i,directPath:r}),t.$1.delete(a)):o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["resolveMediaReupload: msgId (",") is not found in _rmrRequests"])),a)},this.getMediaKey=function(e){var n;return(n=t.$1.get(e))==null?void 0:n.msg.mediaKey}}var a=t.prototype;return a.rmrRequests_TESTONLY=function(){return this.$1},t})(),c=new u;l.RequestMediaReuploadManagerImpl=u,l.RequestMediaReuploadManager=c}),98); __d("WAWebDecodeWebpToRgba",["Promise","WAWebMiscErrors","WAWebWebpToRgbaWorkerResource","WorkerBundleResource"],(function(t,n,r,o,a,i,l){var e;function s(t){return new(e||(e=n("Promise")))(function(e,n){var a=o("WorkerBundleResource").createDedicatedWebWorker(r("WAWebWebpToRgbaWorkerResource"));a.onerror=function(e){a.terminate(),n(new(o("WAWebMiscErrors")).DecodeWebpResultsError("worker error",e))},a.onmessageerror=function(e){a.terminate(),n(new(o("WAWebMiscErrors")).DecodeWebpResultsError("worker message error",e))},a.onmessage=function(t){a.terminate();var n=t.data;e(n)},a.postMessage({type:"message",message:{webpBuffer:t}},[t])})}l.default=s}),98); __d("WAWebSendMessageToMediaWorker",["Promise","WALogger","WAWebMediaWorkerResource","WebWorker"],(function(t,n,r,o,a,i,l){var e,s,u,c=m();function d(t){var r;return new(u||(u=n("Promise")))(function(n,a){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:sendMessageToMediaWorker"]))),r=c&&p(c)?m():c,r.setMessageHandler(function(e){try{e.type==="log"?o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["(via Milan) ",""])),e.msg):n(e)}catch(e){a(e)}}).setErrorHandler(function(e){a(new Error("Milan.onerror = "+(e!=null&&e.message?e.message:e)))}).execute(),r.postMessage(t)}).finally(function(){r&&(r.terminate(),(!c||!c.isCurrentState("constructed"))&&(c=m()))})}function m(){return new(r("WebWorker"))(r("WAWebMediaWorkerResource")).setAllowCrossPageTransition(!0)}function p(e){return e.isCurrentState("preparing")||e.isCurrentState("executing")}l.sendMessageToMediaWorker=d}),98); __d("WAWebWebcMediaAnalyzedWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({WebcMediaAnalyzed:[912,{webcMediaAnalyzeT:[3,e.TYPES.TIMER],webcMediaExtensions:[2,e.TYPES.STRING],webcMediaSupported:[1,e.TYPES.BOOLEAN]},[1,1,1],"regular"]},{WebcMediaAnalyzed:[]});l.WebcMediaAnalyzedWamEvent=s}),98); __d("WAWebMediaAnalyzer",["WALogger","WAMediaWasmWorkerClient","WAWebMediaGatingUtils","WAWebSendMessageToMediaWorker","WAWebWebcMediaAnalyzedWamEvent","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g;function h(e,t){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var r=new(o("WAWebWebcMediaAnalyzedWamEvent")).WebcMediaAnalyzedWamEvent,a=!1;try{var i=o("WAWebMediaGatingUtils").shouldUseWasmMediaWorkerForFile(t),l;if(i)l=yield C(t,n);else{var m={type:"prep",file:t,asGif:n},p=yield o("WAWebSendMessageToMediaWorker").sendMessageToMediaWorker(m),_=p.error,f=p.file,g=p.filename,h=p.result,y=p.type;e:{if(y==="result"){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:checkAndRepair approved file"]))),a=!!h,l=h;break e}if(y==="parsingError"){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["trouble parsing file "," (fossil ",") ",""])),f,g,String(_)),f&&o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:checkAndRepair got parsing error! ",""])),String(_)).sendLogs("media-parsing-error"),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:checkAndRepair rejected file (",")"])),String(_));break e}break e}}return[l,i]}catch(e){return o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["MediaAnalyzer:checkAndRepair got error! ",""])),String(e)).sendLogs("media-detection-error"),[void 0,!1]}finally{if(r){var b=void 0;if(t.name){var v=t.name.split(".");v.length>1&&(b=v[v.length-1])}r.set({webcMediaSupported:a,webcMediaExtensions:b}),r.markWebcMediaAnalyzeT(),r.commit()}}}),y.apply(this,arguments)}function C(e,t){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm] start process video through wasm"])));var n=yield e.arrayBuffer(),r=yield o("WAMediaWasmWorkerClient").mp4RepairMuxInWorker({input:new Uint8Array(n),eventFlow:null});if(r.success)return o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm][success]"]))),{type:"video/mp4",file:new Blob([r.value],{type:"video/mp4"}),isGif:t};switch(r.error){case"undefined-operation":case"worker-connection-runtime-error":case"invalid-media":case"runtime-error":case"internal-error":o("WALogger").WARN(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm][error] failed to repair video file"])));break;case"worker-connection-timeout":o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm][error] error ",""])),r.error).sendLogs("worker-connection-timeout-error");break;default:r.error,o("WALogger").ERROR(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[processVideoThroughWasm][error] unrecognised error ",""])),r.error).sendLogs("media-analyzer-unrecognised-error");break}}),b.apply(this,arguments)}l.checkAndRepair=h}),98); __d("WAWebWamEnumVideoTranscoderAlgorithmType",[],(function(t,n,r,o,a,i){var e=Object.freeze({WA_IPHONE:0,FB_IPHONE:1,WASM_MP4_CHECK_AND_REPAIR:2,WEB_MEDIA_WORKER:3,HYBRID_BRIDGE:4});i.VIDEO_TRANSCODER_ALGORITHM_TYPE=e}),66); __d("WAWebWamEnumVideoTranscoderResultType",[],(function(t,n,r,o,a,i){var e=Object.freeze({UNKNOWN:0,SUCCEEDED:1,FAILED:2,CANCELLED:3});i.VIDEO_TRANSCODER_RESULT_TYPE=e}),66); __d("WAWebWamEnumVideoTranscoderSourceFormatType",[],(function(t,n,r,o,a,i){var e=Object.freeze({SLOMO:0,VIDEO:1,GIF:2});i.VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE=e}),66); __d("WAWebWamEnumVideoTranscoderTargetFormatType",[],(function(t,n,r,o,a,i){var e=Object.freeze({IMAGE:0,VIDEO:1,GIF:2});i.VIDEO_TRANSCODER_TARGET_FORMAT_TYPE=e}),66); __d("WAWebVideoTranscoderWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumVideoTranscoderAlgorithmType","WAWebWamEnumVideoTranscoderResultType","WAWebWamEnumVideoTranscoderSourceFormatType","WAWebWamEnumVideoTranscoderTargetFormatType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({VideoTranscoder:[1802,{sourceAudioBitRate:[12,e.TYPES.NUMBER],sourceAudioCodec:[23,e.TYPES.STRING],sourceContainerFormat:[24,e.TYPES.STRING],sourceDuration:[8,e.TYPES.TIMER],sourceFileExtension:[25,e.TYPES.STRING],sourceFileSize:[7,e.TYPES.NUMBER],sourceFormat:[14,o("WAWebWamEnumVideoTranscoderSourceFormatType").VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE],sourceFrameRate:[13,e.TYPES.NUMBER],sourceHeight:[10,e.TYPES.NUMBER],sourceMimeType:[26,e.TYPES.STRING],sourceVideoBitRate:[11,e.TYPES.NUMBER],sourceVideoCodec:[27,e.TYPES.STRING],sourceWidth:[9,e.TYPES.NUMBER],targetAudioBitRate:[20,e.TYPES.NUMBER],targetDuration:[16,e.TYPES.TIMER],targetFileSize:[15,e.TYPES.NUMBER],targetFormat:[22,o("WAWebWamEnumVideoTranscoderTargetFormatType").VIDEO_TRANSCODER_TARGET_FORMAT_TYPE],targetFrameRate:[21,e.TYPES.NUMBER],targetHeight:[18,e.TYPES.NUMBER],targetVideoBitRate:[19,e.TYPES.NUMBER],targetWidth:[17,e.TYPES.NUMBER],transcoderAlgorithm:[1,o("WAWebWamEnumVideoTranscoderAlgorithmType").VIDEO_TRANSCODER_ALGORITHM_TYPE],transcoderContainsVideocomposition:[5,e.TYPES.BOOLEAN],transcoderHasEdits:[6,e.TYPES.BOOLEAN],transcoderIsPassthrough:[4,e.TYPES.BOOLEAN],transcoderResult:[2,o("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE],transcoderT:[3,e.TYPES.TIMER]},[1,1,1],"regular"]},{VideoTranscoder:[]});l.VideoTranscoderWamEvent=s}),98); __d("WAWebWaveformUtils",["WAPttComposerScaleWaveform","WAWebNewsletterGatingUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e=64;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(!o("WAWebNewsletterGatingUtils").isAudioFileWaveformSenderEnabled())return null;var n=yield t.arrayBuffer(),r=new AudioContext({sampleRate:8e3}),a=yield r.decodeAudioData(n),i=c(a,e);return new Uint8Array(i)}),u.apply(this,arguments)}function c(e,t){var n=e.getChannelData(0);return m(d(n,t))}function d(e,t){return r("WAPttComposerScaleWaveform")(Array.from(e,Math.abs),t)}function m(e){var t=Math.pow(Math.max.apply(Math,e),-1),n=e.map(function(e){return e*t});return n.map(function(e){return e*100})}l.computeWaveform=s}),98); __d("WAWebMediaDataUtils",["Promise","WABase64","WAFilteredCatch","WALogger","WANullthrows","WAPromiseCallSync","WAWebABProps","WAWebCanvasUtils","WAWebDecodeWebpToRgba","WAWebDocumentUploadEnrichment","WAWebFileUtils","WAWebImageUtils","WAWebMediaAnalyzer","WAWebMediaCleanFileName","WAWebMediaConstants","WAWebMediaLoad","WAWebMediaOpaqueData","WAWebMediaTypes","WAWebMimeTypes","WAWebMiscErrors","WAWebMiscGatingUtils","WAWebMmsMediaTypes","WAWebNetworkGetResponseIfOnline","WAWebStickerUtils","WAWebURLUtils","WAWebVcardParsingUtils","WAWebVideoTranscoderWamEvent","WAWebWamEnumMediaPickerOriginType","WAWebWamEnumVideoTranscoderAlgorithmType","WAWebWamEnumVideoTranscoderResultType","WAWebWamEnumVideoTranscoderSourceFormatType","WAWebWamEnumVideoTranscoderTargetFormatType","WAWebWaveformUtils","WAWebWebpParseWebp","WAWebXHR","asyncToGeneratorRuntime","cr:10296","err","file-type","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_=2e4;function f(e){return F((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){t(e);var o=new Image;return yield new(p||(p=n("Promise")))(function(t,n){o.onload=t,o.onabort=function(){n(r("err")("getImageWidthHeight onabort"))},o.onerror=function(){n(r("err")("getImageWidthHeight onerror"))},o.src=e.url()}),{width:o.naturalWidth,height:o.naturalHeight}});return function(e){return t.apply(this,arguments)}})())}function g(e){return new(p||(p=n("Promise")))(function(t,n){var o=new Image,a=window.URL.createObjectURL(e);o.onload=function(){var e={width:o.naturalWidth,height:o.naturalHeight};window.URL.revokeObjectURL(a),t(e)},o.onabort=function(){window.URL.revokeObjectURL(a),n(r("err")("getImageWidthHeight onabort"))},o.onerror=function(){window.URL.revokeObjectURL(a),n(r("err")("getImageWidthHeight onerror"))},o.src=a})}function h(t){return o("WAWebFileUtils").blobToArrayBuffer(t).catch(function(t){throw o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["MediaUtils error: ",""])),t),t})}function y(e){return F(function(t){t(e);var n=e.getBlob();if(n)return h(n);var a=r("WANullthrows")(e.getBase64(),"b64 should be defined");return o("WABase64").decodeB64(a)})}function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield h(e);return r("WAWebDecodeWebpToRgba")(t)}),b.apply(this,arguments)}function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield h(e);return o("WAWebWebpParseWebp").parseWebp(t)}),S.apply(this,arguments)}function R(e){return o("WAWebMediaLoad").videoWidthHeightDuration(e)}function L(e,t){return F((function(){var a=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n){n(e);var a=yield o("WAWebMediaLoad").transcode(e.forceToBlob(),t).then(function(e){return r("WAWebMediaOpaqueData").createFromData(e,e.type)});return n(a),a.autorelease(),a});return function(e){return a.apply(this,arguments)}})())}function E(e,t){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=t.maxDimension,r=t.minDimension,a=t.transparency,i=yield o("WAWebImageUtils").rotateAndResize(e,n,o("WAWebImageUtils").BLOB,{transparency:a,minDimension:r}),l=i.height,s=i.images,u=i.width;if(s==null||s.blob==null)throw new(o("WAWebMiscErrors")).MediaFileFailedLoad;return{width:u,height:l,size:s.blob.size}}),k.apply(this,arguments)}function I(e,t,n){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a,i=t.maxDimension,l=t.minDimension,s=t.transparency,u=e.forceToBlob(),c=yield o("WAWebImageUtils").rotateAndResize(u,i,o("WAWebImageUtils").BLOB|o("WAWebImageUtils").CANVAS,{transparency:s,minDimension:l}),d=c.height,m=c.images,p=c.width;if(m==null||m.canvas==null)throw new(o("WAWebMiscErrors")).MediaFileFailedLoad;var f=yield o("WAWebImageUtils").rotateAndResize(m.canvas,o("WAWebMediaConstants").IMG_THUMB_MAX_EDGE,o("WAWebImageUtils").DATA_URL|o("WAWebImageUtils").CANVAS),g=f.images;if(g==null||g.canvas==null)throw new(o("WAWebMiscErrors")).MediaFileFailedLoad;var h=o("WAWebCanvasUtils").getResizedDataUrl(g.canvas,"image/jpeg",_),y=h!=null&&h!==""?r("WAWebURLUtils").parseDataURL(h).data:null,C=n===o("WAWebWamEnumMediaPickerOriginType").MEDIA_PICKER_ORIGIN_TYPE.STATUS_TAB_CAMERA_PHOTO_LIBRARY||n===o("WAWebWamEnumMediaPickerOriginType").MEDIA_PICKER_ORIGIN_TYPE.STATUS_TAB_CAMERA_CAPTURE||n===o("WAWebWamEnumMediaPickerOriginType").MEDIA_PICKER_ORIGIN_TYPE.STATUS_TAB_CAMERA_MEDIA_STRIP||n===o("WAWebWamEnumMediaPickerOriginType").MEDIA_PICKER_ORIGIN_TYPE.STATUS_TAB_GIF,b=null,v=null;if(C&&m.canvas!=null){var S=yield o("WAWebImageUtils").rotateAndResize(m.canvas,o("WAWebMediaConstants").STATUS_IMG_THUMB_MAX_EDGE,o("WAWebImageUtils").DATA_URL),R=S.images,L=R==null?void 0:R.dataUrl;L!=null&&L!==""&&(b=yield r("WAWebMediaOpaqueData").createFromBase64Jpeg(r("WAWebURLUtils").parseDataURL(L).data),v={width:o("WAWebMediaConstants").STATUS_IMG_THUMB_MAX_EDGE,height:Math.round(o("WAWebMediaConstants").STATUS_IMG_THUMB_MAX_EDGE*d/p)})}return{type:o("WAWebMediaTypes").OUTWARD_TYPES.IMAGE,mediaBlob:m.blob,mimetype:(a=m.blob)==null?void 0:a.type,fullWidth:p,fullHeight:d,preview:y,fullPreviewData:b,fullPreviewSize:v}}),T.apply(this,arguments)}function D(e){return x.apply(this,arguments)}function x(){return x=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.forceToBlob(),n=yield o("WAWebImageUtils").rotateAndResize(t,o("WAWebABProps").getABPropConfigValue("web_image_max_edge"),o("WAWebImageUtils").BLOB,{transparency:!0}),a=n.height,i=n.images,l=n.width;if(i==null||i.blob==null)throw new(o("WAWebMiscErrors")).MediaFileFailedLoad;var s=yield o("WAWebImageUtils").toWebpSticker(i.blob),u=yield r("WAWebMediaOpaqueData").createFromData(s,s.type);return{type:o("WAWebMediaTypes").OUTWARD_TYPES.STICKER,mediaBlob:u,mimetype:s.type,fullWidth:l,fullHeight:a}}),x.apply(this,arguments)}function $(e,t,n,r,o,a,i,l,s,u,c){return P.apply(this,arguments)}function P(){return P=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i,l,m,p,_,f,g,h){var y=!1;try{var C,b,v=e.forceToBlob(),S=v instanceof File?v.name:"",R=new(o("WAWebVideoTranscoderWamEvent")).VideoTranscoderWamEvent({sourceHeight:a==null?void 0:a.fullHeight,sourceWidth:a==null?void 0:a.fullWidth,sourceDuration:a==null?void 0:a.duration,sourceFileSize:e.size(),sourceFormat:i===!0?o("WAWebWamEnumVideoTranscoderSourceFormatType").VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE.GIF:o("WAWebWamEnumVideoTranscoderSourceFormatType").VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE.VIDEO,sourceMimeType:v.type,sourceFileExtension:S.split(".").pop()}),L=(C=n("cr:10296")==null?void 0:n("cr:10296").isWindowsHybridTranscoderEnabled())!=null?C:!1,E=v.type.startsWith("video/"),k=v.type==="video/mp4",I=k?(b=n("cr:10296")==null?void 0:n("cr:10296").isWindowsHybridTranscoderEnabledForMp4())!=null?b:!1:!0,T=L&&E&&I;R.startTranscoderT();var D=null;if(!T){var x=!1,$=yield o("WAWebMediaAnalyzer").checkAndRepair(v,!!i);D=$[0],x=$[1],D&&(R.transcoderAlgorithm=x?o("WAWebWamEnumVideoTranscoderAlgorithmType").VIDEO_TRANSCODER_ALGORITHM_TYPE.WASM_MP4_CHECK_AND_REPAIR:o("WAWebWamEnumVideoTranscoderAlgorithmType").VIDEO_TRANSCODER_ALGORITHM_TYPE.WEB_MEDIA_WORKER)}if(T||!D&&L){R.transcoderAlgorithm=o("WAWebWamEnumVideoTranscoderAlgorithmType").VIDEO_TRANSCODER_ALGORITHM_TYPE.HYBRID_BRIDGE;var P=yield n("cr:10296")==null?void 0:n("cr:10296").transcodeVideo(v,_,f,g,h);if(P!=null){var N=P[0],M=P[1];v=N,y=M,D={type:v.type,file:v,isGif:!1}}}if(R.markTranscoderT(),!D)throw R.set({transcoderResult:o("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE.FAILED}),R.commit(),o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["processRawAudioVideo bad video file ",""])),v.type),new(o("WAWebMiscErrors")).InvalidMediaCheckRepairFailedType;var w=D.type,A=D.file;R.set({targetFileSize:A.size});var F=i===!0||D.isGif===!0;e:{var O=o("WAWebFileUtils").typeFromMimetype(w);if(O===o("WAWebFileUtils").FILETYPE.VIDEO){if(t)throw R.set({transcoderResult:o("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE.FAILED}),R.commit(),o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).sendLogs("media-fault: ptt became video"),new(o("WAWebMiscErrors")).InvalidMediaFileType;R.set({targetFormat:o("WAWebWamEnumVideoTranscoderTargetFormatType").VIDEO_TRANSCODER_TARGET_FORMAT_TYPE.VIDEO,transcoderResult:o("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE.SUCCEEDED});var B={type:o("WAWebMediaTypes").OUTWARD_TYPES.VIDEO,mediaBlob:A,mimetype:w,isGif:F,gifAttribution:F?l||0:void 0,accessibilityLabel:p,size:A.size};if(a&&a.duration!=null&&a.fullHeight!=null&&a.fullHeight!==0&&a.fullWidth!=null&&a.fullWidth!==0&&!r("isStringNullOrEmpty")(a.preview)){var W=a.duration;return R.set({sourceHeight:a.fullHeight,sourceWidth:a.fullWidth,sourceDuration:W}),R.commit(),babelHelpers.extends({},B,{fullWidth:a.fullWidth,fullHeight:a.fullHeight,preview:a.preview,duration:W==null?void 0:W.toString()})}var q=yield o("WAWebImageUtils").generateVideoThumbsAndDuration({file:A,maxDimensions:[o("WAWebMediaConstants").IMG_THUMB_MAX_EDGE,o("WAWebMediaConstants").VIDEO_THUMB_MAX_EDGE],debugHint:"processRawAudioVideo"}),U=q.duration,V=q.thumbs,H=V[0],G=V[1],z=yield r("WAWebMediaOpaqueData").createFromBase64Jpeg(r("WAWebURLUtils").parseDataURL(G.url).data);return R.set({sourceHeight:H.fullHeight,sourceWidth:H.fullWidth,sourceDuration:U}),R.commit(),babelHelpers.extends({},B,{fullWidth:H.fullWidth,fullHeight:H.fullHeight,preview:r("WAWebURLUtils").parseDataURL(H.url).data,fullPreviewData:z,duration:U.toString()});break e}if(O===o("WAWebFileUtils").FILETYPE.AUDIO){var j,K,Q=(j=a==null?void 0:a.duration)!=null?j:yield o("WAWebFileUtils").getAudioDuration(A),X=(K=a==null?void 0:a.waveform)!=null?K:yield o("WAWebWaveformUtils").computeWaveform(A);return{type:t?o("WAWebMediaTypes").OUTWARD_TYPES.PTT:o("WAWebMediaTypes").OUTWARD_TYPES.AUDIO,mediaBlob:A,mimetype:w,duration:Q.toString(),waveform:X}}if(O===o("WAWebFileUtils").FILETYPE.IMAGE||O===o("WAWebFileUtils").FILETYPE.DOCUMENT||O===o("WAWebFileUtils").FILETYPE.STICKER||O===o("WAWebFileUtils").FILETYPE.STICKER_PACK){throw R.set({transcoderResult:o("WAWebWamEnumVideoTranscoderResultType").VIDEO_TRANSCODER_RESULT_TYPE.FAILED}),R.commit(),o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed!"]))).sendLogs("media-fault: audio/video became other"),r("err")("audio/video became "+w);break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+O)}}catch(e){throw o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["processRawAudioVideo error: ",""])),e),y&&g!=null&&g(),e}}),P.apply(this,arguments)}function N(e,t){return M.apply(this,arguments)}function M(){return M=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=e.type;if(n){if(o("WAWebMimeTypes").DOC_MIMES==="*"||o("WAWebMimeTypes").DOC_MIMES.includes(n))return n;throw new(o("WAWebMiscErrors")).InvalidMediaFileType("disallowed mimetype "+n)}else{var a=Math.min(o("WAWebMimeTypes").MIMETYPE_DETERMINING_LENGTH,e.size),i=yield h(e.slice(0,a)),l=new Uint8Array(i);if(o("WAWebMimeTypes").isMsCompoundFileBinaryFormat(l.subarray(0,8))){var s;return t!=null&&(s=o("WAWebFileUtils").getMimeTypeForFilepath(t))!=null?s:o("WAWebMimeTypes").MSCFB_MIME}var u=r("file-type")(l);if(u!=null&&u.mime){var c=o("WAWebMimeTypes").isAllowedDocumentMimetype(u.mime,t,!0);if(!r("isStringNullOrEmpty")(c))return c}else if(!r("isStringNullOrEmpty")(t)){var d=o("WAWebFileUtils").getMimeTypeForFilepath(t);if(!r("isStringNullOrEmpty")(d))return d}throw new(o("WAWebMiscErrors")).InvalidMediaFileType("type: "+String(e.type)+" name: "+String(t))}}),M.apply(this,arguments)}function w(e,t,n,r,o){return A.apply(this,arguments)}function A(){return A=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i,l){var s,u,c=e.forceToBlob(),d=o("WAWebMediaCleanFileName").cleanFilename(c.name||(t!=null?t:"")),m=yield N(c,d),_=a?o("WAWebFileUtils").blobToText(c):null,f=yield(p||(p=n("Promise"))).all([o("WAWebDocumentUploadEnrichment").enrich(c,m),_]),g=f[0],h=f[1],y=(s=g==null||(u=g.microThumbnail)==null?void 0:u.dataUrl)!=null?s:g==null?void 0:g.thumbUrl,C=r("isStringNullOrEmpty")(y)?null:r("WAWebURLUtils").parseDataURL(y).data;return{type:l,mediaBlob:yield r("WAWebMediaOpaqueData").createFromData(c,m),mimetype:m,filename:d||void 0,documentPreview:g,preview:C,fullPreviewData:g==null?void 0:g.fullPreviewData,fullPreviewSize:g?{width:g.width,height:g.height}:null,pageCount:i!=null?i:g==null?void 0:g.pdfPages,isVcardOverMmsDocument:a,parsedVcards:h?o("WAWebVcardParsingUtils").parseMultiVcard(h):null}}),A.apply(this,arguments)}function F(e){var t=[];function n(e){e.retain(),t.push(e)}return o("WAPromiseCallSync").promiseCallSync(e,null,n).finally(function(){for(var e=0;er.width){var f=r.height/r.width;p=s,_=f*s,m=-(_-t)/2}else{var g=r.width/r.height;_=t,p=g*t,d=-(p-s)/2}return a===!0?(u.width=p,u.height=_):(u.width=s,u.height=t),c.drawImage(r,d,m,p,_),{dataUrl:u.toDataURL(n,o).replace("data:image/jpeg;base64,",""),width:u.width,height:u.height}});n(e)},r.src=e})}function K(e){return e?e.fullPreviewData?e.fullPreviewData.url():e.preview instanceof r("WAWebMediaOpaqueData")?e.preview.url():null:null}l.getImageWidthHeight=f,l.getImageWidthHeightNoOpaque=g,l.opaqueDataToArrayBuffer=y,l.decodeWebpToRGBANoOpaque=C,l.parseWebpNoOpaque=v,l.getImageMetadata=E,l.processRawImage=I,l.processRawSticker=D,l.processRawAudioVideo=$,l.getRawDocumentMimetype=N,l.processRawDocument=w,l.fetchMedia=O,l.canPlayOgg=W,l.gatherAndSetMetadata=q,l.gatherAndSetMetadataNoOpaque=V,l.shouldUseMediaCache=G,l.shouldUseLruMediaStore=z,l.getResizedThumbData=j,l.getHighestQualityThumbnailUrl=K}),98); __d("WAWebLruCacheMap",["WALruCache"],(function(t,n,r,o,a,i,l){var e=(function(){function e(e){var t=e.getSize,n=e.sizeLimit;this.$1=new(o("WALruCache")).LruCache({sizeLimit:n,getSize:t!=null?t:function(){return 1}})}var t=e.prototype;return t.clear=function(){this.$1.clear()},t.delete=function(t){var e=this.has(t);return e?(this.$1.delete(t),!0):!1},t.get=function(t){return this.$1.get(t)},t.has=function(t){return this.$1.has(t)},t.set=function(t,n){return this.$1.put(t,n),this},t.iterateOnEach=function(t){this.$1.forEach(t)},babelHelpers.createClass(e,[{key:"size",get:function(){return this.$1.getCurrentSize()}}])})();l.LruCacheMap=e}),98); __d("WAWebInMemoryLottieStickerCache",["WAWebLruCacheMap","WAWebMediaMmsV4Download","WAWebStickerErrorWamEvent","WAWebWamEnumStickerErrorType","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=5e3,s=new(o("WAWebLruCacheMap")).LruCacheMap({sizeLimit:e});function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WAWebMediaMmsV4Download").extractLottieJSON(t,e);if(n==null)return null;try{var r=JSON.parse(n);return d(r)?(s.set(e,r),r):null}catch(e){return new(o("WAWebStickerErrorWamEvent")).StickerErrorWamEvent({stickerErrorType:o("WAWebWamEnumStickerErrorType").STICKER_ERROR_TYPE.RECEIVER_VALIDATION}).commit(),null}}),c.apply(this,arguments)}function d(e){var t=["v","ip","op","layers","fr","w","h"];return t.every(function(t){return Object.prototype.hasOwnProperty.call(e,t)})}l.InMemoryLottieStickerCache=s,l.extractAndSetLottieJSONInMemoryCache=u}),98); __d("WAWebMediaInMemoryBlobCache",["WALogger","WALruCache","WAWebABProps","WAWebMediaStorage","WAWebMediaTypes","err","lodash"],(function(t,n,r,o,a,i,l){var e,s=25e7,u=(function(){function t(e){var t=this;if(e===void 0&&(e=s),this.$3=new Map,this.$4=new Set,this.$5=new Set,this.getOrCreateURL=function(e){var n=t.$3.get(e);if(n!=null)return t.touch(e),n;var o=t.get(e);if(!o)throw r("err")("There is no blob matching filehash: "+e+".");var a=window.URL.createObjectURL(o);return t.$3.set(e,a),a},this.revokeURL=function(e,n){if(n!=null){if(t.$3.get(e)!==n)throw r("err")("The url provided does not match the filehash.");t.$3.delete(e),window.URL.revokeObjectURL(n)}},this.$8=r("lodash").throttle(function(){t.$4.forEach(function(e){var n=t.$3.get(e);n!=null&&(window.URL.revokeObjectURL(n),t.$3.delete(e))}),t.$4.clear()},0,{leading:!1}),e!=null&&e<0)throw r("err")("Size limit cannot be a negative number.");this.$2={},this.$1=new(o("WALruCache")).LruCache({sizeLimit:e,getSize:function(t){return t.size},onEvict:function(n,r){t.$3.has(n)&&t.$6(n)===0&&(t.revokeURL(n,t.$3.get(n)),o("WAWebMediaStorage").getOrCreateMediaObject(n).consolidate({downloadStage:o("WAWebMediaTypes").DownloadStage.INIT,progressiveStage:null}))},shouldEvict:function(n,r){return t.$6(n)===0}})}var n=t.prototype;return n.get=function(t){return this.$1.get(t)},n.has=function(t){return this.$1.has(t)},n.touch=function(t){this.get(t)},n.put=function(t,n){this.$1.put(t,n),this.$7()},n.delete=function(t){this.$1.delete(t),this.$7()},n.clear=function(){var e=this;this.$8.flush(),this.$2={},this.$3.forEach(function(t,n){e.revokeURL(n,t)}),this.$3.clear(),this.$1.clear()},n.increaseUsageCount=function(t){this.$2[t]=this.$6(t)+1,this.$4.delete(t)},n.decreaseUsageCount=function(n){var t=this.$6(n);if(t<=0){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["InMemoryMediaBlobCache: Cannot decrease the usageCount to a negative number."]))).tags("media-in-memory-blob-cache").sendLogs("media-blob-cache-usage-count-negative-number");return}this.$2[n]=t-1,this.$2[n]===0&&(delete this.$2[n],this.$4.add(n),this.$8())},n.$6=function(t){return this.$2[t]||0},n.$7=function(){this.$5.forEach(function(e){return e()})},n.subscribe=function(t){var e=this;return this.$5.add(t),function(){e.$5.delete(t)}},n.getBlobCacheSnapshot=function(t){return this.has(t)},n.canFitFile=function(t){return o("WAWebABProps").getABPropConfigValue("web_skip_cache_for_large_media_enabled")?t<=this.$1.getSizeLimit():!0},t})(),c=new u;l.InMemoryMediaBlobCacheImpl=u,l.InMemoryMediaBlobCache=c}),98); __d("WAWebCheckMediaExistence",["WALogger","WAWebMediaMmsV4Download","WAWebMmsMediaTypes","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(yield t.waitForPhoneUpload(),!t.mediaObject){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["checkExistence msg without mediaObject, id: "," type: ",""])),t.id.toString(),t.type).sendLogs("media-fault: checkExistence msg without mediaObject");return}yield o("WAWebMediaMmsV4Download").checkExistence({mimetype:t.mimetype,mediaObject:t.mediaObject,mediaType:o("WAWebMmsMediaTypes").getMsgMediaType(t)})}),u.apply(this,arguments)}l.checkMediaExistence=s}),98); __d("WAWebClearMediaForChat",["WAWebMediaStorage"],(function(t,n,r,o,a,i,l){function e(e){o("WAWebMediaStorage").clearMediaForChat(e)}l.clearMediaForChat=e}),98); __d("WAWebConsolidateMediaUpdate",["WALogger","WAWebMediaCryptoEligibilityUtils","WAWebMediaGetDownloadOriginForMsg","WAWebMediaMmsV4Download","WAWebMediaObject","WAWebMediaOpaqueData","WAWebMediaStorage","WAWebMediaTypes","WAWebMmsMediaTypes","WAWebMsgGetters","WAWebMsgType"],(function(t,n,r,o,a,i,l){var e,s;function u(e){var t={};if(o("WAWebMediaTypes").MAPPED_MSG_PROPS.forEach(function(n){var r=e[n],a=o("WAWebMediaTypes").MSG_TO_MEDIA[n];t[a]=r}),e.type===o("WAWebMsgType").MSG_TYPE.INTERACTIVE){var n=o("WAWebMediaObject").getInteractiveMsgMediaType(e);n&&(t.type=n)}return t}function c(t,n){if(t.isUnsentPhoneMsg()){t.mediaObject&&o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""])),t.id.toString(),t.type).sendLogs("media-fault: consolidateMediaUpdate unsent message");var a=u(t);if(Object.prototype.hasOwnProperty.call(a,"preview")){var i=a.preview;delete a.preview,i&&r("WAWebMediaOpaqueData").createFromBase64Jpeg(i).then(function(e){t!=null&&t.mediaData&&t.isUnsentPhoneMsg()&&(t.mediaData.preview=e)})}t.mediaData.set(babelHelpers.extends({},a,{mediaStage:o("WAWebMediaTypes").MediaDataStage.REMOTE_NEED_UPLOAD}))}else d(t,t,n)}function d(e,t,n,a){var i=u(t),l=e.mediaObject,c=t.filehash,d=o("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(e);if(l)c&&c!==l.filehash&&(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["media:msg "," "," filehash"])),e.id.toString(),l.filehash?"changed":"added"),o("WAWebMediaStorage").disassociateMediaFromMsg(l,e),l=o("WAWebMediaStorage").getOrCreateMediaObject(c),e.mediaObject=l,o("WAWebMediaStorage").associateMediaWithMsg(l,e));else{c?l=o("WAWebMediaStorage").getOrCreateMediaObject(c):l=new(o("WAWebMediaObject")).MediaObject;var m=e.mediaData;m.aspectRatio!==void 0&&(i.aspectRatio=m.aspectRatio),e.mediaObject=l,o("WAWebMediaStorage").associateMediaWithMsg(l,e)}var p=!1,_=t.deprecatedMms3Url,f=t.directPath,g=t.encFilehash,h=t.firstFrameSidecar,y=t.mediaKey,C=t.mediaKeyTimestamp,b=t.scanLengths,v=t.scansSidecar,S=t.staticUrl,R=t.streamingSidecar,L=t.type;if(_||g||!d){var E;try{E=o("WAWebMmsMediaTypes").msgToMediaType({type:t.type,isGif:t.isGif,interactiveHeader:t.interactiveHeader,isNewsletter:o("WAWebMsgGetters").getIsNewsletterMsg(t)})}catch(e){E=~o("WAWebMmsMediaTypes").MEDIA_TYPE_VALUES.indexOf(L)?L:null}p=d?!l.entries.has({encFilehash:g,deprecatedMms3Url:_}):!l.entries.hasUnencryptedEntry({filehash:c,directPath:f});var k;p?E!=null&&(g!=null||!d)?d&&y!=null?k=l.entries.addEntry({deprecatedMms3Url:_,mediaKey:y,mediaKeyTimestamp:C,encFilehash:g,type:E,sidecar:R,directPath:f,firstFrameSidecar:h,scansSidecar:v,scanLengths:b,debugHint:"consolidate",staticUrl:S}):!d&&f!=null&&c!=null&&(k=l.entries.addUnencryptedEntry({debugHint:"consolidate",directPath:f,filehash:c,type:E})):p=!1:d&&y!=null&&y!==""?k=l.entries.updateEntry({deprecatedMms3Url:_,mediaKey:y,mediaKeyTimestamp:C,encFilehash:g,type:E,sidecar:R,directPath:f,firstFrameSidecar:h,scansSidecar:v,scanLengths:b,staticUrl:S}):!d&&c!=null&&(k=l.entries.updateUnencryptedEntry({filehash:c,directPath:f})),k||(p=!1),p&&l.downloadStage===o("WAWebMediaTypes").DownloadStage.ERROR_MISSING&&(i.downloadStage=o("WAWebMediaTypes").DownloadStage.INIT)}if(l.consolidate(i)||l.notifyMsgsAsync(),p&&l.downloadStage===o("WAWebMediaTypes").DownloadStage.NEED_POKE){var I;try{I=o("WAWebMmsMediaTypes").getMsgMediaType(e)}catch(n){if(!t.type)throw n;I=o("WAWebMmsMediaTypes").msgToMediaType({type:t.type,isGif:e.isGif,isNewsletter:o("WAWebMsgGetters").getIsNewsletterMsg(e)})}o("WAWebMediaMmsV4Download").downloadMedia({mimetype:t.mimetype,mediaObject:l,downloadEvenIfExpensive:!1,mediaType:I,rmrReason:n,downloadOrigin:r("WAWebMediaGetDownloadOriginForMsg")(e),chatWid:a})}}l.consolidateMediaUpdate=c,l.consolidateMediaUpdateWithValues=d}),98); __d("WAWebDownloadProgressiveJpegThumbnail",["WAAbortError","WALogger","WANullthrows","WAWebDownloadManager","WAWebMediaGetDownloadOriginForMsg","WAWebMediaOpaqueData","WAWebMmsMediaTypes","WAWebSerializeError","WAWebStartMediaDownloadQpl","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.chat,a=t.isPreload,i=t.msg,l=t.scanCount,d=l===void 0?1:l,m=t.signal;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["media.downloadProgressiveJpegThumbnail: start"])));var p=o("WAWebStartMediaDownloadQpl").startMediaDownloadQpl({entryPoint:"DownloadProgressiveJpegThumbnail"});try{var _,f=(_=r("WANullthrows"))(i.scanLengths),g=_(i.scansSidecar),h=_(i.mediaObject),y=_(h.filehash),C=i.directPath,b=i.encFilehash,v=yield o("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt({directPath:C,encFilehash:b,filehash:y,mediaKey:i.mediaKey,mediaKeyTimestamp:i.mediaKeyTimestamp,type:o("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE,signal:m||new AbortController().signal,userDownloadAttemptCount:0,progressiveJpegOpts:{mimetype:"image/jpeg",scansSidecar:g,scanLengths:f,scanCount:d},isPreload:a,chatWid:n==null?void 0:n.id,downloadQpl:p,downloadOrigin:r("WAWebMediaGetDownloadOriginForMsg")(i.unsafe())});h.consolidate({fullPreviewData:yield r("WAWebMediaOpaqueData").createFromData(v,"image/jpeg")}),p.endSuccess(),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["media.downloadProgressiveJpegThumbnail: success"])))}catch(e){if(r("getErrorSafe")(e).name===o("WAAbortError").ABORT_ERROR){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["media.downloadProgressiveJpegThumbnail aborted"]))),p.endFailWithError("download_aborted","Download aborted");return}p.endFailWithError("download_failed",r("getErrorSafe")(e).message),o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["media.downloadProgressiveJpegThumbnail: error\n",""],["media.downloadProgressiveJpegThumbnail: error\\n",""])),r("WAWebSerializeError")(e)).sendLogs("download-pjpeg-thumbnail-failed")}}),m.apply(this,arguments)}l.downloadProgressiveJpegThumbnail=d}),98); __d("WAWebDownloadStatusThumbnail",["WAWebDownloadProgressiveJpegThumbnail","WAWebDownloadVideoThumbnail","WAWebMediaDownloadMmsThumbnail","WAWebMsgType","WAWebStatusGatingUtils","asyncToGeneratorRuntime","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e=1,s=2;function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.isPreload,a=t.msg,i=t.signal,l=a.encFilehash,u=a.thumbnailDirectPath,c=a.thumbnailEncSha256,d=a.thumbnailSha256,m=o("WAWebStatusGatingUtils").isUpdatesTabInNavigationBarEnabled()?s:e;if(a.type===o("WAWebMsgType").MSG_TYPE.IMAGE&&a.scanLengths&&a.scansSidecar&&l){yield o("WAWebDownloadProgressiveJpegThumbnail").downloadProgressiveJpegThumbnail({msg:a,signal:i,isPreload:n,scanCount:m});return}else if(a.type===o("WAWebMsgType").MSG_TYPE.VIDEO&&a.isGif!==!0&&o("WAWebStatusGatingUtils").isUpdatesTabInNavigationBarEnabled()){yield o("WAWebDownloadVideoThumbnail").downloadVideoThumbnail({msg:a});return}if(!r("isStringNullOrEmpty")(d)&&!r("isStringNullOrEmpty")(c)&&!r("isStringNullOrEmpty")(u)){yield r("WAWebMediaDownloadMmsThumbnail")({msg:a,signal:i,isPreload:n,chat:null});return}}),c.apply(this,arguments)}l.downloadStatusThumbnail=u}),98); __d("WAWebDownloadVideoThumbnail",["WALogger","WANullthrows","WAPromiseLoop","WAWebDownloadManager","WAWebImageUtils","WAWebMediaConstants","WAWebMediaCryptoEligibilityUtils","WAWebMediaGetDownloadOriginForMsg","WAWebMediaOpaqueData","WAWebMiscErrors","WAWebMmsMediaTypes","WAWebMsgGetters","WAWebMsgModelPropUtils","WAWebSerializeError","WAWebStartMediaDownloadQpl","WAWebURLUtils","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m=1,p=1.5;function _(e){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=t.chat,i=t.downloadQpl,l=t.msg;return yield o("WAPromiseLoop").promiseLoop((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,s){try{var u=Math.max(parseInt(l.mediaData.duration,10),1),c={video:{size:l.mediaData.size,duration:u},secondsToDownload:s===0?m:p},d=yield o("WAWebDownloadManager").downloadManager.downloadAndMaybeDecrypt({directPath:l.directPath,encFilehash:l.encFilehash,filehash:l.filehash,mediaKey:l.mediaKey,mediaKeyTimestamp:l.mediaKeyTimestamp,type:o("WAWebMsgGetters").getIsNewsletterMsg(l)?o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_VIDEO:o("WAWebMmsMediaTypes").MEDIA_TYPES.VIDEO,signal:new AbortController().signal,userDownloadAttemptCount:0,partialVideoOpts:c,isPreload:!0,chatWid:a==null?void 0:a.id,downloadQpl:i,downloadOrigin:r("WAWebMediaGetDownloadOriginForMsg")(l.unsafe())}),_=new Blob([d],{type:"video/mp4"}),f=yield o("WAWebImageUtils").generateVideoThumbsAndDuration({file:_,maxDimensions:[o("WAWebMediaConstants").VIDEO_THUMB_MAX_EDGE],debugHint:"downloadVideoThumbnail",throwOnBlack:!0}),g=f.thumbs,h=g[0];t(h)}catch(t){if(a==null&&t instanceof o("WAWebMiscErrors").UnableToPlayVideoError&&s===0){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["media.generateThumbnailFromVideo: retrying due to UnableToPlayVideoError"])));return}throw t}});return function(e,n,r){return t.apply(this,arguments)}})(),void 0)}),f.apply(this,arguments)}function g(e){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.chat,n=e.msg;if(o("WAWebMsgModelPropUtils").isTrusted(n.unsafe())&&(t==null?void 0:t.isSuspendedOrTerminated())!==!0){var a=n.directPath,i=n.encFilehash,l=n.filehash;if(!(!l||!a)&&!(o("WAWebMediaCryptoEligibilityUtils").isMediaCryptoExpectedForMsg(n)&&!i)){var m=n.mediaData,p=m.fullHeight,f=m.fullPreviewData,g=m.fullWidth;if(!(f&&g!=null&&p!=null)){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["media.downloadVideoThumbnail: start"])));var h=o("WAWebStartMediaDownloadQpl").startMediaDownloadQpl({entryPoint:"DownloadVideoThumbnail"});try{var y=yield _({msg:n,chat:t,downloadQpl:h}),C=yield r("WAWebMediaOpaqueData").createFromBase64Jpeg(r("WAWebURLUtils").parseDataURL(y.url).data),b=r("WANullthrows")(n.mediaObject,"mediaObject cannot be null for thumbnail download"),v={fullPreviewData:C,fullWidth:y.fullWidth,fullHeight:y.fullHeight};b.consolidate(v),h.endSuccess(),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["media.downloadVideoThumbnail: success"])))}catch(e){if(h.endFailWithError("download_failed",r("getErrorSafe")(e).message),e instanceof o("WAWebImageUtils").BlackVideoThumbnailError){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["media.downloadVideoThumbnail: black thumbnail was generated, fallback to blurred thumbnail"])));return}o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["media.downloadVideoThumbnail: error\n",""],["media.downloadVideoThumbnail: error\\n",""])),r("WAWebSerializeError")(e)).verbose()}}}}}),h.apply(this,arguments)}l.downloadVideoThumbnail=g}),98); __d("WAWebManuallySetMedia",["WAWebMediaGetDownloadOriginForMsg","WAWebMediaMmsV4Download","WAWebMediaOpaqueData","WAWebMmsMediaTypes"],(function(t,n,r,o,a,i,l){function e(e){var t=e.chatWid,n=e.media,a=e.msg,i=e.rmrReason,l=a.mediaObject;l&&r("WAWebMediaOpaqueData").createFromData(n,a.mimetype).then(function(e){o("WAWebMediaMmsV4Download").manuallySetMedia({mimetype:a.mimetype,mediaObject:l,mediaBlob:e,mediaType:o("WAWebMmsMediaTypes").getMsgMediaType(a),rmrReason:i,downloadOrigin:r("WAWebMediaGetDownloadOriginForMsg")(a),chatWid:t})})}l.manuallySetMedia=e}),98); __d("WAWebMediaCancelDownloadMsg",["WALogger","WAWebMediaMmsV4Download"],(function(t,n,r,o,a,i,l){var e;function s(e){o("WAWebMediaMmsV4Download").cancelDownloadMedia(e)}function u(t){t.mediaObject?s(t.mediaObject):t.mediaObject||o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""])),t.id.toString(),t.type).sendLogs("media-fault: cancelDownloadMsg msg without mediaObject")}l.cancelDownloadMedia=s,l.cancelDownloadMsg=u}),98); __d("WAWebMediaCancelUploadMsg",["WALogger","WAWebMediaMmsV4Upload"],(function(t,n,r,o,a,i,l){var e;function s(e){o("WAWebMediaMmsV4Upload").cancelUploadMedia(e)}function u(t){t.mediaObject?s(t.mediaObject):o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""])),t.id.toString(),t.type).sendLogs("media-fault: cancelUploadMsg msg without mediaObject")}l.cancelUploadMedia=s,l.cancelUploadMsg=u}),98); __d("WAWebMediaDownloadMsg",["Promise","WALogger","WAWebMediaGetDownloadOriginForMsg","WAWebMediaMmsV4Download","WAWebMmsMediaTypes","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(t){var a=t.chatWid,i=t.downloadEvenIfExpensive,l=t.isAutoDownload,u=t.isUserClick,c=t.mode,d=t.msg,m=t.rmrData,p=t.rmrReason,_=t.shouldSequenceDownload,f=d.mediaObject;if(f){var g=f.getPendingProcess("fromDisk");return g.then(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){u&&f.userDownloadAttemptCount++,yield o("WAWebMediaMmsV4Download").downloadMedia({mimetype:d.mimetype,mediaObject:f,downloadEvenIfExpensive:i,mediaType:o("WAWebMmsMediaTypes").getMsgMediaType(d),rmrReason:p,rmrData:m,downloadOrigin:r("WAWebMediaGetDownloadOriginForMsg")(d),isVcardOverMmsDocument:d.isVcardOverMmsDocument,mode:c,isAutoDownload:l,isViewOnce:!!d.isViewOnce,chatWid:a,shouldSequenceDownload:_}),f.userDownloadAttemptCount=0}))}return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""])),d.id.toString(),d.type).sendLogs("media-fault: downloadMsg msg without mediaObject"),(s||(s=n("Promise"))).resolve()}l.downloadMsg=u}),98); __d("WAWebMediaFastForwardUtils",[],(function(t,n,r,o,a,i){"use strict";function e(e){var t=e.id;return!t.isPSA()&&!t.isCAPISupportAccount()&&!t.isBot()&&!t.isHosted()&&!t.isNewsletter()&&!e.isEnterprise}i.canEnableFastForward=e}),66); __d("WAWebWamEnumStickerSendMessageType",[],(function(t,n,r,o,a,i){var e=Object.freeze({REGULAR:1,PAYMENTS:2});i.STICKER_SEND_MESSAGE_TYPE=e}),66); __d("WAWebWamEnumStickerSendOriginType",[],(function(t,n,r,o,a,i){var e=Object.freeze({STICKER_SEARCH:1,FORWARD:2,STICKER_PICKER_TAB_RECENTS:3,STICKER_PICKER_TAB_FAVORITES:4,STICKER_PICKER_TAB_EMOTION:5,STICKER_PICKER_TAB_PACK:6,STICKER_PICKER_TAB_CONTEXTUAL_SUGGESTIONS:7,STICKER_MAKER:8,STICKER_STORE:9,AI_STICKER_CREATE:10,AI_STICKER_CREATE_TRAY:11,AI_STICKER_CREATE_CHAT:12,STATUS_QUICK_REPLY:13,DISCOVERY_PACK:14,STICKER_FROM_DEVICE_KEYBOARD:15,STICKER_PACK_INFO:16,CONVERSATION_STARTER:17,STICKER_SEARCH_TRENDING:18});i.STICKER_SEND_ORIGIN_TYPE=e}),66); __d("WAWebStickerSendWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumStickerMakerSourceType","WAWebWamEnumStickerSendMessageType","WAWebWamEnumStickerSendOriginType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({StickerSend:[1840,{stickerIsAi:[7,e.TYPES.BOOLEAN],stickerIsAnimated:[3,e.TYPES.BOOLEAN],stickerIsAvatar:[6,e.TYPES.BOOLEAN],stickerIsFirstParty:[2,e.TYPES.BOOLEAN],stickerIsFromStickerMaker:[5,e.TYPES.BOOLEAN],stickerIsFromUserCreatedPack:[12,e.TYPES.BOOLEAN],stickerIsGiphy:[10,e.TYPES.BOOLEAN],stickerIsKlipy:[13,e.TYPES.BOOLEAN],stickerIsLottie:[9,e.TYPES.BOOLEAN],stickerIsTenor:[11,e.TYPES.BOOLEAN],stickerIsText:[14,e.TYPES.BOOLEAN],stickerMakerSourceType:[8,o("WAWebWamEnumStickerMakerSourceType").STICKER_MAKER_SOURCE_TYPE],stickerSendMessageType:[4,o("WAWebWamEnumStickerSendMessageType").STICKER_SEND_MESSAGE_TYPE],stickerSendOrigin:[1,o("WAWebWamEnumStickerSendOriginType").STICKER_SEND_ORIGIN_TYPE]},[1,1,1],"regular"]},{StickerSend:[]});l.StickerSendWamEvent=s}),98); __d("WAWebMediaForwardMediaMsg",["Promise","WALogger","WAWebChatGetters","WAWebFrontendMsgGetters","WAWebGetNewsletterContextForForwardedMsg","WAWebInteractiveMessageType","WAWebMediaFastForwardUtils","WAWebMediaOpaqueData","WAWebMediaPrep","WAWebMediaTypes","WAWebMsgGetters","WAWebMsgType","WAWebStickerSendWamEvent","WAWebWamEnumStickerSendOriginType","WAWebWebpMetadata","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e,t,n,r){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a,i,l){var c,d,m,p,_,f,g,h,y,C,b,v,S,R,L;i===void 0&&(i=!1),l===void 0&&(l=!1),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Prepping media msg"])));var E=t.mediaObject;if(!E)return o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""])),t.id.toString(),t.type).sendLogs("media-fault: forwardMediaMsg msg without mediaObject"),(u||(u=n("Promise"))).reject(r("err")("non initialized media"));var k=t.mediaData.toJSON();k.preview!=null&&(k.preview=E.contentInfo._preview),k.mediaBlob instanceof r("WAWebMediaOpaqueData")&&k.mediaBlob.retain();var I={mimetype:k.mimetype},T=k.isGif?babelHelpers.extends({},I,{isGif:!0}):I;k.type===o("WAWebMediaTypes").OUTWARD_TYPES.PTT&&!o("WAWebMsgGetters").getHasOriginatedFromNewsletter(t)&&(k.type=o("WAWebMediaTypes").OUTWARD_TYPES.AUDIO);var D={businessOwnerJid:t.businessOwnerJid,productId:t.productId,currencyCode:t.currencyCode,priceAmount1000:t.priceAmount1000,salePriceAmount1000:t.salePriceAmount1000,retailerId:t.retailerId,url:t.url,productImageCount:t.productImageCount,title:t.title,description:t.description},x=k.type===o("WAWebMediaTypes").OUTWARD_TYPES.DOCUMENT&&(t.isFromTemplate||t.isDynamicReplyButtonsMsg),$=x||k.type===o("WAWebMediaTypes").OUTWARD_TYPES.PRODUCT?t.caption:void 0;l&&(k.type===o("WAWebMediaTypes").OUTWARD_TYPES.IMAGE||k.type===o("WAWebMediaTypes").OUTWARD_TYPES.VIDEO||k.type===o("WAWebMediaTypes").OUTWARD_TYPES.DOCUMENT||k.type===o("WAWebMediaTypes").OUTWARD_TYPES.STICKER_PACK)&&($=t.caption);var P=o("WAWebMediaFastForwardUtils").canEnableFastForward(a.contact),N=o("WAWebMediaFastForwardUtils").canEnableFastForward(o("WAWebFrontendMsgGetters").getChat(t).contact),M=o("WAWebChatGetters").getIsNewsletter(a)&&(c=t.interactiveAnnotations)!=null?c:void 0,w={forwardedFromWeb:!0,canEnableFastForward:P&&N,caption:$,type:t.type,mentionedJidList:t.mentionedJidList,groupMentions:t.groupMentions,footer:k.type===o("WAWebMediaTypes").OUTWARD_TYPES.PRODUCT?t.footer:void 0,addEvenWhilePreparing:t.type!==o("WAWebMsgType").MSG_TYPE.INTERACTIVE,useBasePropsType:t.type===o("WAWebMsgType").MSG_TYPE.INTERACTIVE,placeholderProps:T,isForwarded:o("WAWebMsgGetters").getShouldDisplayAsForwarded(t),forwardingScore:t.getForwardingScoreWhenForwarded(),multicast:i,productMsgOptions:D,isAvatar:(d=t.isAvatar)!=null?d:!1,forwardedNewsletterMessageInfo:o("WAWebGetNewsletterContextForForwardedMsg").getNewsletterContextForForwardedMsg(t),stickers:(m=t.stickers)!=null?m:void 0,publisher:(p=t.stickerPackPublisher)!=null?p:void 0,fileLength:(_=t.size)!=null?_:void 0,description:k.type===o("WAWebMediaTypes").OUTWARD_TYPES.STICKER_PACK&&t.description!=null?t.description:"",stickerPackId:(f=t.stickerPackId)!=null?f:void 0,thumbnailDirectPath:(g=t.thumbnailDirectPath)!=null?g:void 0,thumbnailSha256:(h=t.thumbnailSha256)!=null?h:void 0,thumbnailEncSha256:(y=t.thumbnailEncSha256)!=null?y:void 0,trayIconFileName:(C=t.trayIconFileName)!=null?C:void 0,stickerPackSize:(b=t.stickerPackSize)!=null?b:void 0,interactiveHeader:(v=t.interactiveHeader)!=null?v:void 0,interactiveType:(S=t.interactiveType)!=null?S:void 0,interactivePayload:(R=t.interactivePayload)!=null?R:void 0,nativeFlowInteractiveMsg:t.interactiveType===r("WAWebInteractiveMessageType").NATIVE_FLOW?!0:void 0,nativeFlowName:(L=t.nativeFlowName)!=null?L:void 0,interactiveAnnotations:M},A=yield new(o("WAWebMediaPrep")).MediaPrep(k.type,(u||(u=n("Promise"))).resolve(k)).sendToChat(a,o("WAWebGetNewsletterContextForForwardedMsg").maybeStripNewsletterForwardMetadata({forwardable:w,destination:a.id,source:t.id.remote,isOriginalMsgForwarded:t.isForwarded,isQuestionOrQuestionReply:t.isQuestion||t.questionReplyQuotedMessage!=null}));if(k.type===o("WAWebMediaTypes").OUTWARD_TYPES.STICKER){var F,O,B,W,q,U={stickerSendOrigin:o("WAWebWamEnumStickerSendOriginType").STICKER_SEND_ORIGIN_TYPE.FORWARD,stickerIsAnimated:!!((F=t.mediaData)!=null&&F.isAnimated),stickerIsFirstParty:!!((O=t.mediaData)!=null&&O.isFirstParty),stickerIsFromStickerMaker:!!((B=t.mediaData)!=null&&B.isFromStickerMaker),stickerIsLottie:!!((W=t.mediaData)!=null&&W.isLottie)},V=new(o("WAWebStickerSendWamEvent")).StickerSendWamEvent(U),H=o("WAWebWebpMetadata").getStickerMakerSourceType((q=t.mediaData)==null?void 0:q.stickerMakerSourceType);H!=null&&(V.stickerMakerSourceType=H),V.commit()}return A}),d.apply(this,arguments)}l.forwardMediaMsg=c}),98); __d("WAWebMediaGetDownloadOriginForMsg",["WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebMsgGetters","WAWebWamEnumDownloadOriginType"],(function(t,n,r,o,a,i,l){function e(e){if(o("WAWebFrontendMsgGetters").getAsProduct(e))return o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.PRODUCT_CATALOG;if(o("WAWebMsgGetters").getIsStatus(e))return o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.STATUS_USER;if(o("WAWebMsgGetters").getIsGroupMsg(e)){var t=o("WAWebFrontendMsgGetters").getChat(e);return t!=null&&o("WAWebFrontendChatGetters").getIsCAG(t)?o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.COMMUNITY:o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_GROUP}return o("WAWebMsgGetters").getIsNewsletterMsg(e)?o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHANNEL:o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE.CHAT_PERSONAL}l.default=e}),98); __d("WAWebMediaMsgRegistration",["Promise","WALogger","WAWebConsolidateMediaUpdate","WAWebLidStatusMigrationGating","WAWebMediaDataUtils","WAWebMediaOpaqueData","WAWebMediaStorage","WAWebMediaTypes","WAWebWamEnumWebcRmrReasonCode"],(function(t,n,r,o,a,i,l){var e,s,u,c="change:ack "+o("WAWebMediaTypes").MEDIA_MSG_PROPS.map(function(e){return"change:"+e}).join(" ");function d(e){o("WAWebConsolidateMediaUpdate").consolidateMediaUpdate(e,o("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.MSG_UPDATE)}function m(e){e.off(null,d);var t=e.mediaObject;t&&o("WAWebMediaStorage").disassociateMediaFromMsg(t,e)}function p(e){!e.mimetype&&e.type===o("WAWebMediaTypes").OUTWARD_TYPES.IMAGE&&(e.mimetype="image/jpeg"),!e.mimetype&&e.type===o("WAWebMediaTypes").OUTWARD_TYPES.STICKER&&(e.mimetype="image/webp"),e.on(c,d),o("WAWebConsolidateMediaUpdate").consolidateMediaUpdate(e,o("WAWebWamEnumWebcRmrReasonCode").WEBC_RMR_REASON_CODE.MSG_INIT)}function _(t,n){t.isUnsentPhoneMsg()&&o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["id: "," type: ",""])),t.id.toString(),t.type).sendLogs("media-fault: registerMsgEarly msg without mediaObject");for(var r={},a=0;a0;)o("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.delete(R(e,n)),n--;o("WAWebMediaInMemoryBlobCache").InMemoryMediaBlobCache.delete(e)}l.EOI_TAG=C,l.ImageStreamer=b,l.getProgressiveMediaCacheKey=R,l.deleteFromInMemoryMediaBlobCache=L}),98); __d("WAWebDownloadAndDecryptCache",["WALogger","WAWebMediaDataUtils","WAWebMediaStore","WAWebSerializeError","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e){var t,n,r=(t=e.progressiveJpegOpts)==null?void 0:t.scanCount,o=(n=e.progressiveJpegOpts)==null?void 0:n.scanLengths;if(r!=null&&o)return e.filehash+"-"+r+"/"+o.length+"-scans";if(e.partialVideoOpts){var a=e.partialVideoOpts.secondsToDownload;return e.filehash+"-"+a+"-seconds"}return e.filehash}var c=(function(){function t(){}var a=t.prototype;return a.get=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){if(!o("WAWebMediaDataUtils").shouldUseLruMediaStore(n.type))return null;try{return yield o("WAWebMediaStore").LruMediaStore.get(u(n))}catch(t){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.asyncCache.get error:\n",""],["downloadManager.asyncCache.get error:\\n",""])),r("WAWebSerializeError")(t)).verbose(),null}});function a(e,n){return t.apply(this,arguments)}return a})(),a.set=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(o("WAWebMediaDataUtils").shouldUseLruMediaStore(n.type))try{yield o("WAWebMediaStore").LruMediaStore.put(u(n),t)}catch(e){o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["downloadManager.asyncCache.set error:\n",""],["downloadManager.asyncCache.set error:\\n",""])),r("WAWebSerializeError")(e)).verbose()}});function t(t,n,r){return e.apply(this,arguments)}return t})(),t})();l.getLRUStoreKey=u,l.DownloadAndDecryptCache=c}),98); __d("WAWebWamEnumAiFetchMediaType",[],(function(t,n,r,o,a,i){var e=Object.freeze({IMAGE_SINGLE:1,GRID_HIGH_RES:2,GRID_LOW_RES:3,INLINE_HIGH_RES:4,INLINE_LOW_RES:5});i.AI_FETCH_MEDIA_TYPE=e}),66); __d("WAWebWamEnumDownloadQualityType",[],(function(t,n,r,o,a,i){var e=Object.freeze({NORMAL_QUALITY:1,MID_QUALITY:2,INELIGIBLE_IMAGE_TOO_SMALL:3,INELIGIBLE_PARTIAL_HASHES_NOT_FOUND:4,ERROR_DETERMINING_ELIGIBILITY:5,NOT_DOWNLOADED_ENOUGH_BYTES_TO_DETERMINE_ELIGIBILITY:6});i.DOWNLOAD_QUALITY_TYPE=e}),66); __d("WAWebWamEnumExpressPathDownloadState",[],(function(t,n,r,o,a,i){var e=Object.freeze({PARTIAL_OR_NONE:1,FULL:2,MEDIANOTIFY_RECEIVED_EP_DISABLED:3,SKIPPED_DIFF_POP:4,SKIPPED_AUTODOWNLOAD:5});i.EXPRESS_PATH_DOWNLOAD_STATE=e}),66); __d("WAWebMediaDownload2WamEvent",["WAWebWamCodegenUtils","WAWebWamEnumAiFetchMediaType","WAWebWamEnumBackendStoreType","WAWebWamEnumConnectionType","WAWebWamEnumDownloadOriginType","WAWebWamEnumDownloadQualityType","WAWebWamEnumExpressPathDownloadState","WAWebWamEnumHttpProtocolVersionType","WAWebWamEnumMediaDownloadModeType","WAWebWamEnumMediaDownloadResultType","WAWebWamEnumMediaType","WAWebWamEnumNetworkStackType","WAWebWamEnumPairedMediaType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({MediaDownload2:[1590,{activeThreadCount:[55,e.TYPES.INTEGER],aiFetchMediaType:[62,o("WAWebWamEnumAiFetchMediaType").AI_FETCH_MEDIA_TYPE],appContext:[64,e.TYPES.STRING],appContextBitfield:[65,e.TYPES.INTEGER],clientMessageId:[50,e.TYPES.STRING],connectionType:[31,o("WAWebWamEnumConnectionType").CONNECTION_TYPE],daysSinceReceive:[46,e.TYPES.INTEGER],debugMediaException:[24,e.TYPES.STRING],debugMediaIp:[22,e.TYPES.STRING],debugUrl:[23,e.TYPES.STRING],deviceCount:[49,e.TYPES.INTEGER],downloadBytesTransferred:[20,e.TYPES.NUMBER],downloadConnectT:[15,e.TYPES.TIMER],downloadHttpCode:[18,e.TYPES.INTEGER],downloadIsReuse:[17,e.TYPES.BOOLEAN],downloadIsStreaming:[19,e.TYPES.BOOLEAN],downloadNetworkT:[16,e.TYPES.TIMER],downloadQuality:[37,o("WAWebWamEnumDownloadQualityType").DOWNLOAD_QUALITY_TYPE],downloadQueueSize:[68,e.TYPES.INTEGER],downloadResumePoint:[14,e.TYPES.INTEGER],downloadTimeToFirstByteT:[21,e.TYPES.TIMER],estimatedBandwidth:[36,e.TYPES.NUMBER],estimatedBandwidthV2:[59,e.TYPES.NUMBER],expressPathBytesSaved:[42,e.TYPES.NUMBER],expressPathDownloadState:[56,o("WAWebWamEnumExpressPathDownloadState").EXPRESS_PATH_DOWNLOAD_STATE],expressPathTimeSavedMs:[43,e.TYPES.TIMER],fileHeight:[47,e.TYPES.INTEGER],fileWidth:[48,e.TYPES.INTEGER],hasLeveragedExpressPath:[44,e.TYPES.BOOLEAN],httpProtocolVersionType:[45,o("WAWebWamEnumHttpProtocolVersionType").HTTP_PROTOCOL_VERSION_TYPE],isProcessedVideo:[58,e.TYPES.BOOLEAN],isSenderPlatformCapi:[52,e.TYPES.BOOLEAN],isViewOnce:[41,e.TYPES.BOOLEAN],maxThreadCount:[57,e.TYPES.INTEGER],mediaId:[38,e.TYPES.INTEGER],networkStack:[30,o("WAWebWamEnumNetworkStackType").NETWORK_STACK_TYPE],overallAttemptCount:[4,e.TYPES.INTEGER],overallBackendStore:[39,o("WAWebWamEnumBackendStoreType").BACKEND_STORE_TYPE],overallConnBlockFetchT:[10,e.TYPES.TIMER],overallConnectionClass:[29,e.TYPES.STRING],overallCumT:[27,e.TYPES.TIMER],overallCumUserVisibleT:[60,e.TYPES.TIMER],overallCumV2T:[53,e.TYPES.TIMER],overallDecryptT:[12,e.TYPES.TIMER],overallDomain:[5,e.TYPES.STRING],overallDownloadMode:[11,o("WAWebWamEnumMediaDownloadModeType").MEDIA_DOWNLOAD_MODE_TYPE],overallDownloadOrigin:[35,o("WAWebWamEnumDownloadOriginType").DOWNLOAD_ORIGIN_TYPE],overallDownloadResult:[25,o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE],overallFileValidationT:[13,e.TYPES.TIMER],overallIsEncrypted:[28,e.TYPES.BOOLEAN],overallIsFinal:[26,e.TYPES.BOOLEAN],overallMediaSize:[7,e.TYPES.NUMBER],overallMediaType:[1,o("WAWebWamEnumMediaType").MEDIA_TYPE],overallMmsVersion:[6,e.TYPES.INTEGER],overallQueueT:[9,e.TYPES.TIMER],overallRetryCount:[3,e.TYPES.INTEGER],overallT:[8,e.TYPES.TIMER],overallUserVisibleT:[61,e.TYPES.TIMER],pairedMediaType:[63,o("WAWebWamEnumPairedMediaType").PAIRED_MEDIA_TYPE],prefetchOrder:[66,e.TYPES.INTEGER],sleepModeAffected:[51,e.TYPES.BOOLEAN],statusId:[67,e.TYPES.STRING],timeDelayed:[54,e.TYPES.TIMER],usedFallbackHint:[40,e.TYPES.STRING]},[1,1,50],"regular"]},{MediaDownload2:[]});l.MediaDownload2WamEvent=s}),98); __d("WAWebCreateMediaDownloadMetrics",["WATimeUtils","WAWebABProps","WAWebAppTracker","WAWebMediaDownload2WamEvent","WAWebMmsDownloadUploadCrashLogger","WAWebMmsMediaTypes","WAWebWamEnumConnectionType","WAWebWamEnumMediaDownloadResultType","WAWebWamEnumNetworkStackType","WAWebWamGroupMetricCache","WAWebWamMediaMetricUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=o("WAWebWamMediaMetricUtils").generateMediaEventId(),r=new(o("WAWebMediaDownload2WamEvent")).MediaDownload2WamEvent({mediaId:n,connectionType:o("WAWebWamEnumConnectionType").CONNECTION_TYPE.HOSTNAME,overallMediaType:o("WAWebWamMediaMetricUtils").getMetricMediaType(e.type),overallMmsVersion:4,networkStack:o("WAWebWamEnumNetworkStackType").NETWORK_STACK_TYPE.NATIVE,overallDownloadMode:o("WAWebWamMediaMetricUtils").getMetricOverallDownloadModeType(e.type,e.downloadMode,e.isPrefetch),overallAttemptCount:e.userDownloadAttemptCount,overallDownloadOrigin:e.downloadOrigin,overallBackendStore:(t=o("WAWebWamMediaMetricUtils").getMetricBackendStore(e.directPath))!=null?t:void 0,isViewOnce:e.isViewOnce});if(o("WAWebAppTracker").AppTracker.start(o("WAWebAppTracker").AppTrackerType.MediaUL),e.type===o("WAWebMmsMediaTypes").MEDIA_TYPES.IMAGE&&o("WAWebABProps").getABPropConfigValue("hqp_log_enabled")&&r.set(babelHelpers.extends({},e.imageDimensions)),o("WAWebABProps").getABPropConfigValue("enable_days_since_receive_logging")&&e.mediaKeyTimestamp!=null){var a=e.mediaKeyTimestamp,i=Math.floor((o("WATimeUtils").unixTime()-a)/(1440*60));r.set({daysSinceReceive:i})}var l=e.chatWid;if(l){var s=yield o("WAWebWamGroupMetricCache").getGroupMetrics(l);(s==null?void 0:s.deviceCount)!=null&&r.set({deviceCount:s.deviceCount})}o("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(n,o("WAWebMmsDownloadUploadCrashLogger").ProgressType.DOWNLOAD_STARTED);var u=function(t){var e=t.failCount,n=t.hostClass,o=t.hostName;r.set({overallDomain:o,overallConnectionClass:n,overallRetryCount:e})},c=function(t){r.set({overallMediaSize:t,overallDownloadResult:o("WAWebWamEnumMediaDownloadResultType").MEDIA_DOWNLOAD_RESULT_TYPE.OK,overallIsFinal:!0,downloadHttpCode:200}),o("WAWebMmsDownloadUploadCrashLogger").downloadUploadCrashLogger.mark(n,o("WAWebMmsDownloadUploadCrashLogger").ProgressType.DOWNLOAD_FINISHED,{overallMediaSize:t})},d=function(t,n){r.set({overallDownloadResult:o("WAWebWamMediaMetricUtils").getMetricDownloadErrorResultType(t),overallIsFinal:n});var e=o("WAWebWamMediaMetricUtils").getStatusCode(t);e!=null&&(r.downloadHttpCode=e),r.markOverallCumT(),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.MediaUL),o("WAWebAppTracker").attachWAMAppContext(r,r.overallCumT),r.commit(),o("WAWebWamMediaMetricUtils").logErrorUnknownDetails(r,t)},m=function(t){r.set({overallT:t})},p=function(t){var e=t.error,n=t.failCount,a=t.overallT,i=new(o("WAWebMediaDownload2WamEvent")).MediaDownload2WamEvent(r.all);i.set({mediaId:o("WAWebWamMediaMetricUtils").generateMediaEventId(),overallDownloadResult:o("WAWebWamMediaMetricUtils").getMetricDownloadErrorResultType(e),overallIsFinal:!1,overallT:a,overallRetryCount:n});var l=o("WAWebWamMediaMetricUtils").getStatusCode(e);l!=null&&(r.downloadHttpCode=l),r.markOverallCumT(),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.MediaUL),o("WAWebAppTracker").attachWAMAppContext(r,r.overallCumT),i.commit(),o("WAWebWamMediaMetricUtils").logErrorUnknownDetails(i,e)},_=function(){r.startOverallDecryptT()},f=function(){r.markOverallDecryptT()},g=function(){r.markOverallCumT(),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.MediaUL),o("WAWebAppTracker").attachWAMAppContext(r,r.overallCumT),r.commit()},h=function(){r.startDownloadNetworkT()},y=function(){r.markDownloadNetworkT()};return{mediaId:n,handleDownloadSuccess:c,handleDownloadHostFound:u,handleDownloadError:d,handleDownloadAttemptSuccess:m,handleDownloadAttemptError:p,handleDownloadAndDecryptSuccess:g,markDecryptionEnd:f,markDecryptionStart:_,startNetworkT:h,markNetworkT:y}}),s.apply(this,arguments)}l.createMediaDownloadMetrics=e}),98); __d("WAWebCryptoDecryptMedia",["Promise","WACryptoAesCbc","WACryptoHmac","WACryptoUtils","WALogger","WAMediaCalculateFilehash","WAPromiseDelays","WATypedArraysCast","WATypedArraysConcat","WAWebABProps","WAWebMiscErrors","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=10;function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=t.ciphertextHmac,i=t.debugString,l=t.expectedPlaintextHash,m=t.mediaKeys,p=o("WAWebABProps").getABPropConfigValue("web_anr_async_media_decryption_enabled");p?yield o("WAPromiseDelays").releaseToMainThread():yield(c||(c=n("Promise"))).resolve();var _={mediaKeys:m};if(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["decryptMedia: [","] start"])),i),a.byteLength0)return!0;return!1},n._maybeConnect=function(){var e=this,t=this._getAggregatedCollection();if(t==null){if(this._isWaitingForCollection)return;this._isWaitingForCollection=!0,this._rootCollection.on("add",this._maybeConnect,this),this._disconnect=function(){e._rootCollection.off("add",e._maybeConnect,e)};return}if(this._isWaitingForCollection){var n;(n=this._disconnect)==null||n.call(this),this._isWaitingForCollection=!1}t.on("all",this._relayEvent,this),this._rootCollection.on("remove",this._handleCollectionRemove,this),this._disconnect=function(){t.off("all",e._relayEvent,e),e._rootCollection.off("remove",e._handleCollectionRemove,e)}},n._maybeDisconnect=function(){var e;this._hasListeners()||((e=this._disconnect)==null||e.call(this),this._disconnect=null)},n._handleCollectionRemove=function(t){if(this._key===t.id){var e;(e=this._disconnect)==null||e.call(this),this._disconnect=null,this._maybeConnect()}},n._relayEvent=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r0}function u(){return!o("WAWebABProps").getABPropConfigValue("web_abprop_direct_connection_md")}function c(e,t){return e===o("WAWebMsgType").MSG_TYPE.LIST&&t===o("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST}function d(){return o("WAWebABProps").getABPropConfigValue("web_abprop_direct_connection_md")}function m(){return o("WAWebABProps").getABPropConfigValue("web_abprop_direct_connection_md")}function p(){var e=o("WAWebABProps").getABPropConfigValue("direct_connection_business_numbers");return typeof e=="string"&&e.length>0?e.split(","):[]}function _(e,t,n){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r){if(u()||!c(t,n)||!r)return!1;if(!s())return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] This web client cannot detect if the product list message recevied is coming from a direct connection business"]))),"unknown";var a=o("WAWebWidFactory").createWid(r),i=o("WAWebBusinessProfileCollection").BusinessProfileCollection.get(a);return(!i||!i.profileOptions)&&(i=yield o("WAWebBusinessProfileCollection").BusinessProfileCollection.find(a)),i.isBusinessDirectConnection()||!1}),f.apply(this,arguments)}function g(e,t,n){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield _(e,t,n);return r===!0&&!d()?{requiresDirectConnection:r,type:o("WAWebMsgType").MSG_TYPE.UNKNOWN,subtype:"phone_only_feature"}:{requiresDirectConnection:r}}),h.apply(this,arguments)}l.supportsDirectConnection=d,l.enablePostcodeInCatalog=m,l.directConnectionBusinessNumbersFromAbprop=p,l.genDirectConnectionMessageModifiers=g}),98); __d("WAWebEmojiSearch",["WALogger","WATrie","WAWebEmoji","WAWebRecentEmojiCollection","asyncToGeneratorRuntime","compactMap","justknobx","once","requireDeferred"],(function(t,n,r,o,a,i,l){var e,s=r("requireDeferred")("WAFtsMultiLangTokenizer").__setRef("WAWebEmojiSearch"),u=["\uD83D\uDE02","\uD83E\uDD23","\u2764","\uD83E\uDD7A","\uD83E\uDD70","\uD83D\uDE18","\uD83D\uDE2D","\uD83D\uDE0D","\uD83D\uDE01","\uD83D\uDE4F","\uD83D\uDE05","\uD83D\uDE06","\uD83D\uDE0A","\uD83D\uDE42","\uD83D\uDE14","\uD83E\uDD73","\uD83D\uDE12","\u263A","\uD83C\uDF82","\uD83D\uDC4D","\uD83D\uDC96","\uD83D\uDE22","\uD83D\uDE44","\uD83D\uDE0F","\uD83D\uDE0E","\uD83D\uDC8B","\uD83D\uDE1E","\uD83D\uDE09","\uD83D\uDC4F","\uD83D\uDE43","\uD83D\uDE21","\uD83D\uDE00","\uD83D\uDE04","\uD83D\uDE07","\uD83E\uDD29","\uD83D\uDE0C","\uD83E\uDD14","\uD83C\uDF39","\uD83D\uDE0B","\uD83D\uDC97","\uD83E\uDD17","\uD83D\uDC95","\uD83D\uDC94","\uD83D\uDE1A","\u2639","\uD83D\uDE03","\uD83C\uDF89","\uD83D\uDD25","\uD83E\uDD74","\uD83D\uDE33"],c=["SMILEYS_PEOPLE","ANIMALS_NATURE","FOOD_DRINK","ACTIVITY","TRAVEL_PLACES","OBJECTS","SYMBOLS","FLAGS","VARIATION"];function d(e,t){var n=[];if(e){var r=_(e.toLowerCase(),t);n=Array.from(new Set(r))}return n}function m(e,t){if(!t)return[];if(e.length<=5)return t.getMatches(e);var n=e.substring(0,5).trim(),r=t.getMatches(n);return r=r.filter(function(t){return t.keyword.startsWith(e)}),r}function p(e){return r("compactMap")(e,o("WAWebEmoji").EmojiUtil.normalizeEmoji)}function _(t,n){var a,i=s.getModuleIfRequireable();i?a=new i:o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["WAFtsMultiLangTokenizer not loaded"]))).sendLogs("WAFtsMultiLangTokenizer not loaded");var l;if(a&&r("justknobx")._("2148")){var c=Array.from(a.tokenize(t)),d=c.map(function(e){return m(e,n)});d.length===0?l=[]:d.length===1?l=d[0]:l=d.reduce(function(e,t){return e.filter(function(e){return t.map(function(e){return e.value}).includes(e.value)})},d[0])}else l=m(t,n);var _=p(l.flatMap(function(e){return e.value})),f=p(l.filter(function(e){return e.keyword===t}).flatMap(function(e){return e.value})),h=b(p(o("WAWebRecentEmojiCollection").RecentEmojiCollection.map(function(e){return e.id})),_),y=b(p(u),_),C=b(v(h,y),f);return v(C,g(f),h,y,g(_))}var f=r("once")(function(){var e=new Map,t=0;for(var n of c){var r=o("WAWebEmoji").EmojiUtil.getEmojisInCategory(n);for(var a of r)e.set(a,t),t++}return e});function g(e){var t=f();return e.toSorted(function(e,n){var r,o,a=(r=t.get(e))!=null?r:Number.MAX_SAFE_INTEGER,i=(o=t.get(n))!=null?o:Number.MAX_SAFE_INTEGER;return a-i})}function h(e){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e[0];e.length>1&&(t=babelHelpers.extends({},t,e[1]));var n=yield s.load(),o=new n,a;return r("justknobx")._("2148")?a=Object.entries(t).flatMap(function(e){var t=e[0],n=e[1],r=t.toLowerCase(),a=Array.from(o.tokenize(r));return a.map(function(e){return{value:n,keyword:e,shortKeyword:e.substring(0,5)}})}):a=Object.entries(t).flatMap(function(e){var t=e[0],n=e[1],r=t.toLowerCase(),o=r.substring(0,5);return{value:n,keyword:r,shortKeyword:o}}),C(a,"shortKeyword")}),y.apply(this,arguments)}function C(e,t){var n=r("WATrie").fromForwardsStrings(e.map(function(e){return e[t]}),e);return{getMatches:function(t){return n.search(t)}}}function b(){for(var e=arguments.length,t=new Array(e),n=0;nthis.constructor.maxsize){var o=this.length-this.constructor.maxsize,a=this.slice(0,o);this.remove(a)}return t},t})(o("WAWebBaseCollection").BaseCollection);s.model=o("WAWebMediaCacheModel").ResizeRotateMediaCache,s.staleCollection=!0,s.maxsize=5,l.WAWebMediaCacheCollection=e,l.WAWebMediaResizeRotateCacheCollection=s}),98); __d("WAWebDocumentUploadEnrichment",["Promise","WALogger","WAPromiseTimeout","WAWebMimeTypes","WAWebNullFunc","WAWebPDFUtils"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t){var r=(function(t){return t==="pdf"?c(e):(s||(s=n("Promise"))).resolve()})(o("WAWebMimeTypes").previewType(t));return o("WAPromiseTimeout").promiseTimeout(r,3e3,"Document enrichment timeout").catch(o("WAWebNullFunc").returnNull)}function c(t){var n;return o("WAWebPDFUtils").fileToPdf(t).then(function(e){return n=e,o("WAWebPDFUtils").pdfToImg(e,1)}).catch(function(t){return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["pdf preview generation failed"]))),null}).finally(function(){n&&o("WAWebPDFUtils").releasePdf(n)})}l.enrich=u}),98); __d("WAXMultiSitePdfWorkerResourceControllerRouteBuilder",["jsRouteBuilder"],(function(t,n,r,o,a,i,l){var e=r("jsRouteBuilder")("/static_resources/webworker/pdf-worker/",Object.freeze({}),void 0),s=e;l.default=s}),98); __d("WAWebPDFWorkerSrc",["WAXMultiSitePdfWorkerResourceControllerRouteBuilder"],(function(t,n,r,o,a,i,l){function e(){return r("WAXMultiSitePdfWorkerResourceControllerRouteBuilder").buildUri({}).toString()}l.getWorkerSrc=e}),98); __d("WAWebPDFUtils",["JSResourceForInteraction","Promise","WABackoffUtils","WAPromiseDelays","WAPromiseLoop","WAPromiseProps","WAWebABProps","WAWebCanvasUtils","WAWebImageUtils","WAWebMediaConstants","WAWebMediaOpaqueData","WAWebMiscErrors","WAWebPDFWorkerSrc","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(){return o("WAPromiseLoop").promiseLoop(function(e,t,n){var a=o("WAPromiseDelays").delayMs(o("WABackoffUtils").expBackoff(n,12e4,0,0));return r("JSResourceForInteraction")("pdfjs-dist").__setRef("WAWebPDFUtils").load().then(function(t){t.GlobalWorkerOptions.workerSrc=o("WAWebPDFWorkerSrc").getWorkerSrc(),e({GlobalWorkerOptions:t.GlobalWorkerOptions,getDocument:t.getDocument})}).catch(function(){return a})})}function u(e){var t=URL.createObjectURL(e);return s().then(function(e){return e.getDocument({url:t,isEvalSupported:!1}).promise})}function c(e){return e.destroy()}function d(t,a){var i=document.createElement("canvas");return t.getPage(a).then(function(e){var t=e.getViewport({scale:1}),n=i.getContext("2d");i.height=t.height,i.width=t.width;var r={canvasContext:n,viewport:t};return e.render(r).promise}).then(function(){var t;return o("WAPromiseProps").promiseProps({blob:o("WAWebCanvasUtils").canvasToBlob(i),thumbnail:(t=o("WAWebImageUtils")).rotateAndResize(i,o("WAWebMediaConstants").DOC_THUMB_MAX_EDGE,t.DATA_URL|t.CANVAS|t.BLOB),microThumbnail:o("WAWebABProps").getABPropConfigValue("upload_document_thumb_mms_enabled")?o("WAWebCanvasUtils").generateMicroThumb(i,o("WAWebABProps").getABPropConfigValue("web_pdf_thumbnail_size_in_bytes"),{mimetype:"image/jpeg",maxAttempts:10}):(e||(e=n("Promise"))).resolve(null)})}).then(function(e){return e}).then((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n=e.blob,a=e.microThumbnail,i=e.thumbnail,l=i.images,s=l.blob,u=l.canvas,c=l.dataUrl;if(u==null||s==null||c==null)throw new(o("WAWebMiscErrors")).MediaFileFailedLoad;return{url:URL.createObjectURL(n),thumbUrl:c,width:u.width,height:u.height,fullPreviewData:yield r("WAWebMediaOpaqueData").createFromData(s,"image/jpeg"),fullPreviewSize:{width:u.width,height:u.height},pdfPages:t.numPages,microThumbnail:a}});return function(t){return e.apply(this,arguments)}})())}l.fileToPdf=u,l.releasePdf=c,l.pdfToImg=d}),98); __d("WAWebPrivacyMode_WORKER_INCOMPATIBLE",["WAWebContactCollection","WAWebWid"],(function(t,n,r,o,a,i,l){function e(e){if(r("WAWebWid").isUser(e)){var t=o("WAWebContactCollection").ContactCollection.get(e);return t==null?void 0:t.privacyMode}}l.getPrivacyModeFromModel=e}),98); __d("WAWebWebcResourceLoadWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({WebcResourceLoad:[688,{webcResourceCached:[3,e.TYPES.BOOLEAN],webcResourceDuration:[2,e.TYPES.TIMER],webcResourceName:[1,e.TYPES.STRING]},[1,1e3,2e3],"regular"]},{WebcResourceLoad:[]});l.WebcResourceLoadWamEvent=s}),98); __d("WAWebWamResourceLoadReporter",["WALogger","WAWebWebcResourceLoadWamEvent"],(function(t,n,r,o,a,i,l){var e;function s(){var t,n=(t=window.performance)==null?void 0:t.timing;if(!(n&&window.performance.getEntriesByType)){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["logResourceLoads: browser metrics unavailable"])));return}var r=window.performance.timing.fetchStart===window.performance.timing.domainLookupEnd,a=window.performance.getEntriesByType("resource"),i=document.createElement("a");a.forEach(function(e){e.initiatorType!=="xmlhttprequest"&&(i.href=e.name,new(o("WAWebWebcResourceLoadWamEvent")).WebcResourceLoadWamEvent({webcResourceName:i.pathname+i.search+i.hash,webcResourceDuration:Math.round(e.duration),webcResourceCached:r}).commit())})}l.default=s}),98); __d("WAWebWamEnumWebcAppcacheStatusCode",[],(function(t,n,r,o,a,i){var e=Object.freeze({UNCACHED:0,IDLE:1,CHECKING:2,DOWNLOADING:3,UPDATEREADY:4,OBSOLETE:5});i.WEBC_APPCACHE_STATUS_CODE=e}),66); __d("WAWebWamEnumWebcNavigationType",[],(function(t,n,r,o,a,i){var e=Object.freeze({NAVIGATE_NEXT:0,RELOAD:1,BACK_FORWARD:2,UNDEFINED:255});i.WEBC_NAVIGATION_TYPE=e}),66); __d("WAWebWebcPageLoadWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcAppcacheStatusCode","WAWebWamEnumWebcNavigationType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({WebcPageLoad:[642,{webcAppcacheStatus:[29,o("WAWebWamEnumWebcAppcacheStatusCode").WEBC_APPCACHE_STATUS_CODE],webcCached:[30,e.TYPES.BOOLEAN],webcConnectEnd:[10,e.TYPES.TIMER],webcConnectStart:[9,e.TYPES.TIMER],webcDomComplete:[19,e.TYPES.TIMER],webcDomContentLoadedEventEnd:[18,e.TYPES.TIMER],webcDomContentLoadedEventStart:[17,e.TYPES.TIMER],webcDomInteractive:[16,e.TYPES.TIMER],webcDomLoading:[15,e.TYPES.TIMER],webcDomainLookupEnd:[8,e.TYPES.TIMER],webcDomainLookupStart:[7,e.TYPES.TIMER],webcExeDone:[23,e.TYPES.TIMER],webcExeStart:[22,e.TYPES.TIMER],webcFetchStart:[6,e.TYPES.TIMER],webcInitialMountT:[38,e.TYPES.TIMER],webcInitialNavMountT:[39,e.TYPES.TIMER],webcInitialPanel:[42,e.TYPES.STRING],webcInitialPanelMountStartT:[43,e.TYPES.TIMER],webcInitialPanelMountT:[40,e.TYPES.TIMER],webcInitialPanelRenderT:[46,e.TYPES.TIMER],webcJsLoadT:[37,e.TYPES.TIMER],webcLoadEventEnd:[21,e.TYPES.TIMER],webcLoadEventStart:[20,e.TYPES.TIMER],webcLoadInForeground:[53,e.TYPES.BOOLEAN],webcMainScriptEnd:[45,e.TYPES.TIMER],webcMainScriptStart:[44,e.TYPES.TIMER],webcNativeLoadT:[36,e.TYPES.TIMER],webcNavigation:[32,o("WAWebWamEnumWebcNavigationType").WEBC_NAVIGATION_TYPE],webcPageLoadId:[54,e.TYPES.STRING],webcPageLoadT:[34,e.TYPES.TIMER],webcParallellyFetched:[41,e.TYPES.BOOLEAN],webcQrCode:[31,e.TYPES.BOOLEAN],webcRedirectCount:[33,e.TYPES.NUMBER],webcRedirectEnd:[5,e.TYPES.TIMER],webcRedirectStart:[4,e.TYPES.TIMER],webcRequestStart:[12,e.TYPES.TIMER],webcResponseEnd:[14,e.TYPES.TIMER],webcResponseStart:[13,e.TYPES.TIMER],webcSecureConnectionStart:[11,e.TYPES.TIMER],webcUnloadEventEnd:[3,e.TYPES.TIMER],webcUnloadEventStart:[2,e.TYPES.TIMER],webcWsAttempts:[28,e.TYPES.NUMBER],webcWsNormal:[27,e.TYPES.TIMER],webcWsOpening:[24,e.TYPES.TIMER],webcWsPairing:[25,e.TYPES.TIMER],webcWsSyncing:[26,e.TYPES.TIMER]},[1,1,1],"regular"]},{WebcPageLoad:[]});l.WebcPageLoadWamEvent=s}),98); __d("WAWebWamPageLoadReporter",["Promise","WALogger","WAWebAppScreen","WAWebPageLoadLogging","WAWebStreamModel","WAWebWam","WAWebWamResourceLoadReporter","WAWebWebcPageLoadWamEvent","once"],(function(t,n,r,o,a,i,l){var e,s,u,c=new(o("WAWebWebcPageLoadWamEvent")).WebcPageLoadWamEvent,d,m={},p,_,f=!1,g=!1;function h(){return{uiTimingComplete:f,wsTimingComplete:g}}var y=new(u||(u=n("Promise")))(function(e){return p=function(){f=!0,e()}}),C=new u(function(e){return _=function(){g=!0,e()}}),b=!1,v;function S(e,t,n){R(e);var r=Math.floor(self.performance.now());m[e]=r,n&&(m.socketSequence=t,_())}function R(e){e:{if(e===o("WAWebStreamModel").StreamInfo.OPENING){o("WAWebPageLoadLogging").addPageLoadQplPoint("webc_ws_opening");break e}if(e===o("WAWebStreamModel").StreamInfo.PAIRING){o("WAWebPageLoadLogging").addPageLoadQplPoint("webc_ws_pairing");break e}if(e===o("WAWebStreamModel").StreamInfo.NORMAL){o("WAWebPageLoadLogging").addPageLoadQplPoint("webc_ws_normal");break e}if(e===o("WAWebStreamModel").StreamInfo.OFFLINE||e===o("WAWebStreamModel").StreamInfo.SYNCING||e===o("WAWebStreamModel").StreamInfo.RESUMING||e===o("WAWebStreamModel").StreamInfo.CONNECTING)break e;throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)}}function L(e){o("WAWebPageLoadLogging").addPageLoadQplPoint("webc_initial_panel_mount_t"),d=e}function E(e){c!=null&&c.set({webcInitialPanel:e})}function k(){p()}window.document&&(v=!document.hidden,document.addEventListener("visibilitychange",T)),u.all([y,C]).then(function(){D(),r("WAWebWamResourceLoadReporter")(),b||(b=!0,o("WAWebWam").Wam.resumeJobs())});function I(e){return!self.performance||!self.performance.timing||!self.performance.timing.navigationStart?null:e-self.performance.timing.navigationStart}function T(){c&&document.hidden&&(v=!1)}function D(){var t;if(!((t=self.performance)!=null&&t.timing&&self.performance.navigation)){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["MetricReporter:logPageLoad metrics not provided by browser!"])));return}if(!c)return;var n=c,r=self.performance.timing,a=self.performance.navigation,i=r.navigationStart,l=r.loadEventEnd-i;if(l<=0){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["MetricReporter:logPageLoad delayed"]))),self.setTimeout(D,1e4);return}function u(e){var t=r[e];return t&&I(t)}n.set({webcPageLoadT:l,webcUnloadEventStart:u("unloadEventStart"),webcUnloadEventEnd:u("unloadEventEnd"),webcRedirectStart:u("redirectStart"),webcRedirectEnd:u("redirectEnd"),webcFetchStart:u("fetchStart"),webcDomainLookupStart:u("domainLookupStart"),webcDomainLookupEnd:u("domainLookupEnd"),webcConnectStart:u("connectStart"),webcConnectEnd:u("connectEnd"),webcSecureConnectionStart:u("secureConnectionStart"),webcRequestStart:u("requestStart"),webcResponseStart:u("responseStart"),webcResponseEnd:u("responseEnd"),webcDomLoading:u("domLoading"),webcDomInteractive:u("domInteractive"),webcDomContentLoadedEventStart:u("domContentLoadedEventStart"),webcDomContentLoadedEventEnd:u("domContentLoadedEventEnd"),webcDomComplete:u("domComplete"),webcLoadEventStart:u("loadEventStart"),webcLoadEventEnd:u("loadEventEnd"),webcCached:r.fetchStart===r.domainLookupEnd,webcNavigation:a.type,webcRedirectCount:a.redirectCount,webcWsOpening:m.OPENING,webcWsPairing:m.PAIRING,webcWsSyncing:m.SYNCING,webcWsNormal:m.NORMAL,webcWsAttempts:m.socketSequence,webcQrCode:!m.SYNCING,webcInitialPanelMountT:d-i,webcLoadInForeground:v,webcPageLoadId:o("WAWebPageLoadLogging").getPageLoadId()}),x(n),n.commit(),window.document&&document.removeEventListener("visibilitychange",T),c=null}function x(e){var t;(t=o("WAWebPageLoadLogging")).addPageLoadValidationData("webc_ws_opening",{wam:e.webcWsOpening}),t.addPageLoadValidationData("webc_ws_pairing",{wam:e.webcWsPairing}),t.addPageLoadValidationData("webc_ws_normal",{wam:e.webcWsNormal}),t.addPageLoadValidationData("webc_initial_panel_mount_t",{wam:e.webcInitialPanelMountT}),t.addPageLoadValidationData("webc_initial_panel_mount_start_t",{wam:e.webcInitialPanelMountStartT}),t.addPageLoadValidationData("webc_initial_panel_render_t",{wam:e.webcInitialPanelRenderT}),t.setWamCompleteForValidation()}var $=(function(){function e(e){this.$4=!1,this.$3=e.label,this.$1=e.startProperty,this.$2=e.endProperty}var t=e.prototype;return t.start=function(){var e;this.$4=!0,c!=null&&c.set((e={},e[this.$1]=I(Date.now()),e))},t.end=function(){var e;c!=null&&c.set((e={},e[this.$2]=I(Date.now()),e))},t.hasStarted=function(){return this.$4},e})();function P(e){W.hasStarted()||N(e)&&(E(e),W.start(),o("WAWebPageLoadLogging").addPageLoadQplPoint("webc_initial_panel_mount_start_t"),window.requestAnimationFrame(function(){W.end(),o("WAWebPageLoadLogging").addPageLoadQplPoint("webc_initial_panel_render_t"),A("initialPanelRenderTRecorded")}))}function N(e){return e!==o("WAWebAppScreen").AppScreen.SYNCING}var M=!1,w=!1;function A(e){e==="initialPanelMountTRecorded"&&(M=!0),e==="initialPanelRenderTRecorded"&&(w=!0),M&&w&&k()}var F=r("once")(function(){L(Date.now()),A("initialPanelMountTRecorded")}),O=new $({label:"PageLoad.webcExe",startProperty:"webcExeStart",endProperty:"webcExeDone"}),B=new $({label:"PageLoad.webcMainScript",startProperty:"webcMainScriptStart",endProperty:"webcMainScriptEnd"}),W=new $({label:"PageLoad.webcInitialPanelRender",startProperty:"webcInitialPanelMountStartT",endProperty:"webcInitialPanelRenderT"});l.getWamPageLoadTimingCompletion=h,l.streamInfoChange=S,l.logWamPageLoad=D,l.maybeLogInitialScreenRenderStart=P,l.logFirstRenderMountTimeOnce=F,l.exeTimer=O,l.mainScriptTimer=B}),98); __d("WAWebFbtIntlList",["fbt","invariant","err","react"],(function(t,n,r,o,a,i,l,s,u){var e,c=e||(e=r("react")),d={AND:"AND",NONE:"NONE",OR:"OR"},m={BULLET:"BULLET",COMMA:"COMMA",SEMICOLON:"SEMICOLON"},p=500,_=function(t,n,r){var e=t.filter(Boolean),o=e.length;if(o===0)return"";if(o===1)return e[0];for(var a=e[o-1],i=e[0],l=0,u=1;u=p){l=o-u;break}e:{if(r===m.SEMICOLON){i=s._(/*BTDS*/"{previous-items}; {following-items}",[s._param("previous-items",i),s._param("following-items",e[u])]);break e}if(r===m.BULLET){i=s._(/*BTDS*/"{previous-items} \u2022 {following-items}",[s._param("previous-items",i),s._param("following-items",e[u])]);break e}if(r===m.COMMA||r===null||r===void 0){i=s._(/*BTDS*/"{previous-items}, {following-items}",[s._param("previous-items",i),s._param("following-items",e[u])]);break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+r)}}return l>0?f(i,l,n||d.AND,r||m.COMMA):g(i,a,n||d.AND,r||m.COMMA)};function f(e,t,n,r){if(r===m.COMMA)switch(n){case d.AND:return s._(/*BTDS*/"{previous-items} y {overflow-item-count} m\u00e1s",[s._param("previous-items",e),s._param("overflow-item-count",t)]);case d.OR:return s._(/*BTDS*/"{previous-items} o {overflow-item-count} m\u00e1s",[s._param("previous-items",e),s._param("overflow-item-count",t)]);case d.NONE:return s._(/*BTDS*/"{previous-items}, {overflow-item-count} m\u00e1s",[s._param("previous-items",e),s._param("overflow-item-count",t)])}return s._(/*BTDS*/"{previous-items}\u2026",[s._param("previous-items",e)])}f.displayName=f.name+" [from "+i.id+"]";function g(e,t,n,o){switch(n){case d.AND:return s._(/*BTDS*/"{list-of-items} y {last-item}",[s._param("list-of-items",e),s._param("last-item",t)]);case d.OR:return s._(/*BTDS*/"{list-of-items} o {last-item}",[s._param("list-of-items",e),s._param("last-item",t)]);case d.NONE:switch(o){case m.SEMICOLON:return s._(/*BTDS*/"{previous-items}; {last-item}",[s._param("previous-items",e),s._param("last-item",t)]);case m.BULLET:return s._(/*BTDS*/"{list-of-items} \u2022 {last-item}",[s._param("list-of-items",e),s._param("last-item",t)]);default:return s._(/*BTDS*/"{list-of-items}, {last-item}",[s._param("list-of-items",e),s._param("last-item",t)])}default:throw r("err")("[intlList] Invalid conjunction "+n+" provided to intlList")}}_.DELIMITERS=m,_.CONJUNCTIONS=d;var h=_,y=h;l.default=y}),226); __d("WAWebAlbumsFormatAlbumMessageText",["fbt","WAWebAlbumMessageUtils","WAWebFbtIntlList","WAWebMessageAssociationUIUtils"],(function(t,n,r,o,a,i,l,s){function e(e){var t=e.associatedMessages,n=e.msg,a=o("WAWebAlbumMessageUtils").getAlbumPhotoAndVideoCountText(t!=null?t:o("WAWebMessageAssociationUIUtils").getHiddenAssociatedMessages(n.id));return a.length===0?s._(/*BTDS*/"\u00c1lbum"):r("WAWebFbtIntlList")(a,r("WAWebFbtIntlList").CONJUNCTIONS.NONE,r("WAWebFbtIntlList").DELIMITERS.COMMA).toString()}l.default=e}),226); __d("WAWebAlbumMessageUtils",["fbt","WAWebFrontendMsgGetters"],(function(t,n,r,o,a,i,l,s){function e(e){var t=e.reduce(function(e,t){return o("WAWebFrontendMsgGetters").getAsImage(t)?e.photoCount+=1:o("WAWebFrontendMsgGetters").getAsVideo(t)&&(e.videoCount+=1),e},{photoCount:0,videoCount:0}),n=t.photoCount,r=t.videoCount,a=n>0?s._(/*BTDS*/"_j{\"*\":\"{photo-count} fotos\",\"_1\":\"1 foto\"}",[s._plural(n,"photo-count")]):null,i=r>0?s._(/*BTDS*/"_j{\"*\":\"{video-count} videos\",\"_1\":\"1 video\"}",[s._plural(r,"video-count")]):null;return[a,i].filter(Boolean)}l.getAlbumPhotoAndVideoCountText=e}),226); __d("WAWebBizAiAgentGating",["WAWebABProps"],(function(t,n,r,o,a,i,l){"use strict";function e(){return o("WAWebABProps").getABPropConfigValue("biz_ai_smb_agents_automatic_reply_enabled")}function s(){return o("WAWebABProps").getABPropConfigValue("biz_ai_web_ai_hub_tap_cta_show_alert")}function u(){return o("WAWebABProps").getABPropConfigValue("biz_ai_auto_save_enabled")}function c(){return o("WAWebABProps").getABPropConfigValue("biz_ai_in_thread_unmute_v2")}function d(){return o("WAWebABProps").getABPropConfigValue("biz_ai_coaching_enabled")}function m(){return o("WAWebABProps").getABPropConfigValue("biz_ai_agent_thread_status_history_sync_enabled")}l.isAiAgentAutoReplyEnabled=e,l.isAiHubTapCtaShowAlertEnabled=s,l.isAiAgentAutoSaveEnabled=u,l.isAiMuteUnmuteV2Enabled=c,l.isAiCoachingEnabled=d,l.isAiAgentThreadStatusHistorySyncEnabled=m}),98); __d("WAWebBizAiAgentStatusUtils",["WAWebBizAiAgentGating","WAWebBusinessProfileCollection","WAWebContactGetters","WAWebMobilePlatforms","WAWebProtobufsE2E.pb","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l){function e(){var e=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),t=o("WAWebBusinessProfileCollection").BusinessProfileCollection.get(e);return(t==null?void 0:t.isBizBot1p)===!0}function s(t){var n=o("WAWebContactGetters").getIsMe(t.contact),r=o("WAWebContactGetters").getIsAiHub(t.contact);return o("WAWebMobilePlatforms").isSMB()&&o("WAWebBizAiAgentGating").isAiAgentAutoReplyEnabled()&&!n&&t.id.isUserNotPSA()&&e()&&!r}function u(e){return e.capiThreadControl===o("WAWebProtobufsE2E.pb").Message$CloudAPIThreadControlNotification$CloudAPIThreadControl.CONTROL_TAKEN}function c(e){return u(e)&&!e.forceDismissAiAgentBlockBar}function d(e){return u(e)}function m(e){return e.attempToEnableAi===!0}l.hasOnboardedAiAgent=e,l.isChatEligibleForAiAgent=s,l.isChatAiEnabled=u,l.shouldShowAiAgentBlockBar=c,l.shouldMuteNotification=d,l.tryToEnableAiAgent=m}),98); __d("WAWebWamEnumBotBizActionType",[],(function(t,n,r,o,a,i){var e=Object.freeze({BOT_BIZ_CARD_CLICK:1,BOT_BIZ_CARD_MESSAGE_CLICK:2,BOT_BIZ_CARD_VIEW_AI_CLICK:3,BOT_BIZ_DEEPLINK_CLICK:4,BOT_BIZ_NUX_APPEAR:5,BOT_BIZ_NUX_DISMISS:6,BOT_BIZ_NUX_SELECT:7,BOT_BIZ_INFO_CHAT_CLICK:8,BOT_BIZ_NUX_CONTINUE_CLICKED:9,BOT_BIZ_NUX_DISMISS_AUTO_ACCEPT:10,BOT_BIZ_NUX_APPEAR_MERGED:11,BOT_BIZ_NUX_APPEAR_NEW:12,BOT_BIZ_MESSAGE_SEND_CLICK:13,BOT_BIZ_MESSAGE_RENDERED:14});i.BOT_BIZ_ACTION_TYPE=e}),66); __d("WAWebWamEnumBotBizEntryPoint",[],(function(t,n,r,o,a,i){var e=Object.freeze({SHARED_BOT_BIZ_CARD:1,SHARED_BOT_BIZ_DEEPLINK:2,BOT_BIZ_CHAT:3});i.BOT_BIZ_ENTRY_POINT=e}),66); __d("WAWebWamEnumBotBizType",[],(function(t,n,r,o,a,i){var e=Object.freeze({BOT_BIZ_3P:1,BOT_BIZ_1P:2});i.BOT_BIZ_TYPE=e}),66); __d("WAWebBotBizJourneyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumBotBizActionType","WAWebWamEnumBotBizEntryPoint","WAWebWamEnumBotBizType","WAWebWamEnumBotType"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({BotBizJourney:[4868,{appSessionId:[1,o("WAWebWamCodegenUtils").TYPES.STRING],botBizActionType:[5,o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE],botBizEntryPoint:[6,o("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT],botBizType:[7,o("WAWebWamEnumBotBizType").BOT_BIZ_TYPE],botType:[4,o("WAWebWamEnumBotType").BOT_TYPE]},[1,1,1],"regular"]},{BotBizJourney:[]});l.BotBizJourneyWamEvent=e}),98); __d("WAWebBizBotLogging",["WAWebBotBizJourneyWamEvent","WAWebBotGating","WAWebChatEntryPoint","WAWebGetSharedSessionId","WAWebWamEnumBotBizActionType","WAWebWamEnumBotBizEntryPoint","WAWebWamEnumBotBizType","WAWebWamEnumBotType"],(function(t,n,r,o,a,i,l){function e(e){if(o("WAWebBotGating").isBizBot3pEnabled()){var t=new(o("WAWebBotBizJourneyWamEvent")).BotBizJourneyWamEvent({appSessionId:o("WAWebGetSharedSessionId").getSharedSessionId(),botBizEntryPoint:o("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT.SHARED_BOT_BIZ_CARD,botBizActionType:m(e),botBizType:c("3p"),botType:d("3p")});t.commit()}}function s(){if(o("WAWebBotGating").isBizBot3pEnabled()){var e=new(o("WAWebBotBizJourneyWamEvent")).BotBizJourneyWamEvent({appSessionId:o("WAWebGetSharedSessionId").getSharedSessionId(),botBizEntryPoint:o("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT.SHARED_BOT_BIZ_DEEPLINK,botBizActionType:o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_DEEPLINK_CLICK,botBizType:c("3p"),botType:d("3p")});e.commit()}}function u(e,t,n){if(!(e==="3p"&&!o("WAWebBotGating").isBizBot3pEnabled()||e==="1p"&&!o("WAWebBotGating").isBizBot1pEnabled())){var r;switch(n){case o("WAWebChatEntryPoint").ChatEntryPoint.Vcard:r=o("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT.SHARED_BOT_BIZ_CARD;break;case o("WAWebChatEntryPoint").ChatEntryPoint.Chatlist:r=o("WAWebWamEnumBotBizEntryPoint").BOT_BIZ_ENTRY_POINT.BOT_BIZ_CHAT;break;default:r=void 0}var a=new(o("WAWebBotBizJourneyWamEvent")).BotBizJourneyWamEvent({appSessionId:o("WAWebGetSharedSessionId").getSharedSessionId(),botBizActionType:m(t),botBizEntryPoint:r,botBizType:c(e),botType:d(e)});a.commit()}}function c(e){switch(e){case"1p":return o("WAWebWamEnumBotBizType").BOT_BIZ_TYPE.BOT_BIZ_1P;case"3p":return o("WAWebWamEnumBotBizType").BOT_BIZ_TYPE.BOT_BIZ_3P}}function d(e){switch(e){case"1p":return o("WAWebWamEnumBotType").BOT_TYPE.BOT_1P_BIZ;case"3p":return o("WAWebWamEnumBotType").BOT_TYPE.BOT_3P_BIZ}}function m(e){switch(e){case"card_click":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_CARD_CLICK;case"message_click":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_CARD_MESSAGE_CLICK;case"view_ai_click":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_CARD_VIEW_AI_CLICK;case"nux_appear":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_APPEAR;case"nux_dismiss":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_DISMISS;case"nux_select":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_SELECT;case"nux_view_new":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_APPEAR_NEW;case"nux_view_merged":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_APPEAR_MERGED;case"nux_dismiss_auto_accept":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_DISMISS_AUTO_ACCEPT;case"nux_continue_clicked":return o("WAWebWamEnumBotBizActionType").BOT_BIZ_ACTION_TYPE.BOT_BIZ_NUX_CONTINUE_CLICKED}}l.logBizBot3pContactCardJourneyEvent=e,l.logBizBot3pDeepLinkClickEvent=s,l.logBizBotNuxJourneyEvent=u}),98); __d("WAWebAiSignalOutlineIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="ai-signal-outline";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=20,R=20;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 20 20",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),fill:"none",color:"#54656F",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.19034 10.2424L7.79758 7.00011C7.4331 6.15148 6.22737 6.15148 5.86289 7.00011L4.4701 10.2424C4.36364 10.4904 4.16571 10.6878 3.9173 10.7941L0.637898 12.1963C-0.208188 12.5581 -0.213946 13.7529 0.628605 14.1227L3.78312 15.5076C4.02005 15.6115 4.21025 15.7991 4.31737 16.0342L5.84374 19.3845C6.22211 20.215 7.40911 20.2021 7.76927 19.3636L9.19034 16.0552C9.29686 15.8073 9.49472 15.6099 9.74322 15.5036L12.9929 14.114C13.8434 13.7503 13.8434 12.5473 12.9929 12.1837L9.74322 10.7941C9.49472 10.6878 9.29686 10.4904 9.19034 10.2424ZM4.58674 13.6761C4.58686 13.6762 4.58697 13.6762 4.58709 13.6763C5.27402 13.9778 5.82616 14.5219 6.13738 15.205L6.13739 15.205L6.77638 16.6076L7.3527 15.2659L7.35274 15.2658C7.66229 14.5452 8.23699 13.9725 8.9568 13.6647L8.95686 13.6647L10.1632 13.1488L8.95686 12.633L8.95679 12.633C8.237 12.3251 7.66229 11.7524 7.35274 11.0319L7.35271 11.0318L6.83023 9.81548L6.30784 11.0316C6.30781 11.0316 6.30777 11.0317 6.30773 11.0318C5.99811 11.7527 5.4232 12.3252 4.70395 12.6329L4.7036 12.633L3.44069 13.173L4.58674 13.6761ZM7.70052 7.7895C7.70046 7.78964 7.7004 7.78979 7.70033 7.78993L7.70052 7.7895ZM12.2066 12.275L12.2065 12.2751L12.2066 12.275ZM5.93202 18.5733C5.93188 18.5737 5.93175 18.574 5.93162 18.5743L5.93162 18.5743L5.93202 18.5733ZM10.9046 3.45455C11.3049 3.45455 11.6308 3.12973 11.6308 2.72728C11.6308 2.32481 11.3049 2 10.9046 2C10.5044 2 10.1785 2.32485 10.1785 2.72728C10.1785 3.12969 10.5044 3.45455 10.9046 3.45455ZM17.2133 6.97379L17.6637 8.98554L15.697 8.36987L17.2133 6.97379ZM13.6308 2.72728C13.6308 4.23351 12.4103 5.45455 10.9046 5.45455C9.39905 5.45455 8.17847 4.23352 8.17847 2.72728C8.17847 1.22104 9.39905 0 10.9046 0C12.4103 0 13.6308 1.22105 13.6308 2.72728ZM18.0943 4.15827C18.4524 4.2704 18.7236 4.56517 18.8056 4.93156L19.9746 10.1529C20.0566 10.5193 19.937 10.9016 19.6609 11.1559C19.3847 11.4101 18.9939 11.4977 18.6358 11.3855L13.5313 9.78762C13.1732 9.67549 12.902 9.38071 12.82 9.01433C12.7379 8.64795 12.8575 8.26561 13.1337 8.01136L17.0692 4.38795C17.3453 4.1337 17.7361 4.04614 18.0943 4.15827Z",fill:"currentColor"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.AiSignalOutlineIcon=m}),98); __d("WAWebBizBotConsumerContentVariant",["$InternalEnum","WANullthrows","WAWebABProps"],(function(t,n,r,o,a,i,l){"use strict";var e=n("$InternalEnum")({ROW:0,INDIA:1,BRAZIL:2});function s(){return r("WANullthrows")(e.cast(o("WAWebABProps").getABPropConfigValue("biz_ai_tos_variant")))}l.BizBotConsumerContentVariant=e,l.getBizBotConsumerContentVariant=s}),98); __d("WAWebBusinessDataSharingIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="business-data-sharing";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=18,R=20;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 20 18",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),fill:"none",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{d:"M14.3 9.30005C14.1 9.10005 14 8.86238 14 8.58705C14 8.31238 14.0917 8.08338 14.275 7.90005L16.175 6.00005H2.00005C1.71672 6.00005 1.47938 5.90405 1.28805 5.71205C1.09605 5.52072 1.00005 5.28338 1.00005 5.00005C1.00005 4.71672 1.09605 4.47905 1.28805 4.28705C1.47938 4.09572 1.71672 4.00005 2.00005 4.00005H16.175L14.275 2.10005C14.0917 1.91672 14 1.68738 14 1.41205C14 1.13738 14.1 0.900049 14.3 0.700049C14.4834 0.516716 14.7167 0.425049 15 0.425049C15.2834 0.425049 15.5167 0.516716 15.7 0.700049L19.3 4.30005C19.4 4.40005 19.4711 4.50838 19.5131 4.62505C19.5544 4.74172 19.5751 4.86672 19.5751 5.00005C19.5751 5.13338 19.5544 5.25838 19.5131 5.37505C19.4711 5.49172 19.4 5.60005 19.3 5.70005L15.7 9.30005C15.5 9.50005 15.2627 9.59572 14.988 9.58705C14.7127 9.57905 14.4834 9.48338 14.3 9.30005ZM4.30005 17.3L0.700049 13.7C0.600049 13.6 0.529382 13.4917 0.488049 13.375C0.446049 13.2584 0.425049 13.1334 0.425049 13C0.425049 12.8667 0.446049 12.7417 0.488049 12.625C0.529382 12.5084 0.600049 12.4 0.700049 12.3L4.30005 8.70005C4.48338 8.51672 4.71272 8.42071 4.98805 8.41205C5.26272 8.40405 5.50005 8.50005 5.70005 8.70005C5.90005 8.88338 6.00405 9.11238 6.01205 9.38705C6.02072 9.66238 5.92505 9.90005 5.72505 10.1L3.82505 12H18C18.2834 12 18.5207 12.0957 18.712 12.287C18.904 12.479 19 12.7167 19 13C19 13.2834 18.904 13.5207 18.712 13.712C18.5207 13.904 18.2834 14 18 14H3.82505L5.72505 15.9C5.90838 16.0834 6.00405 16.3167 6.01205 16.6C6.02072 16.8834 5.92505 17.1167 5.72505 17.3C5.54172 17.5 5.30838 17.6 5.02505 17.6C4.74172 17.6 4.50005 17.5 4.30005 17.3Z",fill:"currentColor"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.BusinessDataSharingIcon=m}),98); __d("WAWebDoubleChevronInCircleIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="double-chevron-in-circle";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=19,R=19;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 19 19",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),fill:"none",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{d:"M5.79303 5.94909C6.10056 5.64155 6.59918 5.64155 6.90672 5.94909L9.87657 8.91893C10.1841 9.22647 10.1841 9.72509 9.87657 10.0326L6.90672 13.0025C6.59918 13.31 6.10056 13.31 5.79303 13.0025C5.48549 12.6949 5.48549 12.1963 5.79303 11.8888L8.20603 9.47578L5.79303 7.06278C5.48549 6.75524 5.48549 6.25662 5.79303 5.94909Z",fill:"currentColor"}),c.jsx("path",{d:"M9.99302 5.94909C10.3006 5.64155 10.7992 5.64155 11.1067 5.94909L14.0766 8.91893C14.3841 9.22647 14.3841 9.72509 14.0766 10.0326L11.1067 13.0025C10.7992 13.31 10.3006 13.31 9.99302 13.0025C9.68549 12.6949 9.68549 12.1963 9.99302 11.8888L12.406 9.47578L9.99302 7.06278C9.68549 6.75524 9.68549 6.25662 9.99302 5.94909Z",fill:"currentColor"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.2569 9.5037C18.2569 14.3372 14.3386 18.2555 9.50517 18.2555C4.67171 18.2555 0.753418 14.3372 0.753418 9.5037C0.753418 4.67024 4.67171 0.751953 9.50517 0.751953C14.3386 0.751953 18.2569 4.67024 18.2569 9.5037ZM16.6819 9.5037C16.6819 13.4673 13.4688 16.6805 9.50517 16.6805C5.54156 16.6805 2.32842 13.4673 2.32842 9.5037C2.32842 5.54009 5.54156 2.32695 9.50517 2.32695C13.4688 2.32695 16.6819 5.54009 16.6819 9.5037Z",fill:"currentColor"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.DoubleChevronInCircleIcon=m}),98); __d("WAWebWdsPictoMetaDataDoubleChevronIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="wds-picto-meta-data-double-chevron";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=70,R=70;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 70 70",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),fill:"none",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{d:"M19.8366 43.656L28.5011 34.983L19.8498 26.3365C18.5433 25.03 18.5433 22.9195 19.8498 21.613C21.1563 20.3065 23.2668 20.3065 24.5733 21.613L35.6031 32.638C36.9096 33.9445 36.9096 36.055 35.6031 37.3615L24.5601 48.413C23.2536 49.7195 21.1431 49.7195 19.8366 48.413C18.5636 47.1065 18.5301 44.9625 19.8366 43.656Z",fill:"#25D366"}),c.jsx("path",{d:"M45.2512 34.983L36.5867 43.656C35.2802 44.9625 35.3137 47.1065 36.5867 48.413C37.8932 49.7195 40.0037 49.7195 41.3102 48.413L52.3532 37.3615C53.6597 36.055 53.6597 33.9445 52.3532 32.638L41.3234 21.613C40.0169 20.3065 37.9064 20.3065 36.5999 21.613C35.2934 22.9195 35.2934 25.03 36.5999 26.3365L45.2512 34.983Z",fill:"#25D366"}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M68.5 35C68.5 16.508 53.492 1.5 35 1.5C16.508 1.5 1.5 16.508 1.5 35C1.5 53.492 16.508 68.5 35 68.5C53.492 68.5 68.5 53.492 68.5 35ZM8.2 35C8.2 20.193 20.193 8.2 35 8.2C49.807 8.2 61.8 20.193 61.8 35C61.8 49.807 49.807 61.8 35 61.8C20.193 61.8 8.2 49.807 8.2 35Z",fill:"#25D366"}),c.jsx("path",{d:"M19.8366 43.656L28.5011 34.983L19.8498 26.3365C18.5433 25.03 18.5433 22.9195 19.8498 21.613C21.1563 20.3065 23.2668 20.3065 24.5733 21.613L35.6031 32.638C36.9096 33.9445 36.9096 36.055 35.6031 37.3615L24.5601 48.413C23.2536 49.7195 21.1431 49.7195 19.8366 48.413C18.5636 47.1065 18.5301 44.9625 19.8366 43.656Z",stroke:"#111B21",strokeWidth:1.5}),c.jsx("path",{d:"M45.2512 34.983L36.5867 43.656C35.2802 44.9625 35.3137 47.1065 36.5867 48.413C37.8932 49.7195 40.0037 49.7195 41.3102 48.413L52.3532 37.3615C53.6597 36.055 53.6597 33.9445 52.3532 32.638L41.3234 21.613C40.0169 20.3065 37.9064 20.3065 36.5999 21.613C35.2934 22.9195 35.2934 25.03 36.5999 26.3365L45.2512 34.983Z",stroke:"#111B21",strokeWidth:1.5}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M68.5 35C68.5 16.508 53.492 1.5 35 1.5C16.508 1.5 1.5 16.508 1.5 35C1.5 53.492 16.508 68.5 35 68.5C53.492 68.5 68.5 53.492 68.5 35ZM8.2 35C8.2 20.193 20.193 8.2 35 8.2C49.807 8.2 61.8 20.193 61.8 35C61.8 49.807 49.807 61.8 35 61.8C20.193 61.8 8.2 49.807 8.2 35Z",stroke:"#111B21",strokeWidth:1.5})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.WdsPictoMetaDataDoubleChevronIcon=m}),98); __d("WAWebBizBotTosContent.react",["fbt","WAWebABProps","WAWebAiSignalOutlineIcon.react","WAWebBizBotConsumerContentVariant","WAWebBox.react","WAWebBusinessDataSharingIcon.react","WAWebDoubleChevronInCircleIcon.react","WAWebExternalLink.react","WAWebFaqUrl","WAWebFlex.react","WAWebText.react","WAWebUISpacing","WAWebWdsPictoMetaDataDoubleChevronIcon.react","react","stylex"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u,c=u||(u=o("react")),d={centerText:{textAlign:"x2b8uid",$$css:!0},iconUpdatedUI:{color:"x110helo",$$css:!0},sectionDescription:{color:"x14ug900",$$css:!0},sectionIcon:{width:"xvy4d1p",$$css:!0}};function m(){var t=o("WAWebBizBotConsumerContentVariant").getBizBotConsumerContentVariant(),n=t===o("WAWebBizBotConsumerContentVariant").BizBotConsumerContentVariant.INDIA?null:c.jsx(o("WAWebFlex.react").FlexItem,{xstyle:o("WAWebUISpacing").uiMargin.vert16,children:c.jsx(o("WAWebWdsPictoMetaDataDoubleChevronIcon.react").WdsPictoMetaDataDoubleChevronIcon,{width:67})}),a=c.jsx(o("WAWebText.react").WAWebTextLarge,{weight:"medium",textAlign:"center",children:s._(/*BTDS*/"Recibe ayuda r\u00e1pida en los chats de empresas que usan la IA de Meta")}),i={icon:c.jsx(o("WAWebAiSignalOutlineIcon.react").AiSignalOutlineIcon,{width:24,height:24,iconXstyle:d.iconUpdatedUI}),title:s._(/*BTDS*/"Las empresas entrenan a la IA para darte respuestas \u00fatiles sobre sus productos y servicios.")},l=t===o("WAWebBizBotConsumerContentVariant").BizBotConsumerContentVariant.ROW?{icon:c.jsx(o("WAWebDoubleChevronInCircleIcon.react").DoubleChevronInCircleIcon,{width:24,height:24,iconXstyle:d.iconUpdatedUI}),title:s._(/*BTDS*/"Este \u00edcono indica que Meta, la empresa matriz de WhatsApp, recibe estos chats para mejorar la {=m2}. Puedes dejar de chatear en cualquier momento. {=m5}",[s._implicitParam("=m2",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getMetaGenAiGuideUrl(),children:s._(/*BTDS*/"IA en Meta")})),s._implicitParam("=m5",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getBizBotTosLearnMoreUrl(),children:s._(/*BTDS*/"M\u00e1s informaci\u00f3n")}))])}:t===o("WAWebBizBotConsumerContentVariant").BizBotConsumerContentVariant.INDIA?{icon:c.jsx(o("WAWebBusinessDataSharingIcon.react").BusinessDataSharingIcon,{width:24,height:24,iconXstyle:d.iconUpdatedUI}),title:o("WAWebABProps").getABPropConfigValue("biz_ai_consumer_tos_update_web")?s._(/*BTDS*/"Meta, la empresa matriz de WhatsApp, recibe estos chats para mejorar la {=m2}. Puedes dejar de chatear en cualquier momento. {=m5}",[s._implicitParam("=m2",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getMetaGenAiGuideUrl(),children:s._(/*BTDS*/"IA en Meta")})),s._implicitParam("=m5",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getBizBotTosLearnMoreUrl(),children:s._(/*BTDS*/"M\u00e1s informaci\u00f3n")}))]):s._(/*BTDS*/"Meta, la empresa matriz de WhatsApp, recibe estos chats para mejorar la calidad de la IA. Puedes dejar de chatear en cualquier momento. {=m2}",[s._implicitParam("=m2",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getBizBotTosLearnMoreUrl(),children:s._(/*BTDS*/"M\u00e1s informaci\u00f3n")}))])}:t===o("WAWebBizBotConsumerContentVariant").BizBotConsumerContentVariant.BRAZIL?{icon:c.jsx(o("WAWebDoubleChevronInCircleIcon.react").DoubleChevronInCircleIcon,{width:24,height:24,iconXstyle:d.iconUpdatedUI}),title:o("WAWebABProps").getABPropConfigValue("biz_ai_consumer_tos_update_web")?s._(/*BTDS*/"Este \u00edcono indica que Meta, la empresa matriz de WhatsApp, recibe estos chats y puede usarlos para mejorar la {=m2}. Puedes dejar de chatear en cualquier momento. {=m5}",[s._implicitParam("=m2",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getMetaGenAiGuideUrl(),children:s._(/*BTDS*/"IA en Meta")})),s._implicitParam("=m5",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getBizBotTosLearnMoreUrl(),children:s._(/*BTDS*/"M\u00e1s informaci\u00f3n")}))]):s._(/*BTDS*/"Este \u00edcono indica que Meta, la empresa matriz de WhatsApp, recibe estos chats y puede usarlos para mejorar la {=m2}.",[s._implicitParam("=m2",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getMetaGenAiGuideUrl(),children:s._(/*BTDS*/"IA en Meta")}))])}:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+t)})(),u=t===o("WAWebBizBotConsumerContentVariant").BizBotConsumerContentVariant.BRAZIL?s._(/*BTDS*/"Tus mensajes personales permanecen cifrados de extremo a extremo. Al chatear, indicas que aceptas las {=m2} y la {=m5} de Meta. Obt\u00e9n m\u00e1s informaci\u00f3n sobre tus {=m7} y c\u00f3mo {=m11}. El uso que haces de WhatsApp est\u00e1 sujeto a la {=m14}.",[s._implicitParam("=m2",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getBotTermsUrl(),children:s._(/*BTDS*/"Condiciones de la IA")})),s._implicitParam("=m5",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getBotPrivacyPolicyUrl(),children:s._(/*BTDS*/"Pol\u00edtica de privacidad")})),s._implicitParam("=m7",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getWhatsappBrazilBizBotRightsUrl(),children:s._(/*BTDS*/"derechos")})),s._implicitParam("=m11",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getWhatsappBrazilBizBotObjectUrl(),children:s._(/*BTDS*/"objeto")})),s._implicitParam("=m14",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getWhatsappPrivacyPolicyBrazilUrl(),children:s._(/*BTDS*/"Pol\u00edtica de privacidad de WhatsApp")}))]):s._(/*BTDS*/"Tus mensajes personales permanecen cifrados de extremo a extremo. Cuando chateas, indicas que aceptas las {=m2} y la {=m5} de Meta.",[s._implicitParam("=m2",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getBotTermsUrl(),children:s._(/*BTDS*/"Condiciones de la IA")})),s._implicitParam("=m5",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getBotPrivacyPolicyUrl(),children:s._(/*BTDS*/"Pol\u00edtica de privacidad")}))]);return c.jsxs(o("WAWebFlex.react").FlexColumn,{align:"center",xstyle:o("WAWebUISpacing").uiMargin.vertAuto,children:[n,c.jsx(r("WAWebBox.react"),{flex:!0,direction:"vertical",rowGap:8,xstyle:[o("WAWebUISpacing").uiMargin.top16,o("WAWebUISpacing").uiMargin.bottom8],children:a}),[i,l].filter(Boolean).map(function(t,n){var a=t.icon,i=t.title;return c.jsxs(o("WAWebFlex.react").FlexRow,{columnGap:24,className:(e||(e=r("stylex")))(o("WAWebUISpacing").uiMargin.vert10,o("WAWebUISpacing").uiPadding.horiz8),align:"center",children:[c.jsx(o("WAWebFlex.react").FlexItem,{shrink:0,xstyle:d.sectionIcon,children:a}),c.jsx(o("WAWebFlex.react").FlexItem,{xstyle:d.sectionDescription,children:i})]},n)}),c.jsx(r("WAWebBox.react"),{xstyle:o("WAWebUISpacing").uiMargin.vert8,children:c.jsx(o("WAWebText.react").WAWebTextMuted,{xstyle:d.centerText,children:u})})]})}m.displayName=m.name+" [from "+i.id+"]",l.default=m}),226); __d("WAWebBizBotTos.react",["WAWebBizBotLogging","WAWebBizBotTosContent.react","WAWebBotTos","WAWebConfirmPopup.react","WAWebFbtCommon","WAWebModalManager","WAWebTos","asyncToGeneratorRuntime","react","useWAWebFocusOnMount","useWAWebListener"],(function(t,n,r,o,a,i,l){var e=["ref"],s,u,c=u||(u=o("react")),d=s||(s=r("react")),m=c.useEffect,p=c.useImperativeHandle,_=c.useState;function f(t){var a=t.ref,i=babelHelpers.objectWithoutPropertiesLoose(t,e),l=i.chatEntryPoint,s=i.onAccept,u=_(!1),c=u[0],f=u[1],g=o("WAWebBotTos").hasSeenBotTos();o("useWAWebListener").useListener(o("WAWebTos").TosManager,"change",function(){o("WAWebBotTos").hasAcceptedBizBotTos()&&o("WAWebModalManager").ModalManager.close()}),p(a,function(){return{close:o("WAWebModalManager").closeModalManager}});var h=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){f(!0);try{return yield o("WAWebBotTos").acceptBizBotTos(),yield s==null?void 0:s(),o("WAWebModalManager").ModalManager.close(),!0}catch(e){return!1}finally{f(!1)}});return function(){return e.apply(this,arguments)}})(),y=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WAWebBizBotLogging").logBizBotNuxJourneyEvent("1p","nux_continue_clicked",l),yield h().then(function(e){e&&o("WAWebBizBotLogging").logBizBotNuxJourneyEvent("1p","nux_select",l)})});return function(){return e.apply(this,arguments)}})(),C=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WAWebBizBotLogging").logBizBotNuxJourneyEvent("1p","nux_dismiss",l),yield h().then(function(e){e&&o("WAWebBizBotLogging").logBizBotNuxJourneyEvent("1p","nux_dismiss_auto_accept",l)})});return function(){return e.apply(this,arguments)}})(),b=function(){C()},v=r("useWAWebFocusOnMount")();return m(function(){o("WAWebBizBotLogging").logBizBotNuxJourneyEvent("1p",g?"nux_view_merged":"nux_view_new",l)},[]),d.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{testid:void 0,okText:r("WAWebFbtCommon")("OK"),onOK:y,okSpinner:c===!0,onOverlayClick:b,ref:v,children:d.jsx(r("WAWebBizBotTosContent.react"),{})})}f.displayName=f.name+" [from "+i.id+"]",l.default=f}),98); __d("WAWebBizBotTosUtils",["Promise","WAWebBizBotTos.react","WAWebBotGating","WAWebBotTos","WAWebBotTypes","WAWebChatEntryPoint","WAWebContactGetters","WAWebCreateBizBotSysMsgAction","WAWebModalManager","asyncToGeneratorRuntime","react"],(function(t,n,r,o,a,i,l){var e,s,u=s||(s=r("react"));function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a;if(!(!o("WAWebBotGating").isBizBot1pEnabled()||!((a=t.contact.businessProfile)!=null&&a.isBizBot1p)||o("WAWebBotTos").hasSeenBizBotTos(o("WAWebBotTypes").BizBotType.BIZ_1P)||o("WAWebContactGetters").getIsMe(t.contact)))return new(e||(e=n("Promise")))(function(e){var a;o("WAWebModalManager").ModalManager.open(u.jsx(r("WAWebBizBotTos.react"),{onAccept:n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAWebCreateBizBotSysMsgAction").maybeCreateBizBot1pDisclosureSysMsg(t),e()}),onCancel:e,chatEntryPoint:(a=t.chatEntryPoint)!=null?a:o("WAWebChatEntryPoint").ChatEntryPoint.Unknown}),{blockClose:!0})})}),d.apply(this,arguments)}l.maybeShowBizBot1pTos=c}),98); __d("WAWebMuteGetters",["WAWeb-moment","WAWebGetters","WAWebGettersCaches"],(function(t,n,r,o,a,i,l){var e=o("WAWebGetters").createGetterFactories({createCache:o("WAWebGettersCaches").createMuteCache}),s=e.clearCacheFor,u=e.computed,c=e.field,d=s,m=c("callExpiration"),p=c("expiration"),_=c("mentionAllMuteExpiration"),f=u(function(e){var t=e[0];return!!t},[p]),g=u(function(e){var t=e[0];return!!t},[m]),h=u(function(e){var t=e[0],n=e[1];return n&&!!t&&t>r("WAWeb-moment")().unix()},[_,f]);l.clearMuteGetterCacheFor=d,l.getCallExpiration=m,l.getExpiration=p,l.getMentionAllMuteExpiration=_,l.getIsMuted=f,l.getIsCallMuted=g,l.getIsMentionAllMuted=h}),98); __d("WAWebNotificationMuteReason",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum").Mirrored(["ParentMsgMissing","GlobalMute","AppState","MutedChat","ArchivedChat","OfflineResumeInProgress","IgnoreGroupMsg","GroupFlood","ReactionFlood","NonHydratedReaction","MutedStatus","AlreadyNotifiedKic","KicOnNonEphemeralChat","KicOnNonOriginalMsg","KicByMe","UserLeftGroupKic","IgnoreAddedToCommunityHome","IgnoreFutureProof","IgnoreBizContentPlaceholder","IgnoreCallMsgs","IgnoreBotMsgs","IgnoreInternalSilentTag","IgnoreHiddenViewModeMsgs","AIRepliesOn","MutedStatusReaction","IgnoreViewedMsgs","GroupSafetyCheck","MentionAllMuted","NewsletterFollowerActivityMuted","NewsletterFollowerActivityDisabled","ReadByPeer"]),l=e;i.default=l}),66); __d("WAWebAiHandoffNotification",["fbt","WAWebBaseNotification","WAWebFrontendContactGetters","WAWebGetNotificationStrings","WAWebMuteGetters","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebWamEnumNotificationTypeEnum","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){var e=(function(e){function t(t){var n,r=t.chat;return n=e.call(this)||this,n.chat=r,n}babelHelpers.inheritsLoose(t,e);var a=t.prototype;return a.shouldPlaySound=function(){return e.prototype.shouldPlaySound.call(this)?o("WAWebNotificationHelpers").shouldPlaySoundGranular(this.chat):!1},a.shouldShowBanner=function(){return e.prototype.shouldShowBanner.call(this)?o("WAWebNotificationHelpers").shouldEnableNotificationGranular(this.chat):!1},a.shouldMute=function(t){return o("WAWebNotificationHelpers").shouldMuteDueToAppState(t)?r("WAWebNotificationMuteReason").AppState:o("WAWebMuteGetters").getIsMuted(this.chat.mute)?r("WAWebNotificationMuteReason").MutedChat:this.chat.archive?r("WAWebNotificationMuteReason").ArchivedChat:o("WAWebNotificationHelpers").isOfflineResumeInProgress()?r("WAWebNotificationMuteReason").OfflineResumeInProgress:null},a.buildKey=function(){return"handoff:"+this.chat.id.toString()},a.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebNotificationIconUtils").getChatNotificationIcon(this.chat,this.abortController.signal)});function t(){return e.apply(this,arguments)}return t})(),a.getBannerOptions=function(){return{wid:this.chat.id,title:u(),body:o("WAWebGetNotificationStrings").getNotificationBody(babelHelpers.extends({},c(this.chat)))}},a.getNotificationDeliveryWamEventData=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return{uiNotificationType:o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.OTHER}});function t(){return e.apply(this,arguments)}return t})(),t})(o("WAWebBaseNotification").WABaseNotification);function u(){return s._(/*BTDS*/"WhatsApp Business AI").toString()}function c(e){var t=o("WAWebFrontendContactGetters").getFormattedName(e.contact),n=s._(/*BTDS*/"La conversaci\u00f3n de {name} requiere tu atenci\u00f3n.",[s._param("name",t)]);return{body:n.toString()}}l.AiHandoffNotification=e,l.getNotificationTitle=u,l.getNotificationParts=c}),226); __d("WAWebOrderRequestMsg.flow",["$InternalEnum"],(function(t,n,r,o,a,i){"use strict";var e=n("$InternalEnum").Mirrored(["SMB_META_CATALOG","NATIVE","UNKNOWN"]);i.CatalogType=e}),66); __d("WAWebLinkedCatalogHelper",["WAWebBusinessProfileCollection","WAWebBusinessProfileTypes","WAWebCatalogCollection","WAWebMobilePlatforms","WAWebOrderRequestMsg.flow","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l){"use strict";function e(){var e=o("WAWebUserPrefsMeUser").getMePnUserOrThrow();return s(e)}function s(e){var t,n=o("WAWebUserPrefsMeUser").getMePnUserOrThrow();if(o("WAWebMobilePlatforms").isSMB()&&n.equals(e)){var r=o("WAWebCatalogCollection").CatalogCollection.get(e);return(r==null?void 0:r.catalogType)===o("WAWebOrderRequestMsg.flow").CatalogType.SMB_META_CATALOG}var a=o("WAWebBusinessProfileCollection").BusinessProfileCollection.get(e);return(a==null||(t=a.profileOptions)==null?void 0:t.commerceExperience)===o("WAWebBusinessProfileTypes").CommerceExperienceTypes.META_CATALOG}l.shouldHideComponentForSMBLinkedCatalog=e,l.isLinkedCatalog=s}),98); __d("WAWebWamEnumCatalogEntryPoint",[],(function(t,n,r,o,a,i){var e=Object.freeze({CATALOG_ENTRY_POINT_PROFILE:1,CATALOG_ENTRY_POINT_SETTINGS:2,CATALOG_ENTRY_POINT_MESSAGE:3,CATALOG_ENTRY_POINT_ATTACHMENT_PANEL:4,CATALOG_ENTRY_POINT_NUX:5,CATALOG_ENTRY_POINT_DEEPLINK:6,CATALOG_ENTRY_POINT_CHAT:7,CATALOG_ENTRY_POINT_ORDER_MESSAGE:8,CATALOG_ENTRY_POINT_INVOICE_ATTACHMENT_PANEL:9,CATALOG_ENTRY_POINT_PRODUCT_LIST_MESSAGE:10,CATALOG_ENTRY_POINT_TOP_BAR:11,CATALOG_ENTRY_POINT_PROFILE_ITEM_CLICK:12,CATALOG_ENTRY_POINT_PROFILE_SEE_ALL:13,CATALOG_ENTRY_POINT_QUOTED_PRODUCT:14,CATALOG_ENTRY_POINT_CATALOG_MESSAGE:15,CATALOG_ENTRY_QBM:16,CATALOG_ENTRY_POINT_ADS_DEEPLINK:17,CATALOG_ENTRY_POINT_WA_PAGES:18,CATALOG_ENTRY_POINT_DIRECTORY_BARE_TIPS:19,CATALOG_ENTRY_POINT_BIZ_ACTION_BAR:20,CATALOG_ENTRY_POINT_BIZ_ONBOARDING:21,CATALOG_ENTRY_POINT_TRUST_CARD:22,CATALOG_ENTRY_POINT_FLOWS:23,CATALOG_ENTRY_POINT_BIZ_AI_HOME:24,CATALOG_ENTRY_POINT_BUSINESS_HOME:25,CATALOG_ENTRY_POINT_LEARNING_HUB:26});i.CATALOG_ENTRY_POINT=e}),66); __d("WAWebWamEnumCatalogViewAction",[],(function(t,n,r,o,a,i){var e=Object.freeze({ACTION_CARD_ITEM_CLICK:2,ACTION_CARD_MORE_CLICK:3,ACTION_LIST_IMPRESSION:4,ACTION_DETAIL_IMAGE_CLICK:6,ACTION_DETAIL_LINK_CLICK:7,ACTION_FULL_IMAGE_SWIPE:11,ACTION_DETAIL_IMPRESSION:12,ACTION_REPORT_PRODUCT:13,ACTION_SEND_PRODUCT_MESSAGE:14,ACTION_REPORT_PRODUCT_SUCCESS:15,ACTION_REPORT_PRODUCT_FAILURE:16,ACTION_QUOTED_PRODUCT_IN_CONVERSATION_CLICK:17,ACTION_PRODUCT_IN_CONVERSATION_CLICK:18,ACTION_SHARE_CATALOG_LINK_CLICK:19,ACTION_SHARE_PRODUCT_LINK_CLICK:20,ACTION_CATALOG_IN_CONVERSATION_CLICK:21,ACTION_SHARE_CATALOG_VIA_WA_LINK_CLICK:22,ACTION_SHARE_PRODUCT_VIA_WA_LINK_CLICK:23,ACTION_SHARE_CATALOG_COPY_LINK_CLICK:24,ACTION_SHARE_PRODUCT_COPY_LINK_CLICK:25,ACTION_CHAT_CATALOG_ICON_CLICK:26,ACTION_MESSAGE_BUSINESS_BUTTON_CLICK:27,ACTION_CART_ADD_PRODUCT:28,ACTION_CART_EDIT_PRODUCT:29,ACTION_CART_DELETE_PRODUCT:30,ACTION_CART_ABANDON:31,ACTION_CART_ICON_CLICK:32,ACTION_CART_SNACKBAR_CLICK:33,ACTION_SEND_ORDER_MESSAGE:34,ACTION_ORDER_LIST_IMPRESSION:35,ACTION_QUOTED_PRODUCT_MESSAGE_SEND:36,ACTION_CART_LIST_IMPRESSION:37,ACTION_ORDER_MESSAGE_CLICK:38,ACTION_ORDER_LIST_ITEM_CLICK:39,ACTION_PLM_CART_CTA_CLICK:40,ACTION_CART_CHAT_ICON_CLICK:42,ACTION_CREATE_CART:43,ACTION_PLP_PRODUCT_VARIANT_BOTTOM_SHEET_OPEN:44,ACTION_PLP_PRODUCT_VARIANT_CHANGE:45,ACTION_PDP_PRODUCT_VARIANT_CHANGE:46,ACTION_PLP_BOTTOM_SHEET_SEE_MORE_DETAILS:47,ACTION_UPDATE_VARIANT_SELECTION:48,ACTION_VIEW_PRODUCT_VARIANTS_BOTTOM_SHEET:49,ACTION_WATCH_PRODUCT_VIDEO:50,ACTION_DETAIL_VIDEO_CLICK:51,ACTION_FULL_VIDEO_SWIPE:52,ACTION_LIST_LOAD:53,ACTION_DETAIL_LOAD:54});i.CATALOG_VIEW_ACTION=e}),66); __d("WAWebWamEnumDeepLinkOpenFrom",[],(function(t,n,r,o,a,i){var e=Object.freeze({DEEP_LINK_EXTERNAL:1,DEEP_LINK_WA_LINK_CLICK:2,QR_CODE_SHEET:3,DEEP_LINK_BANNER:4,DEEP_LINK_SMB_NOTIFICATION:5,DEEP_LINK_MESSENGER_APP:6});i.DEEP_LINK_OPEN_FROM=e}),66); __d("WAWebBizCatalogViewWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumBizPlatform","WAWebWamEnumCatalogEntryPoint","WAWebWamEnumCatalogViewAction","WAWebWamEnumDeepLinkOpenFrom","WAWebWamEnumEntryPointConversationInitiated"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({BizCatalogView:[3006,{adId:[26,e.TYPES.STRING],bizPlatform:[14,o("WAWebWamEnumBizPlatform").BIZ_PLATFORM],cartToggle:[13,e.TYPES.BOOLEAN],catalogCategoryId:[19,e.TYPES.STRING],catalogEntryPoint:[2,o("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT],catalogEventSampled:[11,e.TYPES.BOOLEAN],catalogOwnerJid:[10,e.TYPES.STRING],catalogReportReasonCode:[8,e.TYPES.STRING],catalogSessionId:[3,e.TYPES.STRING],catalogViewAction:[1,o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION],collectionId:[15,e.TYPES.STRING],collectionIndex:[16,e.TYPES.STRING],deepLinkOpenFrom:[12,o("WAWebWamEnumDeepLinkOpenFrom").DEEP_LINK_OPEN_FROM],entryPointConversationInitiated:[22,o("WAWebWamEnumEntryPointConversationInitiated").ENTRY_POINT_CONVERSATION_INITIATED],entryPointConversionApp:[20,e.TYPES.STRING],entryPointConversionSource:[21,e.TYPES.STRING],hasVariants:[23,e.TYPES.BOOLEAN],isNewProductAddedToCart:[7,e.TYPES.BOOLEAN],isOrderMsgAttached:[5,e.TYPES.BOOLEAN],orderId:[4,e.TYPES.STRING],productId:[9,e.TYPES.STRING],productIndex:[17,e.TYPES.STRING],quantity:[6,e.TYPES.INTEGER],sequenceNumber:[18,e.TYPES.INTEGER],variantTypes:[24,e.TYPES.STRING],variantsExtraAttributes:[25,e.TYPES.STRING]},[1,1,1],"private",0]},{BizCatalogView:[]});l.BizCatalogViewWamEvent=s}),98); __d("WAWebWamEnumCatalogBizAction",[],(function(t,n,r,o,a,i){var e=Object.freeze({ACTION_PRODUCT_ADD_CLICKED:1,ACTION_PRODUCT_ADD_SUCCESS:2,ACTION_PRODUCT_ADD_FAILED:3,ACTION_PRODUCT_EDIT_CLICKED:4,ACTION_PRODUCT_EDIT_SUCCESS:5,ACTION_PRODUCT_EDIT_FAILED:6,ACTION_PRODUCT_DELETE_CLICKED:7,ACTION_PRODUCT_DELETE_SUCCESS:8,ACTION_PRODUCT_DELETE_FAILED:9,ACTION_APPEAL_PRODUCT_CLICKED:10,ACTION_APPEAL_PRODUCT_SUCCESS:11,ACTION_APPEAL_PRODUCT_FAILED:12,ACTION_CREATE_PRODUCT_CATALOG:13,ACTION_CREATE_PRODUCT_CATALOG_SUCCESS:14,ACTION_CREATE_PRODUCT_CATALOG_FAILED:15,ACTION_CATALOG_MENU_ITEM_CLICKED:16,ACTION_PRODUCT_RESUBMIT_CLICKED:17,ACTION_START_IMPORT_FLOW:18,ACTION_IMPORT_POST:19,ACTION_CARD_ITEM_CLICK:21,ACTION_CARD_MORE_CLICK:22,ACTION_LIST_IMPRESSION:23,ACTION_DETAIL_IMAGE_CLICK:25,ACTION_DETAIL_LINK_CLICK:26,ACTION_FULL_IMAGE_SWIPE:30,ACTION_DETAIL_IMPRESSION:31,ACTION_QUOTED_PRODUCT_IN_CONVERSATION_CLICK:32,ACTION_PRODUCT_IN_CONVERSATION_CLICK:33,ACTION_SEND_PRODUCT_MESSAGE:34,ACTION_ONBOARD_IMPRESSION:35,ACTION_SHARE_CATALOG_LINK_CLICK:36,ACTION_SHARE_PRODUCT_LINK_CLICK:37,ACTION_CATALOG_IN_CONVERSATION_CLICK:38,ACTION_SHARE_CATALOG_VIA_WA_LINK_CLICK:39,ACTION_SHARE_PRODUCT_VIA_WA_LINK_CLICK:40,ACTION_SHARE_CATALOG_COPY_LINK_CLICK:41,ACTION_SHARE_PRODUCT_COPY_LINK_CLICK:42,ACTION_SEND_CATALOG_CLICK:43,ACTION_ORDER_MESSAGE_CLICK:44,ACTION_ORDER_LIST_IMPRESSION:45,ACTION_ORDER_LIST_ITEM_CLICK:46,ACTION_MESSAGE_BUSINESS_BUTTON_CLICK:47,ACTION_QUOTED_PRODUCT_MESSAGE_SEND:48,ACTION_CART_ADD_PRODUCT:49,ACTION_CART_ICON_CLICK:50,ACTION_CART_SNACKBAR_CLICK:51,ACTION_CART_LIST_IMPRESSION:52,ACTION_CART_EDIT_PRODUCT:53,ACTION_CART_DELETE_PRODUCT:54,ACTION_CART_ABANDON:55,ACTION_SEND_ORDER_MESSAGE:56,ACTION_MENU_CLICK:57,ACTION_PRODUCT_HIDE_CLICKED:58,ACTION_PRODUCT_HIDE_SUCCESS:59,ACTION_PRODUCT_HIDE_CANCELLED:60,ACTION_PRODUCT_HIDE_FAILED:61,ACTION_PRODUCT_UNHIDE_CLICKED:62,ACTION_PRODUCT_UNHIDE_SUCCESS:63,ACTION_PRODUCT_UNHIDE_CANCELLED:64,ACTION_PRODUCT_UNHIDE_FAILED:65,ACTION_CATALOG_LIST_MENU_CLICKED:66,ACTION_CATALOG_LIST_MENU_CLICKED_WITH_ADVERTISE_SHOWN:67,ACTION_COLLECTION_CREATE_CLICKED:68,ACTION_COLLECTION_CREATED:69,ACTION_MENU_COLLECTIONS_CLICK:70,ACTION_COLLECTION_RENAME_CLICKED:71,ACTION_COLLECTION_RENAME_CANCELLED:72,ACTION_COLLECTION_RENAMED:73,ACTION_COLLECTION_DELETE_CLICKED:74,ACTION_COLLECTION_DELETE_CANCELLED:75,ACTION_COLLECTION_DELETED:76,ACTION_COLLECTION_ASSIGN_ITEMS:77,ACTION_COLLECTION_UNASSIGN_ITEMS:78,ACTION_COLLECTION_CHANGE_ORDER:80,ACTION_COLLECTION_ITEM_CHANGE_ORDER:81,ACTION_ERROR_SAVING_ITEM:82,ACTION_MEDIA_DELETE_SUCCESS:83,ACTION_SAVING_PRODUCT_PROGRESS_BAR:84,ACTION_CONTINUE_SAVING_PRODUCT:85,ACTION_ABORT_SAVING_PRODUCT:86,ACTION_CLICK_SAVE_PRODUCT:87,ACTION_CHOOSE_PRODUCT_INTENT:88,ACTION_DETAIL_VIDEO_CLICK:89,ACTION_WATCH_PRODUCT_VIDEO:90,ACTION_FULL_VIDEO_SWIPE:91,ACTION_PROCEED_TO_REPLACE_MEDIA:92,ACTION_PRODUCT_LINK_SHARE_TO_STATUS_BTN_IMPRESSION:93,ACTION_PRODUCT_LINK_SHARE_TO_STATUS_BTN_CLICKED:94,ACTION_CATALOG_LINK_SHARE_TO_STATUS_BTN_IMPRESSION:95,ACTION_CATALOG_LINK_SHARE_TO_STATUS_BTN_CLICKED:96});i.CATALOG_BIZ_ACTION=e}),66); __d("WAWebCatalogBizWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumCatalogBizAction","WAWebWamEnumCatalogEntryPoint","WAWebWamEnumDeepLinkOpenFrom","WAWebWamEnumLastMessageDirection"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({CatalogBiz:[1722,{adId:[19,e.TYPES.STRING],cartToggle:[13,e.TYPES.BOOLEAN],catalogAppealReason:[4,e.TYPES.STRING],catalogBizAction:[1,o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION],catalogEntryPoint:[7,o("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT],catalogSessionId:[3,e.TYPES.STRING],collectionCount:[18,e.TYPES.INTEGER],collectionId:[14,e.TYPES.STRING],collectionIndex:[15,e.TYPES.STRING],deepLinkOpenFrom:[8,o("WAWebWamEnumDeepLinkOpenFrom").DEEP_LINK_OPEN_FROM],entryPointConversionSource:[20,e.TYPES.STRING],errorCode:[5,e.TYPES.INTEGER],extraAttributes:[24,e.TYPES.STRING],isOrderMsgAttached:[10,e.TYPES.BOOLEAN],lastMessageDirection:[21,o("WAWebWamEnumLastMessageDirection").LAST_MESSAGE_DIRECTION],messageDepth:[22,e.TYPES.INTEGER],orderId:[9,e.TYPES.STRING],productCount:[6,e.TYPES.INTEGER],productId:[2,e.TYPES.STRING],productIds:[12,e.TYPES.STRING],productIndex:[16,e.TYPES.STRING],quantity:[11,e.TYPES.INTEGER],threadIdHmac:[23,e.TYPES.STRING]},[1,1,1],"regular"]},{CatalogBiz:[]});l.CatalogBizWamEvent=s}),98); __d("WAWebProductCatalogSession",["WALogger"],(function(t,n,r,o,a,i,l){var e,s="accidental_session",u=(function(){function t(e){this.accidental=e||!1,this.initSessionId()}var n=t.prototype;return n.isAccidental=function(){return this.accidental},n.initSessionId=function(){this.sessionId=this.newSessionId()},n.newSessionId=function(){return this.sessionId=Math.floor(2147483648*Math.random()),this.sessionId},n.toString=function(){var t=""+this.sessionId;return this.accidental&&(o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["sessionId unset, returning random accidental session"]))),t=s+"_"+t),t},t})();l.ProductCatalogSession=u}),98); __d("WAWebProductCatalogContext",["WAWebProductCatalogSession","WAWebWamEnumBizPlatform"],(function(t,n,r,o,a,i,l){function e(e,t,n){return e===void 0&&(e=new(o("WAWebProductCatalogSession")).ProductCatalogSession),t===void 0&&(t=o("WAWebWamEnumBizPlatform").BIZ_PLATFORM.UNKNOWN),{type:"product_catalog",session:e,entryPoint:n,bizPlatform:t}}function s(){return e(new(o("WAWebProductCatalogSession")).ProductCatalogSession(!0))}function u(e){return c(e).session.toString()}function c(e){return e.type==="product_catalog"?e:s()}function d(e){return{catalogSessionId:e.session.toString(),bizPlatform:e.bizPlatform,catalogEntryPoint:e.entryPoint}}l.buildProductCatalogContext=e,l.getProductCatalogSessionId=u,l.getProductCatalogContext=c,l.toDataForCatalogViewEvents=d}),98); __d("WAWebProductCatalogEventUtils",["WAWebBizCatalogViewWamEvent","WAWebBizGatingUtils","WAWebCatalogBizWamEvent","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e=["bizActionConfig","bizPlatform","catalogBizAction","catalogOwnerJid","catalogViewAction","isOwner"],s=function(t){var e;return r("isStringNullOrEmpty")(t.catalogOwnerJid)?t.catalogOwnerWid?e=t.catalogOwnerWid:t.product&&(e=t.product.catalogWid):e=o("WAWebWidFactory").createWid(t.catalogOwnerJid),e instanceof r("WAWebWid")&&o("WAWebUserPrefsMeUser").isMeAccount(e)},u=function(n){var t=n.bizActionConfig,r=n.bizPlatform,a=n.catalogBizAction,i=n.catalogOwnerJid,l=n.catalogViewAction,s=n.isOwner,u=babelHelpers.objectWithoutPropertiesLoose(n,e);if(a&&s){new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent(babelHelpers.extends({catalogBizAction:a},u,t)).commit();return}if(l&&o("WAWebBizGatingUtils").isPSForCatalogViewEnabled()){new(o("WAWebBizCatalogViewWamEvent")).BizCatalogViewWamEvent(babelHelpers.extends({catalogViewAction:l,bizPlatform:r,catalogOwnerJid:i},u)).commit();return}};l.isCatalogOwner=s,l.logCatalogViewOrBizEvent=u}),98); __d("WAWebProductCatalogLogEvents",["WAWebBizCatalogUtils","WAWebBizCatalogViewWamEvent","WAWebCatalogBizWamEvent","WAWebProductCatalogContext","WAWebProductCatalogEventUtils","WAWebProductCatalogSession","WAWebUserPrefsMeUser","WAWebWamEnumCatalogBizAction","WAWebWamEnumCatalogEntryPoint","WAWebWamEnumCatalogViewAction","WAWebWidFactory","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){function e(e){var t=e.catalogContext,n=e.catalogOwnerWid;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t),{isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:n}),catalogOwnerJid:n.toJid()}))}function s(e){var t=e.catalogContext,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CARD_ITEM_CLICK},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t),{catalogOwnerJid:n.catalogWid.toJid()}))}function u(e){var t=e.catalogContext,n=e.catalogOwnerWid;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CARD_MORE_CLICK,catalogOwnerJid:n.toJid()},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function c(e){var t=e.cartToggle,n=e.catalogContext,r=e.catalogOwnerWid;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:r}),catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_LIST_IMPRESSION,catalogOwnerJid:r.toJid(),cartToggle:t},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(n)))}function d(e){var t=e.catalogContext,n=e.catalogOwnerWid,r=o("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:n});o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:r,catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_CATALOG_LINK_CLICK,catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_CATALOG_LINK_CLICK,catalogOwnerJid:n.toJid()},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function m(e){var t=e.catalogContext,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({catalogOwnerJid:n.catalogWid.toJid(),isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n})},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function p(e){var t=e.catalogContext,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_DETAIL_IMAGE_CLICK,catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_DETAIL_IMAGE_CLICK,catalogOwnerJid:n.catalogWid.toJid(),productId:n.id.toString()},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function _(e){var t=e.catalogContext,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({catalogOwnerJid:n.catalogWid.toJid(),isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_DETAIL_LINK_CLICK,catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_DETAIL_LINK_CLICK,productId:n.id.toString()},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function f(e){var t=e.catalogSessionId,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({catalogOwnerJid:n.catalogWid.toJid(),isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogSessionId:t})}function g(e){var t=e.catalogSessionId,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({catalogOwnerJid:n.catalogWid.toJid(),isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogSessionId:t})}function h(e){var t=e.catalogSessionId,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({catalogOwnerJid:n.catalogWid.toJid(),isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogSessionId:t})}function y(e){var t=e.catalogSessionId,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({catalogOwnerJid:n.catalogWid.toJid(),isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_FULL_IMAGE_SWIPE,catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_FULL_IMAGE_SWIPE,catalogSessionId:t,productId:n.id.toString()})}function C(e){var t=e.cartToggle,n=e.catalogContext,r=e.collectionId,a=e.product,i=o("WAWebBizCatalogUtils").getProductStatsInFetched(a.catalogWid.toString(),r,a);o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({catalogOwnerJid:a.catalogWid.toJid(),isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:a}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_DETAIL_IMPRESSION,catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_DETAIL_IMPRESSION,cartToggle:t},i,o("WAWebProductCatalogContext").toDataForCatalogViewEvents(n)))}function b(e){var t=e.catalogSessionId,n=e.product,r=e.reason;new(o("WAWebBizCatalogViewWamEvent")).BizCatalogViewWamEvent({catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_REPORT_PRODUCT_SUCCESS,catalogSessionId:t,catalogOwnerJid:n.catalogWid.toJid(),catalogReportReasonCode:r,productId:n.id.toString()}).commit()}function v(e){var t=e.catalogSessionId,n=e.product,r=e.reason;new(o("WAWebBizCatalogViewWamEvent")).BizCatalogViewWamEvent({catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_REPORT_PRODUCT_FAILURE,catalogOwnerJid:n.catalogWid.toJid(),catalogSessionId:t,catalogReportReasonCode:r,productId:n.id.toString()}).commit()}function S(e){var t=e.catalogContext,n=e.product,r=o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n});o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:r,catalogOwnerJid:n.catalogWid.toJid(),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_QUOTED_PRODUCT_IN_CONVERSATION_CLICK},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function R(e){var t=e.catalogContext,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogOwnerJid:n.catalogWid.toJid(),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_IN_CONVERSATION_CLICK},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function L(e){var t=e.catalogContext,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_PRODUCT_LINK_CLICK,catalogOwnerJid:n.catalogWid.toJid(),catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_PRODUCT_LINK_CLICK,productId:n.id.toString()},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function E(e,t){o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:e}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_MESSAGE_BUSINESS_BUTTON_CLICK,catalogOwnerJid:e.catalogWid.toJid(),catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_MESSAGE_BUSINESS_BUTTON_CLICK,productId:e.id.toString()},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function k(e,t){var n,a=!1,i="";e.businessOwnerJid!=null&&(i=e.businessOwnerJid,a=o("WAWebUserPrefsMeUser").getMePnUserOrThrow().equals(o("WAWebWidFactory").createWid(i))),o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({isOwner:a,catalogOwnerJid:i,catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_QUOTED_PRODUCT_MESSAGE_SEND,catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_QUOTED_PRODUCT_MESSAGE_SEND,productId:e==null||(n=e.productId)==null?void 0:n.toString(),catalogSessionId:r("isStringNullOrEmpty")(t)?new(o("WAWebProductCatalogSession")).ProductCatalogSession().toString():t})}function I(e){var t=e.catalogContext,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_PRODUCT_COPY_LINK_CLICK,catalogOwnerJid:n.catalogWid.toJid(),catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_PRODUCT_COPY_LINK_CLICK,productId:n.id.toString()},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function T(e){var t=e.catalogContext,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogOwnerJid:n.catalogWid.toJid(),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_PRODUCT_VIA_WA_LINK_CLICK,catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_PRODUCT_VIA_WA_LINK_CLICK,productId:n.id.toString()},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function D(e){var t=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CATALOG_IN_CONVERSATION_CLICK,catalogEntryPoint:o("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT.CATALOG_ENTRY_POINT_ATTACHMENT_PANEL,catalogSessionId:e});t.commit()}function x(e){var t=e.catalogSessionId,n=e.product;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({product:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SEND_PRODUCT_MESSAGE,catalogOwnerJid:n.catalogWid.toJid(),catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SEND_PRODUCT_MESSAGE,catalogSessionId:t,productId:n.id.toString()})}function $(e){var t=e.catalogOwnerWid,n=e.catalogSessionId,r=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SEND_CATALOG_CLICK,catalogSessionId:n});r.commit()}function P(e){var t=e.catalogContext,n=e.catalogOwnerWid;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_CATALOG_COPY_LINK_CLICK,catalogOwnerJid:n.toJid(),catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_CATALOG_COPY_LINK_CLICK},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function N(e){var t=e.catalogContext,n=e.catalogOwnerWid;o("WAWebProductCatalogEventUtils").logCatalogViewOrBizEvent(babelHelpers.extends({catalogOwnerJid:n.toJid(),isOwner:o("WAWebProductCatalogEventUtils").isCatalogOwner({catalogOwnerWid:n}),catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_SHARE_CATALOG_VIA_WA_LINK_CLICK,catalogViewAction:o("WAWebWamEnumCatalogViewAction").CATALOG_VIEW_ACTION.ACTION_SHARE_CATALOG_VIA_WA_LINK_CLICK},o("WAWebProductCatalogContext").toDataForCatalogViewEvents(t)))}function M(e,t){var n={has_catalog:t},r=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_ADD_CLICKED,catalogSessionId:e.session.toString(),catalogEntryPoint:e.entryPoint,extraAttributes:JSON.stringify(n)});r.commit()}function w(e){var t=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_ADD_SUCCESS,catalogEntryPoint:e.entryPoint,catalogSessionId:e.session.toString()});t.commit()}function A(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_ADD_FAILED,catalogEntryPoint:e.entryPoint,catalogSessionId:e.session.toString(),errorCode:t});n.commit()}function F(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_EDIT_CLICKED,productId:e.id.toString(),catalogEntryPoint:t.entryPoint,catalogSessionId:t.session.toString()});n.commit()}function O(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_EDIT_SUCCESS,catalogEntryPoint:t.entryPoint,productId:e.id.toString(),catalogSessionId:t.session.toString()});n.commit()}function B(e,t,n){var r=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_EDIT_FAILED,catalogEntryPoint:t.entryPoint,productId:e.id.toString(),errorCode:n,catalogSessionId:t.session.toString()});r.commit()}function W(e,t,n){var r=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_DELETE_CLICKED,catalogEntryPoint:n.entryPoint,productId:e.id.toString(),productCount:t,catalogSessionId:n.session.toString()});r.commit()}function q(e,t,n){var r=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_DELETE_SUCCESS,catalogEntryPoint:n.entryPoint,productId:e.id.toString(),productCount:t,catalogSessionId:n.session.toString()});r.commit()}function U(e,t,n,r){var a=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_DELETE_FAILED,catalogEntryPoint:n.entryPoint,productId:e.id.toString(),productCount:t,errorCode:r,catalogSessionId:n.session.toString()});a.commit()}function V(e){var t=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_ONBOARD_IMPRESSION,catalogEntryPoint:e.entryPoint,catalogSessionId:e.session.toString()});t.commit()}function H(e){var t=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CREATE_PRODUCT_CATALOG,catalogEntryPoint:e.entryPoint,catalogSessionId:e.session.toString()});t.commit()}function G(e){var t=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CREATE_PRODUCT_CATALOG_SUCCESS,catalogEntryPoint:e.entryPoint,catalogSessionId:e.session.toString()});t.commit()}function z(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_CREATE_PRODUCT_CATALOG_FAILED,catalogEntryPoint:e.entryPoint,errorCode:t,catalogSessionId:e.session.toString()});n.commit()}function j(e){var t=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_APPEAL_PRODUCT_CLICKED,catalogEntryPoint:o("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT.CATALOG_ENTRY_POINT_SETTINGS,catalogSessionId:e});t.commit()}function K(e){var t=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_APPEAL_PRODUCT_SUCCESS,catalogEntryPoint:o("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT.CATALOG_ENTRY_POINT_SETTINGS,catalogSessionId:e});t.commit()}function Q(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_APPEAL_PRODUCT_FAILED,catalogEntryPoint:o("WAWebWamEnumCatalogEntryPoint").CATALOG_ENTRY_POINT.CATALOG_ENTRY_POINT_SETTINGS,errorCode:t,catalogSessionId:e});n.commit()}function X(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_MENU_CLICK,catalogEntryPoint:t==null?void 0:t.entryPoint,catalogSessionId:t==null?void 0:t.session.toString(),productId:e});n.commit()}function Y(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_HIDE_CLICKED,catalogEntryPoint:t.entryPoint,catalogSessionId:t.session.toString(),productId:e});n.commit()}function J(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_HIDE_SUCCESS,catalogEntryPoint:t.entryPoint,catalogSessionId:t.session.toString(),productId:e});n.commit()}function Z(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_HIDE_CANCELLED,catalogEntryPoint:t.entryPoint,catalogSessionId:t.session.toString(),productId:e});n.commit()}function ee(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_HIDE_FAILED,catalogEntryPoint:t.entryPoint,catalogSessionId:t.session.toString(),productId:e});n.commit()}function te(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_UNHIDE_CLICKED,catalogEntryPoint:t.entryPoint,catalogSessionId:t.session.toString(),productId:e});n.commit()}function ne(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_UNHIDE_SUCCESS,catalogEntryPoint:t.entryPoint,catalogSessionId:t.session.toString(),productId:e});n.commit()}function re(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_UNHIDE_CANCELLED,catalogEntryPoint:t.entryPoint,catalogSessionId:t.session.toString(),productId:e});n.commit()}function oe(e,t){var n=new(o("WAWebCatalogBizWamEvent")).CatalogBizWamEvent({catalogBizAction:o("WAWebWamEnumCatalogBizAction").CATALOG_BIZ_ACTION.ACTION_PRODUCT_UNHIDE_FAILED,catalogEntryPoint:t.entryPoint,catalogSessionId:t.session.toString(),productId:e});n.commit()}l.logBusinessProfileCatalogView=e,l.logProfileProductClick=s,l.logCarouselViewMoreClick=u,l.logCatalogListView=c,l.logCatalogShareLinkClick=d,l.logCatalogListDetailClick=m,l.logDetailImageClick=p,l.logDetailLinkClick=_,l.logImageCarouselModalView=f,l.logImageListClick=g,l.logFullImageView=h,l.logImageNavigate=y,l.logProductDetailView=C,l.logReportProductSuccess=b,l.logReportProductFailure=v,l.logProductInquiryClick=S,l.logProductMsgClick=R,l.logProductShareLinkClick=L,l.logProductMessageBusinessClick=E,l.logProductMessageBusinessSend=k,l.logShareProductCopyLinkClick=I,l.logShareProductViaWALinkClick=T,l.logCatalogAttachmentButtonClick=D,l.logProductMessageSent=x,l.logSendCatalogClick=$,l.logShareCatalogCopyLinkClick=P,l.logShareCatalogViaWALinkClick=N,l.logAddProductClick=M,l.logAddProductSuccess=w,l.logAddProductFailed=A,l.logEditProductClick=F,l.logEditProductSuccess=O,l.logEditProductFailed=B,l.logDeleteProductClick=W,l.logDeleteProductSuccess=q,l.logDeleteProductFailed=U,l.logCatalogOnboardImpression=V,l.logCreateProductCatalogClick=H,l.logCreateProductCatalogSuccess=G,l.logCreateProductCatalogFailed=z,l.logAppealProductCatalogClick=j,l.logAppealProductCatalogSuccess=K,l.logAppealProductCatalogFailed=Q,l.logCatalogContextMenuClick=X,l.logCatalogProductHideClick=Y,l.logCatalogProductHideSuccess=J,l.logCatalogProductHideCancelled=Z,l.logCatalogProductHideFailed=ee,l.logCatalogProductShowClick=te,l.logCatalogProductShowSuccess=ne,l.logCatalogProductShowCancelled=re,l.logCatalogProductShowFailed=oe}),98); __d("WAWebProductCatalogMetaLinkingGatingUtils",["fbt","WAWebABProps","WAWebBizGatingUtils","WAWebBusinessProfileCollection","WAWebBusinessProfileTypes","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){"use strict";function e(){return s._(/*BTDS*/"Cat\u00e1logo conectado. Visual\u00edzalo con la aplicaci\u00f3n m\u00f3vil de WhatsApp.")}function u(){if(!g())return!1;var e=o("WAWebBusinessProfileCollection").BusinessProfileCollection.get(o("WAWebUserPrefsMeUser").getMePnUserOrThrow());return h(e)}function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return g()?p(e):!1}),d.apply(this,arguments)}function m(){if(o("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled()||g())return!1;var e=o("WAWebBusinessProfileCollection").BusinessProfileCollection.get(o("WAWebUserPrefsMeUser").getMePnUserOrThrow());return h(e)}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebBusinessProfileCollection").BusinessProfileCollection.fetchBizProfile(e);return h(t)}),_.apply(this,arguments)}function f(e){return h(e)}function g(){return o("WAWebABProps").getABPropConfigValue("meta_catalog_linking_m2_enabled")}function h(e){var t;return y()?!0:o("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled()?!1:(e==null||(t=e.profileOptions)==null?void 0:t.commerceExperience)===o("WAWebBusinessProfileTypes").CommerceExperienceTypes.META_CATALOG}function y(){var e=window.location.search,t=new URLSearchParams(e);return t.get("force_disable_catalog")==="1"}l.getDisabledMetaLinkedCatalogTooltipText=e,l.shouldShowMetaLinkedDisabledCatalogTooltipForSelf=u,l.shouldShowMetaLinkedDisabledCatalogTooltip=c,l.shouldDisableCatalogDueToMetaLinkingForSelf=m,l.shouldDisableCatalogDueToMetaLinking=p,l.shouldDisableCatalogDueToMetaLinkingForProfile=f,l.linkedCatalogDisabledTooltipEnabled=g}),226); __d("WAWebDrawerManager",["WAWebDrawerManagerGlobalContext"],(function(t,n,r,o,a,i,l){var e=(function(){function e(){}var t=e.prototype;return t.openDrawerRight=function(t,n){var e;(e=o("WAWebDrawerManagerGlobalContext").getGlobalDrawerManager("right"))==null||e.openDrawer(t,n)},t.openDrawerMid=function(t,n){var e;(e=o("WAWebDrawerManagerGlobalContext").getGlobalDrawerManager("mid"))==null||e.openDrawer(t,n)},t.openDrawerLeft=function(t,n){var e;(e=o("WAWebDrawerManagerGlobalContext").getGlobalDrawerManager("left"))==null||e.openDrawer(t,n)},t.openDrawerFullscreen=function(t,n){var e;(e=o("WAWebDrawerManagerGlobalContext").getGlobalDrawerManager("fullscreen"))==null||e.openDrawer(t,n)},t.closeDrawerRight=function(){var e;(e=o("WAWebDrawerManagerGlobalContext").getGlobalDrawerManager("right"))==null||e.closeDrawer()},t.closeDrawerMid=function(){var e;(e=o("WAWebDrawerManagerGlobalContext").getGlobalDrawerManager("mid"))==null||e.closeDrawer()},t.closeDrawerLeft=function(){var e;(e=o("WAWebDrawerManagerGlobalContext").getGlobalDrawerManager("left"))==null||e.closeDrawer()},t.closeDrawerFullscreen=function(){var e;(e=o("WAWebDrawerManagerGlobalContext").getGlobalDrawerManager("fullscreen"))==null||e.closeDrawer()},e})(),s=new e;function u(){s.closeDrawerRight()}function c(){s.closeDrawerLeft()}l.DrawerManager=s,l.closeDrawerRight=u,l.closeDrawerLeft=c}),98); __d("WAWebFrontendConstants",[],(function(t,n,r,o,a,i){var e=100,l=1024,s=264;i.SCROLL_FUDGE=e,i.LAYOUT_2COLUMNS_MAX_WIDTH=l,i.QR_EDGE=s}),66); __d("WAWebBizProductCatalogAction",["WAWebBizCreateProductInquiry","WAWebBizProductCatalogBridge","WAWebBusinessProfileCollection","WAWebCatalogCollection","WAWebCatalogVariantHelper","WAWebCmd","WAWebComposeBoxActions","WAWebDrawerManager","WAWebFindChatAction","WAWebFrontendConstants","WAWebMsgCollection","WAWebStateUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t,n,r,o,a){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a,i){var l;n===void 0&&(n=100),r===void 0&&(r=100);var s,u,c,d=yield o("WAWebBusinessProfileCollection").BusinessProfileCollection.find(e),m=(l=o("WAWebCatalogCollection").CatalogCollection.get(e))==null?void 0:l.productCollection.get(t);return o("WAWebCatalogVariantHelper").shouldRequestVariantInfo(d,m)&&(s=o("WAWebCatalogVariantHelper").FULL_VARIANT_INFO_FIELDS,u=o("WAWebCatalogVariantHelper").VARIANT_THUMBNAIL_IMAGE_SIZE,c=o("WAWebCatalogVariantHelper").VARIANT_THUMBNAIL_IMAGE_SIZE),o("WAWebBizProductCatalogBridge").queryProduct(e,t,n,r,a,i,s,u,c)}),s.apply(this,arguments)}function u(e,t,n,r,a,i,l,s,u,c){return n===void 0&&(n=5),r===void 0&&(r=100),a===void 0&&(a=100),l===void 0&&(l=!1),o("WAWebBizProductCatalogBridge").queryCatalog(e,t,n,r,a,i,l,s,u,c)}function c(e,t,n,r,a){return n===void 0&&(n=100),r===void 0&&(r=100),o("WAWebBizProductCatalogBridge").queryProductList(e,t,n,r,a)}function d(e,t){return o("WAWebBizProductCatalogBridge").appealProduct(e,t)}function m(e,t,n){return o("WAWebBizProductCatalogBridge").reportProduct(e,t,n)}function p(e,t,n){return t===void 0&&(t=100),n===void 0&&(n=100),o("WAWebBizProductCatalogBridge").addProduct(e,t,n)}function _(e,t,n){return t===void 0&&(t=100),n===void 0&&(n=100),o("WAWebBizProductCatalogBridge").editProduct(e,t,n)}function f(e){return o("WAWebBizProductCatalogBridge").deleteProducts(e)}function g(e,t,n){var r=e.catalogWid;if(t){var a=t.productCollection.get(e.id),i=a?o("WAWebStateUtils").unproxy(a):o("WAWebStateUtils").unproxy(e);if(i){var l=i.getProductImageCollectionHead(),s=l==null?void 0:l.mediaData;s&&o("WAWebFindChatAction").findOrCreateLatestChat(r,"bizProductCatalogAction").then(function(e){var t=e.chat;o("WAWebCmd").Cmd.openChatFromUnread({chat:t}).then(function(e){if(e){var a=o("WAWebStateUtils").unproxy(o("WAWebBizCreateProductInquiry").createProductInquiry(i,t.id,r,s,n==null?void 0:n.session.toString()));o("WAWebMsgCollection").MsgCollection.add(a),t.composeQuotedMsg=a,o("WAWebComposeBoxActions").ComposeBoxActions.focus(t),window.innerWidth<=o("WAWebFrontendConstants").LAYOUT_2COLUMNS_MAX_WIDTH&&o("WAWebDrawerManager").DrawerManager.closeDrawerRight()}})})}}}l.queryProduct=e,l.queryCatalog=u,l.queryProductList=c,l.appealProduct=d,l.reportProduct=m,l.addProduct=p,l.editProduct=_,l.deleteProducts=f,l.sendProductToChat=g}),98); __d("WAWebCatalogVariantHelper",["fbt","$InternalEnum","WAWebBizGatingUtils","WAWebLinkedCatalogHelper"],(function(t,n,r,o,a,i,l,s){"use strict";var e=100,u="listing_details,types,availability,variant_properties";function c(e,t){var n,r=t!=null&&t.variantInfo!=null&&((n=t.variantInfo.listing_details)==null?void 0:n.description)==null&&t.variantInfo.variant_properties==null;return!!(!r&&e&&o("WAWebLinkedCatalogHelper").isLinkedCatalog(e.id)&&o("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled())}var d=n("$InternalEnum")({COLOR:"color",SIZE:"size",MATERIAL:"material",PATTERN:"pattern",GENDER:"gender",AGE_GROUP:"age group"});function m(e,t){var n=d.cast(e.toLocaleLowerCase("en-US"));if(n==null)return e;switch(n){case d.COLOR:return t==null?s._(/*BTDS*/"Color"):s._(/*BTDS*/"_j{\"*\":\"{number} colores\",\"_1\":\"Color\"}",[s._plural(t,"number")]);case d.SIZE:return s._(/*BTDS*/"Tama\u00f1o");case d.MATERIAL:return s._(/*BTDS*/"Material");case d.PATTERN:return s._(/*BTDS*/"Patr\u00f3n");case d.GENDER:return s._(/*BTDS*/"Sexo");case d.AGE_GROUP:return s._(/*BTDS*/"Grupo de edad")}}l.VARIANT_THUMBNAIL_IMAGE_SIZE=e,l.FULL_VARIANT_INFO_FIELDS=u,l.shouldRequestVariantInfo=c,l.VariantOptionName=d,l.getVariantTypeOptions=m}),226); __d("WAWebProductCatalogLogQplEvents",["WAWebQplQuickPerformanceLoggerMarkerIds","WAWebQplQuickPerformanceLoggerModule"],(function(t,n,r,o,a,i,l){function e(e){o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_PRODUCT_MESSAGE_SEND,e)}function s(e){o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CATALOG_VIEW,e)}l.qplPointProductMessageSend=e,l.qplPointCatalogView=s}),98); __d("WAWebCatalogCollection",["Promise","WALogger","WAWebBackendErrors","WAWebBaseCollection","WAWebBizGatingUtils","WAWebBizProductCatalogAction","WAWebBizProductCatalogBridge","WAWebCatalogModel","WAWebCatalogVariantHelper","WAWebLidMigrationUtils","WAWebMsgGetters","WAWebProductCatalogLogQplEvents","WAWebQplQuickPerformanceLoggerModule","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","err","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e,s,u,c=(function(t){function a(){for(var e,n=arguments.length,r=new Array(n),o=0;o=n.t)&&!(i!=null&&i.fetchedFromServer)){var s=o("WAWebBizProductCatalogBridge").mapMsgToProductModel(n);return t.prototype.add.call(this,{id:r,afterCursor:void 0,_msgs:[s],stale:!0,fetchedFromServer:!!l},{merge:!0})}}},i._queryProduct=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var a=e.canLogQpl,i=e.catalogWid,l=e.height,s=e.productId,c=e.productMsgMediaData,d=e.shouldFetchComplianceFields,m=e.width,p=yield o("WAWebBizProductCatalogAction").queryProduct(i,s,m,l,d,a);if(p.error==="NOT_FOUND"){var _=this.get(i);return _==null||_.productCollection.remove(s),(u||(u=n("Promise"))).reject(new(o("WAWebBackendErrors")).E404("CatalogCollection:findProduct:_queryProduct NOT_FOUND"))}if(!p.data)return t.prototype.add.call(this,{id:i,afterCursor:void 0});var f=p.data;if(!f.image_cdn_urls)return(u||(u=n("Promise"))).reject(r("err")("CatalogCollection:findProduct:_queryProduct: could not find image_cdn_urls for product"));var g=o("WAWebBizProductCatalogBridge").mapProductResponseToModel(f,i);if(g.productMsgMediaData=c,g.variantInfo!=null){var h;((h=this.get(i))==null?void 0:h.productCollection.get(f.id))==null&&(g.displayPriority=1)}var y=[g];return t.prototype.add.call(this,{id:i,afterCursor:void 0,_products:y,_msgs:y},{merge:!0})});function a(t){return e.apply(this,arguments)}return a})(),i.findProduct=function(t){var e=t.canLogQpl,o=t.catalogWid,a=t.productId,i=t.productMsgMediaData,l=t.shouldFetchComplianceFields,s=this.convertCatalogIdForLidMigration(o);return r("isStringNullOrEmpty")(a)?(u||(u=n("Promise"))).reject(r("err")("CatalogCollection:findProduct Received productId type "+(a===void 0?"undefined":"null"))):this._queryProduct({catalogWid:s,productId:a,productMsgMediaData:i,shouldFetchComplianceFields:l,canLogQpl:e})},i._queryCatalog=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a,i,l,s,c){var d=t?t.index:0;c&&o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(c,"datasource_catalog_start");var m,p,_;try{o("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled()&&(m=o("WAWebCatalogVariantHelper").FULL_VARIANT_INFO_FIELDS,p=o("WAWebCatalogVariantHelper").VARIANT_THUMBNAIL_IMAGE_SIZE,_=o("WAWebCatalogVariantHelper").VARIANT_THUMBNAIL_IMAGE_SIZE);var f=yield o("WAWebBizProductCatalogAction").queryCatalog(a,i,10,void 0,void 0,l,s,m,p,_);if(c&&o("WAWebQplQuickPerformanceLoggerModule").QPL.markerPoint(c,"datasource_catalog_end"),this.hasSelfCatalogErrorEmailMask()&&this.shouldUseCatalogErrorEmailMask(a)&&this.resetSelfCatalogErrorEmailMask(),!f.data.length)return{id:a,afterCursor:""};var g=[];f.data.forEach(function(e){e.image_cdn_urls&&g.push(o("WAWebBizProductCatalogBridge").mapProductResponseToModel(e,a))});var h={type:"success",catalog:f};this.trigger("catalog-loaded",h);var y=this.get(a);return y&&y.catalogId!=null&&f.catalog_id!=null&&y.catalogId!==f.catalog_id&&o("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled()&&this.remove(a),{id:a,afterCursor:f.paging.cursors.after,_products:g,catalogId:f.catalog_id,catalogType:f.catalog_type,catalogName:f.catalog_name,fetchedFromServer:!0,index:d+g.length}}catch(t){if(t instanceof o("WAWebBackendErrors").AdAccountRecoveryRequiredError&&this.shouldUseCatalogErrorEmailMask(a)){if(r("isStringNullOrEmpty")(t.emailMask))return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Catalog:AdAccountRecoveryRequiredError received empty email mask"]))).sendLogs("catalog email mask empty"),(u||(u=n("Promise"))).reject(new(o("WAWebBackendErrors")).AdAccountRecoveryRequiredEmailMaskEmptyError);this.updateSelfCatalogErrorEmailMask(t.emailMask)}else if(t instanceof o("WAWebBackendErrors").CatalogIncorrectNonceError&&this.shouldUseCatalogErrorEmailMask(a)){var C={type:"incorrect-nonce"};return this.trigger("catalog-loaded",C),(u||(u=n("Promise"))).reject(t)}else if(this.hasSelfCatalogErrorEmailMask()&&this.shouldUseCatalogErrorEmailMask(a)&&this.resetSelfCatalogErrorEmailMask(),t instanceof o("WAWebBackendErrors").ServerStatusCodeError&&t.statusCode===404){var b=this.get(a);b!=null&&o("WAWebBizGatingUtils").isCatalogVariantsViewingEnabled()&&this.remove(a)}var v={type:"error"};return this.trigger("catalog-loaded",v),(u||(u=n("Promise"))).reject(t)}});function a(e,n,r,o,a,i){return t.apply(this,arguments)}return a})(),i._findImplCommon=function(t,n){var e=this.get(t),a=e&&!e.stale?e.afterCursor:void 0,i=t instanceof r("WAWebWid")?t:o("WAWebWidFactory").createWid(t.toString());return this._queryCatalog(e,i,a,void 0,void 0,n==null?void 0:n.markerId)},i.findCarouselCatalog=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n=this.convertCatalogIdForLidMigration(e),r=this.get(n);r&&r.set({index:0});var o=yield this._queryCatalog(r,n,void 0,void 0,!1);return r&&r.markProductCollectionOld(),t.prototype.add.call(this,o,{merge:!0})});function r(t){return e.apply(this,arguments)}return r})(),i.findNextProductPage=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=this.convertCatalogIdForLidMigration(e);t===!0&&o("WAWebProductCatalogLogQplEvents").qplPointCatalogView("datasource_start");var r=yield this.update(n);t===!0&&o("WAWebProductCatalogLogQplEvents").qplPointCatalogView("datasource_end");var a=Array.isArray(r)?r[0]:r;return a.productCollection.getProductModels()});function t(t,n){return e.apply(this,arguments)}return t})(),i.findCollectionMembership=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,n){var r=this.convertCatalogIdForLidMigration(e),o=this.get(r),a=o&&!o.stale?o.afterCursor:void 0,i=yield this._queryCatalog(o,r,a,n);t.prototype.add.call(this,i,{merge:!0}),o=this.get(r),o&&(o.stale=!1)});function r(t,n){return e.apply(this,arguments)}return r})(),i.removeCatalog=function(t){var e=this.convertCatalogIdForLidMigration(t),n=this.get(e);n?this.remove(e):o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Catalog data cleanup called on a non-existent catalogId"])))},i.get=function(n){return t.prototype.get.call(this,this.convertCatalogIdForLidMigration(n))},i.assertGet=function(n){return t.prototype.assertGet.call(this,this.convertCatalogIdForLidMigration(n))},i.convertCatalogIdForLidMigration=function(t){var e=t instanceof r("WAWebWid")?t:o("WAWebWidFactory").createWid(t.toString());if(!o("WAWebBizGatingUtils").isLidMigrationForCatalogEnabled())return e;if(e.isLid()){var n=o("WAWebLidMigrationUtils").toPn(e);if(n!=null)return n}return e},i.getSelfCatalogErrorEmailMask=function(){return this.selfCatalogErrorEmailMask},i.updateSelfCatalogErrorEmailMask=function(t){this.selfCatalogErrorEmailMask=t,this.trigger("change:selfCatalogErrorEmailMask")},i.resetSelfCatalogErrorEmailMask=function(){this.updateSelfCatalogErrorEmailMask(null)},i.hasSelfCatalogErrorEmailMask=function(){return this.selfCatalogErrorEmailMask!=null},i.shouldUseCatalogErrorEmailMask=function(t){return!(t==null||!o("WAWebUserPrefsMeUser").isMeAccount(t)||!o("WAWebBizGatingUtils").catalogTokenRecoveryEnabled())},a})(o("WAWebBaseCollection").BaseCollection);c.model=r("WAWebCatalogModel"),c.staleCollection=!0;var d=new c;l.CatalogCollection=d}),98); __d("WAWebCatalogModel",["WANullthrows","WAWebBaseModel","WAWebBizProductCatalogAction","WAWebBizProductCatalogBridge","WAWebCatalogCollection","WAWebProductCollCollection","WAWebProductCollection","WAWebProductModel","WAWebWid","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a=200&&n.status<300)?t(new(o("WAWebMiscErrors")).CatalogImageDownloadError):n});return function(e){return t.apply(this,arguments)}})()),u=l.result;o("WAWebMediaStore").LruMediaStore.put(t,u),this._processAndUpdateMediaData(u)}catch(e){o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Failed to fetch ",""])),this.mediaUrl),this.mediaData.set({mediaStage:o("WAWebMediaTypes").MediaDataStage.ERROR_MISSING})}}});function t(){return e.apply(this,arguments)}return t})(),i.markOld=function(){this.old=!0},i.evictFromCache=function(){if(this.mediaUrl){var e=f(this.mediaUrl);o("WAWebMediaStore").LruMediaStore.del(e)}},a})(o("WAWebBaseModel").BaseModel);g.Proxy="productImage";var h=o("WAWebBaseModel").defineModel(g);l.STATIC_WHATSAPP_IMAGE_URI=c,l.ProductImage=h}),98); __d("WAWebProductModel",["WAWebBaseModel","WAWebBizGatingUtils","WAWebFileUtils","WAWebMediaData","WAWebMediaTypes","WAWebProductImageCollection"],(function(t,n,r,o,a,i,l){var e=0,s=4503599627370496,u=10,c=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;an}).forEach(function(e){return e.markOld()})},n.triggerMainImageUpdate=function(){if(this.imageCdnUrl!=null&&this.imageCdnUrl!=="")this.productImageCollection.gadd({id:"_0",mediaUrl:this.imageCdnUrl,fetchedFromServer:this.fetchedFromServer,old:!1},{merge:!0});else{var e;(e=this.productImageCollection.get("_0"))==null||e.markOld()}},n.initImageUpdate=function(){if(!this.fetchedFromServer&&this.productMsgMediaData){for(var e=0;eg){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["getBotProfilesFromServer: exceed max number of UGC bot: ",""])),n).sendLogs("exceed-max-ugc-bots"),C();return}o("WAWebUserPrefsBot").setUgcBotListLastBhash(t.botBhash),e=t.botList}}else e=yield o("WAWebRequestBotList").requestBotList();var r=yield o("WAWebRequestBotProfiles").requestBotProfiles(e);yield o("WAWebPersistBotProfiles").persistBotProfiles(r),C()}),y.apply(this,arguments)}function C(){o("WAWebBotGating").isUgcBotEnabled()?o("WAWebUserPrefsBot").setUgcBotListLastRequestedTimestamp(o("WATimeUtils").unixTime()):o("WAWebUserPrefsBot").setBotListLastRequestedTimestamp(o("WATimeUtils").unixTime())}l.initializeBots=_}),98); __d("WAWebPersistBotProfiles",["WAWebBotProfileCollection","WAWebSchemaBotProfile","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=["commands","id","prompts"];function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){yield o("WAWebSchemaBotProfile").getBotProfileTable().bulkCreateOrMerge(t.map(function(t){var n=t.commands,r=t.id,o=t.prompts,a=babelHelpers.objectWithoutPropertiesLoose(t,e);return babelHelpers.extends({id:r.toString(),prompts:JSON.stringify(o),commands:JSON.stringify(n)},a)})),t.forEach(function(e){return o("WAWebBotProfileCollection").BotProfileCollection.gadd(babelHelpers.extends({id:e.id},e))})}),u.apply(this,arguments)}l.persistBotProfiles=s}),98); __d("WAWebCreateBizBotSysMsgAction",["WAWebBotSystemMsg","WAWebBotTypes","WAWebDBProcessMessage","WAWebMsgModelFromData","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.bizBotSystemMsgType!==o("WAWebBotTypes").BizBotType.BIZ_1P){var t=o("WAWebBotSystemMsg").genBizBot1pDisclosureMessage(e.id);e.msgs.add(o("WAWebMsgModelFromData").msgModelFromMsgData(t)),yield o("WAWebDBProcessMessage").storeMessages([t],e.id),yield e.updateBizBotSysMsgCreated(o("WAWebBotTypes").BizBotType.BIZ_1P)}}),s.apply(this,arguments)}l.maybeCreateBizBot1pDisclosureSysMsg=e}),98); __d("WAWebHandleBizBotAutomatedTypeAction",["WAWebApiBusinessProfile","WAWebBotGating","WAWebBotSystemMsg","WAWebBotTos","WAWebBotTypes","WAWebBotUtils","WAWebChatCollection","WAWebContactSystemMsg","WAWebDBProcessMessage","WAWebMsgModelFromData","WAWebPrivacyModeSystemMsg","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){function e(e,t,n){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=o("WAWebChatCollection").ChatCollection.get(e);if(r&&!o("WAWebBotUtils").isMetaAiBot(e)){var a=t;if(!a){var i,l=yield o("WAWebApiBusinessProfile").getBusinessProfileRow(e.toString());a=(i=o("WAWebBotTypes").BizBotAutomatedType.cast(l==null?void 0:l.automatedType))!=null?i:o("WAWebBotTypes").BizBotAutomatedType.UNKNOWN}var s=n!=null?n:o("WAWebBotTypes").BizBotAutomatedType.UNKNOWN;a!==s&&(a===o("WAWebBotTypes").BizBotAutomatedType.UNKNOWN&&s===o("WAWebBotTypes").BizBotAutomatedType.PARTIAL_1P?yield u(r):a===o("WAWebBotTypes").BizBotAutomatedType.UNKNOWN&&s===o("WAWebBotTypes").BizBotAutomatedType.FULL_3P?yield d(r):a===o("WAWebBotTypes").BizBotAutomatedType.FULL_3P&&s===o("WAWebBotTypes").BizBotAutomatedType.UNKNOWN&&(yield p(r)))}}),s.apply(this,arguments)}function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!(!o("WAWebBotTos").hasAcceptedBizBotTos()||e.bizBotSystemMsgType===o("WAWebBotTypes").BizBotType.BIZ_1P)){var t=o("WAWebBotSystemMsg").genBizBot1pDisclosureMessage(e.id);if(yield o("WAWebDBProcessMessage").storeMessages([t],t.id.remote),o("WAWebBotGating").isBizBot1pEnabled()){var n=o("WAWebMsgModelFromData").msgModelFromMsgData(t);e.msgs.add(n)}yield e.updateBizBotSysMsgCreated(o("WAWebBotTypes").BizBotType.BIZ_1P)}}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!(!o("WAWebBotTos").hasAcceptedBizBotTos()||e.bizBotSystemMsgType===o("WAWebBotTypes").BizBotType.BIZ_3P)){var t=o("WAWebBotSystemMsg").genBizBot3pDisclosureMessage(e.id);yield o("WAWebDBProcessMessage").storeMessages([t],t.id.remote);var n=o("WAWebMsgModelFromData").msgModelFromMsgData(t);e.msgs.add(n),yield e.updateBizBotSysMsgCreated(o("WAWebBotTypes").BizBotType.BIZ_3P)}}),m.apply(this,arguments)}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.bizBotSystemMsgType!=null){var t=e.id,n,a=o("WAWebPrivacyModeSystemMsg").getReducedPrivacyMode(e.contact.privacyMode);switch(a){case o("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.E2EE:n=o("WAWebContactSystemMsg").genEncryptNotificationMsg(t,"encrypt_now");break;case o("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.BSP:n=o("WAWebContactSystemMsg").genNonE2ENotificationMsg(t,"biz_privacy_mode_to_bsp");break;case o("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.FB:n=o("WAWebContactSystemMsg").genNonE2ENotificationMsg(t,"biz_privacy_mode_to_fb");break;case o("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.HOSTED_GROUP:n=o("WAWebContactSystemMsg").genNonE2ENotificationMsg(t,"is_capi_hosted_group");break}if(!n)throw r("err")("Unhandled privacy mode");yield o("WAWebDBProcessMessage").storeMessages([n],n.id.remote);var i=o("WAWebMsgModelFromData").msgModelFromMsgData(n);e.msgs.add(i),yield e.updateBizBotSysMsgCreated(null)}}),_.apply(this,arguments)}l.handleBizBotAutomatedTypeTransition=e}),98); __d("WAWebHandleBizBotWelcomeMsgProtocolModeAction",["WAWebApiBusinessProfile","WAWebBotGating","WAWebBotTypes","WAWebBotWelcomeRequestSync","WAWebChatCollection","WAWebSyncdCoreApi","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t,n){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(o("WAWebBotGating").isBizBot3pAvailable()){var r=o("WAWebChatCollection").ChatCollection.get(e);if(r){var a=t;if(!a){var i,l=yield o("WAWebApiBusinessProfile").getBusinessProfileRowLidAware(e.toString());a=(i=o("WAWebBotTypes").BotWelcomeMsgProtocolModeType.cast(l==null?void 0:l.welcomeMsgProtocolMode))!=null?i:o("WAWebBotTypes").BotWelcomeMsgProtocolModeType.NONE}var s=n!=null?n:o("WAWebBotTypes").BotWelcomeMsgProtocolModeType.NONE;a!==s&&s===o("WAWebBotTypes").BotWelcomeMsgProtocolModeType.NONE&&(yield u(r))}}}),s.apply(this,arguments)}function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.hasRequestedWelcomeMsg){e.hasRequestedWelcomeMsg=!1;var t=yield r("WAWebBotWelcomeRequestSync").getBotWelcomeRequestSetMutation(e.id,!1);yield o("WAWebSyncdCoreApi").lockForSync(["chat"],[t],(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t[0];return n.merge(e.id.toString(),{hasRequestedWelcomeMsg:!1})});return function(e){return t.apply(this,arguments)}})())}}),c.apply(this,arguments)}l.handleBizBotWelcomeMsgProtocolModeTransition=e}),98); __d("WAWebBotProfileAction",["WAWebRequestBotProfiles","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=(yield o("WAWebRequestBotProfiles").requestBotProfiles([{id:e,isDefault:!1}]))[0];return t}),s.apply(this,arguments)}l.queryBotProfile=e}),98); __d("WAWebBotProfileCollection",["WALogger","WAWebBaseCollection","WAWebBotGating","WAWebBotProfileAction","WAWebBotProfileModel","WAWebPersistBotProfiles","WAWebWidFactory","asyncToGeneratorRuntime","cr:10195"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p=(function(t){function r(){return t.apply(this,arguments)||this}babelHelpers.inheritsLoose(r,t);var a=r.prototype;return a.getDefaultBot=function(){return this.findFirst(function(e){return e.isDefault===!0})},a.findImpl=function(t){return this.$BotProfileCollectionImpl$p_1(t)},a.update=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var r,a;if(!t.isFbidBot()){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["update only supports FBID bots"])));return}var i=(r=(a=this.get(t))==null?void 0:a.lastUpdateTs)!=null?r:0;if(i+o("WAWebBotGating").ugcBotProfileSyncInterval()>Date.now()){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[BotProfileCollection] skip updating bot profile"])));return}o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[BotProfileCollection] updating bot profile"]))),yield this.$BotProfileCollectionImpl$p_1(t)});function r(e,n){return t.apply(this,arguments)}return r})(),a.$BotProfileCollectionImpl$p_1=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebWidFactory").createWidFromWidLike(e);if(!t.isFbidBot())return o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["_findAndParse only supports FBID bots"]))),null;var n=yield o("WAWebBotProfileAction").queryBotProfile(t);return o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[BotProfileCollection] query bot profile"]))),n?(yield o("WAWebPersistBotProfiles").persistBotProfiles([n]),babelHelpers.extends({},n)):(o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["Unable to find bot profile with id"]))),null)});function t(t){return e.apply(this,arguments)}return t})(),r})(o("WAWebBaseCollection").BaseCollection);p.model=r("WAWebBotProfileModel");var _=new p;l.BotProfileCollection=_}),98); __d("WAWebBotProfileModel",["WAWebBaseModel","WAWebContactCollection","WAWebWid"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0){var n=yield o("WAWebDBLabelAssociationDatabaseApi").queryLabelAssociationsForLabelIds(t.labels),a=new Set;for(var i of n)i.type===o("WAWebSchemaLabelAssociation").LabelAssociationType.Jid&&r("WAWebWid").isStringLid(i.associationId)&&a.add(i.associationId);return{id:t.id,labels:t.labels,recipients:Array.from(a)}}return{id:t.id,labels:t.labels,recipients:t.recipients}});return function(t){return e.apply(this,arguments)}})(),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.SKIP}).waitUntilCompleted({broadcastWid:e})}l.getBroadcastMetadataJob=e}),98); __d("WAWebBroadcastMetadataCollection",["WALogger","WAWebBaseCollection","WAWebBaseModel","WAWebBroadcastDatabaseJob","WAWebBroadcastMetadataModel","WAWebLabelCollection","WAWebListItemParentType","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=(function(t){function r(){var e;return e=t.call(this)||this,e.findImpl=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n,r=o("WAWebWidFactory").createWid(o("WAWebBaseModel").idTypeToString(e)),a=yield o("WAWebBroadcastDatabaseJob").getBroadcastMetadataJob(r);if(a==null)return{id:r,labels:[],recipients:[]};var i=(t=(n=a.recipients)==null?void 0:n.map(function(e){return{id:o("WAWebWidFactory").createWid(e)}}))!=null?t:[];return{id:o("WAWebWidFactory").createWid(a.id),labels:a.labels,recipients:i}});return function(t){return e.apply(this,arguments)}})(),o("WAWebLabelCollection").LabelCollection.forEach(function(t){e.$BroadcastMetadataCollection$p_1(t)}),e.listenTo(o("WAWebLabelCollection").LabelCollection,"add",function(t){e.$BroadcastMetadataCollection$p_1(t)}),e.listenTo(o("WAWebLabelCollection").LabelCollection,"remove",function(t){e.stopListening(t.labelItemCollection)}),e}babelHelpers.inheritsLoose(r,t);var a=r.prototype;return a.$BroadcastMetadataCollection$p_1=function(t){var e=this;this.listenTo(t.labelItemCollection,"add remove",function(t){e.$BroadcastMetadataCollection$p_2(t)})},a.$BroadcastMetadataCollection$p_2=function(n){var t=this;if(n.parentType===o("WAWebListItemParentType").LabelItemParentType.Contact){var r=n.labelId;this.forEach(function(n){var a,i=(a=n.get("labels"))!=null?a:[];i.includes(r)&&t.findImpl(n.id).then(function(e){var r=t.get(n.id);r!=null&&(r.set("labels",e.labels),r.recipients.reset(),e.recipients.forEach(function(e){r.recipients.add({id:e.id})}))}).catch(function(t){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[broadcast-meta] update failed on label change"]))).verbose().sendLogs("broadcast-metadata-collection-failed-to-update-metadata")})})}},r})(o("WAWebBaseCollection").BaseCollection);s.model=r("WAWebBroadcastMetadataModel"),s.staleCollection=!0;var u=new s;l.default=u}),98); __d("WAWebBroadcastMetadataModel",["WAWebBaseModel","WAWebBroadcastRecipientCollection","WAWebWid"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,a=new Array(n),i=0;i=n)return this.remove(t),!1}if(e!=null){var o=e.intervals[0];if(o!=null){var a=Date.now()-e.lastAttempt;if(a0&&(yield o("WAWebDBEphemeralMessage").convertMessageNotEphemeralForContactWithEphmeralityDisabled({messageId:a.id.toString(),contactId:t.contact.id.toString()}),a.ephemeralDuration=0,a.ephemeralStartTimestamp=void 0,a.ephemeralSettingTimestamp=void 0,a.ephemeralOutOfSync=void 0,a.ephemeralSettingUser=void 0),r==null||r.duration===0){o("WALogger").LOG(k||(k=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] Resolving disabled ephemerality: local chat not ephemeral"])));return}if(n==null||n.duration===0){o("WALogger").LOG(I||(I=babelHelpers.taggedTemplateLiteralLoose(["[DMResolve] Resolving disabled ephemerality: incoming msg not ephemeral"])));return}yield o("WAWebUpdateEphemeralSettingChatAction").updateChatEphemeralSettings(t,{ephemeralSettingTimestamp:o("WAWebEphemeralityResolver").resolveSettingTimestamp(n.settingTimestamp),ephemeralDuration:0,disappearingModeInitiator:o("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByOther,disappearingModeTrigger:o("WAWebEphemeralityTypes").DisappearingModeTrigger.Unknown,disappearingModeInitiatedByMe:!1}),yield o("WAWebEphemeralGenerateSystemMessage").generateEphemeralNotificationTemplateSystemMessage(t,0,t.contact.id)}),V.apply(this,arguments)}var H=w;l.processEphemeralSyncResponse=P,l.syncEphemeralSetting=W,l._sendEphemeralSyncResponse=H}),98); __d("WAWebEphemeralFbtKicTypes",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum").Mirrored(["SettingChangeByOthers","SettingChangeByYou","SettingChangeByUnknown","SettingChangeByOthersAsAdmin","SettingChangeByYouAsAdmin","SettingChangeByUnknownAsAdmin","Duration","OutOfSyncInfo","Explanation","ModeChangeByOthers","ModeChangeByYou"]);i.EphemeralStringType=e}),66); __d("WAWebEphemeralFbtKicHoursDaysHelpers",["fbt","WALogger","WAWebEphemeralFbtKicTypes","WAWebMiscGatingUtils"],(function(t,n,r,o,a,i,l,s){var e,u,c,d;function m(t,n,r){var a=o("WAWebMiscGatingUtils").isDefaultDisappearingMessagesEnabled();return t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&r!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(n,"number_of_hours"),s._param("person-name",r)]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYou?s._(/*BTDS*/"_j{\"*\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(n,"number_of_hours")]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknown?s._(/*BTDS*/"_j{\"*\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(n,"number_of_hours")]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&r!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(n,"number_of_hours"),s._param("person-name",r)]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYouAsAdmin?s._(/*BTDS*/"_j{\"*\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(n,"number_of_hours")]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknownAsAdmin?s._(/*BTDS*/"_j{\"*\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(n,"number_of_hours")]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Duration?s._(/*BTDS*/"_j{\"*\":\"{number_of_hours} horas\",\"4\":\"{number_of_hours} hora\",\"_1\":\"1 hora\"}",[s._plural(n,"number_of_hours")]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.OutOfSyncInfo?s._(/*BTDS*/"_j{\"*\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\",\"4\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\",\"_1\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de 1 hora de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\"}",[s._plural(n,"number_of_hours")]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Explanation?s._(/*BTDS*/"_j{\"*\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(n,"number_of_hours")]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByOthers?a?s._(/*BTDS*/"_j{\"*\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\",\"4\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\",\"_1\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\"}",[s._plural(n,"number_of_hours"),s._param("person-name",r)]):s._(/*BTDS*/"_j{\"*\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\",\"4\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\",\"_1\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\"}",[s._plural(n,"number_of_hours"),s._param("person-name",r)]):t===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByYou&&a?s._(/*BTDS*/"_j{\"*\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\",\"4\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\",\"_1\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\"}",[s._plural(n,"number_of_hours")]):(o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnHoursString is given type "," and name ",""])),t,r).sendLogs("invalid-ephemeral-string-type"),"")}function p(e,t,n){var r=o("WAWebMiscGatingUtils").isDefaultDisappearingMessagesEnabled();return e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_days"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYou?s._(/*BTDS*/"_j{\"*\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_days")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknown?s._(/*BTDS*/"_j{\"*\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_days")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_days"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYouAsAdmin?s._(/*BTDS*/"_j{\"*\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_days")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknownAsAdmin?s._(/*BTDS*/"_j{\"*\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_days")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Duration?s._(/*BTDS*/"_j{\"*\":\"{number_of_days} d\\u00edas\",\"4\":\"{number_of_days} d\\u00eda\",\"_1\":\"1 d\\u00eda\"}",[s._plural(t,"number_of_days")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.OutOfSyncInfo?s._(/*BTDS*/"_j{\"*\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\",\"4\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\",\"_1\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\"}",[s._plural(t,"number_of_days")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Explanation?s._(/*BTDS*/"_j{\"*\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos\",\"4\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos\",\"_1\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos\"}",[s._plural(t,"number_of_days")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByOthers?r?s._(/*BTDS*/"_j{\"*\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\",\"4\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\",\"_1\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\"}",[s._plural(t,"number_of_days"),s._param("person-name",n)]):s._(/*BTDS*/"_j{\"*\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\",\"4\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\",\"_1\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\"}",[s._plural(t,"number_of_days"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByYou&&r?s._(/*BTDS*/"_j{\"*\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\",\"4\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\",\"_1\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\"}",[s._plural(t,"number_of_days")]):(o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnDaysString is given type "," and name ",""])),e,n).sendLogs("invalid-ephemeral-string-type"),"")}function _(e,t,n){return e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_hours"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} horas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_hours} hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 hora de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_hours"),s._param("person-name",n)]):(o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnHoursL10nComponent is given type "," and name ",""])),e,n).sendLogs("invalid-ephemeral-string-type"),"")}function f(e,t,n){return e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_days"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00edas de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_days} d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 d\\u00eda de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_days"),s._param("person-name",n)]):(o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnDaysL10nComponent is given type "," and name ",""])),e,n).sendLogs("invalid-ephemeral-string-type"),"")}l.getEphemeralOnHoursString=m,l.getEphemeralOnDaysString=p,l.getEphemeralOnHoursComponent=_,l.getEphemeralOnDaysComponent=f}),226); __d("WAWebEphemeralFbtKic",["fbt","WALogger","WAWebContactCollection","WAWebContactGetters","WAWebEphemeralFbtKicHoursDaysHelpers","WAWebEphemeralFbtKicTypes","WAWebFrontendContactGetters","WAWebMiscGatingUtils"],(function(t,n,r,o,a,i,l,s){var e,u,c,d,m,p,_,f;function g(e,t){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers,e,t)}function h(e,t){return e===void 0&&(e=0),N(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers,e,t)}function y(e){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYou,e)}function C(e){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknown,e)}function b(e,t){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin,e,t)}function v(e,t){return e===void 0&&(e=0),N(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin,e,t)}function S(e){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYouAsAdmin,e)}function R(e){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknownAsAdmin,e)}function L(e){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Duration,e)}function E(e){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.OutOfSyncInfo,e)}function k(e){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Explanation,e)}function I(e,t){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByOthers,e,t)}function T(e){return e===void 0&&(e=0),D(o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByYou,e)}function D(t,n,r){if(n===void 0&&(n=0),n<0)return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralString "," is given invalid duration ",""])),t,n).sendLogs("invalid-duration"),"";if(n===0)return x(t,r);if(n<=60)return $(t,n,r);if(n<3600){var a=Math.floor(n/60);return P(t,a,r)}else if(n<=1440*60){var i=Math.floor(n/60/60);return o("WAWebEphemeralFbtKicHoursDaysHelpers").getEphemeralOnHoursString(t,i,r)}var l=Math.floor(n/24/60/60);return o("WAWebEphemeralFbtKicHoursDaysHelpers").getEphemeralOnDaysString(t,l,r)}function x(e,t){return e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&t!=null?s._(/*BTDS*/"{person-name} desactiv\u00f3 los mensajes temporales.",[s._param("person-name",t)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYou?s._(/*BTDS*/"Desactivaste los mensajes temporales."):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknown?s._(/*BTDS*/"Se desactivaron los mensajes temporales."):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&t!=null?s._(/*BTDS*/"{person-name} desactiv\u00f3 los mensajes temporales. Haz clic para cambiar esto.",[s._param("person-name",t)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYouAsAdmin?s._(/*BTDS*/"Desactivaste los mensajes temporales. Haz clic para cambiar esto."):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknownAsAdmin?s._(/*BTDS*/"Se desactivaron los mensajes temporales. Haz clic para cambiar esto."):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Duration?s._(/*BTDS*/"Desactivados"):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.OutOfSyncInfo?s._(/*BTDS*/"Este mensaje no desaparecer\u00e1 del chat. Es posible que el remitente tenga una versi\u00f3n desactualizada de WhatsApp."):(o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOffString is given invalid type ",""])),e).sendLogs("invalid-ephemeral-string-type"),"")}function $(e,t,n){var r=o("WAWebMiscGatingUtils").isDefaultDisappearingMessagesEnabled();return e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_seconds"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYou?s._(/*BTDS*/"_j{\"*\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_seconds")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknown?s._(/*BTDS*/"_j{\"*\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_seconds")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_seconds"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYouAsAdmin?s._(/*BTDS*/"_j{\"*\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_seconds")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknownAsAdmin?s._(/*BTDS*/"_j{\"*\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_seconds")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Duration?s._(/*BTDS*/"_j{\"*\":\"{number_of_seconds} segundos\",\"4\":\"{number_of_seconds} segundo\",\"_1\":\"1 segundo\"}",[s._plural(t,"number_of_seconds")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.OutOfSyncInfo?s._(/*BTDS*/"_j{\"*\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\",\"4\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\",\"_1\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de 1 segundo de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\"}",[s._plural(t,"number_of_seconds")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Explanation?s._(/*BTDS*/"_j{\"*\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_seconds")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByOthers?r?s._(/*BTDS*/"_j{\"*\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\",\"4\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\",\"_1\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\"}",[s._plural(t,"number_of_seconds"),s._param("person-name",n)]):s._(/*BTDS*/"_j{\"*\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\",\"4\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\",\"_1\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\"}",[s._plural(t,"number_of_seconds"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByYou&&r?s._(/*BTDS*/"_j{\"*\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\",\"4\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\",\"_1\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\"}",[s._plural(t,"number_of_seconds")]):(o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnSecondsString is given type "," and name ",""])),e,n).sendLogs("invalid-ephemeral-string-type"),"")}function P(e,t,n){var r=o("WAWebMiscGatingUtils").isDefaultDisappearingMessagesEnabled();return e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_minutes"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYou?s._(/*BTDS*/"_j{\"*\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_minutes")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknown?s._(/*BTDS*/"_j{\"*\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_minutes")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_minutes"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByYouAsAdmin?s._(/*BTDS*/"_j{\"*\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"Activaste los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_minutes")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByUnknownAsAdmin?s._(/*BTDS*/"_j{\"*\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"Se activaron los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_minutes")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Duration?s._(/*BTDS*/"_j{\"*\":\"{number_of_minutes} minutos\",\"4\":\"{number_of_minutes} minuto\",\"_1\":\"1 minuto\"}",[s._plural(t,"number_of_minutes")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.OutOfSyncInfo?s._(/*BTDS*/"_j{\"*\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\",\"4\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\",\"_1\":\"Este mensaje desaparecer\\u00e1 de este chat despu\\u00e9s de 1 minuto de haber sido enviado, a menos que se use la opci\\u00f3n para conservarlo.\"}",[s._plural(t,"number_of_minutes")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.Explanation?s._(/*BTDS*/"_j{\"*\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_minutes")]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByOthers?r?s._(/*BTDS*/"_j{\"*\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\",\"4\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\",\"_1\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para establecer la duraci\\u00f3n predeterminada que desees.\"}",[s._plural(t,"number_of_minutes"),s._param("person-name",n)]):s._(/*BTDS*/"_j{\"*\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\",\"4\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\",\"_1\":\"{person-name} usa una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para obtener m\\u00e1s informaci\\u00f3n.\"}",[s._plural(t,"number_of_minutes"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.ModeChangeByYou&&r?s._(/*BTDS*/"_j{\"*\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\",\"4\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\",\"_1\":\"Usas una duraci\\u00f3n predeterminada para los mensajes temporales en chats nuevos. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar la duraci\\u00f3n predeterminada.\"}",[s._plural(t,"number_of_minutes")]):(o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnMinutesString is given type "," and name ",""])),e,n).sendLogs("invalid-ephemeral-string-type"),"")}function N(e,t,n){if(t===void 0&&(t=0),t<0)return o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralString "," is given invalid duration ",""])),e,t).sendLogs("invalid-duration"),"";if(t===0)return M(e,n);if(t<=60)return w(e,t,n);if(t<3600){var r=Math.floor(t/60);return A(e,r,n)}else if(t<=1440*60){var a=Math.floor(t/60/60);return o("WAWebEphemeralFbtKicHoursDaysHelpers").getEphemeralOnHoursComponent(e,a,n)}var i=Math.floor(t/24/60/60);return o("WAWebEphemeralFbtKicHoursDaysHelpers").getEphemeralOnDaysComponent(e,i,n)}function M(e,t){return e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&t!=null?s._(/*BTDS*/"{person-name} desactiv\u00f3 los mensajes temporales.",[s._param("person-name",t)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&t!=null?s._(/*BTDS*/"{person-name} desactiv\u00f3 los mensajes temporales. Haz clic para cambiar esto.",[s._param("person-name",t)]):(o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOffL10nComponent is given invalid type ",""])),e).sendLogs("invalid-ephemeral-string-type"),"")}function w(e,t,n){return e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_seconds"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_seconds} segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 segundo de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_seconds"),s._param("person-name",n)]):(o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnSecondsL10nComponent is given type "," and name ",""])),e,n).sendLogs("invalid-ephemeral-string-type"),"")}function A(e,t,n){return e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthers&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos.\"}",[s._plural(t,"number_of_minutes"),s._param("person-name",n)]):e===o("WAWebEphemeralFbtKicTypes").EphemeralStringType.SettingChangeByOthersAsAdmin&&n!=null?s._(/*BTDS*/"_j{\"*\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minutos de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"4\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de {number_of_minutes} minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\",\"_1\":\"{person-name} activ\\u00f3 los mensajes temporales. Los mensajes nuevos desaparecer\\u00e1n de este chat despu\\u00e9s de 1 minuto de haber sido enviados, a menos que se use la opci\\u00f3n para conservarlos. Haz clic para cambiar esto.\"}",[s._plural(t,"number_of_minutes"),s._param("person-name",n)]):(o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["getEphemeralOnMinutesL10nComponent is given type "," and name ",""])),e,n).sendLogs("invalid-ephemeral-string-type"),"")}function F(e){var t=o("WAWebContactCollection").ContactCollection.assertGet(e);if(o("WAWebContactGetters").getIsMe(t))return s._(/*BTDS*/"Conservado por ti");var n=o("WAWebFrontendContactGetters").getFormattedName(t);return s._(/*BTDS*/"Conservado por {person-name}",[s._param("person-name",n)])}F.displayName=F.name+" [from "+i.id+"]",l.EphemeralStringType=o("WAWebEphemeralFbtKicTypes").EphemeralStringType,l.getDisappearingMessageSettingOthersStringKic=g,l.getDisappearingMessageSettingOthersGroupStringKic=h,l.getDisappearingMessageSettingYouStringKic=y,l.getDisappearingMessageSettingUnknownStringKic=C,l.getDisappearingMessageSettingOthersAsAdminStringKic=b,l.getDisappearingMessageSettingOthersAsAdminGroupStringKic=v,l.getDisappearingMessageSettingYouAsAdminStringKic=S,l.getDisappearingMessageSettingUnknownAsAdminStringKic=R,l.getDisappearingMessageDurationStringKic=L,l.getDisappearingMessageOutOfSyncInfoStringKic=E,l.getDisappearingMessageExplanationStringKic=k,l.getDisappearingModeOtherStringKic=I,l.getDisappearingModeYouStringKic=T,l.getKeptByString=F}),226); __d("WAWebDBEventInvalidateChatEvents",["WAWebDBMessageUtils","WAWebModelStorageUtils","WAWebMsgType","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return o("WAWebModelStorageUtils").getStorage().lock(["message"],(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t[0],r=yield n.between(["internalId"],o("WAWebDBMessageUtils").beginningOfChat(e),o("WAWebDBMessageUtils").endOfChat(e));yield n.bulkCreateOrMerge(r.filter(function(e){return e.type===o("WAWebMsgType").MSG_TYPE.EVENT_CREATION&&!e.eventInvalidated}).map(function(e){return{id:e.id,eventInvalidated:!0}}))});return function(e){return t.apply(this,arguments)}})())}l.invalidateChatEvents=e}),98); __d("WAWebInvalidateEventsAction",["WALogger","WAWebDBEventInvalidateChatEvents","WAWebFrontendMsgGetters","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){try{yield o("WAWebDBEventInvalidateChatEvents").invalidateChatEvents(t.id),t.msgs.filter(function(e){return o("WAWebFrontendMsgGetters").getAsEventCreation(e)&&!e.eventInvalidated}).forEach(function(e){e.eventInvalidated=!0})}catch(t){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[EVENTS] Failed to invalidate events with error: ",""])),t)}}),u.apply(this,arguments)}l.invalidateEventMsgsForChat=s}),98); __d("WAWebCollectionConstants",[],(function(t,n,r,o,a,i){var e="collection_has_synced",l=50,s=20;i.COLLECTION_HAS_SYNCED=e,i.PAGE_SIZE=l,i.MSG_PRELOAD_THRESHOLD=s}),66); __d("WAWebEventMsgsCollection",["Promise","WAFilteredCatch","WALogger","WAWebBackendErrors","WAWebBaseCollection","WAWebCollectionConstants","WAWebFrontendMsgGetters","WAWebMsgCollection","WAWebMsgModel","WAWebNoop","WAWebSocketConstants","WAWebSocketModel"],(function(t,n,r,o,a,i,l){var e,s,u=(function(t){function a(e){var n;return n=t.call(this)||this,n.syncPromise=null,n.isFullySynced=!1,n.isInitialized=!1,n.chat=e,n.listenTo(o("WAWebSocketModel").Socket,"change:stream",function(){o("WAWebSocketModel").Socket.stream===o("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED?n.isFullySynced=!1:o("WAWebSocketModel").Socket.stream===o("WAWebSocketConstants").SOCKET_STREAM.CONNECTED&&n.delete()}),n}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.initialize=function(){if(this.isInitialized)return(s||(s=n("Promise"))).resolve();var e=this.chat.msgs;if(e==null)return(s||(s=n("Promise"))).resolve();e.length&&this.add(e.filter(c));var t=(s||(s=n("Promise"))).resolve();return this.chat.msgs.msgLoadState.noEarlierMsgs?this.isFullySynced=!0:t=this.queryEvents({recurse:!1}),this.isInitialized=!0,t},i.delete=function(){this.isFullySynced=!1,this.isInitialized=!1,t.prototype.delete.call(this)},i.queryEvents=function(a){var t=this,i=a.recurse;if(this.syncPromise)return this.syncPromise;if(this.isFullySynced)return(s||(s=n("Promise"))).resolve();var l,u=this.last();u&&(l=u.id);var d=(this.syncPromise=o("WAWebMsgCollection").MsgCollection.getEventMsgs(this.chat.id,o("WAWebCollectionConstants").PAGE_SIZE,l).then(function(e){(!e||e.lengthu){o("WAWebModalManager").ModalManager.open(c.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{onOK:o("WAWebModalManager").closeModalManager,okText:r("WAWebFbtCommon")("OK"),children:o("WAWebL10NIsUsingSupportedBritishEnglishLocale").isUsingSupportedBritishEnglishLocale()?s._(/*BTDS*/"You can't add more than {favorites_limit} favourites",[s._param("favorites_limit",u)]):s._(/*BTDS*/"No puedes a\u00f1adir m\u00e1s de {favorites_limit} favoritos",[s._param("favorites_limit",u)])}));return}var p;if(Array.isArray(t)){var _=yield o("WAWebDBFavoriteDatabaseApi").getNextFavoriteOrderIndex();p=t.map(function(e){return{id:e.toString(),orderIndex:_++}})}else p=[babelHelpers.extends({},t)];a.entryPoint!=null&&o("WAWebFavoritesLogging").logAddingMessagingFavorites(p,a.entryPoint);var f=l.concat(p),g=o("WATimeUtils").unixTime(),h=yield r("WAWebFavoritesSync").getFavoritesMutation(f,g);o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[Favorites] addToFavoritesAction, mutation generated"])));var y=o("WAWebSyncdCoreApi").lockForSync(["favorite","chat"],[h],n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebDBFavoriteDatabaseApi").addOrEditFavorites(p)})).then(function(){return o("WAWebFavoriteCollection").FavoriteCollection.add(p.map(function(e){return babelHelpers.extends({},e)}))});if(a.suppressToast===!0)yield y;else{var C=new(o("WAWebActionToast.react")).ActionType(d()),b=y.then(function(){return new(o("WAWebActionToast.react")).ActionType(m())});o("WAWebToastManager").ToastManager.open(c.jsx(o("WAWebActionToast.react").ActionToast,{id:o("WAWebActionToast.react").genId(),initialAction:C,pendingAction:b}))}}}),_.apply(this,arguments)}l.addToFavoritesAction=p}),226); __d("WAWebRemoveFromFavoritesAction",["fbt","WALogger","WATimeUtils","WAWebActionToast.react","WAWebAddToFavoritesAction","WAWebDBFavoriteDatabaseApi","WAWebFavoriteCollection","WAWebFavoritesLogging","WAWebFavoritesSync","WAWebInboxFiltersGatingUtils","WAWebL10NIsUsingSupportedBritishEnglishLocale","WAWebListsGatingUtils","WAWebSyncdCoreApi","WAWebToastManager","asyncToGeneratorRuntime","react"],(function(t,n,r,o,a,i,l,s){var e,u,c=u||(u=r("react"));function d(){return o("WAWebListsGatingUtils").isListsEnabled()?o("WAWebL10NIsUsingSupportedBritishEnglishLocale").isUsingSupportedBritishEnglishLocale()?s._(/*BTDS*/"Removing from Favourites list"):s._(/*BTDS*/"Quitando de la lista de favoritos\u2026"):o("WAWebL10NIsUsingSupportedBritishEnglishLocale").isUsingSupportedBritishEnglishLocale()?s._(/*BTDS*/"Removing from Favourites"):s._(/*BTDS*/"Quitando de Favoritos\u2026")}function m(){return o("WAWebListsGatingUtils").isListsEnabled()?o("WAWebL10NIsUsingSupportedBritishEnglishLocale").isUsingSupportedBritishEnglishLocale()?s._(/*BTDS*/"Removed from Favourites list"):s._(/*BTDS*/"Se quit\u00f3 de tu lista de favoritos"):o("WAWebL10NIsUsingSupportedBritishEnglishLocale").isUsingSupportedBritishEnglishLocale()?s._(/*BTDS*/"Removed from Favourites"):s._(/*BTDS*/"Quitado de Favoritos")}function p(e,t){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a){if(o("WAWebInboxFiltersGatingUtils").inboxFavoritesEnabled()){var i=t.toString();a.entryPoint!=null&&o("WAWebFavoritesLogging").logRemovingMessagingFavorites([i],a.entryPoint);var l=yield o("WAWebDBFavoriteDatabaseApi").getAllFavorites(),u=l.find(function(e){var t=e.id;return t===i}),p=l.filter(function(e){var t=e.id;return t!==i}),_=o("WATimeUtils").unixTime(),f=yield r("WAWebFavoritesSync").getFavoritesMutation(p,_);o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[Favorites] removeFromFavoritesAction, mutation generated"])));var g=o("WAWebSyncdCoreApi").lockForSync(["favorite","chat"],[f],n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebDBFavoriteDatabaseApi").removeFavorites([i])})).then(function(){return o("WAWebFavoriteCollection").FavoriteCollection.remove([i])});if(a.suppressToast===!0)yield g;else{var h=new(o("WAWebActionToast.react")).ActionType(d()),y=g.then(function(){return new(o("WAWebActionToast.react")).ActionType(m(),u?{actionText:s._(/*BTDS*/"Deshacer"),actionHandler:function(){return o("WAWebAddToFavoritesAction").addToFavoritesAction(u,{entryPoint:a.entryPoint})}}:void 0)});o("WAWebToastManager").ToastManager.open(c.jsx(o("WAWebActionToast.react").ActionToast,{id:o("WAWebActionToast.react").genId(),initialAction:h,pendingAction:y}))}}}),_.apply(this,arguments)}l.removeFromFavoritesAction=p}),226); __d("WAWebFavoriteCollection",["WAWebBaseCollection","WAWebContactCollection","WAWebFavoriteModel","WAWebWidFactory"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){var t;return t=e.call(this)||this,t.listenTo(t,"add",function(e){var t=o("WAWebContactCollection").ContactCollection.get(o("WAWebWidFactory").createWid(e.id));t&&t.set("isFavorite",!0)}),t.listenTo(t,"remove",function(e){var t=o("WAWebContactCollection").ContactCollection.get(o("WAWebWidFactory").createWid(e.id));t&&t.set("isFavorite",!1)}),t}return babelHelpers.inheritsLoose(t,e),t})(o("WAWebBaseCollection").BaseCollection);e.model=o("WAWebFavoriteModel").Favorite;var s=new e;l.FavoriteCollection=s}),98); __d("WAWebFavoriteModel",["WAWebBaseModel","WAWebFavoriteCollection"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0}function c(){var e=o("WAWebSubscriptionCollection").SubscriptionCollection.at(0);if(e==null)return!1;var t=e.newMessageCappingEnabled;if(t===!0)return!1;var n=(e==null?void 0:e.creationTime)!=null&&e.creationTimet.cycle_end_timestamp;return r?(f(o("WAWebUserPrefsTypes").NewChatMessageCappingStatusType.NONE),!1):t.capping_status===o("WAWebUserPrefsTypes").NewChatMessageCappingStatusType.CAPPED}function u(){var t=o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(e),n=typeof(t==null?void 0:t.capping_status)=="string"?o("WAWebUserPrefsTypes").NewChatMessageCappingStatusType.cast(t.capping_status):null;return n!=null?n:o("WAWebUserPrefsTypes").NewChatMessageCappingStatusType.NONE}function c(){return o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(e)}function d(e){var t=e.chat,n=e.contact;return!o("WAWebContactGetters").getIsUser(n)||o("WAWebContactGetters").getIsMe(n)||o("WAWebContactGetters").getIsEnterprise(n)||o("WAWebContactGetters").getIsSupportAccount(n)||n.id.isBot()||o("WAWebContactGetters").getIsHosted(n)||o("WAWebContactGetters").getIsBroadcast(n)||o("WAWebContactGetters").getIsPSA(n)?!0:(t==null?void 0:t.getTcToken())!=null}function m(e){var t;return(t=o("WAWebUserPrefsTypes").NewChatMessageCappingStatusType.cast(e))!=null?t:o("WAWebUserPrefsTypes").NewChatMessageCappingStatusType.NONE}function p(e){var t;return(t=o("WAWebUserPrefsTypes").NewChatMessageCappingOTEStatusType.cast(e))!=null?t:o("WAWebUserPrefsTypes").NewChatMessageCappingOTEStatusType.ELIGIBLE}function _(e){var t;return(t=o("WAWebUserPrefsTypes").NewChatMessageCappingMVStatusType.cast(e))!=null?t:o("WAWebUserPrefsTypes").NewChatMessageCappingMVStatusType.NOT_ACTIVE}function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(e);n!=null&&(yield o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(e,babelHelpers.extends({},n,{capping_status:t})))}),g.apply(this,arguments)}l.NEW_CHAT_MESSAGE_CAPPING_IDB_KEY=e,l.isUserCapped=s,l.getCappingStatus=u,l.getCappingData=c,l.canSendMsgWhileCapped=d,l.getCappingStatusType=m,l.getCappingOTEStatusType=p,l.getCappingMVStatusType=_,l.resetCappingStatus=f}),98); __d("WAWebChatSearchFilters",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum")({UNREAD:"unread",FAVORITES:"favorites",GROUP:"group",COMMUNITY:"community",BROADCAST:"broadcast",CONTACT:"contact",NON_CONTACT:"non_contact",ASSIGNED_TO_YOU:"assigned_to_you",PERSONAL:"personal",BUSINESS:"business",LABELS:"labels"}),l=function(n){switch(n){case e.UNREAD:case e.ASSIGNED_TO_YOU:case e.CONTACT:case e.GROUP:case e.COMMUNITY:case e.LABELS:case e.FAVORITES:return!0;case e.BROADCAST:case e.NON_CONTACT:case e.BUSINESS:case e.PERSONAL:return!1}},s=function(n){switch(n){case e.UNREAD:case e.ASSIGNED_TO_YOU:return!0;case e.BROADCAST:case e.NON_CONTACT:case e.BUSINESS:case e.PERSONAL:case e.CONTACT:case e.GROUP:case e.COMMUNITY:case e.LABELS:case e.FAVORITES:return!1}};i.SearchFilters=e,i.isFilterExcludedFromSearchTreatmentInInboxFlow=l,i.isFilterExcludedFromSearchTreatmentInNormalFlow=s}),66); __d("WAWebWamEnumCtwaLabelType",[],(function(t,n,r,o,a,i){var e=Object.freeze({NEW_ORDER:0,PENDING_PAYMENT:1,PAID:2,ORDER_COMPLETE:3,NEW_CUSTOMER:4,DELIVERED:5,LEAD:6,FOLLOW_UP:7,APPOINTMENT:8,IMPORTANT:9,DO_NEW_ORDER:10,DO_LEAD:11});i.CTWA_LABEL_TYPE=e}),66); __d("WAWebLabelConstants",["WAWebCTWAConstants","WAWebWamEnumCtwaLabelType"],(function(t,n,r,o,a,i,l){var e=["#FF9485","#64C4FF","#FFD429","#DFAEF0","#99B6C1","#55CCB3","#FF9DFF","#D3A91D","#6D7CCE","#D7E752","#00D0E2","#FFC5C7","#93CEAC","#F74848","#00A0F2","#83E422","#FFAF04","#B5EBFF","#9BA6FF","#9368CF"],s=["#A62C71","#90A841","#C1A03F","#792138","#AE8774","#F0B330","#B6B327","#C69FCC","#8B6990","#FF8A8C","#54C265","#FF7B6B","#26C4DC","#57C9FF","#74676A","#7E90A3","#5696FF","#6E257E","#7ACBA5","#243640"],u=Object.freeze({NEW_CUSTOMER:1,NEW_ORDER:2,PENDING_PAYMENT:3,PAID:4,ORDER_COMPLETE:5,IMPORTANT:6,FOLLOW_UP:7,LEAD:8}),c=Object.freeze({NEW_CUSTOMER:"New customer",NEW_ORDER:"New order",PENDING_PAYMENT:"Pending payment",PAID:"Paid",ORDER_COMPLETE:"Order complete",IMPORTANT:"Important",FOLLOW_UP:"Follow up",LEAD:"Lead"}),d=Object.freeze({NEW_CUSTOMER:"new_customer",NEW_ORDER:"new_order",PENDING_PAYMENT:"pending_payment",PAID:"paid",ORDER_COMPLETE:"order_complete",IMPORTANT:"important",FOLLOW_UP:"follow_up",LEAD:"lead"}),m=function(t){switch(t){case c.NEW_CUSTOMER:return u.NEW_CUSTOMER;case c.NEW_ORDER:return u.NEW_ORDER;case c.PENDING_PAYMENT:return u.PENDING_PAYMENT;case c.PAID:return u.PAID;case c.ORDER_COMPLETE:return u.ORDER_COMPLETE;case c.IMPORTANT:return u.IMPORTANT;case c.FOLLOW_UP:return u.FOLLOW_UP;case c.LEAD:return u.LEAD;default:return}},p=function(t){switch(t){case d.NEW_CUSTOMER:return o("WAWebWamEnumCtwaLabelType").CTWA_LABEL_TYPE.NEW_CUSTOMER;case d.NEW_ORDER:return o("WAWebWamEnumCtwaLabelType").CTWA_LABEL_TYPE.NEW_ORDER;case d.PENDING_PAYMENT:return o("WAWebWamEnumCtwaLabelType").CTWA_LABEL_TYPE.PENDING_PAYMENT;case d.PAID:return o("WAWebWamEnumCtwaLabelType").CTWA_LABEL_TYPE.PAID;case d.ORDER_COMPLETE:return o("WAWebWamEnumCtwaLabelType").CTWA_LABEL_TYPE.ORDER_COMPLETE;case d.IMPORTANT:return o("WAWebWamEnumCtwaLabelType").CTWA_LABEL_TYPE.IMPORTANT;case d.FOLLOW_UP:return o("WAWebWamEnumCtwaLabelType").CTWA_LABEL_TYPE.FOLLOW_UP;default:return o("WAWebWamEnumCtwaLabelType").CTWA_LABEL_TYPE.LEAD}},_=function(t){switch(t){case u.NEW_CUSTOMER:return c.NEW_CUSTOMER;case u.NEW_ORDER:case o("WAWebCTWAConstants").DETECTED_OUTCOME_NEW_ORDER_PREDEFINED_ID:return c.NEW_ORDER;case u.PENDING_PAYMENT:return c.PENDING_PAYMENT;case u.PAID:return c.PAID;case u.ORDER_COMPLETE:return c.ORDER_COMPLETE;case u.IMPORTANT:return c.IMPORTANT;case u.FOLLOW_UP:return c.FOLLOW_UP;case u.LEAD:case o("WAWebCTWAConstants").DETECTED_OUTCOME_LEAD_PREDEFINED_ID:return c.LEAD;default:return}},f=100,g=72;l.ANDROID_LABEL_COLOR_PALETTE=e,l.IPHONE_LABEL_COLOR_PALETTE=s,l.PREDEFINED_LABEL_IDS=u,l.PREDEFINED_LABEL_NAMES=c,l.mapLabelNameToPredefinedId=m,l.mapCustomLabelSubtypeToCTWALabelType=p,l.mapPredefinedIdToLabelName=_,l.LABEL_NAME_MAX_LENGTH=f,l.LISTS_ROW_HEIGHT=g}),98); __d("WAWebListUtils",["fbt","WAWebBizGatingUtils","WAWebChatCollection","WAWebChatGetters","WAWebChatSearchFilters","WAWebConnModel","WAWebGroupType","WAWebLabelCollection","WAWebLabelConstants","WAWebListsGatingUtils","WAWebMobilePlatforms","WAWebSchemaLabel"],(function(t,n,r,o,a,i,l,s){var e,u=20,c=22;function d(){return o("WAWebConnModel").Conn.platform===o("WAWebMobilePlatforms").PLATFORMS.SMBI?o("WAWebLabelConstants").IPHONE_LABEL_COLOR_PALETTE:o("WAWebLabelConstants").ANDROID_LABEL_COLOR_PALETTE}function m(e){return d()[e]}var p=function(t,n){var e=parseInt(t.id,10),r=parseInt(n.id,10);return Number.isNaN(e)||Number.isNaN(r)?0:e-r},_=function(t){t.sort(p)},f=function(t){if(!o("WAWebBizGatingUtils").isLabelReorderingSyncFromPrimaryEnabled()){_(t);return}t.sort(function(e,t){var n=e.orderIndex-t.orderIndex;return n===0?p(e,t):n})},g=new Set([(e=o("WAWebSchemaLabel")).ListType.UNREAD,e.ListType.GROUPS,e.ListType.FAVORITES,e.ListType.COMMUNITY]);function h(e){return e==null?!1:g.has(e)}function y(){return o("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()&&o("WAWebLabelCollection").LabelCollection.getServerAssignedLabelIdMap().size>0?c:u}function C(){var e=o("WAWebMobilePlatforms").isSMB(),t=o("WAWebListsGatingUtils").isListsEnabled();if(e&&!t)return o("WAWebLabelCollection").LabelCollection.length>=y();var n=o("WAWebLabelCollection").LabelCollection.countWhere(function(e){return e.type===o("WAWebSchemaLabel").ListType.CUSTOM});return n>=y()}function b(e){if(o("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()){var t=y();return e?s._(/*BTDS*/"No puedes a\u00f1adir m\u00e1s de {max_count} listas",[s._param("max_count",t)]):s._(/*BTDS*/"No puedes a\u00f1adir m\u00e1s de {max_count} etiquetas",[s._param("max_count",t)])}return e?s._(/*BTDS*/"No puedes a\u00f1adir m\u00e1s de 20 listas"):s._(/*BTDS*/"No puedes a\u00f1adir m\u00e1s de 20 etiquetas")}function v(e){var t=s._(/*BTDS*/"Creaste el m\u00e1ximo n\u00famero de listas.");if(o("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()){var n=y();return e?t:s._(/*BTDS*/"No puedes a\u00f1adir m\u00e1s de {max_count} etiquetas",[s._param("max_count",n)])}return e?t:s._(/*BTDS*/"No puedes a\u00f1adir m\u00e1s de 20 etiquetas")}var S=function(t,n){var e,r;return t.filter===o("WAWebChatSearchFilters").SearchFilters.UNREAD||t.filter===o("WAWebChatSearchFilters").SearchFilters.GROUP||t.filter===o("WAWebChatSearchFilters").SearchFilters.FAVORITES||t.filter===o("WAWebChatSearchFilters").SearchFilters.COMMUNITY?(e=n.get(String(t.filter)))!=null?e:0:(r=n.get(String(t.listId)))!=null?r:0};function R(){var e,t=o("WAWebLabelCollection").LabelCollection.toArray(),n=new Map,r=0,a=0,i=0,l=0;return t.forEach(function(e){n.set(e.id,0)}),o("WAWebChatCollection").ChatCollection.forEach(function(e){if(e.unreadCount!==0&&!e.archive&&!e.isLocked){if(r++,o("WAWebChatGetters").getIsGroup(e)){var t;a++;var s=(t=e.groupMetadata)==null?void 0:t.groupType;(s===o("WAWebGroupType").GroupType.COMMUNITY||s===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP||s===o("WAWebGroupType").GroupType.LINKED_SUBGROUP||s===o("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP)&&l++}e.isFavorite&&i++,e.labels!=null&&e.labels.length>0&&(e.labels||[]).forEach(function(e){if(n.has(e)){var t,r=(t=n.get(e))!=null?t:0;n.set(e,r+1)}else n.set(e,1)})}}),n.set(String((e=o("WAWebChatSearchFilters")).SearchFilters.UNREAD),r),n.set(String(e.SearchFilters.GROUP),a),n.set(String(e.SearchFilters.FAVORITES),i),n.set(String(e.SearchFilters.COMMUNITY),l),n}l.getAllLabelColors=d,l.colorIndexToHex=m,l.sortLabels=f,l.isBuiltInList=h,l.isListFlowMaxListsCountReached=C,l.getReachMaxLabelCountTextForBizLabelDrawer=b,l.getReachMaxLabelCountText=v,l.getUnreadChatsCountForFilter=S,l.getListsUnreadChatCountMap=R}),226); __d("WAWebCompactMapString",["isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t){for(var n=e.length,o=[],a=0,i=0;i0,g=(s||(s=r("stylex")))(i==null&&!u&&m.container,u&&m.containerFull,i!=null&&!u&&m.containerFull,d==="label-filter"&&m.labelFilter,d==="drawer-title"&&m.drawerTitle,f&&m.labelFilterWithCount),h=u&&t!=null?{backgroundColor:t}:{},y=a===!0?c.jsx(r("WAWebListIcon.react"),{color:t,xstyle:m.listIcon}):c.jsx(o("WAWebIcLabelFilledIcon.react").IcLabelFilledIcon,{width:18,height:18,style:t!=null?{color:t}:{},iconXstyle:n,xstyle:i!=null&&m.containerFullCircleIcon}),C=u?c.jsx(o("WAWebLabelFilledIcon.react").LabelFilledIcon,{xstyle:m.circleIcon,iconXstyle:m.circleIconSVG}):y;return c.jsxs("div",{className:g,children:[c.jsx("div",{"data-testid":void 0,className:s(u&&m.circleIconContainer,d==="drawer-title"&&m.drawerTitleIconContainer,d==="drawer-title"&&o("WAWebUISpacing").uiMargin.end20,d==="drawer-title"&&o("WAWebUISpacing").uiMargin.start4,(d==="label-filter"||d==="label-pill")&&m.labelFilterIconContainer,d==="label-pill"&&m.labelFilterPillIconContainer),style:h,children:C}),_,f&&c.jsx(r("WDSText.react"),{type:"Body2Emphasized",colorName:"accentEmphasized",xstyle:m.unreadCount,children:p})]})}f.displayName=f.name+" [from "+i.id+"]";function g(e){"use no forget";var t=e.iconXstyle,n=e.isListsFeatureEnabled,a=e.labels,i=e.renderAsCircle,l=i===void 0?!1:i,s=e.showName,u=s===void 0?!1:s,g=e.theme,h=e.unreadCount,y=o("useWAWebForceUpdate").useForceUpdateDONOTUSE(),C=d(function(){return p(a)},[a]);if(o("useWAWebListener").useListener(C!=null?o("WAWebLabelCollection").LabelCollection:null,"label_updated_"+(C!=null?C:""),y),!o("WAWebBizGatingUtils").canDisplayLabel()&&!o("WAWebListsGatingUtils").isListsEnabled())return null;var b=_(a);if(!b||!b.name)return null;if(a.length===1){var v=o("WAWebLabelGetters").getHexColor(b),S=u?b.name:null;return c.jsx(f,{color:v,name:S,renderAsCircle:l,theme:g,iconXstyle:t,unreadCount:h,isListsFeatureEnabled:n})}if(n===!0){var R=r("WAWebCompactMapString")(a,function(e){var t=o("WAWebLabelCollection").LabelCollection.get(e);return t!=null?o("WAWebLabelGetters").getHexColor(t):null});return c.jsx("div",{className:"x1rg5ohu x2lah0s x16dsc37 x1n2onr6 xgd8bvy xxk0z11",children:c.jsx(r("WAWebListIconStacked.react"),{colors:R,xstyle:m.listIconStacked})})}var L=o("WAWebLabelGetters").getHexColor(b);return c.jsxs("div",{className:"x1rg5ohu x2lah0s x16dsc37 x1n2onr6 xgd8bvy xxk0z11","data-testid":void 0,children:[c.jsx(o("WAWebIcLabelFilledIcon.react").IcLabelFilledIcon,{width:18,height:18,style:L!=null?{color:L}:{},iconXstyle:t,xstyle:m.labelStackIcon}),c.jsx(o("WAWebLabelStackIcon.react").LabelStackIcon,{width:18,height:18,iconXstyle:t,xstyle:m.labelStackIcon})]})}g.displayName=g.name+" [from "+i.id+"]",l.getVisibleLabelId=p,l.Label=f,l.Labels=g}),98); __d("WAWebLabelGetters",["WAWebGetters","WAWebGettersCaches","WAWebListUtils"],(function(t,n,r,o,a,i,l){var e=o("WAWebGetters").createGetterFactories({createCache:o("WAWebGettersCaches").createLabelsCache}),s=e.computed,u=e.field,c=u("colorIndex"),d=u("color"),m=s(function(e){var t=e[0],n=e[1];if(n!=null)return o("WAWebListUtils").colorIndexToHex(n)},[d,c]);l.getHexColor=m}),98); __d("WAWebBizLabelUtils",["WALogger","WAWebBizGatingUtils","WAWebCTWAConstants","WAWebChatCollection","WAWebChatModel","WAWebContactCollection","WAWebContactModel","WAWebLabelCollection","WAWebListItemParentType","WAWebMsgCollection","WAWebMsgModel","err"],(function(t,n,r,o,a,i,l){var e;function s(e){var t=m(e);e.labels=o("WAWebLabelCollection").LabelCollection.getLabelsForModel(e.id.toString(),t)}function u(e,t,n){t&&t.length>0&&t.forEach(function(t){if(!(o("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()&&!o("WAWebBizGatingUtils").isCTWADetectedOutcomeWS4Enabled()&&o("WAWebLabelCollection").LabelCollection.getServerAssignedLabelIdMap().has(t))){var r=t,a=null;if(o("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()&&o("WAWebBizGatingUtils").isCTWADetectedOutcomeWS4Enabled()&&o("WAWebLabelCollection").LabelCollection.getServerAssignedLabelIdMap().has(r)){a=o("WAWebLabelCollection").LabelCollection.getServerAssignedLabelIdMap().get(r);var i=_(a);if(i==null)return;r=i}var l=o("WAWebLabelCollection").LabelCollection.gadd({id:r});l.labelItemCollection.gadd({id:p(e,r,n),labelId:r,parentId:e,parentType:n,detectedOutcomeOriginalLabelPredefinedId:a}),n===o("WAWebListItemParentType").LabelItemParentType.Chat&&l.labelItemCollection.gadd({id:p(e,r,o("WAWebListItemParentType").LabelItemParentType.Contact),labelId:r,parentId:e,parentType:o("WAWebListItemParentType").LabelItemParentType.Contact})}})}function c(t,n,r){var a=o("WAWebLabelCollection").LabelCollection.get(n),i=a==null?void 0:a.labelItemCollection;if(!i){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["labelItemCollection does not exist for lableId ",""])),n);return}i.remove(p(t,n,r)),r===o("WAWebListItemParentType").LabelItemParentType.Chat&&i.remove(p(t,n,o("WAWebListItemParentType").LabelItemParentType.Contact))}function d(e){switch(e){case o("WAWebListItemParentType").LabelItemParentType.Chat:return o("WAWebChatCollection").ChatCollection;case o("WAWebListItemParentType").LabelItemParentType.Contact:return o("WAWebContactCollection").ContactCollection;case o("WAWebListItemParentType").LabelItemParentType.Msg:return o("WAWebMsgCollection").MsgCollection}}function m(e){if(e instanceof o("WAWebChatModel").Chat)return o("WAWebListItemParentType").LabelItemParentType.Chat;if(e instanceof r("WAWebContactModel"))return o("WAWebListItemParentType").LabelItemParentType.Contact;if(e instanceof o("WAWebMsgModel").Msg)return o("WAWebListItemParentType").LabelItemParentType.Msg;throw r("err")("getParentTypeFromModel: model is invalid")}function p(e,t,n){return e+"_"+t+"_"+n}function _(e){if(e==null)return null;var t=null;switch(e){case o("WAWebCTWAConstants").DETECTED_OUTCOME_NEW_ORDER_PREDEFINED_ID:t=o("WAWebCTWAConstants").NEW_ORDER_PREDEFINED_ID;break;case o("WAWebCTWAConstants").DETECTED_OUTCOME_LEAD_PREDEFINED_ID:t=o("WAWebCTWAConstants").LEAD_PREDEFINED_ID;break;default:return null}var n=o("WAWebLabelCollection").LabelCollection.findFirst(function(e){return e.predefinedId===t});return n!=null?n.id:null}function f(e){var t,n=(t=o("WAWebLabelCollection").LabelCollection.get(e))==null?void 0:t.predefinedId,r=null;switch(n){case o("WAWebCTWAConstants").NEW_ORDER_PREDEFINED_ID:r=o("WAWebCTWAConstants").DETECTED_OUTCOME_NEW_ORDER_PREDEFINED_ID;break;case o("WAWebCTWAConstants").LEAD_PREDEFINED_ID:r=o("WAWebCTWAConstants").DETECTED_OUTCOME_LEAD_PREDEFINED_ID;break;default:r=null}var a=o("WAWebLabelCollection").LabelCollection.getServerAssignedLabelIdMap().entries().find(function(e){var t=e[0],n=e[1];return n===r});return r==null||a==null?null:a[0]}l.initializeLabels=s,l.addToLabelCollection=u,l.removeLabelFromCollection=c,l.getParentCollection=d,l.getParentTypeFromModel=m,l.createLabelItemId=p,l.mapDOLabelPredefinedIdToManualLabelId=_,l.mapManualLabelIdToDetectedOutcomeLabelId=f}),98); __d("WAWebLabelCollection",["fbt","$InternalEnum","WALogger","WAWebActionToast.react","WAWebAddToFavoritesAction","WAWebBaseCollection","WAWebBizGatingUtils","WAWebBizLabelUtils","WAWebChatCollection","WAWebEditLabelAssociationBridge","WAWebLabelModel","WAWebListItemParentType","WAWebListUtils","WAWebListsGatingUtils","WAWebMsgModel","WAWebNoop","WAWebRemoveFromFavoritesAction","WAWebSchemaLabel","WAWebSchemaLabelAssociation","WAWebToastManager","WAWebWid","lodash","react"],(function(t,n,r,o,a,i,l,s){var e,u,c=["id"],d,m=d||(d=r("react")),p=n("$InternalEnum").Mirrored(["CREATE","EDIT","DELETE"]),_=n("$InternalEnum").Mirrored(["IN_PROGRESS","SUCCESS","ERROR"]);function f(e,t,n){if(n===p.CREATE)return e===_.IN_PROGRESS?s._(/*BTDS*/"Creando lista\u2026"):e===_.SUCCESS?s._(/*BTDS*/"Lista creada"):e===_.ERROR?s._(/*BTDS*/"No se pudo crear la lista"):(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})();if(t)switch(e){case _.IN_PROGRESS:return s._(/*BTDS*/"A\u00f1adiendo a la lista\u2026");case _.SUCCESS:return s._(/*BTDS*/"Se a\u00f1adi\u00f3 a la lista");case _.ERROR:return s._(/*BTDS*/"No se pudo a\u00f1adir a la lista")}else switch(e){case _.IN_PROGRESS:return s._(/*BTDS*/"Actualizando la lista\u2026");case _.SUCCESS:return s._(/*BTDS*/"Se actualiz\u00f3 la lista");case _.ERROR:return s._(/*BTDS*/"No se pudo actualizar la lista")}}var g=(function(t){function n(){var e;return e=t.call(this)||this,e.$LabelCollectionImpl$p_1=new Map,e.listenTo(e,"remove",h),e}babelHelpers.inheritsLoose(n,t);var a=n.prototype;return a.initializeFromCache=function(n){var e=this;if(o("WAWebBizGatingUtils").isCTWADetectedOutcomeWS1Enabled()){var r=n.filter(function(t){var n=t.type===o("WAWebSchemaLabel").ListType.SERVER_ASSIGNED;return n&&e.addToServerAssignedLabelIdMap(t.id,t.predefinedId),!n}),a=r.map(function(e){var t=e.id,n=babelHelpers.objectWithoutPropertiesLoose(e,c);return babelHelpers.extends({id:t},n)});this.add(a)}else t.prototype.initializeFromCache.call(this,n)},a.initializeAssociationsFromCache=function(t){t.forEach(function(e){var t=e.associationId,n=e.labelId,r=e.type;o("WAWebBizLabelUtils").addToLabelCollection(t,[n],r===o("WAWebSchemaLabelAssociation").LabelAssociationType.Jid?o("WAWebListItemParentType").LabelItemParentType.Chat:o("WAWebListItemParentType").LabelItemParentType.Msg)})},a.removeAllLabelsMD=function(t){return this.addOrRemoveLabelsMD((t.labels||[]).map(function(e){return{type:"remove",id:e}}),[t])},a.addOrRemoveLabelsMD=function(t,n){t.forEach(function(e){var t=e.id,a=e.listType,i=e.type;n.forEach(function(e){var n=o("WAWebBizLabelUtils").getParentTypeFromModel(e),l=e.id.toString();a===o("WAWebSchemaLabel").ListType.FAVORITES?e.id instanceof r("WAWebWid")&&(i==="add"?o("WAWebAddToFavoritesAction").addToFavoritesAction([e.id],{suppressToast:!0}).catch(r("WAWebNoop")):o("WAWebRemoveFromFavoritesAction").removeFromFavoritesAction(e.id,{suppressToast:!0}).catch(r("WAWebNoop"))):i==="add"?o("WAWebBizLabelUtils").addToLabelCollection(l,[t],n):o("WAWebBizLabelUtils").removeLabelFromCollection(l,t,n)})})},a.addOrRemoveLabels=function(n,r,a){var t=this;if(!(n.length===0||r.length===0)){var i=a==null?void 0:a.listUpdateMode,l=o("WAWebListsGatingUtils").isListsEnabled(),u=l&&r.some(function(e){var t,n;return((t=(n=e.labels)==null?void 0:n.length)!=null?t:0)>0||!(e instanceof o("WAWebMsgModel").Msg)&&e.isFavorite}),c=o("WAWebActionToast.react").genId(),d=new(o("WAWebActionToast.react")).ActionType(l?f(_.IN_PROGRESS,!u,i):s._(/*BTDS*/"_j{\"*\":\"Cambiando {count} etiquetas\\u2026\",\"_1\":\"Cambiando {count} etiqueta\"}",[s._plural(n.length),s._param("count",n.length)])),p=o("WAWebEditLabelAssociationBridge").editLabelAssociation(this.$LabelCollectionImpl$p_2(n),r).then(function(){t.addOrRemoveLabelsMD(n,r)}).then(function(){return new(o("WAWebActionToast.react")).ActionType(l?f(_.SUCCESS,!u,i):s._(/*BTDS*/"_j{\"*\":\"{count} etiquetas cambiadas\",\"4\":\"{count} etiqueta cambiada\",\"_1\":\"1 etiqueta cambiada\"}",[s._plural(n.length,"count")]))}).catch(function(t){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["addingNewLabel dropped"]))),new(o("WAWebActionToast.react")).ActionType(l?f(_.ERROR,!u,i):s._(/*BTDS*/"_j{\"*\":\"No se pudieron actualizar algunas etiquetas\",\"_1\":\"No se pudo actualizar la etiqueta\"}",[s._plural(n.length)]))});o("WAWebToastManager").ToastManager.open(m.jsx(o("WAWebActionToast.react").ActionToast,{id:c,initialAction:d,pendingAction:p}))}},a.$LabelCollectionImpl$p_2=function(t){return o("WAWebBizGatingUtils").isCTWADetectedOutcomeWS4Enabled()?t.map(function(e){if(e.type==="remove"){var t=o("WAWebBizLabelUtils").mapManualLabelIdToDetectedOutcomeLabelId(e.id);if(t!=null)return[babelHelpers.extends({},e,{listType:o("WAWebSchemaLabel").ListType.SERVER_ASSIGNED,id:t}),e]}return e}).flat(1):t},a.getLabelsForModel=function(t,n){return this.filter(function(e){return e.labelItemCollection.get(o("WAWebBizLabelUtils").createLabelItemId(t,e.id,n))}).map(function(e){return e.id})},a.getNextAvailableColor=function(){var e=o("WAWebListUtils").getAllLabelColors(),t=this.map(function(e){return e.colorIndex}).sort(function(e,t){return Number(e)-Number(t)});if(t.length===0)return 0;var n=t.findIndex(function(e,t){return e!==t});return n>=0?n:Math.floor(Math.random()*e.length)},a.getChatLabelsWithUnarchivedAssociations=function(){return this.filter(function(e){return e.count===0?!1:e.labelItemCollection.some(function(e){switch(e.parentType){case o("WAWebListItemParentType").LabelItemParentType.Chat:var t=o("WAWebChatCollection").ChatCollection.get(e.parentId);return!(t==null||t.archive===!0||t.isLocked===!0);case o("WAWebListItemParentType").LabelItemParentType.Contact:case o("WAWebListItemParentType").LabelItemParentType.Msg:return!1}})})},a.getActiveLists=function(){return this.filter(function(e){return e.isActive!==!1})},a.getChatLists=function(){return this.filter(function(e){return e.labelItemCollection.length===0?!0:e.labelItemCollection.some(function(e){switch(e.parentType){case o("WAWebListItemParentType").LabelItemParentType.Chat:{var t=o("WAWebChatCollection").ChatCollection.get(e.parentId);return!(t==null||t.isLocked===!0)}case o("WAWebListItemParentType").LabelItemParentType.Contact:case o("WAWebListItemParentType").LabelItemParentType.Msg:return!1}})})},a.getCustomLists=function(){return this.filter(function(e){return e.type===o("WAWebSchemaLabel").ListType.CUSTOM})},a.getServerAssignedLabelIdMap=function(){return this.$LabelCollectionImpl$p_1},a.addToServerAssignedLabelIdMap=function(t,n){n!=null&&!this.$LabelCollectionImpl$p_1.has(t)?this.$LabelCollectionImpl$p_1.set(t,n):n==null&&o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["label sync: malformed mutation, unexpected null predefinedId"])))},n})(o("WAWebBaseCollection").BaseCollection);g.model=o("WAWebLabelModel").Label,g.staleCollection=!0;function h(e){var t=e.labelItemCollection;t.toArray().forEach(function(e){var t=e.labelId,n=e.parentId,a=e.parentType,i=o("WAWebBizLabelUtils").getParentCollection(a).get(n);i&&(i.labels=r("lodash").remove(i.labels,function(e){return e!==t}))})}var y=new g;l.ListUpdateMode=p,l.LabelCollection=y}),226); __d("WAWebLabelItemModel",["WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;an.lastEditTimestamp}function m(e){var t=e.chatId,n=e.member,r=e.memberLabel,o=e.prevRecord;if(!o)return{chatId:t,memberLabelMap:new Map([[n,r]])};var a=c(o.memberLabelMap);return d(o,n,r)?o:(a.set(n,r),babelHelpers.extends({},o,{memberLabelMap:a}))}function p(e){var t=e.member,n=e.prevRecord,r=c(n.memberLabelMap);return r.delete(t),babelHelpers.extends({},n,{memberLabelMap:r})}var _=(function(){return o("WABatcher").batch({delayMs:o("WAWebMemberLabelUtils").getBatchDelayMs()},(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var r=Array.from(new Set(t.map(function(e){return e.data.chatId}))),a=o("WAWebSchemaMemberLabel").getMemberLabelTable(),i=new Map((yield a.bulkGet(r)).filter(Boolean).map(function(e){return[e.chatId,e]})),l=[];for(var c of t){var d=c.data,_=c.type,f=d.chatId,g=d.member,h=d.memberLabel,y=i.get(f),C=null,b=!1;switch(_){case"UPSERT":{if(h==null){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[updateMemberLabelsBatched] memberLabel null for upsert"]))),l.push(null);continue}C=m({chatId:f,member:g,memberLabel:h,prevRecord:y}),b=!0;break}case"DELETE":{if(!y){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[updateMemberLabelsBatched]: no record found for chat ",""])),f),l.push(null);continue}C=p({prevRecord:y,member:g}),b=!0;break}}C!=null&&i.set(C.chatId,C),l.push(b?c:null)}var v=Array.from(i.values()),S=[],R=[];for(var L of v)L.memberLabelMap.size===0?S.push(L):R.push(L);return yield(u||(u=n("Promise"))).all([a.bulkRemove(S.map(function(e){return e.chatId})),a.bulkCreateOrReplace(R)]),l});return function(e){return t.apply(this,arguments)}})())})();l.updateMemberLabelsBatched=_}),98); __d("WAWebMemberLabelHistorySync",["Promise","WALogger","WATimeUtils","WAWebBackendApi","WAWebLidMigrationUtils","WAWebMemberLabel.flow","WAWebMemberLabelBridgeApi","WAWebMemberLabelBulkJob","WAWebMemberLabelGating","WAWebWidFactory","WAWebWidToJid","asyncToGeneratorRuntime","compactMap","gkx"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c,d,m,p;function _(e){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(o("WAWebMemberLabelGating").isMemberLabelInfraEnabled())try{var a=[],i=t.conversations.filter(function(e){var t=o("WAWebWidFactory").createWid(e.id);return t.isGroup()?e.participant.length>0:!1}).flatMap(function(t){var n=o("WAWebWidFactory").createWid(t.id),a=o("WAWebWidToJid").widToGroupJid(n);return r("compactMap")(t.participant,function(t){try{var n;if(t.memberLabel==null)return null;var i=o("WAWebWidFactory").createWid(t.userJid);if(!i)return null;var l=o("WAWebLidMigrationUtils").toUserLid(i);if(!l)return null;var u=o("WAWebWidToJid").userLidtoLidUserJid(l),c=t.memberLabel,d=o("WAWebMemberLabel.flow").castToMemberLabeString(String((n=c==null?void 0:c.label)!=null?n:"")),m=o("WATimeUtils").castToUnixTime(Number(c==null?void 0:c.labelTimestamp));return{chatId:a,member:u,label:d,lastEditTimestamp:m}}catch(t){return r("gkx")("26258")?o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error processing member label"]))).sendLogs("Failed to handle member label change"):o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error processing member label: ",""])),t).sendLogs("Failed to handle member label change"),null}})});for(var l of i){var _=l.chatId,f=l.label,g=l.lastEditTimestamp,h=l.member;a.push(o("WAWebMemberLabelBridgeApi").createUpsert(_,h,{label:f,lastEditTimestamp:g}))}if(a.length===0)return;o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[history sync] processing "," member label updates"])),a.length);var y=yield(p||(p=n("Promise"))).all(a.map(o("WAWebMemberLabelBulkJob").updateMemberLabelsBatched)),C=y.filter(Boolean);if(C.length===0)return;o("WAWebBackendApi").frontendFireAndForget("updateMemberLabelCollection",{updates:C}),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[history sync] successfully processed "," member label updates"])),C.length)}catch(e){r("gkx")("26258")?o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Failed to process member labels from history sync"]))).sendLogs("Failed to process member labels from history sync"):o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Failed to process member labels from history sync: ",""])),e).sendLogs("Failed to process member labels from history sync")}}),f.apply(this,arguments)}l.processMemberLabels=_}),98); __d("WAWebMemberLabelKey",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){function e(e){this.chatId=e.chatId,this.member=e.member;var t=[this.chatId,this.member];this.serialized=t.join("_")}var t=e.prototype;return t.toString=function(){return this.serialized},t.equals=function(n){return n instanceof e&&this.toString()===n.toString()},e})();i.default=e}),66); __d("WAWebMemberLabelBridgeApi",["WALogger","WAWebMemberLabelCollection","WAWebMemberLabelKey"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t){return{type:"DELETE",data:{chatId:e,member:t}}}function c(e,t,n){return{type:"UPSERT",data:{chatId:e,member:t,memberLabel:n}}}var d={updateMemberLabelCollection:function(n){var t=n.updates;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[updateMemberLabelsModel] processing "," updates"])),t.length);var a=[],i=[];t.forEach(function(e){var t=e.data,n=e.type,l=t.chatId,u=t.member,c=t.memberLabel,d=new(r("WAWebMemberLabelKey"))({chatId:l,member:u});switch(n){case"UPSERT":{if(c==null){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[updateMemberLabelsModel] memberLabel null for upsert"])));return}a.push({id:d,label:c.label,lastEditTimestamp:c.lastEditTimestamp});break}case"DELETE":{i.push(d);break}}}),a.length>0&&r("WAWebMemberLabelCollection").add(a,{merge:!0}),i.length>0&&r("WAWebMemberLabelCollection").remove(i)}};l.createDelete=u,l.createUpsert=c,l.MemberLabelBridgeApi=d}),98); __d("WAWebMemberLabelModel",["WAWebBaseModel","WAWebMemberLabelKey"],(function(t,n,r,o,a,i,l){"use strict";var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0&&t.filter(Boolean).forEach(function(t){e.trigger(t.id.toString(),n(t))})},i.add=function(n,r){var e=t.prototype.add.call(this,n,r);return this.$MemberLabelCollection$p_2(e,function(e){return e}),e},i.remove=function(n,r){r===void 0&&(r={});var e=t.prototype.remove.call(this,n,r);return this.$MemberLabelCollection$p_2(e,o("WAWebNullFunc").returnNull),e},i.initializeLabelsForChat=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this.$MemberLabelCollection$p_1.get(e);if(t!=null)return t;var n=this.$MemberLabelCollection$p_3(e);return this.$MemberLabelCollection$p_1.set(e,n),n});function t(t){return e.apply(this,arguments)}return t})(),i.$MemberLabelCollection$p_3=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=this;try{yield o("WAExponentialBackoff").exponentialBackoff({minTimeout:1e3,retries:3,signal:new AbortController().signal},(function(){var i=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n,i){return o("WAWebMemberLabelActions").getMemberLabelsForGroupAction(t).then(function(e){e!=null&&a.add(e)}).catch(function(a){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[MemberLabelCollection][initialize]: Attempt "," failed for group ",""])),i+1,t);var l=a instanceof Error?a:r("err")(String(a));return n(l)})});return function(e,t){return i.apply(this,arguments)}})())}catch(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[MemberLabelCollection][initialize]: All retries failed for group ",""])),t),this.$MemberLabelCollection$p_1.delete(t)}});function a(e){return t.apply(this,arguments)}return a})(),a})(o("WAWebBaseCollection").BaseCollection);u.model=r("WAWebMemberLabelModel");var c=new u;l.default=c}),98); __d("WAWebMessageAssociationUIUtils",["WAWebFrontendMsgGetters","WAWebMessageAssociation.flow","WAWebMsgCollection","WAWebMsgType","WAWebPollCreationUtils","WAWebViewMode.flow","WAWebViewModeUtils"],(function(t,n,r,o,a,i,l){"use strict";var e=new Set([o("WAWebMsgType").MSG_TYPE.ALBUM,o("WAWebMsgType").MSG_TYPE.POLL_CREATION]);function s(t,n,r){return r&&e.has(n)?Math.min.apply(Math,[t].concat(r.map(function(e){var t=e.ack;return t}))):t}function u(e,t){return t===void 0&&(t=o("WAWebViewMode.flow").ViewModeSurface.CHAT),d(o("WAWebMsgCollection").MsgCollection.byParentMessage(e),t)}function c(e,t){return t===void 0&&(t=o("WAWebViewMode.flow").ViewModeSurface.CHAT),o("WAWebMsgCollection").MsgCollection.byChat(e).filter(function(e){var n=e.viewMode;return!o("WAWebViewModeUtils").isViewModeVisibleInSurface(t,n)})}function d(e,t){return e.filter(function(e){var n=e.associationType,r=e.parentMsgKey,a=e.pendingDeleteForMe,i=e.viewMode;return n!=null&&r!=null&&!a&&!o("WAWebViewModeUtils").isViewModeVisibleInSurface(t,i)})}function m(e){var t=e.duringDetach,n=t===void 0?!1:t,r=e.parentMsgKey,o=n?1:0;return u(r).length-o>0}function p(e){var t=e.duringDetach,n=t===void 0?!1:t,r=e.parentMsg;switch(r.type){case o("WAWebMsgType").MSG_TYPE.POLL_CREATION:{var a=o("WAWebFrontendMsgGetters").getAsPollCreation(r);return a==null?!0:a.pollContentType===o("WAWebPollCreationUtils").PollContentType.IMAGE&&u(r.id).length!==a.pollOptions.length}case o("WAWebMsgType").MSG_TYPE.ALBUM:default:return!m({parentMsgKey:r.id,duringDetach:n})}}function _(e){var t=e.associationType;if(!t)return!0;var n=e.parentMsgKey?o("WAWebMsgCollection").MsgCollection.get(e.parentMsgKey):null;switch(t){case o("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL:return n!=null&&n.type===o("WAWebMsgType").MSG_TYPE.POLL_CREATION&&!p({parentMsg:n});default:return!0}}l.getLowestAckState=s,l.getHiddenAssociatedMessages=u,l.getHiddenViewModeMessagesForChat=c,l.filterOutVisibleAssociatedMessages=d,l.shouldHideParentMessage=p,l.shouldDisplayOrphanMessage=_}),98); __d("WAWebBuildEditedMessageProto",["WAWebE2EProtoGenerator","WAWebMsgType","err","gkx"],(function(t,n,r,o,a,i,l){function e(e){var t,n=e.contextInfo,a=e.json,i=!!(a.matchedText||a.description||a.title),l=(t=a.editMsgType)!=null?t:o("WAWebMsgType").MSG_TYPE.CHAT;switch(l){case o("WAWebMsgType").MSG_TYPE.CHAT:{var s=babelHelpers.extends({},a,{type:o("WAWebMsgType").MSG_TYPE.CHAT,subtype:i?"url":void 0});return o("WAWebE2EProtoGenerator").getProtobufMessage(s,void 0,n)}case o("WAWebMsgType").MSG_TYPE.IMAGE:return{imageMessage:{caption:a.caption,contextInfo:n}};case o("WAWebMsgType").MSG_TYPE.VIDEO:return{videoMessage:{caption:a.caption,contextInfo:n}};case o("WAWebMsgType").MSG_TYPE.DOCUMENT:return{documentWithCaptionMessage:{message:{documentMessage:{caption:a.caption,contextInfo:n}}}};default:if(!r("gkx")("26258")&&l===o("WAWebMsgType").MSG_TYPE.AUDIO)return{audioMessage:{}};throw r("err")("Unsupported edit msg type: "+l)}}l.buildEditedMessageProto=e}),98); __d("WAWebGenerateProtocolMessageEditProto",["WAWebBuildEditedMessageProto","WAWebE2EProtoUtils","WAWebProtobufsE2E.pb"],(function(t,n,r,o,a,i,l){function e(e){var t=e.contextInfo,n=e.json,r=o("WAWebBuildEditedMessageProto").buildEditedMessageProto({json:n,contextInfo:t});return{protocolMessage:{key:o("WAWebE2EProtoUtils").encodeKey(n.protocolMessageKey),type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT,timestampMs:n.latestEditSenderTimestampMs,editedMessage:r}}}l.default=e}),98); __d("WAWebGroupHistorySendGroupMsgJobUtils",["WAWebApiContact","WAWebDBDeviceListFanout","WAWebMaybe","WAWebSendGroupMsgJob","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t,n){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=t.skDistribList,a=t.skList,i=new Set(r.concat(a).map(function(e){return String(o("WAWebWidFactory").asUserWidOrThrow(e))})),l=function(t){return o("WAWebMaybe").ifSome(o("WAWebApiContact").getAlternateUserWid(o("WAWebWidFactory").asUserWidOrThrow(t)),function(e){return i.has(String(e))})},s=e.filter(function(e){return i.has(String(e))||l(e)}),u=n.isLidAddressingMode?o("WAWebUserPrefsMeUser").getMeLidUserOrThrow():o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),c=n.normalizeAddressingModeFn([].concat(s,[u])).filter(Boolean),d=yield o("WAWebDBDeviceListFanout").getFanOutList({wids:c});return{type:o("WAWebSendGroupMsgJob").GROUP_MSG_TYPE.DIRECT,deviceList:[].concat(d)}}),s.apply(this,arguments)}l.getGroupSendListForGroupHistoryBundle=e}),98); __d("WAWebGetMyAddOnsRPC",["WASmaxNewslettersMyAddOnsRPC","WAWebBackendErrors","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.count,n=e.newsletterJid,r=yield o("WASmaxNewslettersMyAddOnsRPC").sendMyAddOnsRPC({myAddonsLimit:t,myAddonsJid:n});switch(r.name){case"MyAddOnsResponseSuccess":return{messagesByNewsletter:r.value.myAddonsMessages};case"MyAddOnsResponseServerError":{var a=r.value.errorIQErrorInternalServerErrorMixin,i=a.code,l=a.text;throw new(o("WAWebBackendErrors")).ServerStatusCodeError(Number(i),l)}case"MyAddOnsResponseClientError":{var s=r.value.myAddonsClientErrors;switch(s.name){case"ItemNotFoundIQErrorResponse":{var u=s.value.errorIQErrorItemNotFoundMixin,c=u.code,d=u.text;throw new(o("WAWebBackendErrors")).ServerStatusCodeError(Number(c),d)}case"RateLimitedIQErrorResponse":{var m=s.value.errorIQErrorRateOverlimitMixin,p=m.code,_=m.text;throw new(o("WAWebBackendErrors")).ServerStatusCodeError(Number(p),_)}case"BadRequestIQErrorResponse":{var f=s.value.errorIQErrorBadRequestMixin,g=f.code,h=f.text;throw new(o("WAWebBackendErrors")).ServerStatusCodeError(Number(g),h)}case"UnauthorizedIQErrorResponse":{var y=s.value.errorIQErrorNotAuthorizedMixin,C=y.code,b=y.text;throw new(o("WAWebBackendErrors")).ServerStatusCodeError(Number(C),b)}}}}}),s.apply(this,arguments)}l.getMyNewsletterAddOnsRPC=e}),98); __d("WAWebNewsletterGetMyAddOnsJob",["Promise","WAJobOrchestratorTypes","WAWebCRUDOperationsNewsletterMyVotes","WAWebDBCreateOrUpdateReactions","WAWebGetMyAddOnsRPC","WAWebNewsletterDBUtils","WAWebOrchestratorNonPersistedJob","WAWebPollOptionHashUtils","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getMyNewsletterAddOns",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield o("WAWebGetMyAddOnsRPC").getMyNewsletterAddOnsRPC(e),n=t.messagesByNewsletter;return u(n,e.newsletterJid)}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r){var a=t.reduce(function(e,t){var n=t.jid,o=t.message,a=n!=null?n:r;return a==null||o.forEach(function(t){var n=d(t,a);n!=null&&e.reactions.push(n);var r=m(t,a);r!=null&&e.pollVotes.push(r)}),e},{reactions:[],pollVotes:[]});return yield(e||(e=n("Promise"))).all([o("WAWebDBCreateOrUpdateReactions").createOrUpdateReactions(a.reactions),o("WAWebCRUDOperationsNewsletterMyVotes").bulkCreateOrUpdateMyVotes(a.pollVotes)]),a}),c.apply(this,arguments)}function d(e,t){var n,r,a=o("WAWebNewsletterDBUtils").craftNewsletterMsgKeyFromServerId(e.serverId,t).toString(),i=e==null||(n=e.newsletterMyReactionMixin)==null?void 0:n.reactionCode,l=e==null||(r=e.newsletterMyReactionMixin)==null?void 0:r.reactionT;return i==null||l==null?null:{parentMsgKey:a,senderUserJid:o("WAWebUserPrefsMeUser").getMePnUserOrThrow().toString(),reactionText:i,timestamp:l*1e3,orphan:0,msgKey:a}}function m(e,t){var n=e.newsletterMyPollVoteMixin;if(n==null)return null;var r=n.votesT,a=n.votesVote;return{chatJid:t,msgServerId:e.serverId,serverTimestampMs:r*1e3,t:r,msgKey:o("WAWebNewsletterDBUtils").craftNewsletterMsgKeyFromServerId(e.serverId,t).toString(),votes:a.map(function(e){return o("WAWebPollOptionHashUtils").bufferToHex(e.elementValue)})}}l.getMyNewsletterAddOnsJob=s}),98); __d("WAWebNewsletterLoadingStageManager",["$InternalEnum","WAWebBaseModel","WAWebModelUtils"],(function(t,n,r,o,a,i,l){var e=n("$InternalEnum").Mirrored(["None","Loading","Finished","Failed"]),s=(function(t){function n(){for(var n,r=arguments.length,a=new Array(r),i=0;i0&&_.push(babelHelpers.extends({},f,{countryCodes:m}))}})}).finally(function(){i.geoSuspensions=_})}return i}),c.apply(this,arguments)}function d(e){return e.appeal_creation_time==null&&e.appeal_state!=="NOT_APPEALED"&&e.appeal_state!=="NON_APPEALABLE"}function m(e){if(e==null)return null;var t=e==null?void 0:e.ip_violation_report_data,n=e==null?void 0:e.enforcement_target_data,r=e==null?void 0:e.enforcing_entity_data,o=e==null?void 0:e.appeal_extra_data,a=e==null?void 0:e.enforcement_origin_workflow,i=e==null?void 0:e.enforcement_origin_legal_basis,l=null;return t!=null&&(l={ipViolationReportData:{reportFbid:t.report_fbid,appealFormUrl:t.appeal_form_url,reporterEmail:t.reporter_email,reporterName:t.reporter_name}}),n!=null&&(l=babelHelpers.extends({},l,{enforcementTargetData:{serverId:parseInt(n.server_msg_id,10)}})),o!=null&&o.appeal_form_url!=null&&(l=babelHelpers.extends({},l,{appealExtraData:{appealFormUrl:o.appeal_form_url}})),r!=null&&r.name!=null&&(l=babelHelpers.extends({},l,{enforcingEntityData:{name:r.name}})),a!=null&&(l=babelHelpers.extends({},l,{enforcementOriginWorkflow:a})),i!=null&&(l=babelHelpers.extends({},l,{enforcementOriginLegalBasis:i})),l}function p(e,t){var n,r;return{appealCreationTime:o("WATimeUtils").castToUnixTime(parseInt((n=e.appeal_creation_time)!=null?n:0,10)),enforcementCreationTime:o("WATimeUtils").castToUnixTime(parseInt(e.enforcement_creation_time,10)),appealState:e.appeal_state,enforcementViolationCategory:e.enforcement_violation_category,enforcementId:e.enforcement_id,enforcementType:t,enforcementSource:(r=e.enforcement_source)!=null?r:null,enforcementExtraData:m(e.enforcement_extra_data)}}l.mexFetchNewsletterEnforcements=u}),98); __d("WAWebNewsletterEnforcementAlertModelUtils",["WAWebWidFactory"],(function(t,n,r,o,a,i,l){function e(e,t,n){var r=[],a;return e==null||e.map(function(e){var i,l=(i=e.enforcementExtraData)==null||(i=i.enforcementTargetData)==null?void 0:i.serverId.toString(),s=l!=null?t==null?void 0:t.get(Number(l)):null,u=new Map,c={id:e.enforcementId,chatId:o("WAWebWidFactory").createWid(n),enforcementViolationCategory:e.enforcementViolationCategory,enforcementType:e.enforcementType,enforcementId:e.enforcementId,enforcementExtraData:e.enforcementExtraData,enforcementSource:e.enforcementSource,appealCreationTime:e.appealCreationTime,appealState:e.appealState,appealReason:null,countryCode:null,lastUpdated:Date.now(),serverMsgId:l,msgData:s};l!=null&&s!=null&&u.set(l,c),a={id:e.enforcementId,chatId:o("WAWebWidFactory").createWid(n),enforcementCreationTime:e.enforcementCreationTime,enforcementViolationCategory:e.enforcementViolationCategory,enforcementType:e.enforcementType,enforcementId:e.enforcementId,enforcementExtraData:e.enforcementExtraData,targetMsgMapForEvidence:u,lastUpdated:Date.now(),enforcementSource:e.enforcementSource,countryCodes:[],appeal:c},r.push(a)}),r}function s(e,t,n){var r=new Map;e.map(function(e){var a={id:e.enforcementId,chatId:o("WAWebWidFactory").createWid(n),enforcementViolationCategory:e.enforcementViolationCategory,enforcementType:e.enforcementType,enforcementId:e.enforcementId,enforcementExtraData:e.enforcementExtraData,enforcementSource:e.enforcementSource,appealCreationTime:e.appealCreationTime,appealState:e.appealState,appealReason:null,countryCode:null,lastUpdated:Date.now(),serverMsgId:e.serverId.toString(),msgData:t==null?void 0:t.get(e.serverId)};r.set(e.serverId.toString(),a)});var a=e[0];return a==null?null:{id:a.enforcementId,chatId:o("WAWebWidFactory").createWid(n),enforcementCreationTime:a.enforcementCreationTime,enforcementViolationCategory:a.enforcementViolationCategory,enforcementType:a.enforcementType,enforcementId:a.enforcementId,enforcementExtraData:a.enforcementExtraData,targetMsgMapForEvidence:r,lastUpdated:Date.now(),enforcementSource:a.enforcementSource,countryCodes:[],appeal:{id:a.enforcementId,chatId:o("WAWebWidFactory").createWid(n),enforcementViolationCategory:a.enforcementViolationCategory,enforcementType:a.enforcementType,enforcementId:a.enforcementId,enforcementExtraData:a.enforcementExtraData,enforcementSource:a.enforcementSource,appealCreationTime:a.appealCreationTime,appealState:a.appealState,appealReason:null,countryCode:null,lastUpdated:Date.now(),serverMsgId:a.serverId.toString(),msgData:t==null?void 0:t.get(a.serverId)}}}function u(e,t){var n=[],r;return e==null||e.map(function(e){var a={id:e.enforcementId,chatId:o("WAWebWidFactory").createWid(t),enforcementViolationCategory:e.enforcementViolationCategory,enforcementType:e.enforcementType,enforcementId:e.enforcementId,enforcementExtraData:e.enforcementExtraData,enforcementSource:e.enforcementSource,appealCreationTime:e.appealCreationTime,appealState:e.appealState,appealReason:null,countryCode:null,lastUpdated:Date.now(),serverMsgId:null,msgData:null};r={id:e.enforcementId,chatId:o("WAWebWidFactory").createWid(t),enforcementCreationTime:e.enforcementCreationTime,enforcementViolationCategory:e.enforcementViolationCategory,enforcementType:e.enforcementType,enforcementId:e.enforcementId,enforcementExtraData:e.enforcementExtraData,targetMsgMapForEvidence:null,lastUpdated:Date.now(),enforcementSource:e.enforcementSource,countryCodes:[],appeal:a},n.push(r)}),n}function c(e,t,n){var r=[],a;return e==null||e.map(function(e){var i,l=(i=e.enforcementExtraData)==null||(i=i.enforcementTargetData)==null?void 0:i.serverId.toString(),s=l!=null?t==null?void 0:t.get(Number(l)):null,u=new Map,c={id:e.enforcementId,chatId:o("WAWebWidFactory").createWid(n),enforcementViolationCategory:e.enforcementViolationCategory,enforcementType:e.enforcementType,enforcementId:e.enforcementId,enforcementExtraData:e.enforcementExtraData,enforcementSource:e.enforcementSource,appealCreationTime:e.appealCreationTime,appealState:e.appealState,appealReason:null,countryCode:e.countryCodes,lastUpdated:Date.now(),serverMsgId:l,msgData:s};l!=null&&s!=null&&u.set(l,c),a={id:e.enforcementId,chatId:o("WAWebWidFactory").createWid(n),enforcementCreationTime:e.enforcementCreationTime,enforcementViolationCategory:e.enforcementViolationCategory,enforcementType:e.enforcementType,enforcementId:e.enforcementId,enforcementExtraData:e.enforcementExtraData,targetMsgMapForEvidence:u,lastUpdated:Date.now(),enforcementSource:e.enforcementSource,countryCodes:e.countryCodes,appeal:c},r.push(a)}),r}function d(t,n,r){var o=[];if((t==null?void 0:t.suspensions)!=null&&o.push.apply(o,e(t==null?void 0:t.suspensions,n,r)),(t==null?void 0:t.geoSuspensions)!=null&&o.push.apply(o,c(t==null?void 0:t.geoSuspensions,n,r)),(t==null?void 0:t.profilePictureDeletions)!=null&&o.push.apply(o,u(t==null?void 0:t.profilePictureDeletions,r)),(t==null?void 0:t.violatingMessages)!=null){var a=s(t==null?void 0:t.violatingMessages,n,r);a!=null&&o.push(a)}return o}l.convertNewsletterBaseEnforcementTypeToNewsletterAlert=d}),98); __d("WAWebGetNewsletterEnforcementAlertsJob",["WAJobOrchestratorTypes","WAWebMexFetchNewsletterEnforcementsJob","WAWebNewsletterEnforcementAlertModelUtils","WAWebOrchestratorNonPersistedJob","WAWebSchemaNewsletterMetadata","WAWebSuspendInformDataModelUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t){return t===void 0&&(t=o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION),o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getNewsletterEnforcementAlerts",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().get(e);if(t!=null){var n=yield o("WAWebMexFetchNewsletterEnforcementsJob").mexFetchNewsletterEnforcements(e),r=yield o("WAWebSuspendInformDataModelUtils").populateMsgModels(Array.from(d(n)),e);return{enforcementData:n!=null?o("WAWebNewsletterEnforcementAlertModelUtils").convertNewsletterBaseEnforcementTypeToNewsletterAlert(n,r,e):[],msgModelMap:r}}}),{priority:t}).waitUntilCompleted()}function s(e){var t,n=e==null||(t=e.filter(function(e){var t;return((t=e.enforcementExtraData)==null||(t=t.enforcementTargetData)==null?void 0:t.serverId)!=null}))==null?void 0:t.map(function(e){var t,n;return(t=(n=e.enforcementExtraData)==null||(n=n.enforcementTargetData)==null?void 0:n.serverId)!=null?t:0});return n!=null&&n.length>0?n:[]}function u(e){var t=e==null?void 0:e.flatMap(function(e){return e.serverId});return t!=null&&t.length>0?t:[]}function c(e){return e==null?[]:e.reduce(function(e,t){var n,r=(n=t.enforcementExtraData)==null||(n=n.enforcementTargetData)==null?void 0:n.serverId;return r!=null&&e.push(r),e},[])}function d(e){if(e==null)return new Set([]);var t=e.geoSuspensions,n=e.suspensions,r=e.violatingMessages;return new Set([].concat(s(n),u(r),c(t)))}l.getNewsletterEnforcementAlerts=e}),98); __d("WAWebMexCreateNewsletterJobMutation.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},r=[t,{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"update_time",storageKey:null}],o=[t,n,{alias:null,args:null,kind:"ScalarField",name:"direct_path",storageKey:null}],a=[{alias:null,args:[{kind:"Variable",name:"newsletter_input",variableName:"input"}],concreteType:"XWA2Newsletter",kind:"LinkedField",name:"xwa2_newsletter_create",plural:!1,selections:[t,{alias:null,args:null,concreteType:"XWA2NewsletterState",kind:"LinkedField",name:"state",plural:!1,selections:[n],storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadMetadata",kind:"LinkedField",name:"thread_metadata",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterName",kind:"LinkedField",name:"name",plural:!1,selections:r,storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterDescription",kind:"LinkedField",name:"description",plural:!1,selections:r,storageKey:null},{alias:null,args:[{kind:"Literal",name:"type",value:"IMAGE"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:o,storageKey:'picture(type:"IMAGE")'},{alias:"preview",args:[{kind:"Literal",name:"type",value:"PREVIEW"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:o,storageKey:'picture(type:"PREVIEW")'},{alias:null,args:null,kind:"ScalarField",name:"invite",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"handle",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verification",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"subscribers_count",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"creation_time",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterViewerMetadata",kind:"LinkedField",name:"viewer_metadata",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterUserSetting",kind:"LinkedField",name:"settings",plural:!0,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"role",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebMexCreateNewsletterJobMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebMexCreateNewsletterJobMutation",selections:a},params:{id:"25149874324715067",metadata:{},name:"WAWebMexCreateNewsletterJobMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebMexCreateNewsletterJob",["WAWebMexClient","WAWebMexCreateNewsletterJobMutation.graphql","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t,n){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r,a){var i=e!==void 0?e:e=n("WAWebMexCreateNewsletterJobMutation.graphql"),l={input:{name:t,description:r,picture:a}},s=yield o("WAWebMexClient").fetchQuery(i,l);return s}),u.apply(this,arguments)}l.mexCreateNewsletter=s}),98); __d("WAWebNewsletterCreateQueryJob",["WAWebMexCreateNewsletterJob","WAWebMexNewsletterParseUtils","WAWebNewsletterRpcUtils","WAWebURLUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){var t=e.description,n=e.name,r=e.picture;return s(n,t,r)}function s(e,t,n){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a;n!=null&&(a=r("WAWebURLUtils").parseDataURL(n).data);var i=yield o("WAWebNewsletterRpcUtils").runWithBackoff(function(){return o("WAWebMexCreateNewsletterJob").mexCreateNewsletter(e,t,a)});return o("WAWebMexNewsletterParseUtils").parseMexNewsletterResponse(i.xwa2_newsletter_create)}),u.apply(this,arguments)}l.createNewsletterQuery=e}),98); __d("WAWebNewsletterSystemMessages",["WATimeUtils","WAWebCommonNewsletterEnums","WAWebContactSystemMsg","WAWebMsgKey","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebUserPrefsMeUser","WAWebWidFactory"],(function(t,n,r,o,a,i,l){var e=new Map([["newsletter_privacy",10],["newsletter_created",20],["newsletter_admin_context_card",30],["newsletter_deleted",Number.MAX_SAFE_INTEGER]]),s=100,u=2147476647;function c(e){var t=e.serverId;return t==null?!1:t0||r.length>0?{newsletters:n,deletedNewsletters:r.length>0?{id:r}:null}:{newsletters:[]}}),m.apply(this,arguments)}l.mexFetchAllNewsletters=u,l.handleMexGetAllNewsletters=d}),98); __d("WAWebMexUpdateNewsletterJobMutation.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"},{defaultValue:null,kind:"LocalArgument",name:"updates"}],t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},n={alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null},r=[t,{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"update_time",storageKey:null}],o=[t,n,{alias:null,args:null,kind:"ScalarField",name:"direct_path",storageKey:null}],a=[{alias:null,args:[{kind:"Variable",name:"newsletter_id",variableName:"newsletter_id"},{kind:"Variable",name:"updates",variableName:"updates"}],concreteType:"XWA2Newsletter",kind:"LinkedField",name:"xwa2_newsletter_update",plural:!1,selections:[t,{alias:null,args:null,concreteType:"XWA2NewsletterState",kind:"LinkedField",name:"state",plural:!1,selections:[n],storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadMetadata",kind:"LinkedField",name:"thread_metadata",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterName",kind:"LinkedField",name:"name",plural:!1,selections:r,storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterDescription",kind:"LinkedField",name:"description",plural:!1,selections:r,storageKey:null},{alias:null,args:[{kind:"Literal",name:"type",value:"IMAGE"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:o,storageKey:'picture(type:"IMAGE")'},{alias:"preview",args:[{kind:"Literal",name:"type",value:"PREVIEW"}],concreteType:"XWA2Picture",kind:"LinkedField",name:"picture",plural:!1,selections:o,storageKey:'picture(type:"PREVIEW")'},{alias:null,args:null,kind:"ScalarField",name:"invite",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"handle",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"verification",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"creation_time",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterThreadSettings",kind:"LinkedField",name:"settings",plural:!1,selections:[{alias:null,args:null,concreteType:"XWA2NewsletterReactionCodesSetting",kind:"LinkedField",name:"reaction_codes",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebMexUpdateNewsletterJobMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebMexUpdateNewsletterJobMutation",selections:a},params:{id:"24250201037901610",metadata:{},name:"WAWebMexUpdateNewsletterJobMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebMexUpdateNewsletterJob",["WAWebMexClient","WAWebMexNewsletterUtils","WAWebMexUpdateNewsletterJobMutation.graphql","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t,n,r,o){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r,a,i,l){var s=e!==void 0?e:e=n("WAWebMexUpdateNewsletterJobMutation.graphql"),u={newsletter_id:t,updates:{name:r,description:a,picture:i,settings:l!=null?{reaction_codes:{value:o("WAWebMexNewsletterUtils").mapReactionCodesSettingToMexInput(l)}}:null}},c=yield o("WAWebMexClient").fetchQuery(s,u);return c}),u.apply(this,arguments)}l.mexUpdateNewsletter=s}),98); __d("WAWebNewsletterMetadataQueryJob",["WABase64","WAWebMexFetchAllNewslettersMetadataJob","WAWebMexNewsletterParseUtils","WAWebMexNewsletterUtils","WAWebMexUpdateNewsletterJob","WAWebNewsletterQueryUtils","WAWebNewsletterRpcUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(){var e=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebMexFetchAllNewslettersMetadataJob").handleMexGetAllNewsletters()});return function(){return e.apply(this,arguments)}})();return o("WAWebNewsletterRpcUtils").runWithBackoff(e)}function s(e,t){var n=o("WAWebNewsletterQueryUtils").getNewsletterMetadataQueryParamArgs(e,t,{creationTime:!0,name:!0,picture:!0,description:!0,inviteLink:!0,handle:!0,subscribers:!0,privacy:!0,verification:!0,linkedAccounts:!0,state:!0});return o("WAWebNewsletterRpcUtils").runWithBackoff(function(){return c(n)})}function u(e,t,n){var r=o("WAWebNewsletterQueryUtils").getNewsletterMetadataQueryParamArgs(e,t,n);return o("WAWebNewsletterRpcUtils").runWithBackoff(function(){return c(r)})}function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return o("WAWebMexNewsletterUtils").handleMexGetNewsletter(e)}),d.apply(this,arguments)}function m(e,t,n){return _(e,t,n)}function p(e){return{idJid:e,newsletterUserSettingsMetadataMixin:[],newsletterCreationTimeMetadataMixin:null,newsletterNameMetadataMixin:null,newsletterPictureMetadataMixin:null,newsletterDescriptionMetadataMixin:null,newsletterInviteLinkMetadataMixin:null,newsletterSubscribersMetadataMixin:null,newsletterPrivacyMetadataMixin:null,newsletterVerificationMetadataMixin:null,hasNewsletterLinkedAccountsMetadataMixin:!1,newsletterMembershipMetadataMixin:null,newsletterStateMetadataMixin:null}}function _(e,t,n){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=t.editDescription,a=t.editName,i=t.editPicture,l=t.editReactionCodesSetting,s=n.description,u=n.name,c=n.picture,d=n.reactionCodesSetting,m;c!=null&&(m=o("WABase64").encodeB64(c));var p=g(i,m),_=g(a,u),f=g(r,s),h=l===!0?d:null,y=yield o("WAWebNewsletterRpcUtils").runWithBackoff(function(){return o("WAWebMexUpdateNewsletterJob").mexUpdateNewsletter(e,_,f,p,h)});return o("WAWebMexNewsletterParseUtils").parseMexNewsletterResponse(y.xwa2_newsletter_update)}),f.apply(this,arguments)}function g(e,t){if(e===!0)return t!=null?t:""}l.queryAllNewslettersMetadata=e,l.queryNewsletterMetadataByInviteCode=s,l.queryNewsletterMetadataByJid=u,l.editNewsletterMetadataQuery=m,l.emptyNewsletterMetadataType=p}),98); __d("WAWebNewsletterMetadataJob",["Promise","WAJobOrchestratorTypes","WAWebNewsletterCreateJob","WAWebNewsletterMetadataQueryJob","WAWebOrchestratorNonPersistedJob","WAWebSchemaNewsletterMetadata","WAWebSchemaProfilePicThumb","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=["id"],s;function u(){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getAllNewslettersMetadata",function(){return o("WAWebNewsletterMetadataQueryJob").queryAllNewslettersMetadata()},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function c(e,t,n){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("getNewsletterMetadata",function(){return o("WAWebNewsletterMetadataQueryJob").queryNewsletterMetadataByJid(e,t,n)},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function d(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateNewsletterMetadata",function(){return Array.isArray(e)?o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().bulkCreateOrMerge(e):o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().createOrMerge(e.id,e)},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function m(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("deleteNewsletterMetadata",function(){return o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().remove(e)},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function p(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("deleteNewsletterPicture",function(){return o("WAWebSchemaProfilePicThumb").getProfilePicThumbTable().remove(e)},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function _(e,t,n){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("editNewsletterMetadata",function(){var r=n.picture,a=o("WAWebNewsletterCreateJob").encodePicture(r);return o("WAWebNewsletterMetadataQueryJob").editNewsletterMetadataQuery(e,t,babelHelpers.extends({},n,{picture:a}))},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function f(t,r,a,i){return i===void 0&&(i=o("WAJobOrchestratorTypes").JOB_PRIORITY.LOW),o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateNewsletterMessageDeliveryUpdates",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var i=yield o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().get(t);if(i==null)return(s||(s=n("Promise"))).resolve();var l=i.messageDeliveryUpdates,u=l===void 0?new Map:l;return a.forEach(function(e){u==null||u.delete(e)}),r.forEach(function(t){var n=t.id,r=babelHelpers.objectWithoutPropertiesLoose(t,e);u==null||u.set(n,r)}),i.messageDeliveryUpdates=u,o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().merge(t,i)}),{priority:i}).waitUntilCompleted()}function g(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("suspendNewsletter",function(){return o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().merge(e,{id:e,suspended:!0})},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function h(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("geosuspendNewsletter",function(){return o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().merge(e,{id:e,suspended:!0,geosuspended:!0})},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}l.getAllNewslettersMetadata=u,l.getNewsletterMetadata=c,l.updateNewsletterMetadata=d,l.deleteNewsletterMetadata=m,l.deleteNewsletterPicture=p,l.editNewsletterMetadata=_,l.updateNewsletterMessageDeliveryUpdates=f,l.suspendNewsletter=g,l.geosuspendNewsletter=h}),98); __d("WAWebNewsletterSendMessageQueryJob",["WASmaxMessagePublishNewsletterRPC","WAStanzaUtils","WAWebNewsletterValidationUtils","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){o("WAWebNewsletterValidationUtils").validateNewsletterJidOrThrow(e.newsletterJid);var t={messageTo:e.newsletterJid,clientNewsletterAndServerOrNewsletterIDMixinGroupArgs:u(e)},n=yield o("WASmaxMessagePublishNewsletterRPC").sendNewsletterRPC(t);switch(n.name){case"NewsletterResponseSuccess":return{success:!0,ack:{t:n.value.newsletterQuestionResponseOrNewsletterMessageAckMixinGroup.value.t},serverId:n.value.newsletterQuestionResponseOrNewsletterMessageAckMixinGroup.value.serverId};case"NewsletterResponseNegative":return{success:!1,ack:{t:n.value.t,error:n.value.error}}}}),s.apply(this,arguments)}function u(e){switch(e.type){case"reaction":return c(e);case"pollVote":return d(e);case"newsletterQuestionResponse":return m(e);default:return{newsletterClientID:p(e)}}}function c(e){var t=e.reactionCode,n=t!=null&&t!==""?{newsletterReaction:{reactionCode:t}}:{isNewsletterReactionRevoke:!0};return{newsletterClientAndServerID:{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),messageServerId:e.parentMsgServerId,newsletterQuestionResponsePublishOrReactionOrReactionRevokeOrPollVoteMixinGroupArgs:n}}}function d(e){var t={voteArgs:e.votes.map(function(e){return{voteElementValue:e}})};return{newsletterClientAndServerID:{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),messageServerId:e.parentMsgServerId,newsletterQuestionResponsePublishOrReactionOrReactionRevokeOrPollVoteMixinGroupArgs:{newsletterPollVote:t}}}}function m(e){return{newsletterClientAndServerID:{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),messageServerId:e.parentMsgServerId,newsletterQuestionResponsePublishOrReactionOrReactionRevokeOrPollVoteMixinGroupArgs:{newsletterQuestionResponsePublish:{payloadMixinArgs:{plaintextElementValue:e.payload}}}}}}function p(e){switch(e.type){case"editText":return{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),newsletterClientIdContentArgs:{newsletterEdit:{hasWAMOSub:e.isWamoSub,newsletterQuestionReplyOrTextOrMediaMixinGroupArgs:{newsletterText:{payloadMixinArgs:{plaintextElementValue:e.payload}}}}}};case"editMedia":{var t=e.contentId==null?null:{senderContentTypeMediaRCATMixinArgs:{plaintextContentId:e.contentId}};return babelHelpers.extends({messageId:o("WAStanzaUtils").toStanzaId(e.messageId)},t,{newsletterClientIdContentArgs:{newsletterEdit:{hasWAMOSub:e.isWamoSub,newsletterQuestionReplyOrTextOrMediaMixinGroupArgs:{newsletterMedia:{payloadMixinArgs:{plaintextElementValue:e.payload},plaintextMediatype:e.mediaType}}}}})}case"revoke":return{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),newsletterClientIdContentArgs:{newsletterRevoke:{hasWAMOSub:e.isWamoSub}}};case"pollCreation":return{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),newsletterClientIdContentArgs:{newsletterPollCreation:{payloadMixinArgs:{plaintextElementValue:e.payload},hasWAMOSub:e.isWamoSub,metaContenttype:e.contentType}}};case"pollResultSnapshot":return{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),newsletterClientIdContentArgs:{newsletterPollResultSnapshot:{payloadMixinArgs:{plaintextElementValue:e.payload},hasWAMOSub:e.isWamoSub}}};case"text":return{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),newsletterClientIdContentArgs:babelHelpers.extends({},_({newsletterText:{payloadMixinArgs:{plaintextElementValue:e.payload},hasWAMOSub:e.isWamoSub}},e.isQuestion,e.questionReplyQuotedMessage))};case"url":return{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),senderContentTypeMediaRCATMixinArgs:{plaintextContentId:e.contentId},newsletterClientIdContentArgs:babelHelpers.extends({},_({newsletterMediaPublish:{plaintextMediatype:e.type,payloadMixinArgs:{plaintextElementValue:e.payload},messageMediaId:e.mediaHandle,hasWAMOSub:e.isWamoSub,messageAssociationTypeMixinArgs:e.messageAssociationTypeMixinArgs}},e.isQuestion,e.questionReplyQuotedMessage))};case"audio":case"avatar_sticker":case"document":case"gif":case"image":case"ptt":case"sticker":case"sticker_pack":case"vcard":case"video":return{messageId:o("WAStanzaUtils").toStanzaId(e.messageId),newsletterClientIdContentArgs:babelHelpers.extends({},_({newsletterMediaPublish:{plaintextMediatype:e.type,payloadMixinArgs:{plaintextElementValue:e.payload},messageMediaId:e.mediaHandle,hasWAMOSub:e.isWamoSub,messageAssociationTypeMixinArgs:e.messageAssociationTypeMixinArgs}},e.isQuestion,e.questionReplyQuotedMessage))};default:throw e.type,r("err")("Wrong code path for "+e.type)}}function _(e,t,n){if(t)return{newsletterQuestionPublish:{newsletterTextOrMediaPublishMixinGroupArgs:e}};if(n){var o,a;if(((o=n.quotedResponse.questionResponseInfo)==null?void 0:o.responseServerId)==null)throw r("err")("Missing response server id for question reply");return{newsletterQuestionReplyPublish:{metaParentServerId:n.questionServerId,metaResponseServerId:(a=n.quotedResponse.questionResponseInfo)==null?void 0:a.responseServerId,newsletterTextOrMediaPublishMixinGroupArgs:e}}}return e}l.querySendNewsletterMessage=e}),98); __d("WAWebNewsletterSendMessageJob",["Promise","WAJobOrchestratorTypes","WALogger","WAWebBackendJobs.flow","WAWebBackendJobsCommon","WAWebMediaGatingUtils","WAWebMediaMetadata","WAWebMessageAssociation.flow","WAWebMsgType","WAWebNewsletterSendMessageQueryJob","WAWebNewsletterValidationUtils","WAWebOrchestratorNonPersistedJob","WAWebOutgoingMessage","WAWebPollCreationUtils","WAWebProtobufsE2E.pb","WAWebSendMsgTypes","encodeProtobuf","err","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=/[?&]id=([0-9]+)(?=&|#|$)/i;function m(e){if(r("isStringNullOrEmpty")(e))return null;var t=e.match(d);return t?t[1]:null}var p="&";function _(e,t){try{if(e.type!==o("WAWebMsgType").MSG_TYPE.VIDEO||!o("WAWebMediaGatingUtils").isChannelVideoServerTranscodeUploadEnabled())return t;var n=o("WAWebMediaMetadata").mediaMetadata(e),a=n==null?void 0:n.metadataUrl;if(a==null)return t;var i=m(a);if(r("isStringNullOrEmpty")(i))return t;var l=t||"";return l&&(l+=p),l+=i,l}catch(e){return t}}function f(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendNewsletterMessage",function(){return h(e)},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function g(e,t){var n=e.msg,r=e.type,a={messageId:n.id.id,newsletterJid:e.newsletterJid,payload:o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufsE2E.pb").MessageSpec,t).readByteArrayView(),isWamoSub:n.isWamoSub===!0||void 0};if(r==="pollCreation")return babelHelpers.extends({},a,{type:"pollCreation",contentType:(n==null?void 0:n.pollContentType)===o("WAWebPollCreationUtils").PollContentType.IMAGE?"image":"text"});var i=babelHelpers.extends({},a,{isQuestion:n.isQuestion,questionReplyQuotedMessage:n.questionReplyQuotedMessage});if(r==="media"){var l=_(n,e.mediaHandle);return babelHelpers.extends({},i,{mediaHandle:l,type:C(t),messageAssociationTypeMixinArgs:y(n),contentId:e.contentId})}return babelHelpers.extends({},i,{type:r})}function h(e){switch(o("WAWebNewsletterValidationUtils").validateNewsletterJidOrThrow(e.newsletterJid),e.type){case"edit":{var t=o("WAWebOutgoingMessage").createOutgoingMsgModelProtobuf(o("WAWebOutgoingMessage").OutgoingMessageOriginType.Newsletter,e.msg),a=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufsE2E.pb").MessageSpec,t),i=e.msg.isWamoSub===!0||void 0,l={messageId:e.msg.id.id,newsletterJid:e.newsletterJid,payload:a.readByteArrayView(),isWamoSub:i},s=e.editType==="media"?babelHelpers.extends({},l,{type:"editMedia",mediaType:C(t),contentId:e.contentId}):babelHelpers.extends({},l,{type:"editText"});return o("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage(s)}case"pollCreation":case"pollResultSnapshot":case"text":case"media":{var u=o("WAWebOutgoingMessage").createOutgoingMsgModelProtobuf(o("WAWebOutgoingMessage").OutgoingMessageOriginType.Newsletter,e.msg),d=g(e,u);return o("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage(d)}case"revoke":return o("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage({messageId:e.messageId,newsletterJid:e.newsletterJid,type:"revoke",isContentMedia:e.isContentMedia,isWamoSub:e.isWamoSub===!0||void 0});case"reaction":return o("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage({type:"reaction",newsletterJid:e.newsletterJid,reactionCode:e.reactionCode,messageId:e.msg.id.id,parentMsgServerId:e.parentMsgServerId});case"pollVote":return o("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage({type:"pollVote",newsletterJid:e.newsletterJid,votes:e.votes,messageId:e.msg.id.id,parentMsgServerId:e.parentMsgServerId});case"newsletterQuestionResponse":{var m=o("WAWebOutgoingMessage").createOutgoingMessageProtobuf(o("WAWebOutgoingMessage").OutgoingMessageOriginType.Newsletter,{type:o("WAWebSendMsgTypes").SendMessageRecordType.Addon,data:e.msg});return o("WAWebNewsletterSendMessageQueryJob").querySendNewsletterMessage({messageId:e.msg.id.id,newsletterJid:e.newsletterJid,payload:o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufsE2E.pb").MessageSpec,m).readByteArrayView(),type:"newsletterQuestionResponse",parentMsgServerId:e.parentMsgServerId})}default:return e.type,(c||(c=n("Promise"))).reject(r("err")("Unexpected message type: "+e.type))}}function y(t){var n=t.associationType;if(n==null)return null;switch(n){case o("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL:return{metaMessageAssociationType:"media_poll"};case o("WAWebMessageAssociation.flow").MessageAssociationType.BOT_PLUGIN:case o("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_ALBUM:case o("WAWebMessageAssociation.flow").MessageAssociationType.HD_IMAGE_DUAL_UPLOAD:case o("WAWebMessageAssociation.flow").MessageAssociationType.HD_VIDEO_DUAL_UPLOAD:case o("WAWebMessageAssociation.flow").MessageAssociationType.HEVC_VIDEO_DUAL_UPLOAD:case o("WAWebMessageAssociation.flow").MessageAssociationType.UNKNOWN:return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] unexpected msg association type: ",""])),n).tags("newsletter").sendLogs("newsletter-message-association-type-"+n),null}}function C(e){var t=o("WAWebBackendJobsCommon").mediaTypeFromProtobuf(e);if(t==null)throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to get media type from protobuf"]))).tags("newsletter").sendLogs("newsletter-failed-media-type-from-protobuf"),r("err")("Failed to get media type from protobuf");switch(t){case o("WAWebBackendJobs.flow").EncMediaType.Audio:return"audio";case o("WAWebBackendJobs.flow").EncMediaType.Document:return"document";case o("WAWebBackendJobs.flow").EncMediaType.Gif:return"gif";case o("WAWebBackendJobs.flow").EncMediaType.Image:return"image";case o("WAWebBackendJobs.flow").EncMediaType.Ptt:return"ptt";case o("WAWebBackendJobs.flow").EncMediaType.Sticker:return"sticker";case o("WAWebBackendJobs.flow").EncMediaType.Url:return"url";case o("WAWebBackendJobs.flow").EncMediaType.VCard:return"vcard";case o("WAWebBackendJobs.flow").EncMediaType.Video:return"video";case o("WAWebBackendJobs.flow").EncMediaType.StickerPack:return"sticker_pack";default:throw o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Unsupported media type"]))).tags("newsletter").sendLogs("newsletter-unsupported-media-type-"+t),r("err")("Unsupported media type "+t)}}l.extractVideoIdFromMetadataUrl=m,l.maybeAddVideoIdToMediaHandle=_,l.sendNewsletterMessageJob=f,l.sendNewsletterMessage=h}),98); __d("WAWebNewsletterUpdateMsgsRecordsJob",["Promise","WAJobOrchestratorTypes","WALogger","WAWebDBMessageSerialization","WAWebDBMessageUtils","WAWebFrontendMsgGetters","WAWebMessageProcessorCache","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebOrchestratorNonPersistedJob","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e){return d(e).waitUntilCompleted()}function d(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("addNewsletterMsgsRecords",function(){return e.length===0?(u||(u=n("Promise"))).resolve():o("WAWebMessageProcessorCache").messageProcessorCache.addMessages(e.map(function(e){return{msg:e}}),!0)},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION})}function m(t){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateNewsletterMsgRecord",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(!o("WAWebMsgGetters").getIsNewsletterMsg(t)){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterMsgRecord] Called on a non-newsletter msg"])));return}if((yield o("WAWebSchemaMessage").getMessageTable().get(t.id.toString()))==null){o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterMsgRecord] Msg not found, skipping"])));return}var n=t.serverId,r=o("WAWebFrontendMsgGetters").getChat(t),a=p(o("WAWebMsgDataFromModel").msgDataFromMsgModel(t)),i=o("WAWebDBMessageSerialization").dbRowFromMessage(a);n!=null&&(i.internalId=o("WAWebDBMessageUtils").craftInternalId(r.id.toJid(),n)),yield o("WAWebSchemaMessage").getMessageTable().merge(t.id.toString(),i)}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function p(e){return delete e.serverId,delete e.rowId,delete e.messageRangeIndex,e}l.addNewsletterMsgsRecords=c,l.addNewsletterMsgsRecordsJob=d,l.updateNewsletterMsgRecord=m}),98); __d("WAWebMexUpdateNewsletterUserSettingJobMutation.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"XWA2NewsletterMutationResponse",kind:"LinkedField",name:"xwa2_newsletter_update_user_setting",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,concreteType:"XWA2NewsletterState",kind:"LinkedField",name:"state",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"type",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebMexUpdateNewsletterUserSettingJobMutation",selections:t,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebMexUpdateNewsletterUserSettingJobMutation",selections:t},params:{id:"31938993655691868",metadata:{},name:"WAWebMexUpdateNewsletterUserSettingJobMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebMexUpdateNewsletterUserSetting",["WAWebMexClient","WAWebMexNewsletterUtils","WAWebMexUpdateNewsletterUserSettingJobMutation.graphql","WAWebNewsletterRpcUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=e!==void 0?e:e=n("WAWebMexUpdateNewsletterUserSettingJobMutation.graphql");function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebNewsletterRpcUtils").runWithBackoff(function(){return d(e)}),n=o("WAWebMexNewsletterUtils").convertMutationResponse(t.xwa2_newsletter_update_user_setting);return[n]}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t={input:e},n=yield o("WAWebMexClient").fetchQuery(s,t);return n}),m.apply(this,arguments)}l.mexUpdateNewsletterUserSetting=u}),98); __d("WAWebNewsletterUpdateUserSettingJob",["Promise","WAJobOrchestratorTypes","WALogger","WAWebMexUpdateNewsletterUserSetting","WAWebMiscErrors","WAWebNewsletterModelUtils","WAWebOrchestratorNonPersistedJob","WAWebSchemaChat","WAWebSchemaNewsletterMetadata","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateNewsletterUserSetting",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield m(e)}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.muteExpirationValue,n=e.newsletterJid,r=e.type;o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["newsletter setMuteState"])));var a=t===o("WAWebNewsletterModelUtils").MUTED_STATE?"mute":"unmute",i=yield o("WAWebMexUpdateNewsletterUserSetting").mexUpdateNewsletterUserSetting({newsletter_id:n,type:r===o("WAWebNewsletterModelUtils").ADMIN_NOTIFICATIONS?"MUTE_ADMIN_ACTIVITY":"MUTE_FOLLOWER_ACTIVITY",value:t===o("WAWebNewsletterModelUtils").MUTED_STATE?"ON":"OFF"}),l=i.filter(function(e){return e.subscriberNotFoundMixin==null}).map(function(e){return e.jid});try{return yield _(l,r,t)}catch(e){throw e instanceof o("WAWebMiscErrors").DbOnLogoutAbort||o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][","Newsletter] Failed to persist the mutation on db"])),a).tags("newsletter").sendLogs("newsletter-"+a+"-db-fail"),e}}),p.apply(this,arguments)}function _(t,r,a){switch(r){case o("WAWebNewsletterModelUtils").ADMIN_NOTIFICATIONS:return o("WAWebSchemaChat").getChatTable().bulkMergeOnly(t.map(function(e){return{id:e,muteExpiration:a}}));case o("WAWebNewsletterModelUtils").FOLLOWER_NOTIFICATIONS:return o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().bulkMergeOnly(t.map(function(e){return{id:e,followerActivityMuteExpiration:a}}));default:return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][updateNewsletterUserSetting] Invalid setting type ",""])),r).tags("newsletter"),(c||(c=n("Promise"))).resolve()}}l.updateNewsletterUserSetting=d}),98); __d("WAWebNewsletterMetadataInitFromStorage",["WAJids","WALinkify","WALogger","WAWebBackendApi","WAWebCommonNewsletterEnums","WAWebNewsletterMessageDeliveryUpdateToModelUtils","WAWebNewsletterMetadataCollection","WAWebSchemaNewsletterMetadata","WAWebWidFactory","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){var e;function s(e){switch(e){case 0:return o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber;case 1:return o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin;case 3:return o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner;case 2:default:return o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest}}function u(e){switch(e){case 0:return o("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.All;case 3:return o("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.None;case 2:return o("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.Blocklist;case 1:default:return o("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.Basic}}function c(e){switch(e){case 0:return o("WAWebCommonNewsletterEnums").NewsletterCapability.Insights;case 1:return o("WAWebCommonNewsletterEnums").NewsletterCapability.PhotoPolls;default:return null}}function d(e){switch(e){case 1:return o("WAWebCommonNewsletterEnums").NewsletterPrivacy.Private;case 0:default:return o("WAWebCommonNewsletterEnums").NewsletterPrivacy.Public}}function m(e){switch(e){case 0:return o("WAWebCommonNewsletterEnums").WamoSubStatus.ACTIVE;case 1:default:return o("WAWebCommonNewsletterEnums").WamoSubStatus.INACTIVE}}function p(){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var t=yield o("WAWebSchemaNewsletterMetadata").getNewsletterMetadataTable().all(),a=new Set;t.forEach((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebWidFactory").createWid(e.id),n={id:t,creationTime:e.creationTime,name:e.name,nameUpdateTime:e.nameUpdateTime,description:e.description,descriptionUpdateTime:e.descriptionUpdateTime,handle:e.handle,inviteCode:e.inviteCode,size:e.size,verified:e.verified,membershipType:s(e.membershipType),reactionCodesSetting:u(e.reactionCodesSetting),privacy:d(e.privacy),website:e.website!=null?o("WALinkify").findLink(e.website):null,adminCount:e.adminCount,capabilities:e.capabilities!=null?new Set(r("compactMap")(Array.from(e.capabilities),function(e){var t=c(e);return t==null&&a.add(e),t})):new Set,suspended:e.suspended,geosuspended:e.geosuspended,terminated:e.terminated,wamoSubPlanId:e.wamoSubPlanId,wamoSubStatus:m(e.wamoSubStatus)};if(r("WAWebNewsletterMetadataCollection")==null||r("WAWebNewsletterMetadataCollection").add(n,{merge:!0}),e.messageDeliveryUpdates!=null){var i=[];e.messageDeliveryUpdates.forEach(function(e,t){return i.push({id:t,code:e.code})});var l=yield o("WAWebNewsletterMessageDeliveryUpdateToModelUtils").getMessageDeliveryUpdatesModelToUpdate(o("WAJids").toNewsletterJid(e.id),i,[]),p=l.modelUpdatesToAdd;yield o("WAWebBackendApi").frontendFireAndForget("updateNewsletterMessageDeliveryUpdate",{id:t,modelUpdatesToAdd:p,modelUpdatesToRemove:[]})}});return function(t){return e.apply(this,arguments)}})()),a.size>0&&o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Encountered "," unexpected newsletter capabilities in DB: ",""])),a.size,Array.from(a).join(", ")).tags("newsletter-capabilities").sendLogs("Unexpected newsletter capability in DB")}finally{}}),_.apply(this,arguments)}l.restoreNewsletterMetadata=p}),98); __d("WAWebCRUDOperationsNewsletterPollsVotes",["WAWebModelStorageUtils","WAWebSchemaNewsletterPollsVotes","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return o("WAWebModelStorageUtils").getStorage().lock(["newsletter-polls-votes"],(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t[0],r=new Map(e.map(function(e){return[e.parentMsgKey,e]})),o=(yield n.bulkGet(e.map(function(e){return e.parentMsgKey}))).filter(Boolean);o.forEach(function(e){var t=r.get(e.parentMsgKey);t!=null&&t.serverTimestamp0,n),C=(l=y==null?void 0:y.id)!=null?l:yield s(t,e.serverId),b=(u=e.newsletterViewsCountViewsOrDeprecatedMixinGroup)==null||(u=u.value)==null?void 0:u.viewsCountCount,v=(c=(d=e.newsletterForwardsCountMixin)==null?void 0:d.forwardsCountCount)!=null?c:0,S=(_=(f=e.newsletterResponsesCountMixin)==null?void 0:f.responsesCountCount)!=null?_:0;return{msgData:y,reactionData:m(g,C,n),pollVoteData:p(h,C,n),id:C,viewCount:b,questionResponsesCount:S,forwardsCount:v}}),d.apply(this,arguments)}function m(e,t,n){return t!=null&&e!=null&&e.length>0?{parentMsgKey:t,serverTimestamp:n,emojiCountMap:e.reduce(function(e,t){return e.set(t.code,t.count)},new Map)}:null}function p(e,t,n){return t==null||e==null||e.length===0?null:{parentMsgKey:t,serverTimestamp:n,voteCountMap:e.reduce(function(e,t){return e.set(o("WAWebPollOptionHashUtils").bufferToHex(t.elementValue),t.count)},new Map)}}l.mapMsgAndAddOns=c}),98); __d("WAWebNewsletterPollsUtils",["WATimeUtils","WAWebNewsletterGatingUtils","sumBy"],(function(t,n,r,o,a,i,l){function e(e,t,n){var a,i,l=new Map,s=Array.from((a=e==null||(i=e.pollVotesCountMap)==null?void 0:i.values())!=null?a:[]),c=r("sumBy")(s,function(e){return e}),d=Math.max.apply(Math,s),m=e==null?void 0:e.pollVotersMap;for(var p of t){var _,f,g,h,y,C,b=!!(!(e==null||(_=e.myVote)==null)&&_.has(p.localId)),v=Math.max((f=e==null||(g=e.pollVotesCountMap)==null?void 0:g.get(p.localId))!=null?f:0,b?1:0),S=m==null?void 0:m.get(p.localId),R=b?u(n,e==null?void 0:e.myVoteTs):null,L=(R!=null?[R]:[]).concat((h=S==null?void 0:S.contacts)!=null?h:[]);l.set(p,{isVotedForByMe:b,isCurrentLeader:d>0&&v===d,percentageOfAll:c===0?0:v/c,percentageOfMostVotedForOption:d===0?0:v/d,votes:o("WAWebNewsletterGatingUtils").isNewsletterPollsVotersEnabled()?L.concat((y=S==null?void 0:S.others)!=null?y:[]):[],count:v,mode:"newsletter",contactVoters:L,otherVoters:(C=S==null?void 0:S.others)!=null?C:[]})}return l}function s(e){return{parentMsgKey:e.parentMsgKey.toString(),serverTimestamp:e.serverTimestamp,votesMap:e.voteCountMap}}function u(e,t){var n;return e==null?null:{contact:e,id:e.id,time:(n=o("WATimeUtils").castMillisTimeToUnixTime(t))!=null?n:o("WATimeUtils").unixTime()}}l.aggregateNewsletterVotes=e,l.mapNewsletterVoteToDbRecord=s}),98); __d("WAWebNewsletterReactionUtils",["WATimeUtils"],(function(t,n,r,o,a,i,l){function e(e){var t,n;return{serverTimestamp:(t=e.reactionCountMapTs)!=null?t:o("WATimeUtils").unixTime(),emojiCountMap:(n=e.reactionCountMap)!=null?n:new Map,parentMsgKey:e.id.toString()}}function s(e){var t=e.emojiCountMap,n=e.parentMsgKey,r=e.serverTimestamp;if(!(r==null||t==null))return{serverTimestamp:r,emojiCountMap:t,parentMsgKey:n.toString()}}l.mapFrontendReactionToBackend=e,l.mapReactionDataToDbRecord=s}),98); __d("WAWebNewsletterBackendAddOnsUtils",["Promise","WAWebCRUDOperationsNewsletterPollsVotes","WAWebDBProcessEditProtocolMsgs","WAWebModelStorageUtils","WAWebMsgType","WAWebNewsletterMapMsgAndAddOns","WAWebNewsletterMsgEditUtils","WAWebNewsletterPollsUtils","WAWebNewsletterReactionUtils","WAWebSchemaMessage","WAWebStoreMsgs","WAWebdbCRUDOperationsNewsletterReaction","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.forwardsCounts,a=e.ids,i=e.msgs,l=e.pollVotes,s=e.questionResponsesCounts,u=e.reactionIdsToRemove,c=e.reactions,d=e.timestamp,m=e.viewCounts;if(c.length>0&&(yield o("WAWebdbCRUDOperationsNewsletterReaction").createOrUpdateNewsletterReactions(r("compactMap")(c,o("WAWebNewsletterReactionUtils").mapReactionDataToDbRecord))),u.length>0&&(yield o("WAWebdbCRUDOperationsNewsletterReaction").bulkRemoveNewsletterReactionsForParentMsg(u)),l.length>0&&(yield o("WAWebCRUDOperationsNewsletterPollsVotes").bulkCreateOrUpdateVotes(l.map(o("WAWebNewsletterPollsUtils").mapNewsletterVoteToDbRecord))),i.length>0){var p=new Map(i.map(function(e){return[e.id.toString(),e]})),_=[],f=[],g=[],h=yield o("WAWebSchemaMessage").getMessageTable().bulkGet(i.map(function(e){return e.id.toString()}));h.forEach(function(e){if(e!=null){var t=p.get(e.id);t!=null&&(t==null?void 0:t.kind)===o("WAWebMsgType").MsgKind.RevokedMessage&&e.type!==o("WAWebMsgType").MSG_TYPE.REVOKED?(f.push(t),g.push(e)):(t==null?void 0:t.t)!=null&&t.t>e.t&&_.push(t)}}),yield o("WAWebDBProcessEditProtocolMsgs").processEditProtocolMsgs(_.map(o("WAWebNewsletterMsgEditUtils").mapMsgToEditProtocolMsgLegacy)),yield o("WAWebSchemaMessage").getMessageTable().bulkRemove(g.map(function(e){var t=e.id;return t.toString()})),yield o("WAWebStoreMsgs").storeMsgs(f)}a.length>0&&(yield o("WAWebModelStorageUtils").getStorage().lock(["message"],(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n=e[0],r=yield n.bulkGet(a.map(function(e){return e.toString()})).then(function(e){return e.filter(Boolean)}),o=r.map(function(e){var n,r,o,a=e.forwardsCount,i=e.id,l=e.questionResponsesCount,u=e.viewCount;return{id:i,lastUpdateFromServerTs:d,viewCount:(n=m==null?void 0:m.get(i))!=null?n:u,questionResponsesCount:(r=s==null?void 0:s.get(i))!=null?r:l,forwardsCount:(o=t==null?void 0:t.get(i))!=null?o:a}});return n.bulkCreateOrMerge(o)});return function(t){return e.apply(this,arguments)}})()))}),u.apply(this,arguments)}function c(t,r,a){return t.reduce((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield e,i=yield o("WAWebNewsletterMapMsgAndAddOns").mapMsgAndAddOns(t,r,a);if(i==null)return n;var l=i.forwardsCount,s=i.id,u=i.msgData,c=i.pollVoteData,d=i.questionResponsesCount,m=i.reactionData,p=i.viewCount;return s!=null&&(u==null?void 0:u.kind)!==o("WAWebMsgType").MsgKind.RevokedMessage&&n.ids.push(s),u!=null&&n.msgs.push(u),p!=null&&s!=null&&n.viewCounts.set(s.toString(),p),d!=null&&s!=null&&n.questionResponsesCounts.set(s.toString(),d),l!=null&&s!=null&&n.forwardsCounts.set(s.toString(),l),m==null?s!=null&&n.reactionIdsToRemove.push(s.toString()):n.reactions.push(m),c!=null&&n.pollVotes.push(c),n});return function(t,n){return e.apply(this,arguments)}})(),(e||(e=n("Promise"))).resolve({ids:[],reactions:[],reactionIdsToRemove:[],msgs:[],viewCounts:new Map,pollVotes:[],questionResponsesCounts:new Map,forwardsCounts:new Map}))}l.updateAddOnDbRecords=s,l.getMsgsAndAddOnsFromUpdates=c}),98); __d("WAWebNewsletterGetMessagesQueryJob",["Promise","WALogger","WASmaxNewslettersGetNewsletterMessagesRPC","WATimeUtils","WAWebBackendErrors","WAWebNewsletterGatingUtils","WAWebNewsletterQueryUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e){if((e==null?void 0:e.before)!=null)return{beforeMixin:{messagesBefore:e.before}};if((e==null?void 0:e.after)!=null)return{afterMixin:{messagesAfter:e.after}}}function c(e,t,n){var r=o("WAWebNewsletterQueryUtils").getNewsletterMessagesQueryParams(e);return m(r,t,n)}function d(e){var t=e.cursor,n=e.inviteCode,r=e.messagesCount,a=e.qpl,i=o("WAWebNewsletterQueryUtils").getNewsletterMessagesQueryParams(n);return m(i,r,t,a)}function m(e,t,n,r){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r,a,i){var l=u(a);r>o("WAWebNewsletterGatingUtils").getMaxMsgCountFromServer()&&o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[queryNewsletterMessages] "," messages requested"])),r).tags("newsletter").sendLogs("newsletter-server-msg-count-exceeded"),i==null||i.markFetchStart();var c=yield o("WASmaxNewslettersGetNewsletterMessagesRPC").sendGetNewsletterMessagesRPC({queryNewsletterParamsMixinArgs:{queryNewsletterParamsArgs:t},newsletterMessageRequestPayloadMixinArgs:{messagesCount:Math.min(r,o("WAWebNewsletterGatingUtils").getMaxMsgCountFromServer()),messageDirectionsArgs:l}});switch(i==null||i.markFetchEnd(),c.name){case"GetNewsletterMessagesResponseSuccess":{var d=c.value.messagesNewsletterMessageResponsePayloadMixin,m=d.message,p=d.t;return{messages:m,end:m.length0&&(yield o("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(l));var u=yield o("WAWebNewsletterDBUtils").bulkGetMessagesByServerIds(a,t),c=a.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=u.get(e);return t==null?null:t.id});return function(t){return e.apply(this,arguments)}})());return{modelUpdatesToAdd:(yield(e||(e=n("Promise"))).all(s)).filter(Boolean),modelUpdatesToRemove:(yield e.all(c)).filter(Boolean)}}),u.apply(this,arguments)}l.getMessageDeliveryUpdatesModelToUpdate=s}),98); __d("WAWebNewsletterMsgHistoryUtils",["Promise","WAWebBackendApi","WAWebNewsletterBackendAddOnsUtils","WAWebNewsletterDBUtils","WAWebNewsletterGatingUtils","WAWebNewsletterGetMessagesJob","WAWebNewsletterSystemMessages","WAWebNewsletterUpdateMsgsRecordsJob","WAWebNewsletterValidationUtils","WAWebNullFunc","asyncToGeneratorRuntime","lodash"],(function(t,n,r,o,a,i,l){var e;function s(e,t){t===void 0&&(t=new Set);for(var n=[],r=function(){var r=e[i-1].serverId,a=e[i].serverId;if(a==null||r==null)return 0;var l=a-r;if(l<=1)return 0;var s=Array.from({length:l-1},function(e,t){return t+r+1}).filter(function(e){return e>=o("WAWebNewsletterSystemMessages").EARLIEST_AVAILABLE_MESSAGE_ID&&!t.has(e)});if(s.length<=0)return 0;for(;s.length>0;)n.push(s.splice(0,o("WAWebNewsletterGatingUtils").getMaxMsgCountFromServer()))},a,i=1;i=o("WAWebNewsletterDBUtils").TEMPORARY_SERVER_ID_LOWER_BOUND||m>=o("WAWebNewsletterDBUtils").TEMPORARY_SERVER_ID_LOWER_BOUND||m-d+1===i.length&&l==null)return i;var p;if(l!=null){var _=l.end,f=l.start,g={serverId:Math.min(f,_)-1},h={serverId:Math.max(f,_)+1};p=s([g].concat(i).concat(h),c)}else p=s(i,c);if(p.length===0)return i;var y=p.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebNewsletterGetMessagesJob").getNewsletterMessages(o("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(String(a)),e.length,{after:e[0]-1}).catch(o("WAWebNullFunc").returnNull);if(t!=null)return o("WAWebBackendApi").frontendFireAndForget("updateNewsletterMessages",t),yield o("WAWebNewsletterBackendAddOnsUtils").updateAddOnDbRecords(t),t.msgs});return function(t){return e.apply(this,arguments)}})()),C=r("lodash").flatten(yield(e||(e=n("Promise"))).all(y)).filter(Boolean);return o("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecordsJob(C).fireAndForget(),r("lodash").sortBy(i.concat(C),"serverId")}),c.apply(this,arguments)}l.identifyMsgGaps=s,l.fillMsgHistoryGaps=u}),98); __d("WAWebSuspendInformDataModelUtils",["WAWebNewsletterDBUtils","WAWebNewsletterGetMessagesJob","WAWebNewsletterUpdateMsgsRecordsJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n,r=yield o("WAWebNewsletterDBUtils").bulkGetMessagesByServerIds(e,t),a=[],i=[],l=new Map;e.forEach(function(e){var t=r.get(e);t!=null?l.set(e,t):i.push(e)});var s;if(i.length>0){var u=Math.min.apply(Math,i),c=Math.max.apply(Math,i);s=yield o("WAWebNewsletterGetMessagesJob").getNewsletterMessages(t,c-u+1,{after:u-1})}return(n=s)==null||n.msgs.forEach(function(e){e!=null&&(a.push(e),e.serverId!=null&&l.set(e.serverId,e))}),a.length>0&&(yield o("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(a)),l}),s.apply(this,arguments)}l.populateMsgModels=e}),98); __d("WAWebGetNewsletterContextForForwardedMsg",["WAWebMsgGetters","WAWebMsgType","WAWebNewsletterMetadataCollection","WAWebWidFactory"],(function(t,n,r,o,a,i,l){function e(e){var t;if(e.forwardedNewsletterMessageInfo!=null)return e.forwardedNewsletterMessageInfo;if(o("WAWebMsgGetters").getIsNewsletterMsg(e)){var n=e.id.remote,a=r("WAWebNewsletterMetadataCollection").get(n);return{newsletterId:o("WAWebWidFactory").asNewsletterWidOrThrow(n),newsletterName:a==null?void 0:a.name,serverMessageId:(t=e.serverId)!=null?t:void 0}}}function s(e){var t=e.destination,n=e.forwardable,r=e.isOriginalMsgForwarded,a=e.isQuestionOrQuestionReply,i=e.source;return t.isNewsletter()&&t.equals(i)&&!r&&n.type!==o("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT&&!a?babelHelpers.extends({},n,{isForwarded:!1,forwardedNewsletterMessageInfo:void 0,forwardingScore:void 0}):n}l.getNewsletterContextForForwardedMsg=e,l.maybeStripNewsletterForwardMetadata=s}),98); __d("WAWebNewsletterModelUtils",["WALogger","WATimeUtils","WAWebCommonNewsletterEnums","WAWebNewsletterGatingUtils","WAWebNewsletterMetadataCollection","WAWebWid","WAWebWidFactory","err","lodash"],(function(t,n,r,o,a,i,l){var e,s,u=1,c=-1,d=0,m="admin",p="follower";function _(e){return e==="verified"}function f(e){var t=v(e);return g(t),h(t)}function g(t){var n,r=(n=t.newsletterMembershipMetadataMixin)==null?void 0:n.membershipType,a=r==null||r==="guest";if(!a){var i="Trying to map an already subscribed newsletter";o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][throwIfNewsletterNotPreview] ",""])),i).tags("newsletter").sendLogs("newsletter-converting-already-subscribed-newsletter")}}function h(e){var t=C(e);return t.muteExpiration=c,t.isReadOnly=!0,t}function y(e){return e==="admin"||e==="owner"}function C(e){var t,n,a,i=(t=e.newsletterNameMetadataMixin)==null?void 0:t.nameElementValue,l=(n=e.newsletterMembershipMetadataMixin)==null?void 0:n.membershipType,s=(a=e.newsletterCreationTimeMetadataMixin)==null?void 0:a.creationTimeValue,u={id:o("WAWebWidFactory").createWid(e.idJid),name:i!=null?i:void 0,isReadOnly:l!=null?!y(l):void 0,muteExpiration:L(e,"MUTE_ADMIN_ACTIVITY"),t:s!=null?o("WATimeUtils").castToUnixTime(s):void 0};return r("lodash").pickBy(u,function(e){return e!=null})}function b(e){var t=R(e);return t.membershipType=o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest,t}function v(e){return{idJid:e.idJid,newsletterCreationTimeMetadataMixin:e.newsletterCreationTimeMetadataMixin,newsletterNameMetadataMixin:e.newsletterNameMetadataMixin,newsletterPictureMetadataMixin:e.newsletterPictureMetadataMixin,newsletterDescriptionMetadataMixin:e.newsletterDescriptionMetadataMixin,newsletterInviteLinkMetadataMixin:e.newsletterInviteLinkMetadataMixin,newsletterSubscribersMetadataMixin:e.newsletterSubscribersMetadataMixin,newsletterPrivacyMetadataMixin:e.newsletterPrivacyMetadataMixin,newsletterVerificationMetadataMixin:e.newsletterVerificationMetadataMixin,hasNewsletterLinkedAccountsMetadataMixin:!1,newsletterMembershipMetadataMixin:null,newsletterUserSettingsMetadataMixin:[],newsletterStateMetadataMixin:null}}function S(e){var t=v(e);return g(t),b(t)}function R(e){var t,n,a,i,l,s,u,c,d,m,p,f,g=(t=e.newsletterVerificationMetadataMixin)==null?void 0:t.verificationState,h=(n=e.newsletterStateMetadataMixin)==null?void 0:n.stateType,y=(a=e.newsletterMembershipMetadataMixin)==null?void 0:a.membershipType,C=(i=e.newsletterPrivacyMetadataMixin)==null?void 0:i.privacyType,b=babelHelpers.extends({id:o("WAWebWidFactory").createWid(e.idJid),creationTime:(l=e.newsletterCreationTimeMetadataMixin)==null?void 0:l.creationTimeValue,name:(s=e.newsletterNameMetadataMixin)==null?void 0:s.nameElementValue,nameUpdateTime:(u=e.newsletterNameMetadataMixin)==null?void 0:u.nameUpdateTime,description:(c=e.newsletterDescriptionMetadataMixin)==null||(c=c.descriptionQueryDescriptionResponseMixin)==null?void 0:c.elementValue,descriptionUpdateTime:(d=e.newsletterDescriptionMetadataMixin)==null||(d=d.descriptionQueryDescriptionResponseMixin)==null?void 0:d.updateTime,inviteCode:(m=e.newsletterInviteLinkMetadataMixin)==null?void 0:m.inviteCode,size:(p=e.newsletterSubscribersMetadataMixin)==null?void 0:p.subscribersCount,verified:g!=null?_(g):void 0,membershipType:y!=null?o("WAWebCommonNewsletterEnums").NewsletterMembershipType.cast(y):void 0,reactionCodesSetting:Object.prototype.hasOwnProperty.call(e,"newsletterReactionCodesSettingMetadataMixin")?(f=e==null?void 0:e.newsletterReactionCodesSettingMetadataMixin)!=null?f:o("WAWebCommonNewsletterEnums").NewsletterReactionCodesSetting.All:void 0,privacy:C!=null?o("WAWebCommonNewsletterEnums").NewsletterPrivacy.cast(C):void 0,website:void 0,followerActivityMuteExpiration:L(e,"MUTE_FOLLOWER_ACTIVITY"),suspended:h!=null?o("WAWebCommonNewsletterEnums").NewsletterState.cast(h)===o("WAWebCommonNewsletterEnums").NewsletterState.Suspended||o("WAWebCommonNewsletterEnums").NewsletterState.cast(h)===o("WAWebCommonNewsletterEnums").NewsletterState.GeoSuspended:void 0,geosuspended:h!=null?o("WAWebCommonNewsletterEnums").NewsletterState.cast(h)===o("WAWebCommonNewsletterEnums").NewsletterState.GeoSuspended:void 0},o("WAWebNewsletterGatingUtils").isWamoSubExperienceEnabled()&&{wamoSubPlanId:e.newsletterWamoSubPlanIdMetadataMixin,wamoSubStatus:e.newsletterWamoSubStatusMetadataMixin});return r("lodash").pickBy(b,function(e){return e!=null})}function L(e,t){var n,r=(n=e.newsletterUserSettingsMetadataMixin)==null?void 0:n.find(function(e){return e.type===t});return(function(e){if(e==="ON")return c;if(e==="OFF")return d})(r==null?void 0:r.value)}var E="https://pps.whatsapp.net";function k(e){if(e==null||e==="")return null;var t=new URL(e,E);return t.href}function I(e,t){var n,a,i,l,s,u,c,d=o("WAWebWidFactory").createWid(e);if(t.length===0)return{id:d};var m,p;for(var _ of t){var f=_.queryPictureDirectPathOrEmptyResponseMixinGroup;if(f.name==="QueryPictureDirectPathResponse")f.value.type==="preview"?p=f.value:f.value.type==="image"&&(m=f.value);else if(f.name==="QueryPictureEmptyResponse")return{id:d,timestamp:Date.now(),eurl:null,previewEurl:null,eurlStale:!1,stale:!1}}var g={id:d,timestamp:Date.now(),tag:(n=(a=m)==null?void 0:a.id)!=null?n:(i=p)==null?void 0:i.id,eurl:k((l=(s=m)==null?void 0:s.directPath)!=null?l:(u=p)==null?void 0:u.directPath),previewEurl:k((c=p)==null?void 0:c.directPath),eurlStale:!1,stale:!1};return r("lodash").pickBy(g,function(e){return e!=null})}function T(e){var t,n;return{chat:C(e),metadata:R(e),pic:I(e.idJid,(t=(n=e.newsletterPictureMetadataMixin)==null?void 0:n.picture)!=null?t:[])}}function D(e){var t;if(r("WAWebWid").isNewsletter(e)){var n;return(n=r("WAWebNewsletterMetadataCollection").get(e))==null?void 0:n.membershipType}return(t=r("WAWebNewsletterMetadataCollection").filter(function(t){return t.inviteCode===e})[0])==null?void 0:t.membershipType}function x(e){return e===c}function $(e){switch(e){case"INSIGHTS":return o("WAWebCommonNewsletterEnums").NewsletterCapability.Insights;case"PHOTO_POLLS":return o("WAWebCommonNewsletterEnums").NewsletterCapability.PhotoPolls;case"QUESTIONS":return o("WAWebCommonNewsletterEnums").NewsletterCapability.QUESTIONS;case"INVITE_ADMINS_BUTTON":return o("WAWebCommonNewsletterEnums").NewsletterCapability.INVITE_ADMINS_BUTTON;case"INVITE_FOLLOWERS":return o("WAWebCommonNewsletterEnums").NewsletterCapability.INVITE_FOLLOWERS;case"ADMIN_NOTIFICATIONS":return o("WAWebCommonNewsletterEnums").NewsletterCapability.ADMIN_NOTIFICATIONS;case"QUIZ":return o("WAWebCommonNewsletterEnums").NewsletterCapability.QUIZ;case"ADMIN_CONTEXT_CARD_1":return o("WAWebCommonNewsletterEnums").NewsletterCapability.ADMIN_CONTEXT_CARD_1;case"ADMIN_CONTEXT_CARD_2":return o("WAWebCommonNewsletterEnums").NewsletterCapability.ADMIN_CONTEXT_CARD_2;case"ADMIN_CONTEXT_CARD_3":return o("WAWebCommonNewsletterEnums").NewsletterCapability.ADMIN_CONTEXT_CARD_3;case"SHARE_STICKER_PACKS":return o("WAWebCommonNewsletterEnums").NewsletterCapability.SHARE_STICKER_PACKS;case"ADMIN_ONBOARDING":return o("WAWebCommonNewsletterEnums").NewsletterCapability.ADMIN_ONBOARDING;case"ADMIN_ONBOARDING_2":return o("WAWebCommonNewsletterEnums").NewsletterCapability.ADMIN_ONBOARDING_2;case"MUSIC":return o("WAWebCommonNewsletterEnums").NewsletterCapability.MUSIC;case"NEW_MESSAGE_TYPES_TOOLTIP":return o("WAWebCommonNewsletterEnums").NewsletterCapability.NEW_MESSAGE_TYPES_TOOLTIP;case"PINNING_NUDGE":return o("WAWebCommonNewsletterEnums").NewsletterCapability.PINNING_NUDGE;case"THREAD_MENU":return o("WAWebCommonNewsletterEnums").NewsletterCapability.THREAD_MENU;case"ADMIN_PROFILE":return o("WAWebCommonNewsletterEnums").NewsletterCapability.ADMIN_PROFILE;default:return o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Encountered unexpected newsletter capability: ",""])),e).tags("newsletter-capabilities").sendLogs("Unexpected newsletter capability"),o("WAWebCommonNewsletterEnums").NewsletterCapability.Insights}}l.DEFAULT_NEWSLETTER_ADMIN_COUNT=u,l.MUTED_STATE=c,l.UNMUTED_STATE=d,l.ADMIN_NOTIFICATIONS=m,l.FOLLOWER_NOTIFICATIONS=p,l.mapDirectoryNewsletterToChat=f,l.mapPreviewNewsletterToChat=h,l.isMembershipAdminOrOwner=y,l.mapNewsletterToChat=C,l.mapPreviewNewsletterToMetadata=b,l.convertDirectoryNewsletterMetadataToNewsletterMetadata=v,l.mapDirectoryNewsletterToMetadata=S,l.mapNewsletterToMetadata=R,l.formatProfilePictureURL=k,l.mapPicturesToProfilePicThumb=I,l.mapNewsletterToModels=T,l.getRoleByIdentifier=D,l.isMuted=x,l.getNewsletterCapabilityFromValue=$}),98); __d("WAWebNewsletterEnforcementAppealModel",["WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a=o("WAWebNewsletterSystemMessages").EARLIEST_AVAILABLE_MESSAGE_ID&&e.serverId<=o("WAWebNewsletterSystemMessages").LATEST_AVAILABLE_MESSAGE_ID}),l=Math.min.apply(Math,i.map(function(e){var t;return(t=e.lastUpdateFromServerTs)!=null?t:0}));if(_(l)){var m=Math.min.apply(Math,r("compactMap")(i,function(e){return e.serverId}));if(Number.isSafeInteger(m))try{for(var p=m-1,f=0,g=[];f0?l:void 0,ids:i.map(function(e){return e.id})})),p+=h,f+=h}var y=yield(d||(d=n("Promise"))).all(g);y.forEach(function(e){o("WAWebNewsletterBridgeApi").NewsletterBridgeApi.updateNewsletterMessages(e)})}catch(e){if(e instanceof o("WAWebBackendErrors").ServerStatusCodeError&&e.status===423)try{yield o("WAWebNewsletterMetadataJob").suspendNewsletter(o("WAJids").toNewsletterJid(t.id.toJid())),o("WAWebNewsletterBridgeApi").NewsletterBridgeApi.suspendNewsletter({id:t.id})}catch(e){var C=t.id.toString(),b=r("getErrorSafe")(e).name;o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[maybeUpdateMsgsAddOns] suspend failed (423) "," ",""])),C,b).tags("newsletter").sendLogs("newsletter-maybe-update-msg-addons-suspend-error");return}else if(e instanceof o("WAWebBackendErrors").ServerStatusCodeError&&e.status===451)try{yield o("WAWebNewsletterMetadataJob").geosuspendNewsletter(o("WAJids").toNewsletterJid(t.id.toJid())),o("WAWebNewsletterBridgeApi").NewsletterBridgeApi.geosuspendNewsletter({id:t.id})}catch(e){var v=t.id.toString(),S=r("getErrorSafe")(e).name;o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[maybeUpdateMsgsAddOns] geosuspend failed (451) "," ",""])),v,S).tags("newsletter").sendLogs("newsletter-maybe-update-msg-addons-geosuspend-error");return}o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[maybeUpdateMsgsAddOns] Failed to update messages"]))).tags("newsletter")}}}}),p.apply(this,arguments)}function _(e){return Number.isSafeInteger(e)?o("WATimeUtils").unixTime()-e>o("WAWebNewsletterGatingUtils").getPullMessageUpdatesThresholdSeconds():!1}l.maybeUpdateMsgsAddOns=m}),98); __d("WAWebNewsletterGetNewsletterEnforcementAlertAction",["WAJobOrchestratorTypes","WALogger","WAWebGetNewsletterEnforcementAlertsJob","WAWebNewsletterBridgeApi","WAWebNewsletterEnforcementAlertCollection","WAWebNewsletterValidationUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){n===void 0&&(n=o("WAJobOrchestratorTypes").JOB_PRIORITY.HIGH);try{var r=o("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(t.toJid()),a=yield o("WAWebGetNewsletterEnforcementAlertsJob").getNewsletterEnforcementAlerts(r,n);if(a==null)return;var i=a.enforcementData,l=a.msgModelMap;o("WAWebNewsletterEnforcementAlertCollection").NewsletterEnforcementAlertCollection.setMsgModelMap(l),o("WAWebNewsletterBridgeApi").NewsletterBridgeApi.updateNewsletterEnforcementAlerts({enforcementAlerts:i})}catch(t){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[getNewsletterEnforcementAlertAction] fetch failed"]))).tags("newsletter").sendLogs("newsletter-failed-to-get-NewsletterEnforcement-alerts")}}),u.apply(this,arguments)}l.getNewsletterEnforcementAlertAction=s}),98); __d("WAWebNewsletterMessageDeliveryUpdateAction",["WAJids","WAWebNewsletterMetadataJob","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){function e(e,t){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n;yield o("WAWebNewsletterMetadataJob").updateNewsletterMessageDeliveryUpdates(o("WAJids").toNewsletterJid(e.id.toString()),[],r("compactMap")(t,function(e){return e.serverId})),(n=e.newsletterMetadata)==null||n.messageDeliveryUpdates.remove(t.map(function(e){return e.id}))}),s.apply(this,arguments)}l.removeMessageDeliveryUpdates=e}),98); __d("WAWebNewsletterPullMessagesFromServerAction",["Promise","WAAbortError","WALogger","WARaceSignal","WAWebApiChat","WAWebChatGetters","WAWebChatSeenBridge","WAWebMsgModelFromData","WAWebNewsletterBackendAddOnsUtils","WAWebNewsletterBridgeApi","WAWebNewsletterErrors","WAWebNewsletterGetMessagesJob","WAWebNewsletterUpdateMsgsRecordsJob","WAWebNewsletterValidationUtils","WAWebStateUtils","WAWebUpdateUnreadChatAction","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u;function c(t,a){var i=o("WAWebStateUtils").unproxy(t);return o("WAWebChatGetters").getIsNewsletter(i)?a.messageCount<0?(u||(u=n("Promise"))).resolve([]):r("WARaceSignal")([a.signal,i.getDeleteSignal()].filter(Boolean),function(e){return f(i,babelHelpers.extends({},a,{signal:e}))}):(o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[pullNewsletterMessagesFromServer] not a newsletter"]))),(u||(u=n("Promise"))).reject(new(o("WAWebNewsletterErrors")).UnexpectedNonNewsletterChatError))}function d(e,t,n){switch(t){case"before":{e.msgs.msgLoadState.isLoadingEarlierMsgs=n;break}case"after":{e.msgs.msgLoadState.isLoadingRecentMsgs=n;break}}}function m(e,t,r){return t.length===0?(u||(u=n("Promise"))).resolve():e.addQueue.enqueue((u||(u=n("Promise"))).resolve().then(function(){if(e.msgs.add(t,r==="before"?{at:0}:void 0),r==="after"){var n,o=Math.max.apply(null,t.map(function(e){return e.t}));e.t=Math.max((n=e.t)!=null?n:0,o)}}))}function p(e,t){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WAWebApiChat").getChatMeta(e.id),r=n.unreadCount,a=Math.max(r-t,0);yield o("WAWebChatSeenBridge").markConversationSeen(e.id,a),yield o("WAWebUpdateUnreadChatAction").updateUnreadCountMD(e,0,!1)}),_.apply(this,arguments)}function f(e,t){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(t.signal.aborted)throw new(o("WAAbortError")).AbortError;var r=t.cursor,a=t.messageCount,i=t.shouldUpdateMsg,l=r==null||r.after!=null?"after":"before",c="[pullNewsletterMessagesFromServer]["+e.id.toJid()+"]["+l+"]",_=e.msgs.msgLoadState,f=_.isLoadingEarlierMsgs,g=_.isLoadingRecentMsgs;if(l==="before"&&f)return e.msgs.loadEarlierPromise;if(l==="after"&&g)return e.msgs.loadRecentPromise;d(e,l,!0);try{if(t.signal.aborted)throw new(o("WAAbortError")).AbortError;var y=o("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(e.id.toJid()),C=(u||(u=n("Promise"))).resolve().then(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var s=yield o("WAWebNewsletterGetMessagesJob").getNewsletterMessages(y,a,r),c=i!=null?s.msgs.filter(i):s.msgs,_=c.map(o("WAWebMsgModelFromData").msgModelFromMsgData);if(t.signal.aborted)throw new(o("WAAbortError")).AbortError;return _.length>0&&(yield(u||(u=n("Promise"))).all([o("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(c),h(s),m(e,_,l)]),t.resetUnreadCount===!0&&(yield p(e,_.length))),d(e,l,!1),s.msgs.map(o("WAWebMsgModelFromData").msgModelFromMsgData)}));return l==="before"?e.msgs.loadEarlierPromise=C:l==="after"&&(e.msgs.loadRecentPromise=C),yield C}catch(e){throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[pullNewsletterMessagesFromServer] pull msgs failed"]))).tags("newsletter"),e}}),g.apply(this,arguments)}function h(e){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.pollVotes,n=e.reactions,r=e.timestamp;yield o("WAWebNewsletterBackendAddOnsUtils").updateAddOnDbRecords(e);var a=n.map(function(e){return e.parentMsgKey});return o("WAWebNewsletterBridgeApi").NewsletterBridgeApi.updateNewsletterMessages({reactions:n,ids:a,timestamp:r,pollVotes:t})}),y.apply(this,arguments)}l.pullNewsletterMessagesFromServer=c}),98); __d("WAWebNewsletterReparseMsgAction",["WAWebBackendApi","WAWebHandleMsgTypes.flow","WAWebNewsletterFutureProofUtils","WAWebNewsletterUpdateMsgsRecordsJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.futureproofBuffer,n=e.futureproofSubtype,r=e.futureproofType;if(t!=null||r==null)return e;var a=o("WAWebNewsletterFutureProofUtils").isMsgSupported(e),i=a.supported;if(!i)return e;var l=babelHelpers.extends({},e,{type:r,kind:r,subtype:n,futureproofType:void 0,futureproofSubtype:void 0});return yield o("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords([l]),yield o("WAWebBackendApi").frontendSendAndReceive("updateMessageUI",{msg:l,chatId:e.id.remote,messageOverwriteOption:o("WAWebHandleMsgTypes.flow").MessageOverwriteOption.RETRY}),l}),s.apply(this,arguments)}l.reparseNewsletterMsg=e}),98); __d("WAWebWamEnumChannelEventType",[],(function(t,n,r,o,a,i){var e=Object.freeze({FOLLOW:1,UNFOLLOW:2,MUTE:3,UNMUTE:4,PREMIUM_SUBSCRIBE:5,PREMIUM_UNSUBSCRIBE:6,CHANNEL_PREMIUM_SETUP:7,CHANNEL_PREMIUM_CANCEL:8,HIDE:9,UNHIDE:10,CREATE:11,DELETE:12});i.CHANNEL_EVENT_TYPE=e}),66); __d("WAWebNewsletterToggleAdminActivityMuteStateAction",["WAJids","WALogger","WAWebNewsletterAttributionLogging","WAWebNewsletterBridgeApi","WAWebNewsletterCollection","WAWebNewsletterModelUtils","WAWebNewsletterUpdateUserSettingJob","WAWebWamEnumChannelEventType","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s;function u(e,t,n){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a){var i=a.eventSurface,l=n===o("WAWebNewsletterModelUtils").MUTED_STATE?"mute":"unmute";if(!t.isNewsletter()){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][","NewsletterAdminActivityAction] called with a non-newsletter chat"])),l).tags("newsletter").sendLogs(l+"-admin-activity-not-a-newsletter");return}try{var u=n===o("WAWebNewsletterModelUtils").MUTED_STATE?o("WAWebWamEnumChannelEventType").CHANNEL_EVENT_TYPE.MUTE:o("WAWebWamEnumChannelEventType").CHANNEL_EVENT_TYPE.UNMUTE;o("WAWebNewsletterAttributionLogging").NewsletterCoreEventLogger.log({eventSurface:i,cid:t,channelCoreEventType:u});var c=r("WAWebNewsletterCollection").get(t);if(c==null)throw r("err")("Failed to retrieve newsletter");var d=o("WAWebNewsletterUpdateUserSettingJob").updateNewsletterUserSetting({newsletterJid:o("WAJids").toNewsletterJid(t.toJid()),type:o("WAWebNewsletterModelUtils").ADMIN_NOTIFICATIONS,muteExpirationValue:n}).then(function(){return{status:200}}).catch(function(){return{status:400}});n===o("WAWebNewsletterModelUtils").MUTED_STATE?c.mute.promises.mute=d:c.mute.promises.unmute=d,yield d,yield o("WAWebNewsletterBridgeApi").NewsletterBridgeApi.toggleNewsletterAdminActivityMuteState({id:t,muteExpirationValue:n})}catch(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][","AdminActivityNewsletterAction] failed to mute the newsletter"])),l).tags("newsletter").sendLogs("newsletter-"+l+"-admin-activity-action-failed")}}),c.apply(this,arguments)}l.toggleNewsletterAdminActivityMuteStateAction=u}),98); __d("WAWebQueryAndUpdateNewslettersMetadataAction",["$InternalEnum","Promise","WAJids","WAJobOrchestratorTypes","WALogger","WAWebBackendErrors","WAWebCommonNewsletterEnums","WAWebContactCollection","WAWebContactProfilePicThumbBridge","WAWebCreateChat","WAWebDBBulkPersistProfilePic","WAWebNewsletterBridgeApi","WAWebNewsletterCollection","WAWebNewsletterDeleteChatJob","WAWebNewsletterGetAdminCapabilitiesJob","WAWebNewsletterGetAdminCountJob","WAWebNewsletterGetNewsletterEnforcementAlertAction","WAWebNewsletterMembershipUtil","WAWebNewsletterMetadataCollection","WAWebNewsletterMetadataJob","WAWebNewsletterModelUtils","WAWebNewsletterPullMessagesFromServerAction","WAWebNewsletterStorageUtils","WAWebNewsletterSystemMessagesAction","WAWebNewsletterUpdateNewslettersRecordsJob","WAWebNoop","WAWebProfilePicThumbCollection","WAWebSchemaChat","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWidFactory","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S;function R(e){return e!=null&&Number.isInteger(e)&&e>0}var L=n("$InternalEnum").Mirrored(["Bootstrap","DirtyBit","Debug"]);function E(e,t){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r){r===void 0&&(r={}),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction] Start"])));var a=r!=null?r:{},i=a.addSystemMsgs,l=a.messageCount,m=a.qplEvent;try{var p;m==null||m.annotate({string:{entryPoint:t}}),m==null||m.addPoint("getAllNewslettersMetadata_start");var _=yield o("WAWebNewsletterMetadataJob").getAllNewslettersMetadata(),f=_.deletedNewsletters,g=_.newsletters,h=g.reduce(function(e,t){var n;e.chats.push(o("WAWebNewsletterModelUtils").mapNewsletterToChat(t)),e.metadata.push(o("WAWebNewsletterModelUtils").mapNewsletterToMetadata(t));var r=(n=t.newsletterPictureMetadataMixin)==null?void 0:n.picture;return r!=null&&e.pics.push(o("WAWebNewsletterModelUtils").mapPicturesToProfilePicThumb(t.idJid,r)),e},{chats:[],metadata:[],pics:[]}),y=h.chats,C=h.metadata,b=h.pics;m==null||m.addPoint("getAllNewslettersMetadata_end"),m==null||m.addPoint("processDeletedNewsletters_start"),yield $(f),m==null||m.addPoint("processDeletedNewsletters_end");var v=(p=g.map(function(e){return e.idJid})).concat.apply(p,((f==null?void 0:f.id)||[]).map(function(e){return e.jid}));return t===L.DirtyBit&&(m==null||m.addPoint("processUnsubscribedNewsletters_start"),yield N(v),m==null||m.addPoint("processUnsubscribedNewsletters_end")),m==null||m.addPoint("fetchAdminCountsForOwnerNewsletter_start"),yield(S||(S=n("Promise"))).all(C.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(o("WAWebNewsletterMembershipUtil").iAmOwner(e)){var t=yield o("WAWebNewsletterGetAdminCountJob").getNewsletterAdminCount(o("WAJids").toNewsletterJid(e.id.toString()));e.adminCount=t}});return function(t){return e.apply(this,arguments)}})())),m==null||m.addPoint("fetchAdminCountsForOwnerNewsletter_start"),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction] Update local model"]))),yield D({chats:y,metadata:C,pics:b,messageCount:l,addSystemMsgs:i,qplEvent:m}),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][getNewsletterEnforcementsUpdatesAction] Update local model"]))),m==null||m.addPoint("processChannelEnforcementsUpdates_start"),yield S.all(C.map(function(e){o("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(e)&&o("WAWebNewsletterGetNewsletterEnforcementAlertAction").getNewsletterEnforcementAlertAction(o("WAWebWidFactory").createWid(e.id.toString()),o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION)})),m==null||m.addPoint("processChannelEnforcementsUpdates_end"),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction] End"]))),{chats:y,success:!0}}catch(e){return o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][queryAndUpdateAllNewsletterMetadataAction] Failed to retrieve the list of newsletters"]))).tags("newsletter").sendLogs("newsletter-failed-to-retrieve-newsletters"),{success:!1}}}),k.apply(this,arguments)}function I(e,t){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateNewsletterMetadataAction] Start"])));try{var n,a,i,l=o("WAWebNewsletterModelUtils").getRoleByIdentifier(e),s=yield o("WAWebNewsletterMetadataJob").getNewsletterMetadata(e,l,t==null?void 0:t.fields);if(s==null)return;var u=o("WAWebNewsletterModelUtils").mapNewsletterToChat(s),c=o("WAWebNewsletterModelUtils").mapNewsletterToMetadata(s),d=(n=s.newsletterPictureMetadataMixin)==null?void 0:n.picture,f=d?[o("WAWebNewsletterModelUtils").mapPicturesToProfilePicThumb(e,d)]:[],g=void 0,h=(a=t==null?void 0:t.adminFields)!=null?a:{},y=h.adminCount;y===!0&&(g=yield o("WAWebNewsletterGetAdminCountJob").getNewsletterAdminCount(e));var C=void 0,b=(i=t==null?void 0:t.adminFields)!=null?i:{},v=b.capabilities;return v===!0&&(C=yield o("WAWebNewsletterGetAdminCapabilitiesJob").getNewsletterAdminCapabilities(e)),yield D({chats:[u],metadata:[babelHelpers.extends({},c,{adminCount:g,capabilities:C})],pics:f,messageCount:t==null?void 0:t.messageCount}),o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateNewsletterMetadataAction] End"]))),r("WAWebNewsletterCollection").get(s.idJid)}catch(e){if(e instanceof o("WAWebBackendErrors").ServerStatusCodeError&&e.statusCode===405)return;o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[newsletter][queryAndUpdateNewsletterMetadataAction] Failed to retrieve newsletter metadata"]))).tags("newsletter").sendLogs("newsletter-failed-to-retrieve-newsletter")}}),T.apply(this,arguments)}function D(e){return x.apply(this,arguments)}function x(){return x=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.addSystemMsgs,a=e.chats,i=e.messageCount,l=e.metadata,s=e.pics,u=e.qplEvent;o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][updateCollections] Start"])));var c=w(a,l,s),d=c.filteredChats,m=c.filteredMetadata,p=c.filteredPics;u==null||u.addPoint("updateNewsletterChatRecords_start"),yield o("WAWebNewsletterUpdateNewslettersRecordsJob").updateNewsletterChatRecords(d.map(o("WAWebCreateChat").createNewsletterObjectForStorage)),u==null||u.addPoint("updateNewsletterChatRecords_end"),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][updateCollections][chat] Persist changes to DB"]))),u==null||u.addPoint("updateNewsletterMetadata_start"),yield o("WAWebNewsletterMetadataJob").updateNewsletterMetadata(m.map(o("WAWebNewsletterStorageUtils").createNewsletterMetadataObjectForStorage)),u==null||u.addPoint("updateNewsletterMetadata_end"),o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][updateCollections][metadata] Persist changes to DB"]))),u==null||u.addPoint("bulkPersistProfilePicChanges_start"),yield o("WAWebDBBulkPersistProfilePic").bulkPersistProfilePicChanges(r("compactMap")(p,function(e){var t,n,r,a;if(Object.prototype.hasOwnProperty.call(e,"eurl")){var i=o("WAWebWidFactory").createWid(e.id.toString());return o("WAWebContactProfilePicThumbBridge").mapProfilePictureToProfilePicThumbRowType(i,{id:i,tag:(t=e.tag)!=null?t:void 0,eurl:(n=e.eurl)!=null?n:void 0,previewEurl:(r=e.previewEurl)!=null?r:void 0,stale:e.stale,eurlStale:!1,timestamp:(a=e.timestamp)!=null?a:Date.now()})}})),u==null||u.addPoint("bulkPersistProfilePicChanges_end"),o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][updateCollections][picture] Persist changes to DB"]))),o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction] Update local model"]))),r("WAWebNewsletterMetadataCollection").add(l,{merge:!0}),o("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.add(s,{merge:!0}),r("WAWebNewsletterCollection").add(a,{merge:!0}),u==null||u.addPoint("pullNewsletterMessagesFromServer_start"),o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction][messages] Start"]))),R(i)&&(yield(S||(S=n("Promise"))).all(r("WAWebNewsletterCollection").filter(function(e){var t;return!((t=e.newsletterMetadata)!=null&&t.isSuspendedOrTerminated)}).map(function(e){return o("WAWebNewsletterPullMessagesFromServerAction").pullNewsletterMessagesFromServer(e,{messageCount:i,resetUnreadCount:!0}).then(function(n){if(n.filter(function(e){return e.isWamoSub!==!0||o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.CHAT,e.viewMode)}).length===0&&t===!0)return o("WAWebNewsletterSystemMessagesAction").addSystemMessagesToChat(e)}).catch(r("WAWebNoop"))}))),u==null||u.addPoint("pullNewsletterMessagesFromServer_end"),o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["[newsletters][queryAndUpdateAllNewsletterMetadataAction][messages] End"]))),u==null||u.addPoint("contactUpdates_start");var _=l.filter(function(e){return e.name}).map(function(e){return{id:e.id,name:e.name}});o("WAWebContactCollection").ContactCollection.add(_,{merge:!0}),u==null||u.addPoint("contactUpdates_end")}),x.apply(this,arguments)}function $(e){return P.apply(this,arguments)}function P(){return P=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e!=null){var t=e.id.map(function(e){return{id:e.jid.toString(),terminated:!0}}),n=e.id.map(function(e){return{id:o("WAWebWidFactory").createWid(e.jid),terminated:!0}});yield o("WAWebNewsletterMetadataJob").updateNewsletterMetadata(t),r("WAWebNewsletterMetadataCollection").add(n,{merge:!0})}}),P.apply(this,arguments)}function N(e){return M.apply(this,arguments)}function M(){return M=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebSchemaChat").getChatTable().all(),r=t.map(function(e){return o("WAWebWidFactory").createWid(e.id)}).filter(function(t){var n=o("WAJids").validateNewsletterJid(t.toJid());return n!=null&&!e.includes(n)}),a=[];r.map(function(e){a.push(o("WAWebNewsletterBridgeApi").NewsletterBridgeApi.deleteNewsletter({id:e,keep:!1})),a.push(o("WAWebNewsletterMetadataJob").deleteNewsletterMetadata(e.toString())),a.push(o("WAWebNewsletterDeleteChatJob").deleteNewsletterChat(e)),a.push(o("WAWebNewsletterMetadataJob").deleteNewsletterPicture(e.toString()))}),yield(S||(S=n("Promise"))).all(a)}),M.apply(this,arguments)}function w(e,t,n){var a=t.filter(function(e){if(e.membershipType!=null)return e.membershipType===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest;var t=r("WAWebNewsletterMetadataCollection").get(e.id);return t==null?!1:t.membershipType===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest}).map(function(e){return e.id}),i=e.filter(function(e){return!a.includes(e.id)}),l=t.filter(function(e){return!a.includes(e.id)}),s=n.filter(function(e){return!a.includes(e.id)});return{filteredChats:i,filteredMetadata:l,filteredPics:s}}l.NewsletterMetadataUpdateEntryPoint=L,l.queryAndUpdateAllNewsletterMetadataAction=E,l.queryAndUpdateNewsletterMetadataAction=I,l.updateCollections=D}),98); __d("WAWebUpdateNewsletterMsgUIAction",["Promise","WAAckLevel","WAJids","WATimeUtils","WAWebFrontendMsgGetters","WAWebMsgCollection","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterCollection","WAWebNewsletterDBUtils","WAWebNewsletterDeleteChatJob","WAWebNewsletterMessageDeliveryUpdateAction","WAWebNewsletterPollVotesModelCollection","WAWebNewsletterReactionCollection","WAWebQueryAndUpdateNewslettersMetadataAction","WAWebReactionsMsgAction","WAWebRevokeMsgAction","WAWebUpdateLastAddOnPreviewChatAction","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WAJids").toNewsletterJid(t.toJid()),a=r("WAWebNewsletterCollection").get(t);if(a==null&&(a=yield o("WAWebQueryAndUpdateNewslettersMetadataAction").queryAndUpdateNewsletterMetadataAction(n),a!=null&&r("WAWebNewsletterCollection").add(a)),a==null){yield o("WAWebNewsletterDeleteChatJob").deleteNewsletterChat(t);return}if(e.type==="reaction")return c(e);if(e.type==="poll_update")return e.subtype==="poll_vote"?m(e):void 0;if(e.subtype==="admin_revoke")return p(e,t);e.type!==o("WAWebMsgType").MSG_TYPE.PROTOCOL&&(yield o("WAWebMsgCollection").MsgCollection.processMultipleMessages(a.id,[babelHelpers.extends({},o("WAWebMsgDataFromModel").msgDataFromMsgModel(e),{recvFresh:!0,isNewMsg:!0})],{},"updateNewsletterMessageUI",a.msgs,!0))}),u.apply(this,arguments)}function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebMsgCollection").MsgCollection.get(e.reactionParentKey),n=e.reactionText;if(t!=null){var r=t.serverId;if(r!=null){o("WAWebNewsletterReactionCollection").updateOrCreateMessageReaction({parentMsg:t,reactionMsg:e,reactionCode:n});var a={msgKey:e.id.toString(),parentMsgKey:o("WAWebNewsletterDBUtils").craftNewsletterMsgKeyFromServerId(r,e.from).toString(),senderUserJid:o("WAWebUserPrefsMeUser").getMePnUserOrThrow().toString(),reactionText:n,timestamp:e.t*1e3,orphan:0,read:!0,ack:o("WAAckLevel").ACK.SENT};yield o("WAWebReactionsMsgAction").addOrUpdateReactionsModelCollection(a,{allowNotify:!1})}}}),d.apply(this,arguments)}function m(e){if(e.pollUpdateParentKey!=null){var t=o("WAWebMsgCollection").MsgCollection.get(e.pollUpdateParentKey);if(!(t==null||e.type!==o("WAWebMsgType").MSG_TYPE.POLL_UPDATE)){var n=e.senderTimestampMs;o("WAWebNewsletterPollVotesModelCollection").updateOrCreatePollVote({msgKey:e.id,parentMsgKey:t.id,selectedOptionLocalIds:new Set(e.selectedOptionLocalIds),timestamp:n!=null?o("WATimeUtils").castToMillisTime(n):o("WATimeUtils").castUnixTimeToMillisTime(o("WATimeUtils").castToUnixTime(e.t))})}}}function p(e,t){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a){var i,l=(i=r("WAWebNewsletterCollection").get(a))==null?void 0:i.msgs.get(t.protocolMessageKey);return l==null?(e||(e=n("Promise"))).resolve():(o("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview([l.id.toString()]),yield o("WAWebNewsletterMessageDeliveryUpdateAction").removeMessageDeliveryUpdates(o("WAWebFrontendMsgGetters").getChat(l),[l]),(e||(e=n("Promise"))).resolve(o("WAWebRevokeMsgAction").revoke(l,{subtype:t.subtype,msgKey:t.id,sender:o("WAWebMsgGetters").getIsSentByMe(t)?o("WAWebUserPrefsMeUser").getMePnUserOrThrow():t.from,revokeTimestamp:t.t,viewMode:t.viewMode})))}),_.apply(this,arguments)}l.updateNewsletterMessageUI=s}),98); __d("WAWebNewsletterInsightUtils",["$InternalEnum","WALogger"],(function(t,n,r,o,a,i,l){"use strict";var e,s=n("$InternalEnum").Mirrored(["Available","Missing"]);function u(t){switch(t){case"OK":return s.Available;case"MISSING":return s.Missing;default:return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Encountered unexpected status"]))).tags("newsletter-admin-insights"),s.Missing}}l.NewsletterInsightDataStatus=s,l.getNewsletterInsightsDataStatus=u}),98); __d("WAWebNewsletterAdminInsightsModel",["fbt","WAWebBaseModel","WAWebClock","WAWebModelUtils","WAWebNewsletterInsightUtils","WAWebWid"],(function(t,n,r,o,a,i,l,s){"use strict";var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0&&(yield o("WAWebMsgCollection").MsgCollection.processMultipleMessages(m[0].id.remote,m,{},"updateNewsletterMessages"))});function t(t){return e.apply(this,arguments)}return t})(),updateNewsletterMessageDeliveryUpdate:function(t){var e,n,a=t.id,i=t.modelUpdatesToAdd,l=t.modelUpdatesToRemove,s=r("WAWebNewsletterCollection").get(a);s!=null&&((e=s.newsletterMetadata)==null||e.messageDeliveryUpdates.remove(l),(n=s.newsletterMetadata)==null||n.messageDeliveryUpdates.add(i.map(function(e){var t=o("WAWebMsgModelFromData").msgModelFromMsgData(e.msgData);return o("WAWebMsgCollection").MsgCollection.add(t,{merge:!0}),babelHelpers.extends({},e,{msgModel:t})}),{merge:!0}))},findMsgKeyFromServerId:function(t){var e,n=t.from,o=t.serverId,a=r("WAWebNewsletterCollection").get(n);return a==null||(e=a.msgs)==null||(e=e.findFirst(function(e){return e.serverId===o}))==null?void 0:e.id},updateMsgsViewed:function(t){var e=t.ids;e.forEach(function(e){var t;(t=o("WAWebMsgCollection").MsgCollection.get(e))==null||t.set("viewed",!0)})},updateGeosuspendedCountry:function(t){var e=t.countryCodes,n=t.id,o=t.toAdd,a=r("WAWebNewsletterCollection").get(n);if(a!=null)if(o){var i;(i=a.newsletterMetadata)==null||i.geosuspendedCountries.add(e.map(function(e){return{id:e,geosuspended:!0}}))}else{var l;(l=a.newsletterMetadata)==null||l.geosuspendedCountries.remove(e.map(function(e){return e}))}},suspendNewsletter:function(t){var e=t.id;r("WAWebNewsletterMetadataCollection").gadd(e).set({suspended:!0},{merge:!0})},geosuspendNewsletter:function(t){var e=t.id;r("WAWebNewsletterMetadataCollection").gadd(e).set({suspended:!0,geosuspended:!0},{merge:!0})},updateProfilePictureDeletionAlertState:function(t){var e=t.newsletterWid;r("WAWebNewsletterMetadataCollection").gadd(e).set({hasProfilePictureDeletionAlerts:!0},{merge:!0})},getActiveNewsletter:function(){var e;return(e=r("WAWebNewsletterCollection").getActive())==null?void 0:e.id},getNewsletterMetadata:function(t){var e,n=t.id;return(e=r("WAWebNewsletterCollection").get(n))==null?void 0:e.newsletterMetadata},handleMyRoleChangeNotification:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=e.jid,a=o("WAWebWidFactory").createWid(n),i=r("WAWebNewsletterCollection").get(a);i==null||(t=i.newsletterMetadata)==null||(t=t.subscribers)==null||t.reset();var l=i!=null;yield o("WAWebQueryAndUpdateNewslettersMetadataAction").queryAndUpdateNewsletterMetadataAction(n,{messageCount:l?void 0:1,fields:{membership:!0,state:!0,creationTime:l?void 0:!0,description:l?void 0:!0,handle:l?void 0:!0,inviteLink:l?void 0:!0,linkedAccounts:l?void 0:!0,muted:l?void 0:!0,name:l?void 0:!0,picture:l?void 0:!0,privacy:l?void 0:!0,subscribers:l?void 0:!0,verification:l?void 0:!0}})});function t(t){return e.apply(this,arguments)}return t})(),displayRoleChangeDesktopNotification:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=e.notification,a=n.xwa2_notify_newsletter_admin_promote!=null?"promote":"demote",i=(t=n.xwa2_notify_newsletter_admin_promote)!=null?t:n.xwa2_notify_newsletter_admin_demote;if(i!=null){var l=i!=null?r("WAWebNewsletterCollection").get(i==null?void 0:i.id):null,s=o("WAWebMexNewsletterRoleChangeNotificationHandler").getUserIdFromPayload(babelHelpers.extends({},i.user)),u=o("WAWebMexNewsletterUtils").mapRoleToMembership(i.user_new_role);if(!(s==null||l==null||u==null)){var c=i.admin&&o("WAWebMexNewsletterRoleChangeNotificationHandler").getUserIdFromPayload(babelHelpers.extends({},i.admin)),d=l;yield o("WAWebShowNewsletterRoleChangeNotification").showNewsletterRoleChangeNotification({mode:a,user:s,admin:c,chat:d,newRole:u})}}});function t(t){return e.apply(this,arguments)}return t})(),displayNewsletterMilestoneDesktopNotification:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){o("WAWebNotificationBackend").showNewsletterMilestoneNotification(e)});function t(t){return e.apply(this,arguments)}return t})(),handleOtherUserRoleChangeNotification:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n,a=e.jid,i=e.newRole,l=e.userId,s=o("WAWebWidFactory").createWid(a),u=r("WAWebNewsletterCollection").get(s),c=u==null||(t=u.newsletterMetadata)==null||(t=t.subscribers)==null?void 0:t.get(l);if(c!=null)c.membership=i;else{var d=o("WAWebContactCollection").ContactCollection.get(l);if(!d&&o("WAWebNewsletterGatingUtils").isNewsletterMultiAdminLidMigrationEnabled()&&(d=o("WAWebContactCollection").ContactCollection.gadd({id:l,type:"out"})),i===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin&&d){var m;u==null||(m=u.newsletterMetadata)==null||(m=m.subscribers)==null||m.add(new(o("WAWebNewsletterSubscriberModel")).NewsletterSubscriber({id:l,membership:i,isPendingAdmin:!1,contact:d}))}}if(u==null||(n=u.newsletterMetadata)==null||(n=n.subscribers)==null||n.sort(),i===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin){var p;u==null||(p=u.newsletterMetadata)==null||(p=p.pendingAdmins)==null||p.remove(l)}});function t(t){return e.apply(this,arguments)}return t})(),updateChatPreviewFromReaction:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.parentMsgKey,n=e.reactionMsgObj,r=yield o("WAWebShouldUpdateLastAddOnPreview").filterChatsWithAddOnPreviewUpdates([o("WAWebLastAddOnDBSerialization").lastAddOnPreviewCandidateFromReactionRowType(babelHelpers.extends({},n,{parentMsgKey:t.toString()}))]);r.size>0&&(yield o("WAWebDBUpdateLastAddOnPreviewChat").updateDatabaseForLastAddOnPreview(r),o("WAWebUpdateLastAddOnPreviewChatAction").updateModelsForLastAddOnPreview(r))});function t(t){return e.apply(this,arguments)}return t})(),updateChatPreviewFromVote:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.parentMsgKey,n=e.voteMsgObj,r=yield o("WAWebShouldUpdateLastAddOnPreview").filterChatsWithAddOnPreviewUpdates([o("WAWebLastAddOnDBSerialization").lastAddOnPreviewCandidateFromVoteData(babelHelpers.extends({},n,{parentMsgKey:t}),!1)]);r.size>0&&(yield o("WAWebDBUpdateLastAddOnPreviewChat").updateDatabaseForLastAddOnPreview(r),o("WAWebUpdateLastAddOnPreviewChatAction").updateModelsForLastAddOnPreview(r))});function t(t){return e.apply(this,arguments)}return t})(),updateNewsletterReports:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.reports;o("WAWebNewsletterReportCollection").NewsletterReportCollection.reset(),o("WAWebNewsletterReportCollection").NewsletterReportCollection.add(t)});function t(t){return e.apply(this,arguments)}return t})(),updateNewsletterReport:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.report;o("WAWebNewsletterReportCollection").NewsletterReportCollection.add(t,{merge:!0})});function t(t){return e.apply(this,arguments)}return t})(),updateNewsletterEnforcementAlerts:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.enforcementAlerts;o("WAWebNewsletterEnforcementAlertCollection").NewsletterEnforcementAlertCollection.reset(),o("WAWebNewsletterEnforcementAlertCollection").NewsletterEnforcementAlertCollection.add(t)});function t(t){return e.apply(this,arguments)}return t})(),updateNewsletterQuestionResponses:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.append,n=e.responses;t||o("WAWebNewsletterQuestionResponseCollection").QuestionResponseCollection.reset(),o("WAWebNewsletterQuestionResponseCollection").QuestionResponseCollection.add(n)});function t(t){return e.apply(this,arguments)}return t})(),hideNewsletterQuestionResponse:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=e.questionServerId,r=e.responseServerId,a=yield(t=o("WAWebNewsletterQuestionResponseCollection").QuestionResponseCollection.filter(function(e){return e.responseServerId===r&&e.questionServerId===n}))==null?void 0:t[0];a!=null&&o("WAWebNewsletterQuestionResponseCollection").QuestionResponseCollection.remove(a)});function t(t){return e.apply(this,arguments)}return t})(),updateMyNewsletterMembershipRole:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.newRole,n=e.newsletter,a=n.newsletterMetadata;if(a==null){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterMembershipRole] called with newsletterMetadata = null"])));return}a.membershipType=t,r("WAWebNewsletterCollection").add(n,{merge:!0})});function t(t){return e.apply(this,arguments)}return t})(),updateNewsletterMemberRole:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=e.member,r=e.newRole,a=e.newsletter,i=a.newsletterMetadata;if(i==null){o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterMembershipRole] called with newsletterMetadata = null"])));return}var l=(t=i.subscribers)==null?void 0:t.get(n.id);if(l!=null){var s;l.membership=r,(s=a.newsletterMetadata)==null||(s=s.subscribers)==null||s.sort();var c=o("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(a.id.toJid());yield o("WAWebUserPrefsNewsletter").flushCachedNewsletterSubscribers(c)}});function t(t){return e.apply(this,arguments)}return t})(),displayNewsletterMetadataUpdateNotification:function(t){var e=t.notification,n=e.actorId,a=e.newsletterId,i=e.updates,l=r("WAWebNewsletterCollection").get(a);l!=null&&o("WAWebShowNewsletterMetadataUpdateNotification").showNewsletterMetadataUpdateNotification({chat:l,user:n,updates:i})},expireNewsletterAdminInvites:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.expiredMsgData;t.forEach(function(e){var t,n=e.id,r=e.newsletterAdminInviteInfo;(t=o("WAWebMsgCollection").MsgCollection.get(n))==null||t.set({newsletterAdminInviteInfo:r})})});function t(t){return e.apply(this,arguments)}return t})(),updateNewsletterInsights:function(t){var e=t.insights,n=t.newsletter,r=n.newsletterMetadata;if(r==null){o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[updateNewsletterInsights] called with newsletterMetadata = null"])));return}var a=r.adminInsights;a==null?r.adminInsights=new(o("WAWebNewsletterAdminInsightsModel")).NewsletterAdminInsights(e):a.set(babelHelpers.extends({},e))},handleNewsletterWamoSubStatusChangeNotification:(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.jid,n=e.wamoSubStatus,a=o("WAWebWidFactory").createWid(t),i=r("WAWebNewsletterCollection").get(a);if(i!=null){var l=i.newsletterMetadata;l!=null&&(l.wamoSubStatus=n),yield o("WAWebQueryAndUpdateNewslettersMetadataAction").queryAndUpdateNewsletterMetadataAction(t),n===o("WAWebCommonNewsletterEnums").WamoSubStatus.ACTIVE&&(yield o("WAWebNewsletterPullMessagesFromServerAction").pullNewsletterMessagesFromServer(i,{messageCount:o("WAWebNewsletterGatingUtils").getMaxMsgCountFromServer()}))}});function t(t){return e.apply(this,arguments)}return t})()};l.NewsletterBridgeApi=y}),98); __d("WAWebNewsletterBridgeMsgAddOnsUtils",["Promise","WAWebMsgCollection","WAWebNewsletterPollVotesModelCollection","WAWebNewsletterReactionCollection","WAWebNoop","WAWebPollsCreateOptionLocalIdMap","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){if(e!=null&&e.size>0)for(var t of e.entries()){var n=t[0],r=t[1],a=o("WAWebMsgCollection").MsgCollection.get(n);a==null||a.set("viewCount",r)}}function u(e){if(e!=null&&e.size>0)for(var t of e.entries()){var n=t[0],r=t[1],a=o("WAWebMsgCollection").MsgCollection.get(n);a==null||a.set("questionResponsesCount",r)}}function c(e){if(e!=null&&e.size>0)for(var t of e.entries()){var n=t[0],r=t[1],a=o("WAWebMsgCollection").MsgCollection.get(n);if(a!=null){var i,l=(i=a.forwardsCount)!=null?i:0;a.set("forwardsCount",Math.max(l,r))}}}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a,i=t.ids,l=t.reactionIdsToRemove,s=t.reactions;l!=null&&o("WAWebNewsletterReactionCollection").NewsletterMessageReactionsCollection.remove(l),yield(e||(e=n("Promise"))).all((a=i.map(function(e){return o("WAWebNewsletterReactionCollection").NewsletterMessageReactionsCollection.find(e.toString()).catch(r("WAWebNoop"))}))!=null?a:[]),o("WAWebNewsletterReactionCollection").NewsletterMessageReactionsCollection.add(s.map(function(e){return{id:e.parentMsgKey,reactionCountMap:e.emojiCountMap,reactionCountMapTs:e.serverTimestamp}}),{merge:!0})}),m.apply(this,arguments)}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a,i=t.ids,l=t.pollVotes;yield(e||(e=n("Promise"))).all((a=i.map(function(e){return o("WAWebNewsletterPollVotesModelCollection").NewsletterPollVotesModelCollection.find(e).catch(r("WAWebNoop"))}))!=null?a:[]);var s=yield e.all(l.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebMsgCollection").MsgCollection.get(e.parentMsgKey),n=t==null?void 0:t.pollOptions;if(n!=null){var r=yield o("WAWebPollsCreateOptionLocalIdMap").createOptionLocalIdMap(n);return{id:e.parentMsgKey,pollVotesCountMap:f(e.voteCountMap,r),pollVotesCountMapTs:e.serverTimestamp}}});return function(t){return e.apply(this,arguments)}})()));o("WAWebNewsletterPollVotesModelCollection").NewsletterPollVotesModelCollection.add(s.filter(Boolean),{merge:!0})}),_.apply(this,arguments)}function f(e,t){var n=new Map;for(var r of e.entries()){var o=r[0],a=r[1];n.set(t.getLocalIdForHexHash(o),a)}return n}function g(e,t){t!=null&&e.forEach(function(e){var n=o("WAWebMsgCollection").MsgCollection.get(e);n==null||n.set("lastUpdateFromServerTs",t)})}l.updateViewCounts=s,l.updateQuestionResponsesCounts=u,l.updateForwardCounts=c,l.updateReactions=d,l.updatePollVotes=p,l.updateLastUpdateTs=g}),98); __d("WAWebGetEphemeralFieldsMsgActionsUtils",["WAWebABProps","WAWebChatEphemerality","WAWebChatGetters"],(function(t,n,r,o,a,i,l){function e(e){var t={};o("WAWebChatEphemerality").isEphemeralSettingOn(e)&&(t.ephemeralDuration=o("WAWebChatEphemerality").getEphemeralSetting(e));var n=o("WAWebChatEphemerality").getEphemeralSettingTimestamp(e);n!=null&&(t.ephemeralSettingTimestamp=n);var r=o("WAWebChatEphemerality").getDisappearingModeInitiator(e);if(r!=null&&(t.disappearingModeInitiator=r),o("WAWebABProps").getABPropConfigValue("dm_initiator_trigger")){var a=o("WAWebChatEphemerality").getDisappearingModeTrigger(e);a!=null&&(t.disappearingModeTrigger=a);var i=o("WAWebChatEphemerality").getDisappearingModeInitiatedByMe(e);i!=null&&(t.disappearingModeInitiatedByMe=i)}if(o("WAWebChatGetters").getIsGroup(e)&&o("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_groups")){var l=o("WAWebChatEphemerality").getDisappearingModeTriggerGroups(e);l!=null&&(t.disappearingModeTrigger=l);var s=o("WAWebChatEphemerality").getDisappearingModeInitiatedByMeGroups(e);s!=null&&(t.disappearingModeInitiatedByMe=s)}return babelHelpers.extends({},t)}l.getEphemeralFields=e}),98); __d("WAWebMexCreateNewsletterAdminInviteJobMutation.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"newsletter_id"},{defaultValue:null,kind:"LocalArgument",name:"user_id"}],t=[{kind:"Variable",name:"newsletter_id",variableName:"newsletter_id"},{kind:"Variable",name:"user_id",variableName:"user_id"}],n={alias:null,args:null,kind:"ScalarField",name:"invite_expiration_time",storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebMexCreateNewsletterAdminInviteJobMutation",selections:[{alias:null,args:t,concreteType:"XWA2NewsletterAdminInviteCreateResponse",kind:"LinkedField",name:"xwa2_newsletter_admin_invite_create",plural:!1,selections:[n],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebMexCreateNewsletterAdminInviteJobMutation",selections:[{alias:null,args:t,concreteType:"XWA2NewsletterAdminInviteCreateResponse",kind:"LinkedField",name:"xwa2_newsletter_admin_invite_create",plural:!1,selections:[n,{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}]},params:{id:"9387141988078609",metadata:{},name:"WAWebMexCreateNewsletterAdminInviteJobMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null); __d("WAWebMexCreateNewsletterAdminInviteJob",["WANullthrows","WATimeUtils","WAWebLidMigrationUtils","WAWebMexClient","WAWebMexCreateNewsletterAdminInviteJobMutation.graphql","WAWebNewsletterRpcUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=e!==void 0?e:e=n("WAWebMexCreateNewsletterAdminInviteJobMutation.graphql");function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){return o("WAWebNewsletterRpcUtils").runWithBackoff(function(){return d(e,t)})}),c.apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WAWebLidMigrationUtils").toUserLidOrThrow(t),a=yield o("WAWebMexClient").fetchQuery(s,{newsletter_id:e,user_id:n.toString()}),i=a.xwa2_newsletter_admin_invite_create,l=r("WANullthrows")(i==null?void 0:i.invite_expiration_time);return{inviteExpiration:o("WATimeUtils").castToUnixTime(Number.parseInt(l,10))}}),m.apply(this,arguments)}l.createNewsletterAdminInvite=u}),98); __d("WAWebNewsletterSendMsgAction",["Promise","WAAckLevel","WALogger","WANullthrows","WATimeUtils","WAWebChatGetters","WAWebCoreActionsODS","WAWebDBProcessEditProtocolMsgs","WAWebFrontendMsgGetters","WAWebGetEphemeralFieldsMsgActionsUtils","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebMexCreateNewsletterAdminInviteJob","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModel","WAWebMsgModelFromData","WAWebMsgRcatUtils","WAWebMsgType","WAWebNewsletterCollection","WAWebNewsletterErrors","WAWebNewsletterGatingUtils","WAWebNewsletterSendMessageJob","WAWebNewsletterSendMsgActionUtils","WAWebNewsletterUpdateMsgsRecordsJob","WAWebNewsletterValidationUtils","WAWebPollsGatingUtils","WAWebSendMsgChatAction","WAWebSendMsgResultAction","WAWebSendTextMsgChatAction","WAWebStateUtils","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWamEnumMessageSendResultType","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h;function y(e,t,n){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var a=o("WAWebStateUtils").unproxy(e);if(!o("WAWebChatGetters").getIsNewsletter(a))throw new(o("WAWebNewsletterErrors")).UnexpectedNonNewsletterChatError;var i=yield o("WAWebSendTextMsgChatAction").createTextMsgData(a,t,n);if(i==null)throw r("err")("Failed to generate MsgData");o("WAWebNewsletterSendMsgActionUtils").validateMsgDataForMsgSend(i,a);var l=new(o("WAWebMsgModel")).Msg(i),s=n.linkPreview?"media":"text";return $({chat:a,msg:l,type:s})}),C.apply(this,arguments)}function b(e){var t=o("WAWebFrontendMsgGetters").getChat(e);return o("WAWebFrontendMsgGetters").getAsMms(e)?(h||(h=n("Promise"))).resolve():$({chat:t,msg:e,type:"text"})}function v(e,t,r){if(!o("WAWebChatGetters").getIsNewsletter(e))return(h||(h=n("Promise"))).reject(new(o("WAWebNewsletterErrors")).UnexpectedNonNewsletterChatError);var a=t instanceof o("WAWebMsgModel").Msg?t:new(o("WAWebMsgModel")).Msg(t);return a.local=!0,$({chat:e,msg:a,type:"media",uploadMediaMsg:r})}function S(e){e.wamMessageSendReporter=new(o("WAWebMessageSendReporter")).MessageSendReporter(e),e.wamMessageSendPerfReporter=new(o("WAWebMessageSendPerfReporter")).MessageSendPerfReporter({chatWid:e.to,mediaType:e.getWamMediaType(),messageType:e.getWamMessageType()})}function R(e,t){return L.apply(this,arguments)}function L(){return L=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){try{var r=o("WAWebDBProcessEditProtocolMsgs").generateMessageEdit(o("WAWebMsgDataFromModel").msgDataFromMsgModel(t),o("WAWebMsgDataFromModel").msgDataFromMsgModel(n)),a=r.editedMsgData;t.set(a);var i=o("WAWebMsgGetters").getIsMedia(t),l=o("WAWebMsgGetters").getLinkPreview(t),s=o("WAWebMsgRcatUtils").getContentIdString(t,!0),u=s!=null&&o("WAWebNewsletterGatingUtils").isRCATFieldGenerationEnabled()?s:null,c=yield o("WAWebNewsletterSendMessageJob").sendNewsletterMessageJob({type:"edit",editType:i||l?"media":"text",msg:t,newsletterJid:o("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(t.id.remote.toJid()),contentId:u});return n.updateAck(o("WAAckLevel").ACK.SENT),{t:c.ack.t,messageSendResult:c.success===!0?o("WAWebSendMsgResultAction").SendMsgResult.OK:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_NETWORK}}catch(t){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to edit message"]))).tags("newsletter").sendLogs("newsletter-edit-fail"),{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}}),L.apply(this,arguments)}function E(e){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.chat,n=e.msgData;if(!o("WAWebNewsletterGatingUtils").isNewsletterPollsCreationEnabled())throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Poll creation is not enabled"]))).tags("newsletter").sendLogs("poll-creation-not-enabled"),r("err")("Poll creation is not enabled");var a=new(o("WAWebMsgModel")).Msg(n),i=yield $({chat:t,msg:a,type:"pollCreation"});return[a,i]}),k.apply(this,arguments)}function I(e){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.chat,n=e.msgData;if(!o("WAWebNewsletterGatingUtils").isNewsletterPollForwardingEnabled())throw o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Poll forwarding is not enabled"]))).tags("newsletter").sendLogs("poll-forwarding-not-enabled"),r("err")("Poll forwarding is not enabled");var a=new(o("WAWebMsgModel")).Msg(n),i=yield $({chat:t,msg:a,type:"pollResultSnapshot"});return[a,i]}),T.apply(this,arguments)}function D(e,t){return x.apply(this,arguments)}function x(){return x=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(o("WAWebFrontendMsgGetters").getIsMms(t))return o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Forwarding MMS messages is not supported"]))),{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN};var n=yield o("WAWebNewsletterSendMsgActionUtils").prepMsgDataForForward(t);return $({chat:e,msg:o("WAWebMsgModelFromData").msgModelFromMsgData(n),type:t.type===o("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT&&o("WAWebPollsGatingUtils").isPollResultSnapshotPollTypeEnvelopeEnabled()?"pollResultSnapshot":"text"})}),x.apply(this,arguments)}function $(e){return P.apply(this,arguments)}function P(){return P=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,r,a=e.chat,i=e.type,l=e.uploadMediaMsg,s=e.msg;S(s),(t=s.wamMessageSendPerfReporter)==null||t.startRenderedStage(),yield a.addQueue.enqueue((h||(h=n("Promise"))).resolve(s)).then((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield o("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords([o("WAWebMsgDataFromModel").msgDataFromMsgModel(s)]),a.msgs.add(e),a.t=s.t});return function(t){return e.apply(this,arguments)}})()),(r=s.wamMessageSendPerfReporter)==null||r.postRenderedStage();try{var u,c,f,g;try{l!=null&&(s=yield l(s))}catch(e){throw new(o("WAWebNewsletterErrors")).NewsletterMediaUploadError}(u=s.wamMessageSendPerfReporter)==null||u.startReadyToSendStage();var y=o("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(a.id.toJid()),C=o("WAWebMsgRcatUtils").getContentIdString(s,!0),b=i==="media"?{msg:s,type:i,newsletterJid:y,mediaHandle:s.mediaHandle,contentId:C!=null&&o("WAWebNewsletterGatingUtils").isRCATFieldGenerationEnabled()?o("WAWebMsgRcatUtils").getContentIdString(s,!0):null}:{msg:s,type:i,newsletterJid:y};(c=s.wamMessageSendPerfReporter)==null||c.postReadyToSendStage(),(f=s.wamMessageSendPerfReporter)==null||f.startWrittenWireStage();var v=yield a.sendQueue.enqueue(o("WAWebNewsletterSendMessageJob").sendNewsletterMessageJob(b));switch((g=s.wamMessageSendPerfReporter)==null||g.postWrittenWireStage(),v.success){case!0:{var R;o("WAWebCoreActionsODS").logChannelMsgSend();var L=v.serverId;if(L==null)throw new(o("WAWebNewsletterErrors")).MissingNewsletterServerIdError;s.serverId=v.serverId,s.t=v.ack.t,s.updateAck(o("WAAckLevel").ACK.SENT,!0);try{var E,k;(E=s.wamMessageSendPerfReporter)==null||E.startSavedStage(),yield o("WAWebNewsletterUpdateMsgsRecordsJob").updateNewsletterMsgRecord(s),(k=s.wamMessageSendPerfReporter)==null||k.postSavedStage()}catch(e){o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to persist sent message on db"]))).tags("newsletter").sendLogs("newsletter-send-message-db-fail")}return(R=s.wamMessageSendReporter)==null||R.postSuccess(),{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.OK}}case!1:{var I;return o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to send message, "," from server"])),v.ack.error).tags("newsletter").sendLogs("newsletter-send-message-fail-server"),s.updateAck(o("WAAckLevel").ACK.FAILED,!0),(I=s.wamMessageSendReporter)==null||I.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_NETWORK,isTerminal:!1}),{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_NETWORK}}}}catch(e){var T;return e instanceof o("WAWebNewsletterErrors").MissingNewsletterServerIdError?o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Empty serverId returned from server"]))).tags("newsletter").sendLogs("newsletter-empty-server-id"):o("WALogger").WARN(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[newsletter] Failed to send message"]))).tags("newsletter"),s.updateAck(o("WAAckLevel").ACK.FAILED,!0),(T=s.wamMessageSendReporter)==null||T.postFailure({result:e instanceof o("WAWebNewsletterErrors").NewsletterMediaUploadError?o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UPLOAD:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!1}),e instanceof o("WAWebNewsletterErrors").NewsletterMediaUploadError?{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UPLOAD}:{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}finally{s.wamMessageSendReporter=null,s.wamMessageSendPerfReporter=null}}),P.apply(this,arguments)}function N(e,t){return M.apply(this,arguments)}function M(){return M=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=t.base64Thumb,a=t.invitee,i=t.inviteMessage,l=t.newsletterWid;try{var s=o("WAWebStateUtils").unproxy(e),u=yield o("WAWebMexCreateNewsletterAdminInviteJob").createNewsletterAdminInvite(o("WAWebNewsletterValidationUtils").toNewsletterJidOrThrow(l.toJid()),a),c=u.inviteExpiration,d=r("WANullthrows")(r("WAWebNewsletterCollection").get(l)),m=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),p=babelHelpers.extends({ack:o("WAAckLevel").ACK.CLOCK,from:m,id:new(r("WAWebMsgKey"))({from:m,to:s.id,id:yield r("WAWebMsgKey").newId(),participant:void 0,selfDir:"out"}),local:!0,t:o("WATimeUtils").unixTime(),to:s.id,type:"newsletter_admin_invite",kind:"newsletterAdminInvite",viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE,isNewMsg:!0,newsletterAdminInviteInfo:{newsletterId:o("WAWebWidFactory").asNewsletterWidOrThrow(l),newsletterName:d==null?void 0:d.name,inviteExpiration:r("WANullthrows")(c),inviteMessage:i,pictureThumbnail:n}},o("WAWebGetEphemeralFieldsMsgActionsUtils").getEphemeralFields(s));return o("WAWebSendMsgChatAction").addAndSendMsgToChat(s,p)[1]}catch(e){return o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[sendNewsletterAdminInviteMessage] Failed to send message ",""])),e).tags("newsletter").sendLogs("newsletter-failed-to-send-admin-invite"),{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}}),M.apply(this,arguments)}function w(e,t){return A.apply(this,arguments)}function A(){return A=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=t.base64Thumb,a=t.inviteMessage,i=t.newsletterWid;try{var l=o("WAWebStateUtils").unproxy(e),s=r("WANullthrows")(r("WAWebNewsletterCollection").get(i)),u=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),c=babelHelpers.extends({ack:o("WAAckLevel").ACK.CLOCK,from:u,id:new(r("WAWebMsgKey"))({from:u,to:l.id,id:yield r("WAWebMsgKey").newId(),participant:void 0,selfDir:"out"}),local:!0,t:o("WATimeUtils").unixTime(),to:l.id,type:"newsletter_follower_invite",kind:"newsletterFollowerInvite",viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE,broadcast:!0,isNewMsg:!0,newsletterFollowerInviteInfo:{newsletterId:o("WAWebWidFactory").asNewsletterWidOrThrow(i),newsletterName:s==null?void 0:s.name,inviteMessage:a,pictureThumbnail:n}},o("WAWebGetEphemeralFieldsMsgActionsUtils").getEphemeralFields(l));return o("WAWebSendMsgChatAction").addAndSendMsgToChat(l,c)[1]}catch(e){return o("WALogger").ERROR(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[sendNewsletterFollowerInviteMessage] Failed to send message ",""])),e).tags("newsletter").sendLogs("newsletter-failed-to-send-follower-invite"),{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}}}),A.apply(this,arguments)}l.sendNewsletterTextMsg=y,l.resendNewsletterMsg=b,l.sendNewsletterMediaMsg=v,l.sendNewsletterEditMsg=R,l.sendNewsletterPollCreationMsg=E,l.sendNewsletterPollResultSnapshotMsg=I,l.forwardNewsletterMessage=D,l.sendNewsletterAdminInviteMessage=N,l.sendNewsletterFollowerInviteMessage=w}),98); __d("WAWebNewsletterSendMsgActionUtils",["WAWebFrontendMsgGetters","WAWebMediaConstants","WAWebMediaGetUploadOriginForChat","WAWebMediaOpaqueData","WAWebMediaUploadMmsThumbnail","WAWebMmsMediaTypes","WAWebMsgModelFromData","WAWebMsgModelUtils","WAWebNewsletterErrors","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return o("WAWebMsgModelUtils").notRefiningTypeIsUrl(e)?u(e):e}),s.apply(this,arguments)}function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebFrontendMsgGetters").getAsUrl(o("WAWebMsgModelFromData").msgModelFromMsgData(e));if(t==null)return e;var n=t.thumbnailHQ;if(n==null)return e;var a=yield r("WAWebMediaUploadMmsThumbnail")({thumbnail:yield r("WAWebMediaOpaqueData").createFromBase64Jpeg(n),mediaType:o("WAWebMmsMediaTypes").MEDIA_TYPES.NEWSLETTER_THUMBNAIL_LINK,uploadOrigin:r("WAWebMediaGetUploadOriginForChat")(o("WAWebFrontendMsgGetters").getChat(t.unsafe())),forwardedFromWeb:!0,timeout:o("WAWebMediaConstants").MMS_THUMBNAIL_UPLOAD_TIMEOUT,isViewOnce:!1}),i=a.filehash,l=a.mediaEntry;return babelHelpers.extends({},e,{thumbnailDirectPath:l==null?void 0:l.directPath,thumbnailSha256:i,thumbnailEncSha256:void 0,mediaKey:void 0,mediaKeyTimestamp:void 0})}),c.apply(this,arguments)}function d(e,t){if(e.quotedParticipant!=null&&e.quotedParticipant!==t.id)throw new(o("WAWebNewsletterErrors")).UnexpectedNewsletterQuotedParticipantMismatchError}l.prepMsgDataForForward=e,l.validateMsgDataForMsgSend=d}),98); __d("WAWebNewsletterSystemMessagesAction",["Promise","WAWebMsgModelFromData","WAWebNewsletterSystemMessages","WAWebNewsletterUpdateMsgsRecordsJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(t){return t.addQueue.enqueue((e||(e=n("Promise"))).resolve().then(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e,n,r=o("WAWebNewsletterSystemMessages").genNewsletterCreationSystemMessages({id:t.id,name:t.name,t:(e=t.newsletterMetadata)==null?void 0:e.creationTime,role:(n=t.newsletterMetadata)==null?void 0:n.membershipType}),a=r.map(o("WAWebMsgModelFromData").msgModelFromMsgData);return yield o("WAWebNewsletterUpdateMsgsRecordsJob").addNewsletterMsgsRecords(r),t.msgs.add(a,{at:0}),a})))}l.addSystemMessagesToChat=s}),98); __d("WAWebNewsletterViewModeUIUtils",["WAWebMessageAssociationUIUtils","WAWebViewMode.flow"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t){t===void 0&&(t=o("WAWebViewMode.flow").ViewModeSurface.CHAT);var n=o("WAWebMessageAssociationUIUtils").getHiddenViewModeMessagesForChat(e,t),r=n.map(function(e){return e.serverId}).filter(Boolean);return new Set(r)}l.getHiddenMessageServerIdsForChat=e}),98); __d("WAWebChatFlowTypes",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum")({Group:"group",Broadcast:"broadcast",Chat:"chat",Community:"community",Newsletter:"newsletter"});i.ChatKindType=e}),66); __d("WAWebInfoFlowStep",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum").Mirrored(["GroupInfo","BroadcastInfo","ContactInfo","NewsletterInfo","NewsletterContactInfo","DeleteNewsletter","NewsletterAdminCenter","NewsletterInsights","NewsletterLink","NewsletterSettings","NewsletterTransferOwnershipSelection","NewsletterTransferOwnership","ProductDetail","ProductCollection","ProductLink","ProductInfo","CatalogLink","Cart","Catalog","ProductList","Starred","Wallpaper","Kept","GroupSettings","MediaGallery","GroupInviteLink","PendingParticipants","Verification","DefaultEphemerality","Ephemeral","SentForAdminReview","SaveContactFlow","EventInfo","AllEvents","LimitSharing","Notifications","Search"]);i.InfoFlowStep=e}),66); __d("WAWebNotificationsNewsletterMetadataUpdateNotification",["fbt","WATimeUtils","WAWebBaseNotification","WAWebChatFlowTypes","WAWebCmd","WAWebContactCollection","WAWebFbtIntlList","WAWebInfoFlowStep","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebParticipantListUtils","WAWebWidFormat","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){var e=(function(e){function t(t){var n;return n=e.call(this)||this,n.updates=t.updates,n.user=t.user,n.chat=t.chat,n}babelHelpers.inheritsLoose(t,e);var r=t.prototype;return r.buildKey=function(){return"newslowner:"+this.chat.id.toString()+":"+this.user.toString()+":"+o("WATimeUtils").unixTime().toString()},r.shouldPlaySound=function(){return e.prototype.shouldPlaySound.call(this)?o("WAWebNotificationHelpers").shouldPlaySoundGranular(this.chat):!1},r.shouldShowBanner=function(){return e.prototype.shouldShowBanner.call(this)?o("WAWebNotificationHelpers").shouldEnableNotificationGranular(this.chat):!1},r.getBannerOptions=function(){var e=this,t=this.updates.some(function(e){var t=e.item;return t==="reaction_setting"})?o("WAWebInfoFlowStep").InfoFlowStep.NewsletterSettings:o("WAWebInfoFlowStep").InfoFlowStep.NewsletterInfo;return{wid:this.chat.id,title:this.chat.name,body:this.getNotificationBody(),onClick:function(){o("WAWebCmd").Cmd.openNewsletterProfile(e.chat,t)}}},r.getNotificationBody=function(){var e=this.getActor();return c(e,this.updates).toString()},r.getActor=function(){var e=o("WAWebContactCollection").ContactCollection.get(this.user);return e!=null?o("WAWebParticipantListUtils").getFirstNameForContact(e):o("WAWebWidFormat").widToFormattedUser(this.user)},r.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebNotificationIconUtils").getChatNotificationIcon(this.chat,this.abortController.signal)});function t(){return e.apply(this,arguments)}return t})(),r.matchesChat=function(t){return t.equals(this.chat)},r.getChatKind=function(){return o("WAWebChatFlowTypes").ChatKindType.Newsletter},t})(o("WAWebBaseNotification").WABaseNotification);function u(e){switch(e){case"name":return s._(/*BTDS*/"nombre");case"description":return s._(/*BTDS*/"descripci\u00f3n");case"profile_picture":return s._(/*BTDS*/"foto del perfil");case"reaction_setting":return s._(/*BTDS*/"ajustes de reacciones")}}function c(e,t){if(t.length===1&&t[0].item==="name"){var n=t[0].value;return s._(/*BTDS*/"{actor} cambi\u00f3 el nombre del canal a \"{updateValue}\".",[s._param("actor",e),s._param("updateValue",n)])}var o=t.map(function(e){var t=e.item;return u(t)}),a=r("WAWebFbtIntlList")(o,r("WAWebFbtIntlList").CONJUNCTIONS.AND,r("WAWebFbtIntlList").DELIMITERS.COMMA);return s._(/*BTDS*/"{actor} cambi\u00f3 {update} del canal.",[s._param("actor",e),s._param("update",a.toString())])}l.WANewsletterMetadataUpdateNotification=e}),226); __d("WAWebNotificationsNewsletterRoleChangeNotification",["fbt","WAWebBaseNotification","WAWebChatFlowTypes","WAWebContactCollection","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebParticipantListUtils","WAWebUserPrefsMeUser","WAWebWidFormat","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){var e=(function(e){function t(t){var n;return n=e.call(this)||this,n.mode=t.mode,n.admin=t.admin,n.user=t.user,n.chat=t.chat,n}babelHelpers.inheritsLoose(t,e);var r=t.prototype;return r.shouldPlaySound=function(){return e.prototype.shouldPlaySound.call(this)?o("WAWebNotificationHelpers").shouldPlaySoundGranular(this.chat):!1},r.shouldShowBanner=function(){return e.prototype.shouldShowBanner.call(this)?o("WAWebNotificationHelpers").shouldEnableNotificationGranular(this.chat):!1},r.buildKey=function(){return"newsladmin:"+this.chat.id.toString()+":"+this.mode+":"+this.user.toString()},r.getBannerOptions=function(){var e=this.getNotificationUser(),t=o("WAWebUserPrefsMeUser").isMeAccount(this.user);return{wid:this.chat.id,title:this.chat.name,body:u[this.mode](e,t).toString()}},r.getNotificationUser=function(){var e=this.mode==="ownership"?this.admin:this.user;if(e==null)return null;var t=o("WAWebContactCollection").ContactCollection.get(e);return t!=null?o("WAWebParticipantListUtils").getFirstNameForContact(t):o("WAWebWidFormat").widToFormattedUser(this.user)},r.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebNotificationIconUtils").getChatNotificationIcon(this.chat,this.abortController.signal)});function t(){return e.apply(this,arguments)}return t})(),r.matchesChat=function(t){return this.chat.equals(t)},r.getChatKind=function(){return o("WAWebChatFlowTypes").ChatKindType.Newsletter},t})(o("WAWebBaseNotification").WABaseNotification),u={promote:function(t,n){return n?s._(/*BTDS*/"Ahora eres admin."):s._(/*BTDS*/"{who} ahora es admin.",[s._param("who",t)])},demote:function(t,n){return n?s._(/*BTDS*/"Ya no eres admin."):s._(/*BTDS*/"{who} ya no es admin.",[s._param("who",t)])},ownership:function(t){return t==null?s._(/*BTDS*/"Ahora eres el propietario del canal."):s._(/*BTDS*/"{who} te design\u00f3 como propietario del canal.",[s._param("who",t)])}};l.WANewsletterRoleChangeNotification=e}),226); __d("WAWebShowNewsletterMetadataUpdateNotification",["WAWebNewsletterMembershipUtil","WAWebNotificationController","WAWebNotificationsNewsletterMetadataUpdateNotification","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.chat,n=e.updates,r=e.user,a=t.newsletterMetadata;if(a!=null&&o("WAWebNewsletterMembershipUtil").iAmOwner(a)&&!o("WAWebUserPrefsMeUser").isMeAccount(r)&&n.length!==0)return o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebNotificationsNewsletterMetadataUpdateNotification")).WANewsletterMetadataUpdateNotification({chat:t,user:r,updates:n}))}),s.apply(this,arguments)}l.showNewsletterMetadataUpdateNotification=e}),98); __d("WAWebShowNewsletterRoleChangeNotification",["Promise","WAWebCommonNewsletterEnums","WAWebNewsletterMembershipUtil","WAWebNotificationController","WAWebNotificationsNewsletterRoleChangeNotification","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l){var e;function s(t){var r=t.admin,a=t.chat,i=t.mode,l=t.newRole,s=t.user,u=a.newsletterMetadata;if(u==null)return(e||(e=n("Promise"))).resolve();var c=i==="promote"&&o("WAWebUserPrefsMeUser").isMeAccount(s)&&l===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner;if(c)return o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebNotificationsNewsletterRoleChangeNotification")).WANewsletterRoleChangeNotification({mode:"ownership",chat:a,admin:r,user:s}));var d=o("WAWebNewsletterMembershipUtil").iAmOwner(u)&&i==="promote"&&l===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin&&!o("WAWebUserPrefsMeUser").isMeAccount(s),m=i==="demote"&&l===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber&&!o("WAWebUserPrefsMeUser").isMeAccount(s)&&s.toJid()===(r==null?void 0:r.toJid()),p=i==="demote"&&o("WAWebUserPrefsMeUser").isMeAccount(s)&&s.toJid()!==(r==null?void 0:r.toJid());return d||m||p?o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebNotificationsNewsletterRoleChangeNotification")).WANewsletterRoleChangeNotification({mode:i,chat:a,admin:r,user:s})):(e||(e=n("Promise"))).resolve()}l.showNewsletterRoleChangeNotification=s}),98); __d("WAWebWamEnumChannelEntryPoint",[],(function(t,n,r,o,a,i){var e=Object.freeze({UNKNOWN:0,UPDATES_TAB:1,DIRECTORY:2,LINK:3,DEEPLINK:4,FORWARDED_MESSAGE:5,DIRECTORY_SEARCH:6,RECOMMENDED_LIST:7,NOTIFICATION:8,UPDATES_TAB_SEARCH:9,STATUS:10,ADMIN_INVITE_MESSAGE:11,MEDIA_BROWSER:12,SIMILAR_CHANNEL:13,DIRECTORY_CATEGORIES:14,DIRECTORY_CATEGORIES_SEARCH:15,NEWSLETTER_MEDIA_GALLERY_MEDIA:16,NEWSLETTER_MEDIA_GALLERY_LINKS:17,THREAD_CHAIN_PILL:18,THREAD_CHAIN_SWIPE_UP:19,RECENT_SEARCHES:20,NEWSLETTER_CREATION_UPDATES_TAB:21,NEWSLETTER_CREATION_DIRECTORY:22,NEWSLETTER_CREATION_DIRECTORY_CATEGORIES:23,INVITE_CONTACTS_TO_FOLLOW_MESSAGE:24,MUSIC_ATTRIBUTION_BOTTOM_SHEET_FROM_CHAT:25});i.CHANNEL_ENTRY_POINT=e}),66); __d("WAWebWamEnumChannelEntryPointApp",[],(function(t,n,r,o,a,i){var e=Object.freeze({EXTERNAL_UNKNOWN:1,WHATSAPP:2});i.CHANNEL_ENTRY_POINT_APP=e}),66); __d("WAWebWamEnumChannelEntryPointMetadata",[],(function(t,n,r,o,a,i){var e=Object.freeze({STATUS_HEADER:1,LINK_TOOLTIP:2,LINK_BUTTON:3,POST_TOOLTIP:4});i.CHANNEL_ENTRY_POINT_METADATA=e}),66); __d("WAWebWamEnumChannelEventSurface",[],(function(t,n,r,o,a,i){var e=Object.freeze({CHANNEL_UPDATES_HOME:1,CHANNEL_THREAD:2,CHANNEL_DIRECTORY:3,CHANNEL_DIRECTORY_SEARCH:4,CHANNEL_PROFILE:5,CHANNEL_UPDATES_HOME_SEARCH:6,CHANNEL_DIRECTORY_CATEGORIES:7,CHANNEL_DIRECTORY_CATEGORIES_SEARCH:8});i.CHANNEL_EVENT_SURFACE=e}),66); __d("WAWebWamEnumChannelEventUnit",[],(function(t,n,r,o,a,i){var e=Object.freeze({RECOMMENDED_CHANNELS:1,SIMILAR_CHANNELS:2,RECENT_SEARCHES:3});i.CHANNEL_EVENT_UNIT=e}),66); __d("WAWebChannelCoreEventWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumChannelEntryPoint","WAWebWamEnumChannelEntryPointApp","WAWebWamEnumChannelEntryPointMetadata","WAWebWamEnumChannelEventSurface","WAWebWamEnumChannelEventType","WAWebWamEnumChannelEventUnit","WAWebWamEnumTsSurface"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({ChannelCoreEvent:[4692,{channelCoreEventSequenceNumber:[8,e.TYPES.INTEGER],channelCoreEventType:[1,o("WAWebWamEnumChannelEventType").CHANNEL_EVENT_TYPE],channelDirectorySessionId:[7,e.TYPES.INTEGER],channelDiscoveryQueryId:[15,e.TYPES.STRING],channelDiscoverySearchId:[16,e.TYPES.STRING],channelEntryPoint:[2,o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT],channelEntryPointApp:[3,o("WAWebWamEnumChannelEntryPointApp").CHANNEL_ENTRY_POINT_APP],channelEntryPointMetadata:[10,o("WAWebWamEnumChannelEntryPointMetadata").CHANNEL_ENTRY_POINT_METADATA],channelEventUnit:[12,o("WAWebWamEnumChannelEventUnit").CHANNEL_EVENT_UNIT],cid:[4,e.TYPES.STRING],directoryChannelIndex:[9,e.TYPES.INTEGER],discoverySurface:[14,o("WAWebWamEnumTsSurface").TS_SURFACE],entryPointMetadata:[5,e.TYPES.STRING],eventSurface:[6,o("WAWebWamEnumChannelEventSurface").CHANNEL_EVENT_SURFACE],similarChannelsSessionId:[13,e.TYPES.INTEGER],unifiedSessionId:[17,e.TYPES.STRING],updatesTabSessionId:[18,e.TYPES.INTEGER]},[1,1,1],"regular"]},{ChannelCoreEvent:[]});l.ChannelCoreEventWamEvent=s}),98); __d("WAWebSimilarNewsletterSessionId",["react"],(function(t,n,r,o,a,i,l){"use strict";var e,s=(e||(e=o("react"))).useMemo;function u(){return 1+Math.floor(Number.MAX_SAFE_INTEGER*Math.random())}function c(){var e=s(function(){return u()},[]);return e}function d(e){return e}l.generateSessionId=u,l.useSimilarNewslettersSessionId=c,l.newsletterSessionIdToInt=d}),98); __d("WAWebNewsletterAttributionLogging",["WALogger","WAWebChannelCoreEventWamEvent","WAWebCommonNewsletterEnums","WAWebNewsletterCollection","WAWebNewsletterDirectoryFilterUtils","WAWebNewsletterGatingUtils","WAWebSimilarNewsletterSessionId","WAWebWamEnumChannelEntryPoint","WAWebWamEnumChannelEntryPointApp","WAWebWamEnumTsSurface"],(function(t,n,r,o,a,i,l){var e=["channelCoreEventType","cid","entryPoint","eventSurface","eventUnit","similarChannelSessionId","unifiedSessionId"],s;function u(e){switch(e){case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.LINK:return o("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_THREAD;case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.RECOMMENDED_LIST:case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.UPDATES_TAB:return o("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_UPDATES_HOME;case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.DIRECTORY_CATEGORIES:return o("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_DIRECTORY_CATEGORIES;case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.FORWARDED_MESSAGE:return o("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_THREAD;case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.DIRECTORY_CATEGORIES_SEARCH:case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.DIRECTORY_SEARCH:return o("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_DIRECTORY_CATEGORIES_SEARCH;case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.STATUS:return o("WAWebWamEnumTsSurface").TS_SURFACE.STATUS_VIEWER_SHEET;case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.ADMIN_INVITE_MESSAGE:return o("WAWebWamEnumTsSurface").TS_SURFACE.CHAT_THREAD;case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.SIMILAR_CHANNEL:return o("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_PROFILE;case o("WAWebWamEnumChannelEntryPoint").CHANNEL_ENTRY_POINT.NEWSLETTER_CREATION_UPDATES_TAB:return o("WAWebWamEnumTsSurface").TS_SURFACE.CHANNEL_UPDATES_HOME;default:return o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Encountered unexpected entry point: ",""])),e).tags("newsletter-logging").sendLogs("Unexpected entry point in newsletter open logging"),o("WAWebWamEnumTsSurface").TS_SURFACE.UNKNOWN}}function c(){return r("WAWebNewsletterCollection").some(function(e){var t;return((t=e.newsletterMetadata)==null?void 0:t.membershipType)===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Subscriber})?1:0}var d=(function(){function t(){this.$6={}}var n=t.prototype;return n.setChannelEntryPoint=function(t){this.$1=t},n.setChannelEntryPointMetadata=function(t){this.$4=t},n.setSimilarChannelsSessionId=function(t){this.$5=t},n.setNewsletterDirectoryLoggingData=function(t){this.$6=t},n.getSimilarChannelsSessionId=function(){return this.$5},n.getIsSimilarUnitMountedForChat=function(t){return t.equals(this.$7)},n.setIsSimilarUnitMountedForChat=function(t){this.$7=t},n.getSimilarChannelsSessionIdForLogging=function(){var e=this.$5;if(e!=null)return o("WAWebSimilarNewsletterSessionId").newsletterSessionIdToInt(e)},n.setDirectorySessionId=function(t){this.$2=t},n.getDirectorySessionIdForLogging=function(){return this.$2},n.getNewsletterDirectoryLoggingData=function(){return this.$6},n.setDirectoryFilter=function(t){if(t==null){this.$3=null;return}switch(t){case o("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.Recommended:return this.$3="all";case o("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.New:return this.$3="new";case o("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.Popular:return this.$3="popular";case o("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.Featured:return this.$3="featured";case o("WAWebNewsletterDirectoryFilterUtils").NewsletterDirectoryFilterType.Trending:return this.$3="most_active";default:return this.$3=null}},n.log=function(n){var t,r,a,i=n.channelCoreEventType,l=n.cid,s=n.entryPoint,d=n.eventSurface,m=n.eventUnit,p=n.similarChannelSessionId,_=n.unifiedSessionId,f=babelHelpers.objectWithoutPropertiesLoose(n,e),g=JSON.stringify(babelHelpers.extends({has_followed_channels:c(),pill_type:(t=this.$3)!=null?t:void 0},o("WAWebNewsletterGatingUtils").isDirectoryCategoriesLoggingEnabled()?f:{}));new(o("WAWebChannelCoreEventWamEvent")).ChannelCoreEventWamEvent({cid:l.user,eventSurface:d,channelCoreEventType:i,channelEntryPointApp:o("WAWebWamEnumChannelEntryPointApp").CHANNEL_ENTRY_POINT_APP.WHATSAPP,channelEntryPoint:(r=s!=null?s:this.$1)!=null?r:void 0,channelDirectorySessionId:(a=this.$2)!=null?a:void 0,entryPointMetadata:g,similarChannelsSessionId:p!=null?o("WAWebSimilarNewsletterSessionId").newsletterSessionIdToInt(p):void 0,channelEntryPointMetadata:this.$4,channelEventUnit:m!=null?m:void 0,unifiedSessionId:_,discoverySurface:s!=null?u(s):void 0}).commit()},t})(),m=new d;l.getDiscoverySurfaceFromChannelEntryPoint=u,l.NewsletterCoreEventLogger=m}),98); __d("WAWebNewsletterCollection",["WAWebChatCollection"],(function(t,n,r,o,a,i,l){var e=new(o("WAWebChatCollection")).ChatCollectionImpl;l.default=e}),98); __d("WAWebNewsletterGeosuspendedCountryModel",["WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a1||o("WAWebNewsletterMembershipUtil").iAmAdmin(this)||o("WAWebNewsletterMembershipUtil").iAmSubscriber(this)},["adminCount","membershipType"]),t.isSubscribedOrOwned=o("WAWebModelUtils").derived(function(){return o("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(this)||o("WAWebNewsletterMembershipUtil").iAmSubscriber(this)},["membershipType"]),t.isPreview=o("WAWebModelUtils").derived(function(){return this.membershipType===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Guest},["membershipType"]),t.showInsightDelta=o("WAWebModelUtils").derived(function(){return o("WAWebClock").Clock.daysDeltaAbs(this.creationTime)>=o("WAWebNewsletterMetricUtils").INSIGHT_DAYS_COVERED},["creationTime"]),babelHelpers.assertThisInitialized(t)||babelHelpers.assertThisInitialized(t)}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.initialize=function(){var t=this;e.prototype.initialize.call(this),this.listenTo(this.subscribers,"change add reset set remove",function(){t.updateAdminCount()})},n.getCollection=function(){return r("WAWebNewsletterMetadataCollection")},n.resetRecentlyFollowedFrom=function(){this.recentlyFollowedFrom=null},n.updateAdminCount=function(){var e,t,n=(e=(t=this.subscribers)==null?void 0:t.countWhere(function(e){var t=e.membership;return t===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Admin||t===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner}))!=null?e:0;this.adminCount=this.membershipType===o("WAWebCommonNewsletterEnums").NewsletterMembershipType.Owner?n+1:n},n.setFollowerActivityMuteExpiration=function(t){this.followerActivityMuteExpiration=t},t})(o("WAWebBaseModel").BaseModel);e.Proxy="newsletterMetadata",e.idClass=r("WAWebWid");var s=o("WAWebBaseModel").defineModel(e);l.NewsletterMetadata=s}),98); __d("WAWebNewsletterPendingAdminsCollection",["WAWebBaseCollection","WAWebNewsletterSubscriberModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t})(o("WAWebBaseCollection").BaseCollection);e.model=o("WAWebNewsletterSubscriberModel").NewsletterSubscriber,l.default=e}),98); __d("WAWebNewsletterPollVotesGetters",["WAWebGetters","WAWebGettersCaches"],(function(t,n,r,o,a,i,l){var e=o("WAWebGetters").createGetterFactories({createCache:o("WAWebGettersCaches").createNewsletterPollVotesCache}),s=e.clearCacheFor,u=e.field,c=e.unsafeIdentityGetter,d=s,m=c,p=u("ack");l.clearNewsletterPollVotesGetterCacheFor=d,l.getNewsletterPollVotesUnsafe=m,l.getAck=p}),98); __d("WAWebFrontendNewsletterPollVotesGetters",["WAWebAck","WAWebGetters","WAWebGettersCaches","WAWebNewsletterPollVotesGetters"],(function(t,n,r,o,a,i,l){var e=o("WAWebGetters").createGetterFactories({root:o("WAWebNewsletterPollVotesGetters").getNewsletterPollVotesUnsafe,createCache:o("WAWebGettersCaches").createFrontendNewsletterPollVotesCache}),s=e.clearCacheFor,u=e.computed,c=e.field,d=s,m=c("isSendFailure",{default:!1}),p=u(function(e){var t=e[0],n=e[1],r=t!=null&&t0?r.set(n,i):r.delete(n)}this.$NewsletterMessageReactionsImpl$p_3(t)},n.$NewsletterMessageReactionsImpl$p_1=function(){var e,t=this.myReaction;if(t!=null){this.reactionCountMap=(e=this.reactionCountMap)!=null?e:new Map;var n=this.reactionCountMap,r=n.get(t);r!=null&&(r>1?n.set(t,r-1):n.delete(t),this.$NewsletterMessageReactionsImpl$p_3(null))}},n.$NewsletterMessageReactionsImpl$p_3=function(t){this.myReactionTs=o("WATimeUtils").unixTime(),this.myReaction=t},t})(o("WAWebBaseModel").BaseModel);e.Proxy="newsletterReaction",e.idClass=r("WAWebMsgKey");var s=o("WAWebBaseModel").defineModel(e);l.NewsletterMessageReactions=s}),98); __d("WAWebNewsletterReactionCollection",["WATimeUtils","WAWebBaseCollection","WAWebDBGetReactions","WAWebMiscErrors","WAWebMsgCollection","WAWebMsgKey","WAWebNewsletterDBUtils","WAWebNewsletterReactionModel","WAWebReactionsBEUtils","WAWebUserPrefsMeUser","WAWebdbCRUDOperationsNewsletterReaction","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,a=arguments.length,i=new Array(a),l=0;l0&&!e.read&&!o("WAWebUserPrefsMeUser").isMeAccount(e.sender)})},n.getVoteCount=function(){return this.countWhere(function(e){return e.selectedOptionLocalIds.length>0})},t})(o("WAWebBaseCollection").BaseCollection);e.model=o("WAWebPollsPollVoteModel").PollVote;var s=(function(t){function n(){for(var e,n=arguments.length,r=new Array(n),o=0;o>/g,""):e.message.replace(/<>/g,n)}l.hydratePremiumMessage=e}),98); __d("WAWebPremiumMessageCollection",["WAWebBaseCollection","WAWebPremiumMessageModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t})(o("WAWebBaseCollection").BaseCollection);e.model=o("WAWebPremiumMessageModel").PremiumMessage;var s=new e;l.PremiumMessageCollection=s}),98); __d("WAWebPremiumMessageModel",["WAWebBaseModel","WAWebMsgCollection","WAWebPremiumMessageHydrateMessageAction"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0?!!this.catalog.afterCursor:!0;else{var a;this.canLoadMoreCollectionItems=e.collections.length>0?((a=this.catalog.collections.get(t))==null?void 0:a.afterCursor)!=="":!0}}var a=t.prototype;return a.loadMore=function(a){var t=this;if(this.loading)return this.loading;if(!this.getCanLoadMore())return(e||(e=n("Promise"))).resolve();var i=this.collectionId;if(r("isStringNullOrEmpty")(i))this.loading=o("WAWebCatalogCollection").CatalogCollection.update(this.catalog.id).then(function(){t.canLoadMoreAllItems=!!t.catalog.afterCursor,t.loading=null});else{var l=a===!0?o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_COLLECTION_VIEW_ALL:void 0;this.loading=this.catalog.collections.findCollectionProducts(this.catalog.id,i,!1,l).then(function(){var e;t.canLoadMoreCollectionItems=!!((e=t.catalog.collections.get(i))!=null&&e.afterCursor),t.loading=null})}return this.loading},a.loadInitialItems=function(){var e=o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_COLLECTION_VIEW_ALL;return u(this,e)},a.getCanLoadMore=function(){return this.canLoadMoreCollectionItems||this.canLoadMoreAllItems},a.getData=function(){var e=this.collectionId,t;if(r("isStringNullOrEmpty")(e))t=this.catalog.productCollection.getProductModels(this.forCatalogManager)||[];else{var n;t=((n=this.catalog.collections.get(e))==null?void 0:n.productCollection.getProductModels(this.forCatalogManager))||[]}return t.map(function(e){return{product:e,collection:void 0}})},t})(),m=(function(){function t(e,t,n,r){this.loading=null,this.catalog=e,this.forCatalogManager=t,this.listItemHeight=n,this.canLoadMoreCollections=e.collections.length>0?!!this.catalog.collections.afterCursor:!0,this.canLoadMoreCatalog=e.productCollection.length>0?!!this.catalog.afterCursor:!0,this.canLogQpl=r}var r=t.prototype;return r.loadMore=function(r){var t=this;if(this.loading)return this.loading;if(!this.getCanLoadMore())return(e||(e=n("Promise"))).resolve();if(this.canLoadMoreCollections){var a=this.canLogQpl&&r===!0?o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CATALOG_COLLECTIONS_VIEW:void 0;this.loading=this.catalog.collections.findCollectionsList(this.catalog.id,s,this.forCatalogManager,a).then(function(){t.canLoadMoreCollections=!!t.catalog.collections.afterCursor,t.loading=null})}else this.loading=o("WAWebCatalogCollection").CatalogCollection.update(this.catalog.id).then(function(){t.canLoadMoreCatalog=!!t.catalog.afterCursor,t.loading=null});return this.loading},r.loadInitialItems=function(){var e=this.canLogQpl?o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_CATALOG_COLLECTIONS_VIEW:void 0;return u(this,e)},r.getCanLoadMore=function(){return this.canLoadMoreCollections||this.canLoadMoreCatalog},r.getData=function(){var e=this,t=this.catalog.collections.getCollectionModels(this.forCatalogManager),n=t.reduce(function(t,n){t===void 0&&(t=[]);var r=n.productCollection.getProductModels(e.forCatalogManager)||[];if(r.length!==0){var o;t.push({collection:n,product:void 0}),r.length>s&&(r.length=s),(o=t).push.apply(o,r.map(function(e){return{product:e,collection:n}}))}return t},[]),r=n.length>0;if(this.canLoadMoreCollections)return n;r&&n.push({allItems:{totalItemsCount:n.length}});var o=this.catalog.productCollection.getProductModels(this.forCatalogManager).map(function(e){return{product:e,collection:void 0}});return n.push.apply(n,o),n},t})(),p=(function(){function t(e,t,n,r){this.loading=null,this.canLoadMoreCollections=!0,this.catalog=e,this.forCatalogManager=t,this.listItemHeight=n,this.canLogQpl=r}var r=t.prototype;return r.loadMore=function(r){var t=this;if(this.loading)return this.loading;if(!this.getCanLoadMore())return(e||(e=n("Promise"))).resolve();if(this.canLoadMoreCollections){var a=this.canLogQpl&&r===!0?o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_COLLECTIONS_MANAGEMENT_VIEW:void 0;this.loading=this.catalog.collections.findCollectionsList(this.catalog.id,s,this.forCatalogManager,a).then(function(){t.canLoadMoreCollections=!!t.catalog.collections.afterCursor,t.loading=null})}return this.loading||(e||(e=n("Promise"))).resolve()},r.loadInitialItems=function(){var e=this.canLogQpl?o("WAWebQplQuickPerformanceLoggerMarkerIds").QuickLogMarkerId.WHATSAPP_COLLECTIONS_MANAGEMENT_VIEW:void 0;return u(this,e)},r.getCanLoadMore=function(){return this.canLoadMoreCollections},r.resetData=function(){var e;(e=this.catalog)!=null&&e.collections&&(this.catalog.collections.reset(),this.catalog.collections.afterCursor=""),this.canLoadMoreCollections=!0},r.getData=function(){return this.catalog.collections.getCollectionModels(this.forCatalogManager).map(function(e){return{collection:e,product:void 0}})},t})(),_=(function(){function t(e,t,n){this.loading=null,this.canLoadMore=!0,this.catalog=e,this.catalog.stale=!0,this.catalog.markProductCollectionOld(),this.catalog.productCollection.reset(),this.listItemHeight=t,this.collectionId=o("WAWebNonEmptyString").asMaybeNonEmptyString(n)}var a=t.prototype;return a.loadMore=function(){var t=this;return this.loading?this.loading:this.getCanLoadMore()?(this.canLoadMore&&(r("isStringNullOrEmpty")(this.collectionId)?this.loading=o("WAWebCatalogCollection").CatalogCollection.update(this.catalog.id).then(function(){t.canLoadMore=!!t.catalog.afterCursor,t.loading=null}):this.loading=o("WAWebCatalogCollection").CatalogCollection.findCollectionMembership(this.catalog.id,this.collectionId).then(function(){t.canLoadMore=!!t.catalog.afterCursor,t.loading=null})),this.loading||(e||(e=n("Promise"))).resolve()):(e||(e=n("Promise"))).resolve()},a.loadInitialItems=function(){return u(this)},a.getCanLoadMore=function(){return this.canLoadMore},a.getData=function(){return this.catalog.productCollection.getProductModels(!0).map(function(e){return{product:e,collection:void 0}})},t})();function f(e,t){return e*t=t.scrollHeight-t.clientHeight},t.willLoadMore=function(t){return!!(this.dataSource.loading||this.isScrollAtBottom(t))},t.onScroll=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){return this.dataSource.loading?(yield this.dataSource.loading,!0):this.isScrollAtBottom(t)?(yield this.dataSource.loadMore(),!0):!1});function t(t,n){return e.apply(this,arguments)}return t})(),e})();function h(e,t,n){var a=o("WAWebCatalogCollection").CatalogCollection.get(e),i,l;if(a){if(!r("isStringNullOrEmpty")(t)&&n){var s=a.productCollection.get(n.id);return i=s&&a.productCollection.indexOf(s),{productId:n.id.toString(),productIndex:o("WATypeUtils").isNumber(i)&&i>-1?i.toString():void 0}}if(!r("isStringNullOrEmpty")(t)){var u=a.collections.get(t);l=u&&a.collections.indexOf(u);var c=n&&(u==null?void 0:u.productCollection.get(n.id));i=c&&(u==null?void 0:u.productCollection.indexOf(c))}return{collectionId:t||"",productId:n==null?void 0:n.id.toString(),collectionIndex:o("WATypeUtils").isNumber(l)&&l>-1?l.toString():void 0,productIndex:o("WATypeUtils").isNumber(i)&&i>-1?i.toString():void 0}}}l.SingleCollectionDataSource=d,l.CatalogWithCollectionsDataSource=m,l.CollectionsDataSource=p,l.CollectionsContentDataSource=_,l.CatalogListItemScrollHelper=g,l.getProductStatsInFetched=h}),98); __d("WAWebChangeProfilePicThumb",["Promise","WAWebApiContact","WAWebBackendApi","WAWebContactProfilePicThumbBridge","WAWebProfilePicConstants","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r){var a=[c(t,r)];if(t.isUser()){var i=o("WAWebApiContact").getAlternateUserWid(t);i&&a.push(c(i,r))}yield(e||(e=n("Promise"))).all(a)}),u.apply(this,arguments)}function c(e,t){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(t===o("WAWebProfilePicConstants").ProfilePicCommand.Remove)yield o("WAWebContactProfilePicThumbBridge").persistProfilePicToDB(e),o("WAWebBackendApi").frontendFireAndForget("removeProfilePicThumb",{wid:e});else return o("WAWebWorkerSafeBackendApi").workerSafeSendAndReceive("setProfilePicThumb",{wid:e})}),d.apply(this,arguments)}l.changeProfilePicThumb=s}),98); __d("WAWebProfilePicThumbCollection",["Promise","WAFilteredCatch","WALogger","WATimeUtils","WAWebBackendErrors","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebChatCollection","WAWebChatGetters","WAWebContactCollection","WAWebContactProfilePicThumbBridge","WAWebGroupType","WAWebNewsletterCollection","WAWebProfilePicPrivacyTokenGating","WAWebProfilePicThumbModel","WAWebSocketConstants","WAWebSocketModel","WAWebUnjoinedSubgroupMetadataCollection","WAWebUserPrefsKeys","WAWebVcardParsingUtils","WAWebWid","asyncToGeneratorRuntime","cr:17219"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_=(function(t){function a(){var e,a;a=t.call(this)||this,a.findImpl=function(e){var t,a,i,l,s=e.isNewsletter()?r("WAWebNewsletterCollection"):o("WAWebChatCollection").ChatCollection,u=s.get(e),c=(u==null||(t=u.groupMetadata)==null?void 0:t.groupType)===o("WAWebGroupType").GroupType.COMMUNITY,d=r("WAWebUnjoinedSubgroupMetadataCollection").get(e.toString());if(u!=null&&u.isReadOnly&&!c&&!(u!=null&&o("WAWebChatGetters").getIsNewsletter(u))&&d==null||u!=null&&(a=u.groupMetadata)!=null&&a.terminated||u!=null&&(i=u.newsletterMetadata)!=null&&i.terminated||u!=null&&(l=u.newsletterMetadata)!=null&&l.isPreview)return(p||(p=n("Promise"))).resolve({id:e,stale:!0});if((r("WAWebWid").isUser(e)||r("WAWebWid").isGroup(e)||r("WAWebWid").isNewsletter(e))&&!r("WAWebWid").isPSA(e)){var m,_=c?e:u==null||(m=u.groupMetadata)==null?void 0:m.parentGroup;if(d!=null&&(_=d.parentGroupId),o("WAWebSocketModel").Socket.stream!==o("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED){if(o("WAWebProfilePicPrivacyTokenGating").isProfilePicIQPrivacyTokenEnabled()&&r("WAWebWid").isUser(e)){var f,g=o("WAWebContactCollection").ContactCollection.get(e),h=o("WAWebChatCollection").ChatCollection.get(e);return o("WAWebContactProfilePicThumbBridge").requestProfilePicFromServer(e,_,h==null?void 0:h.tcToken,(h==null?void 0:h.tcToken)==null?g==null||(f=g.maybeCommonGroupChatModel)==null?void 0:f.id:null)}return o("WAWebContactProfilePicThumbBridge").requestProfilePicFromServer(e,_)}return(p||(p=n("Promise"))).resolve({id:e,stale:!0})}return(p||(p=n("Promise"))).resolve({id:e,tag:null})},a._getUpdatedProfilePicModel=function(e){return{tag:e.tag,raw:void 0,stale:!1,eurl:e.eurl,eurlStale:!1,previewEurl:e.previewEurl,previewDirectPath:e.previewDirectPath,fullDirectPath:e.fullDirectPath,filehash:e.filehash,timestamp:Date.now()}};var i=(e=n("cr:17219"))==null?void 0:e.getWindowsBridge();return i&&a.listenTo(a,"add remove change:timestamp",function(e,t,n){var r;(r=i.pictures)==null||r.notifyUpdate(e)}),a}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.get=function(n){var e=t.prototype.get.call(this,n);return this.isProfilePicRefreshNeeded(e==null?void 0:e.timestamp,e==null?void 0:e.eurlStale)&&(e==null||e.markStale({eurl:!0})),this.modelClass.prototype.isIdType(n),e},i.resyncPicturesByWid=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=this;try{var r=yield o("WAWebContactProfilePicThumbBridge").profilePicResync(t.map(function(e){return{id:e}}));o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures success"]))),r.forEach(function(e){var t=n._getUpdatedProfilePicModel(e),r=n.get(e.id);r?r.set(t):n.add(babelHelpers.extends({id:e.id},t))})}catch(e){o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncMyProfilePicture failed: ",""])),e)}});function r(e){return t.apply(this,arguments)}return r})(),i.resyncPictures=function(t){var e=this;return t.length===0?(p||(p=n("Promise"))).resolve():o("WAWebContactProfilePicThumbBridge").profilePicResync(t.map(function(e){return{id:e.id,tag:e.tag}})).then(function(n){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures success"]))),n.forEach(function(t){var n=e.get(t.id);n&&n.set(e._getUpdatedProfilePicModel(t))}),t.forEach(function(t){t.eurlStale&&e.update(t.id),t.stale=!1})}).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){e.status===423||e.status===429?o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures blocked ",""])),e.status):e.status>=400&&o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures dropped: ",""])),String(e))})).catch(function(e){o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["ProfilePicThumbStore:resyncPictures dropped: ",""])),String(e))})},i.findThumbnailWid=function(t){var e=this;return t.find(function(t){var n;return(n=e.get(t))==null?void 0:n.img})},i.getThumbnailWidFromVcard=function(t){if(!t)return null;var e=o("WAWebVcardParsingUtils").vcardPhoneNumberWids(t).map(function(e){return e});if(e.length>0){var n;return(n=this.findThumbnailWid(e))!=null?n:e[0]}var r=o("WAWebVcardParsingUtils").vcardLidWid(t);return r!=null?r:null},i.isProfilePicRefreshNeeded=function(t,n){if(n===void 0&&(n=!1),t==null||n)return!0;var e=Date.now()-t;return e>o("WATimeUtils").WEEK_MILLISECONDS},a})(o("WAWebBaseCollection").BaseCollection);_.model=o("WAWebProfilePicThumbModel").ProfilePicThumb,_.staleCollection=!0,_.cachePolicy={id:o("WAWebUserPrefsKeys").COLLECTIONS_KEYS.PROFILE_PIC_THUMB_COLLECTION,trigger:"change:tag",policy:o("WAWebBaseCachePolicy").CACHE_POLICY.NONE,delay:5e3};var f=new _;l.ProfilePicThumbCollection=f}),98); __d("WAWebProfilePicThumbModel",["WALogger","WAWebBaseModel","WAWebChatCollection","WAWebMediaHosts","WAWebMediaHostsRouteSelection","WAWebMmsClientSelectHost","WAWebMmsMediaTypes","WAWebProfilePicConstants","WAWebProfilePicThumbCollection","WAWebUserPrefsMeUser","WAWebWid","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e,s={SINGLE:"SINGLE",GROUP:"GROUP"},u=(function(t){function n(){for(var e,n=arguments.length,a=new Array(n),i=0;i0}l.getPIX=p,l.isPIXValid=g,l.isStringFieldValid=h,l.setCustomPaymentMethods=f}),98); __d("WAWebPixQuickReplyFeature",["WAWebABProps","WAWebGetMessageChatTypeFromWid","WAWebPaymentsChat","WAWebPaymentsConstants","WAWebUserPrefsCustomPaymentMethods","WAWebWamEnumMessageChatType"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebABProps").getABPropConfigValue("payments_br_pix_quick_reply_enabled")}function s(){return o("WAWebABProps").getABPropConfigValue("br_payments_pix_groups_enabled")}function u(e){return o("WAWebUserPrefsCustomPaymentMethods").isPIXValid()&&d(e.groupMetadata)&&s()}function c(t){return e()&&u(t)}function d(e){if(e==null)return!1;var t=e.participants;return t.every(function(e){return o("WAWebPaymentsChat").doesUserHaveCountryPhoneNumber(e.id,o("WAWebPaymentsConstants").BRAZIL_COUNTRY_CODE)})}function m(t){if(!e()||t==null)return!1;var n=o("WAWebGetMessageChatTypeFromWid").getMessageChatTypeFromWid(t.id);switch(n){case o("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE.INDIVIDUAL:return o("WAWebPaymentsChat").doesUserHaveCountryPhoneNumber(t.id,o("WAWebPaymentsConstants").BRAZIL_COUNTRY_CODE);case o("WAWebWamEnumMessageChatType").MESSAGE_CHAT_TYPE.GROUP:return u(t);default:return!1}}l.showPixQuickReplyInAttachmentTrayForGroups=c,l.shouldShowPixQuickReplyForChat=m}),98); __d("WAWebQuickReplyModel",["WAWebBaseModel","WAWebBizQuickReplyBridge","WAWebFrontendQuickReplyGetters","WAWebPixQuickReplyFeature","WAWebQuickReplyEnum","WAWebQuickReplyGetters"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;ar?-1:1},babelHelpers.assertThisInitialized(t)||babelHelpers.assertThisInitialized(t)}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.addSmartDefaultsIfNeeded=function(){this.smartDefaultsAdded===!1&&(o("WAWebQuickReplySmartDefaults").addSmartDefaults(),this.smartDefaultsAdded=!0)},n.filterShortcuts=function(t){var e=this.filter(function(e){var n=e.shortcut;return n.toLowerCase().startsWith(t.toLowerCase())});return e.sort(this.sortQuickReply)},t})(o("WAWebBaseCollection").BaseCollection);e.model=r("WAWebQuickReplyModel");var s=new e;l.QuickReplyCollection=s}),98); __d("WAWebBizFrontendGatingUtils",["WAWebABProps","WAWebMobilePlatforms","WAWebPrimaryFeaturesModel"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebMobilePlatforms").isSMB()&&o("WAWebPrimaryFeaturesModel").PrimaryFeatures.paymentInfoSyncSupport&&o("WAWebABProps").getABPropConfigValue("order_details_payment_instructions_sync_enabled")}function s(){return o("WAWebMobilePlatforms").isSMB()&&o("WAWebPrimaryFeaturesModel").PrimaryFeatures.customPaymentMethodsSyncSupport&&o("WAWebABProps").getABPropConfigValue("payments_br_pix_phase_1_seller_sync_enabled")}function u(){return o("WAWebMobilePlatforms").isSMB()&&o("WAWebPrimaryFeaturesModel").PrimaryFeatures.customPaymentMethodsSyncSupport&&o("WAWebABProps").getABPropConfigValue("payments_br_pix_quick_reply_enabled")}function c(){return o("WAWebMobilePlatforms").isSMB()&&o("WAWebABProps").getABPropConfigValue("payments_br_force_copy_pix_cta_enabled")}function d(){return o("WAWebABProps").getABPropConfigValue("payments_br_copy_pix_code_api_merchant_enabled")}function m(){return o("WAWebMobilePlatforms").isSMB()&&o("WAWebPrimaryFeaturesModel").PrimaryFeatures.customPaymentMethodsSyncSupport&&o("WAWebABProps").getABPropConfigValue("payments_br_pix_on_web")}l.isOrderDetailsPaymentInstructionsSyncEnabled=e,l.isCustomPaymentMethodsSyncEnabled=s,l.isPixInQuickReplyEnabled=u,l.isForceCopyPixCTAEnabled=c,l.isAPICopyPixCTAEnabled=d,l.isPixOnWebEnabled=m}),98); __d("WAWebBrazilPixKeyFormattingUtils",["fbt","WAWebUserPrefsTypes"],(function(t,n,r,o,a,i,l,s){"use strict";var e=/^(\d{3})(\d{3})(\d{3})(\d{2})$/g,u="$1.$2.$3-$4",c=/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})$/g,d="$1.$2.$3/$4-$5",m=/^(\+\d{2})(\d{2})(\d{4,5})(\d{4})$/g,p="$2 $3-$4";function _(e,t){if(t==null)return e;switch(t){case o("WAWebUserPrefsTypes").PixKeyType.CPF:return h(e);case o("WAWebUserPrefsTypes").PixKeyType.CNPJ:return y(e);case o("WAWebUserPrefsTypes").PixKeyType.PHONE:return C(e);case o("WAWebUserPrefsTypes").PixKeyType.EMAIL:case o("WAWebUserPrefsTypes").PixKeyType.EVP:return e}}function f(e,t){if(t==null)return e;switch(t){case o("WAWebUserPrefsTypes").PixKeyType.PHONE:return e.substr(3);default:return e}}function g(e){var t,n=(t=o("WAWebUserPrefsTypes").PixKeyType.cast(e))!=null?t:o("WAWebUserPrefsTypes").PixKeyType.PHONE;switch(n){case o("WAWebUserPrefsTypes").PixKeyType.CPF:return s._(/*BTDS*/"CPF");case o("WAWebUserPrefsTypes").PixKeyType.CNPJ:return s._(/*BTDS*/"CNPJ");case o("WAWebUserPrefsTypes").PixKeyType.PHONE:return s._(/*BTDS*/"Tel\u00e9fono");case o("WAWebUserPrefsTypes").PixKeyType.EMAIL:return s._(/*BTDS*/"Correo electr\u00f3nico");case o("WAWebUserPrefsTypes").PixKeyType.EVP:return s._(/*BTDS*/"EVP")}}function h(t){return t.replace(e,u)}function y(e){return e.replace(c,d)}function C(e){return e.replace(m,p)}l.getFormattedPixKey=_,l.getCopiedPixKey=f,l.getPixKeyTypeLabel=g}),226); __d("WAWebQuickReplySmartDefaults",["fbt","WAWebBizFrontendGatingUtils","WAWebBrazilPixKeyFormattingUtils","WAWebBusinessProfileCollection","WAWebBusinessProfileUtils","WAWebContactCollection","WAWebFrontendContactGetters","WAWebQuickReplyCollection","WAWebQuickReplyEnum","WAWebQuickReplyModel","WAWebUserPrefsCustomPaymentMethods","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l,s){function e(){f(),u(),c(),d()}function u(){var e=o("WAWebQuickReplyEnum").QuickReplyTypes.PROFILE_SMART_DEFAULT,t=p();o("WAWebQuickReplyCollection").QuickReplyCollection.get(e)?t&&o("WAWebQuickReplyCollection").QuickReplyCollection.add({id:e,message:t.message},{merge:!0}):t&&o("WAWebQuickReplyCollection").QuickReplyCollection.add(t,{merge:!0})}function c(){var e=o("WAWebQuickReplyEnum").QuickReplyTypes.ADDRESS_SMART_DEFAULT,t=_();o("WAWebQuickReplyCollection").QuickReplyCollection.get(e)?t&&o("WAWebQuickReplyCollection").QuickReplyCollection.add({id:e,message:t.message},{merge:!0}):t&&o("WAWebQuickReplyCollection").QuickReplyCollection.add(t,{merge:!0})}function d(){var e=o("WAWebQuickReplyEnum").QuickReplyTypes.HOURS_SMART_DEFAULT,t=m();o("WAWebQuickReplyCollection").QuickReplyCollection.get(e)?t&&o("WAWebQuickReplyCollection").QuickReplyCollection.add({id:e,message:t.message},{merge:!0}):t&&o("WAWebQuickReplyCollection").QuickReplyCollection.add(t,{merge:!0})}function m(){var e,t=o("WAWebUserPrefsMeUser").getMaybeMePnUser();if(t!=null){var n=o("WAWebBusinessProfileCollection").BusinessProfileCollection.get(t);if(n!=null&&(e=n.businessHours)!=null&&e.config){var a=o("WAWebQuickReplyEnum").QuickReplyTypes.HOURS_SMART_DEFAULT,i=o("WAWebBusinessProfileUtils").quickReplyHoursStr(n.businessHours);return new(r("WAWebQuickReplyModel"))({id:a,shortcut:s._(/*BTDS*/"horario").toString(),message:i,count:-1,keywords:[]})}}}function p(){var e=o("WAWebContactCollection").ContactCollection.getMeContact();if(e){var t=o("WAWebQuickReplyEnum").QuickReplyTypes.PROFILE_SMART_DEFAULT;return new(r("WAWebQuickReplyModel"))({id:t,shortcut:s._(/*BTDS*/"perfil").toString(),message:o("WAWebFrontendContactGetters").getDisplayName(e),count:-1,keywords:[]})}}function _(){var e=o("WAWebUserPrefsMeUser").getMaybeMePnUser();if(e!=null){var t=o("WAWebBusinessProfileCollection").BusinessProfileCollection.get(e);if((t==null?void 0:t.latitude)!=null||(t==null?void 0:t.longitude)!=null||(t==null?void 0:t.address)!=null){var n=o("WAWebQuickReplyEnum").QuickReplyTypes.ADDRESS_SMART_DEFAULT,a=t.address||s._(/*BTDS*/"Ubicaci\u00f3n en el mapa"),i="\uD83D\uDCCD";return new(r("WAWebQuickReplyModel"))({id:n,shortcut:s._(/*BTDS*/"direcci\u00f3n").toString(),message:s._(/*BTDS*/"{pinEmoji} {address}",[s._param("pinEmoji",i),s._param("address",a)]).toString(),count:-1,keywords:[]})}}}function f(){var e=o("WAWebQuickReplyEnum").QuickReplyTypes.PIX_KEY_SMART_DEFAULT,t=g();o("WAWebQuickReplyCollection").QuickReplyCollection.get(e)?t?o("WAWebQuickReplyCollection").QuickReplyCollection.add({id:e,message:t.message},{merge:!0}):o("WAWebQuickReplyCollection").QuickReplyCollection.remove(e):t&&o("WAWebQuickReplyCollection").QuickReplyCollection.add(t,{merge:!0})}function g(){if(o("WAWebBizFrontendGatingUtils").isPixInQuickReplyEnabled()){var e=o("WAWebUserPrefsCustomPaymentMethods").getPIX();if(e){var t=o("WAWebQuickReplyEnum").QuickReplyTypes.PIX_KEY_SMART_DEFAULT;return new(r("WAWebQuickReplyModel"))({id:t,shortcut:s._(/*BTDS*/"Pix").toString(),message:o("WAWebBrazilPixKeyFormattingUtils").getFormattedPixKey(e.key,e.key_type),count:-1,keywords:[]})}}}l.addSmartDefaults=e,l.getOrUpdatePixKeySmartDefault=f}),226); __d("WAWebReachoutTimelockRestrictedModalLoadable",["JSResourceForInteraction","WAWebLazyLoadedRetriable","WAWebLoadable","WAWebLoadingModal.react","asyncToGeneratorRuntime","react"],(function(t,n,r,o,a,i,l){"use strict";var e,s=e||(e=r("react")),u=r("WAWebLazyLoadedRetriable")(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield r("JSResourceForInteraction")("WAWebReachoutTimelockRestrictedModal.react").__setRef("WAWebReachoutTimelockRestrictedModalLoadable").load();return e.ReachoutTimelockRestrictedModal}),"ReachoutTimelockRestrictedModal"),c=r("WAWebLoadable")({loader:u,loading:function(t){return s.jsx(r("WAWebLoadingModal.react"),{error:!!t.error})}});l.ReachoutTimelockRestrictedModalLoadable=c}),98); __d("WAWebReactionsMsgAction",["WAAbortError","WAJobOrchestratorTypes","WALogger","WAWebAck","WAWebAddOnsUpdateSendStatesAction","WAWebAddonGatingUtils","WAWebDBCreateOrUpdateReactions","WAWebLidMigrationUtils","WAWebMaybe","WAWebMessageAddOnType","WAWebMsgCollection","WAWebMsgModel","WAWebMsgReactionsBridge","WAWebNotificationBackend","WAWebOrchestratorNonPersistedJob","WAWebReactionDataUtils","WAWebReactionGatingUtils","WAWebReactionNotificationUtils","WAWebReactionsBEUtils","WAWebReactionsCollection","WAWebReactionsMsgActionUtils","WAWebSendAddonMsgChatAction","WAWebSendMsgRecordAction","WAWebSendMsgResultAction","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s=["senderUserJid"];function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=t.allowNotify,r=e.parentMsgKey,a=o("WAWebReactionDataUtils").reactionRowToReactionMsgData(e),i=!!n&&!o("WAWebReactionNotificationUtils").nonHydratedShouldMuteReactionNotification(a),l;if(i?l=yield o("WAWebReactionsCollection").ReactionsCollection.find(r):l=o("WAWebReactionsCollection").ReactionsCollection.getAddressingModeInsensitive(r),l){o("WAWebReactionsCollection").ReactionsCollection.addOrUpdateReaction(e);var s=l.reactions.length>0;yield o("WAWebMsgReactionsBridge").updateHasReactionInParent(r,s)}else e.reactionText!==o("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT&&(yield o("WAWebMsgReactionsBridge").updateHasReactionInParent(r,!0));i&&!o("WAWebReactionGatingUtils").isReactionNotificationAddOnApiEnabled()&&o("WAWebNotificationBackend").showReactionNotification(a)}),c.apply(this,arguments)}function d(e,t){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WAWebDBCreateOrUpdateReactions").createOrUpdateReactions([e]),r=n[0];if(r)return u(r,{allowNotify:t}),r}),m.apply(this,arguments)}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n,r=t.senderUserJid,a=babelHelpers.objectWithoutPropertiesLoose(t,s),i=(n=o("WAWebReactionsCollection").ReactionsCollection.getExistingSenderModelFromReactionDetails(a))!=null?n:o("WAWebMaybe").ifSome(o("WAWebLidMigrationUtils").getAlternateMsgKey(a.msgKey),function(e){return o("WAWebReactionsCollection").ReactionsCollection.getExistingSenderModelFromReactionDetails(babelHelpers.extends({},a,{msgKey:e}))});if(i==null){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["WAWebReactionsUtils:resendUpdateFailedPropsForSentReactionsDBAndModel Reactions model not found for this message id"])));return}yield f(t,i.timestamp)}),_.apply(this,arguments)}function f(e,t){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a=o("WAWebMsgCollection").MsgCollection.get(e.parentMsgKey),i=e.parentMsgKey,l=e.msgKey;if(a){var s=i.remote,u=o("WAWebReactionsMsgActionUtils").getFromForReactionMessage(a),c=yield o("WAWebReactionsMsgActionUtils").getReactionMsgData(a,e.reactionText,u,l,Math.floor(t/1e3),s,t);if(o("WAWebAddonGatingUtils").isUnifiedInfraEnabled(c)){var d=yield o("WAWebSendAddonMsgChatAction").addAndSendAddonToChat(c);if(d.messageSendResult!==o("WAWebSendMsgResultAction").SendMsgResult.OK)throw r("err")("Reaction send error");return}var m=new(o("WAWebMsgModel")).Msg(c);return yield o("WAWebAddOnsUpdateSendStatesAction").updateAddOnSendStatesAction(new Map([[o("WAWebMessageAddOnType").MessageAddOnType.Reaction,[{msgKey:e.msgKey.toString(),ack:o("WAWebAck").ACK.CLOCK,isSendFailure:!1}]]])),o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebSendMsgRecordAction").sendMsgRecord(m)}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}}),g.apply(this,arguments)}function h(e){for(var t of e){var n=!o("WAWebReactionNotificationUtils").nonHydratedShouldMuteReactionNotification(t);n&&o("WAWebNotificationBackend").showReactionNotification(t).catch(o("WAAbortError").catchAbort(function(e){}))}}l.addOrUpdateReactionsModelCollection=u,l.addOrUpdateReactions=d,l.resendUpdateFailedPropsForSentReactionsDBAndModel=p,l.handleReactionNotification=h}),98); __d("WAWebReactionsMsgActionUtils",["WALogger","WANullthrows","WAWebAck","WAWebAddonEncryption","WAWebFrontendMsgGetters","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebReferentialMsgKey","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e){var t,n=!!((t=o("WAWebFrontendMsgGetters").getChat(e).groupMetadata)!=null&&t.isCag),r=o("WAWebUserPrefsMeUser").getMeLidUserOrThrow();return n?r:o("WAWebUserPrefsMeUser").getMePnUserOrThrow()}function c(e,t,n,r,o,a,i){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a,i,l,u,c){var d,m=o("WAWebMsgKeyUtils").msgKeyToTargetInfo(i,o("WAWebMsgKeyUtils").TranslateMsgKeyType.Addon);if(a.equals(m.from)||o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["create reaction: "," and "," do not match"])),a.toLogString(),m.from.toLogString()).tags("messaging").sendLogs("reactionMsgData: from is not matching",{sampling:.01}),u.equals(m.to)||o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["create reaction: "," and "," do not match"])),u.toLogString(),m.to.toLogString()).tags("messaging").sendLogs("reactionMsgData: to is not matching",{sampling:.01}),(d=o("WAWebFrontendMsgGetters").getChat(t).groupMetadata)!=null&&d.isCag){var p=self.crypto.getRandomValues(new Uint8Array(12)),_={type:o("WAWebMsgType").MsgKind.ReactionDecrypted,encode:{text:n,senderTimestampMs:c}},f=yield o("WAWebAddonEncryption").encryptAddOn(_,{messageSecret:r("WANullthrows")(t.messageSecret,"Parent message missing message secret"),iv:p,stanzaId:t.id.id,originalMessageSender:o("WAWebMsgGetters").getOriginalSender(t.unsafe()),addOnSender:o("WAWebWidFactory").asUserWidOrThrow(a)}),g=f.encPayload;return{id:i,type:o("WAWebMsgType").MSG_TYPE.REACTION_ENC,kind:o("WAWebMsgType").MsgKind.ReactionEncrypted,viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE,t:l,from:a,to:u,author:m.author,ack:o("WAWebAck").ACK.CLOCK,targetMessageKey:o("WAWebReferentialMsgKey").getReferentialMsgKey(t),encPayload:g,encIv:p.buffer}}return{id:i,reactionParentKey:o("WAWebReferentialMsgKey").getReferentialMsgKey(t),type:o("WAWebMsgType").MSG_TYPE.REACTION,viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE,kind:o("WAWebMsgType").MsgKind.ReactionDecrypted,t:l,from:a,to:u,author:m.author,ack:o("WAWebAck").ACK.CLOCK,reactionText:n,reactionTimestamp:c,read:!0}}),d.apply(this,arguments)}l.getFromForReactionMessage=u,l.getReactionMsgData=c}),98); __d("WAWebNotificationsBaseReactionNotification",["WALogger","WANullthrows","WAWebBaseNotification","WAWebConstantsDeprecated","WAWebEnvironment","WAWebFrontendMsgGetters","WAWebLidMigrationUtils","WAWebMsgCollection","WAWebNotificationController","WAWebNotificationHelpers","WAWebNotificationMuteReason","WAWebReactionNotificationUtils","WAWebReactionsCollection","WAWebWamEnumNotificationTypeEnum","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=(function(t){function a(n){var a,i=n.reactionMsg;a=t.call(this)||this,a.$WABaseReactionNotification$p_1=function(){o("WAWebFrontendMsgGetters").getChat(a.parentMsg)!=null&&a.parentMsg!=null&&o("WAWebFrontendMsgGetters").getChat(a.parentMsg).reactionSquelch===r("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE&&(a.parentMsg.squelch=r("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE)},o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["WAReactionNotification: constructor"]))),a.reactionMsg=i;var l=r("WANullthrows")(a.reactionMsg.reactionParentKey),u=o("WAWebMsgCollection").MsgCollection.get(l.toString());if(u==null){var c=o("WAWebLidMigrationUtils").getAlternateMsgKey(l);c!=null&&(u=o("WAWebMsgCollection").MsgCollection.get(c.toString()))}return u==null?(o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["WAReactionNotification: parentMsg is not present in the MsgCollection. It may need to be hydrated."]))),babelHelpers.assertThisInitialized(a)):(a.parentMsg=u,a)}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.beforeBannerShown=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(this.parentMsg!=null){var e=yield o("WAWebReactionsCollection").ReactionsCollection.findAddressingModeInsensitive(this.parentMsg.id.toString());if(e){var t=o("WAWebReactionsCollection").ReactionsCollection.getAggregateEmojiAndSender(e,o("WAWebReactionNotificationUtils").getReactionSenderJid(this.reactionMsg).toString()),n=t.reactionSenderModel;this.reactionSender=n}else o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["WAReactionNotification: Reaction model not found"])))}});function t(){return e.apply(this,arguments)}return t})(),i.afterBannerShown=function(t){var e=this;if(this.reactionSender!=null){var n=this.reactionSender,r=o("WAWebFrontendMsgGetters").getMaybeChat(this.parentMsg);n.on("revoked change:read",this.closeBanner),r==null||r.on("change:reactionSquelch",this.$WABaseReactionNotification$p_1),t.waitForClose().then(function(){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["WAReactionNotification: cleaning up reaction notification"]))),n.off("revoked change:read",e.closeBanner),r==null||r.off("change:reactionSquelch",e.$WABaseReactionNotification$p_1)})}},i.shouldMute=function(t){if(r("WAWebEnvironment").isWindows&&this.reactionMsg.viewed===!0)return r("WAWebNotificationMuteReason").IgnoreViewedMsgs;if(o("WAWebReactionNotificationUtils").nonHydratedShouldMuteReactionNotification(this.reactionMsg))return r("WAWebNotificationMuteReason").NonHydratedReaction;if(this.parentMsg==null)return r("WAWebNotificationMuteReason").ParentMsgMissing;if(this.shouldMuteDueToAppState(t))return r("WAWebNotificationMuteReason").AppState},i.shouldSquelch=function(){var e=o("WAWebNotificationController").WANotificationController.notificationExists(this.buildKey());if(e)return null},i.buildKey=function(){return"reaction:"+this.parentMsg.id.toString()+"-"+o("WAWebReactionNotificationUtils").getReactionSenderJid(this.reactionMsg).toString()},i.shouldMuteDueToAppState=function(t){return o("WAWebNotificationHelpers").shouldMuteDueToAppState(t)},i.getNotificationDeliveryWamEventData=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return{uiNotificationType:o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.REACTION_MESSAGE,triggeredByOfflineMessage:this.reactionMsg.isOffline===!0}});function t(){return e.apply(this,arguments)}return t})(),a})(o("WAWebBaseNotification").WABaseNotification);l.WABaseReactionNotification=d}),98); __d("WAWebNotificationsReactionNotification",["WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebMuteGetters","WAWebNoop","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebNotificationsBaseReactionNotification","WAWebReactionNotificationUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){return e.apply(this,arguments)||this}babelHelpers.inheritsLoose(t,e);var a=t.prototype;return a.shouldMute=function(n){var t=e.prototype.shouldMute.call(this,n);if(t!=null)return t;var a=o("WAWebFrontendMsgGetters").getChat(this.parentMsg);return o("WAWebMuteGetters").getIsMuted(a.mute)?r("WAWebNotificationMuteReason").MutedChat:o("WAWebReactionNotificationUtils").isArchivedChat(a)?r("WAWebNotificationMuteReason").ArchivedChat:null},a.shouldPlaySound=function(){if(!e.prototype.shouldPlaySound.call(this))return!1;var t=o("WAWebFrontendMsgGetters").getChat(this.parentMsg);return o("WAWebNotificationHelpers").shouldPlaySoundGranular(t)},a.shouldShowBanner=function(){return e.prototype.shouldShowBanner.call(this)?o("WAWebReactionNotificationUtils").shouldEnableReactionsNotificationGranular(this.parentMsg):!1},a.shouldSquelch=function(){if(e.prototype.shouldSquelch.call(this)==null)return null;var t=o("WAWebFrontendMsgGetters").getChat(this.parentMsg);return o("WAWebNotificationHelpers").shouldSquelch(t,!1)?r("WAWebNotificationMuteReason").GroupFlood:o("WAWebReactionNotificationUtils").shouldSquelchReactionMessage(t,this.parentMsg)?r("WAWebNotificationMuteReason").ReactionFlood:null},a.matchesChat=function(t){return o("WAWebFrontendMsgGetters").getChat(this.parentMsg).equals(t)},a.getChatKind=function(){return o("WAWebFrontendChatGetters").getKind(o("WAWebFrontendMsgGetters").getChat(this.parentMsg))},a.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=o("WAWebFrontendMsgGetters").getChat(this.parentMsg);return o("WAWebNotificationIconUtils").getChatNotificationIcon(e,this.abortController.signal)});function t(){return e.apply(this,arguments)}return t})(),a.getBannerOptions=function(){var e=this.parentMsg,t=o("WAWebFrontendMsgGetters").getChat(e),n=o("WAWebReactionNotificationUtils").getNotificationPartsForChatReaction(e,this.reactionMsg),a=n.action,i=n.author,l=n.body,s=o("WAWebGetNotificationStrings").getNotificationBody({action:a,author:i,body:l,msgDir:o("WAWebFrontendMsgGetters").getDir(e)});return{wid:t.id,msgId:e.id.toString(),onClick:r("WAWebNoop"),tag:e.id.toString(),doNotOpenChat:!1,title:o("WAWebNotificationHelpers").getNotificationTitle(t),body:s}},t})(o("WAWebNotificationsBaseReactionNotification").WABaseReactionNotification);l.WAReactionNotification=e}),98); __d("WAWebNotificationsStatusReactionNotification",["WANullthrows","WAWebABProps","WAWebEnvironment","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebMuteCollection","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebNotificationsBaseReactionNotification","WAWebReactionNotificationUtils","WAWebStatusNotificationUtils","asyncToGeneratorRuntime","cr:7293"],(function(t,n,r,o,a,i,l){var e,s=(e=n("cr:7293"))!=null?e:{},u=s.getStatusReactionsSetting,c=(function(e){function t(){return e.apply(this,arguments)||this}babelHelpers.inheritsLoose(t,e);var a=t.prototype;return a.shouldMute=function(n){var t=e.prototype.shouldMute.call(this,n);return t!=null?t:(u==null?void 0:u())===!1?r("WAWebNotificationMuteReason").MutedStatusReaction:null},a.shouldPlaySound=function(){if(!e.prototype.shouldPlaySound.call(this))return!1;var t=o("WAWebABProps").getABPropConfigValue("wa_web_enable_granular_notifications");return t?o("WAWebMuteCollection").MuteCollection.getGlobalStatusSoundsEnabled():e.prototype.shouldPlaySound.call(this)},a.shouldShowBanner=function(){if(!e.prototype.shouldShowBanner.call(this))return!1;var t=o("WAWebABProps").getABPropConfigValue("wa_web_enable_granular_notifications");return t?o("WAWebMuteCollection").MuteCollection.getGlobalStatusNotificationReactionsEnabled():e.prototype.shouldShowBanner.call(this)},a.matchesChat=function(t){return t.id.isStatus()},a.getChatKind=function(){return null},a.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebNotificationIconUtils").getNotificationIconByWid(o("WAWebReactionNotificationUtils").getReactionSenderJid(this.reactionMsg),this.abortController.signal,o("WAWebNotificationIconUtils").USER_DEFAULT_ICON)});function t(){return e.apply(this,arguments)}return t})(),a.getBannerOptions=function(){var e=this.parentMsg,t=o("WAWebReactionNotificationUtils").getNotificationPartsForStatusReaction(e,this.reactionMsg),n=t.action,a=t.author,i=t.body,l=o("WAWebGetNotificationStrings").getNotificationBody({action:n,body:i,msgDir:o("WAWebFrontendMsgGetters").getDir(e)}),s=function(){o("WAWebStatusNotificationUtils").openStatusViewer(e)};return{wid:e.id.remote,msgId:e.id.toString(),onClick:s,tag:e.id.toString(),doNotOpenChat:!0,title:r("WANullthrows")(a),body:l}},a.shouldMuteDueToAppState=function(n){return r("WAWebEnvironment").isWindows?!1:e.prototype.shouldMuteDueToAppState.call(this,n)},t})(o("WAWebNotificationsBaseReactionNotification").WABaseReactionNotification);l.WAStatusReactionNotification=c}),98); __d("WAWebChatContactUtils",["fbt"],(function(t,n,r,o,a,i,l,s){function e(e,t){return t===void 0&&(t=!0),e==null||e===""?"":"~"+(t?"\u202F":"")+e}function u(e){return e==null||e===""?"":s._(/*BTDS*/"Quiz\u00e1 {notifyName}",[s._param("notifyName",e)])}l.getFormattedNotifyName=e,l.getAccessibleNotifyName=u}),226); __d("WAWebReactionNotificationUtils",["fbt","WANullthrows","WAWebABProps","WAWebChatContactUtils","WAWebChatGetters","WAWebConstantsDeprecated","WAWebContactCollection","WAWebContactGetters","WAWebElevatedPushNamesFlag","WAWebEmoji","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebGroupMetadataCollection","WAWebMsgGetters","WAWebMsgType","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationHelpers","WAWebReactionsBEUtils","WAWebSettingsGetters","WAWebSettingsModel","WAWebUserPrefsMeUser","WAWebWidFactory","WAWebWidFormat"],(function(t,n,r,o,a,i,l,s){function e(e){return o("WAWebWidFactory").asUserWidOrThrow(r("WANullthrows")(o("WAWebMsgGetters").getSender(e)))}function u(t){var n=t.reactionText,r=t.read,a=e(t).toString();return!!(r===!0||o("WAWebUserPrefsMeUser").isSerializedWidMe(a)||!t.reactionParentKey.fromMe||n===o("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT||o("WAWebNotificationHelpers").isOfflineResumeInProgress())}function c(e){var t=o("WAWebABProps").getABPropConfigValue("wa_web_enable_granular_notifications");if(t){var n=o("WAWebFrontendMsgGetters").getChat(e),r=o("WAWebChatGetters").getIsGroup(n);return r?o("WAWebMuteCollection").MuteCollection.getGlobalGroupNotificationReactionsEnabled():o("WAWebMuteCollection").MuteCollection.getGlobalNotificationReactionsEnabled()}return!o("WAWebMuteGetters").getIsMuted(o("WAWebMuteCollection").MuteCollection.globalReactionsMute())}function d(e,t){if(!o("WAWebChatGetters").getIsGroup(e))return!1;var n=Date.now(),a=t.squelch||0;return n>a?(r("WAWebGroupMetadataCollection").find(e.id).then(function(n){if(n!=null){var a=o("WAWebNotificationHelpers")._calculateTimeoutFromGroupMetadata(e.id,n),i=Date.now()+a;t.squelch=i,e.reactionSquelch===r("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE&&(e.reactionSquelch=i)}}),!1):!0}function m(t,n){var r,a=e(n),i=o("WAWebContactCollection").ContactCollection.gadd(a),l=o("WAWebFrontendMsgGetters").getChat(t),s=o("WAWebElevatedPushNamesFlag").elevatedPushNamesM2Enabled(l);if(a.isLid()&&i.phoneNumber){var u,c=o("WAWebContactCollection").ContactCollection.get(i.phoneNumber),d=o("WAWebElevatedPushNamesFlag").pushNameCanBeUsed(c)&&s,m=c!=null?o("WAWebContactGetters").getNotifyName(c):null;r=(u=c==null?void 0:c.name)!=null?u:d&&m!=null?o("WAWebChatContactUtils").getFormattedNotifyName(m).toString():o("WAWebWidFormat").widToFormattedUser(i.phoneNumber)}else{var p,_=o("WAWebElevatedPushNamesFlag").pushNameCanBeUsed(i)&&s;r=(p=i.name)!=null?p:_&&o("WAWebContactGetters").getNotifyName(i)!=null?o("WAWebChatContactUtils").getFormattedNotifyName(o("WAWebContactGetters").getNotifyName(i)).toString():o("WAWebWidFormat").widToFormattedUser(i.id)}return r}function p(e,t){var n,r,a;o("WAWebMsgGetters").getIsGroupMsg(e)&&(a=m(e,t));var i=(n=o("WAWebEmoji").EmojiUtil.normalizeEmojiFromString(t.reactionText))!=null?n:o("WAWebEmoji").OPEN_BOX_CHAR,l=s._(/*BTDS*/"Reaccion\u00f3 con {emoji} a",[s._param("emoji",i)]);return e.type===o("WAWebMsgType").MSG_TYPE.CHAT&&!e.shouldShowNotificationPreview()?r=s._(/*BTDS*/"un mensaje"):(r=o("WAWebGetNotificationStrings").getNotificationMessageBody(e),r=s._(/*BTDS*/"\"{originalMessageBody}\"",[s._param("originalMessageBody",r)])),{body:r.toString(),author:a,action:l.toString()}}function _(e,t){return{body:s._(/*BTDS*/"Le gust\u00f3 tu estado").toString(),author:m(e,t)}}function f(e){return!(!o("WAWebSettingsGetters").getShowArchiveV2(r("WAWebSettingsModel"))||!e.archive)}l.getReactionSenderJid=e,l.nonHydratedShouldMuteReactionNotification=u,l.shouldEnableReactionsNotificationGranular=c,l.shouldSquelchReactionMessage=d,l.getNotificationPartsForChatReaction=p,l.getNotificationPartsForStatusReaction=_,l.isArchivedChat=f}),226); __d("WAWebReactionsCollection",["WALogger","WATypeUtils","WAWebAck","WAWebApiContact","WAWebBaseCollection","WAWebEmoji","WAWebLidMigrationUtils","WAWebMsgCollection","WAWebMsgKey","WAWebMsgReactionsBridge","WAWebReactionsBEUtils","WAWebReactionsModels","WAWebUserPrefsMeUser","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d=(function(t){function a(){for(var e,r=arguments.length,a=new Array(r),i=0;i=o("WAWebAck").ACK.SENT&&(a.isSendFailure=!1,a.trigger("change:isSendFailure")),a.trigger("change:ack");return}else if(t.timestamp>a.timestamp){o("WAWebUserPrefsMeUser").isSerializedWidMe(t.senderUserJid)&&(a.trigger("revoked"),r.set({hasReactionByMe:!1})),this._addNewReactionToAggregate(t,e),r.aggregateEmoji===o("WAWebEmoji").EmojiUtil.getEmojiAggregate(t.reactionText)?(r.senders.remove(a.id),e.reactions.trigger("change:senders")):this._removeAggregateEmojiAndSender(e,a,r);return}return}this._addNewReactionToAggregate(t,e)}},i.removeReaction=function(n){if(o("WAWebUserPrefsMeUser").isSerializedWidMe(n.senderUserJid))return this._removeSelfReaction(n);var t=this.get(n.parentMsgKey);if(t){var r=this.getAggregateEmojiAndSender(t,n.senderUserJid),a=r.reactionAggregateWithSender,i=r.reactionSenderModel;a&&i&&(this._removeAggregateEmojiAndSender(t,i,a),i.trigger("revoked"))}else o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:removeReaction no reactions model found"])))},i._addNewReactionToAggregate=function(t,n){var e=o("WAWebEmoji").EmojiUtil.getEmojiAggregate(t.reactionText),a=n.reactions.get(e),i=r("WAWebMsgKey").fromString(t.msgKey),l=new(o("WAWebReactionsModels")).ReactionsSenders(babelHelpers.extends({},t,{id:i})),s=o("WAWebUserPrefsMeUser").isSerializedWidMe(t.senderUserJid);a?(s&&(a.set({hasReactionByMe:!0}),n.set({reactionByMe:t})),a.senders.add(l),n.reactions.sort(),a.trigger("change:senders")):(s&&n.set({reactionByMe:t}),n.reactions.add({aggregateEmoji:e,hasReactionByMe:s,id:e,senders:[l]}))},i._removeAggregateEmojiAndSender=function(t,n,r){r.senders.remove(n.id),r.senders.length===0?t.reactions.remove(r.id):t.reactions.sort(),r.trigger("change:senders")},i.getAggregateEmojiAndSender=function(t,n){for(var e=null,r=null,a=o("WAWebApiContact").getAlternateUserWid(o("WAWebWidFactory").createUserWidOrThrow(n)),i=0;ir||n===o("WAWebAck").ACK.FAILED))}return o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["reactions_collection:shouldUpdateAck Reaction sender model not found"]))),!1},i.deleteReactionsByParentMessageKey=function(t){this.remove(t)},a})(o("WAWebBaseCollection").BaseCollection);d.model=o("WAWebReactionsModels").Reactions;var m=new d;l.ReactionsCollection=m}),98); __d("WAWebReactionsModels",["WAWebAck","WAWebAddOnModel","WAWebBaseModel","WAWebCollection","WAWebContactCollection","WAWebMsgCollection","WAWebMsgKey","WAWebReactionsCollection","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","lodash"],(function(t,n,r,o,a,i,l){var e,s=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;as&&this.remove(this.slice(s)))},o})(o("WAWebBaseCollection").BaseCollection);c.model=r("WAWebRecentReactionModel"),c.cachePolicy={id:o("WAWebUserPrefsKeys").COLLECTIONS_KEYS.RECENT_REACTIONS_COLLECTION,policy:o("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:2e3},c.comparator=function(e,t){return t.timestamp-e.timestamp};var d=new c;l.RECENT_REACTIONS_LIMIT=s,l.LISTENER_DEBOUNCE_WAIT=u,l.RecentReactionsCollection=d}),98); __d("WAWebApiStatus",["Promise","WAJids","WALogger","WATimeUtils","WAWebAck","WAWebDBMessageSerialization","WAWebDBMessageStoreUtils","WAWebDBMessageUtils","WAWebDbEncryptionKey","WAWebLidStatusMigrationGating","WAWebLidStatusMigrationUtils","WAWebMsgGetters","WAWebMsgKey","WAWebMsgType","WAWebSchemaMessage","WAWebViewMode.flow","WAWebWidFactory","asyncToGeneratorRuntime","countWhere","justknobx","lodash"],(function(t,n,r,o,a,i,l){var e,s,u,c,d;function m(){return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getAllStatuses: Lid migration stage: ",""])),o("WAWebLidStatusMigrationGating").getLidStatusMigrationStage()),o("WAWebDbEncryptionKey").DbEncKeyStore.waitForFinalDbMsgEncKey().then(function(){var e=[p(),_()];return(d||(d=n("Promise"))).all(e).then((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.flat(1),n=[],a=[],i=r("justknobx")._("4912"),l=0,c=0;t.forEach(function(e){e.author?e.viewMode===o("WAWebViewMode.flow").ViewModeType.HIDDEN&&i?c++:o("WATimeUtils").happenedWithin(o("WATimeUtils").castToUnixTime(e.t),o("WATimeUtils").DAY_SECONDS)&&e.type!==o("WAWebMsgType").MSG_TYPE.REVOKED?e.type!==o("WAWebMsgType").MSG_TYPE.PROTOCOL&&a.push(o("WAWebDBMessageSerialization").messageFromDbRow(e)):n.push(e.id):l++}),l>0&&o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose([""," status messages have null author"])),l),c>0&&o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose([""," status messages have hidden viewMode"])),c),yield o("WAWebSchemaMessage").getMessageTable().bulkRemove(n);var d=a.map(function(e){return babelHelpers.extends({},e,{id:new(r("WAWebMsgKey"))({id:e.id.id,remote:e.id.remote,fromMe:e.id.fromMe,participant:e.id.participant==null?void 0:o("WAWebLidStatusMigrationUtils").matWidConvert(e.id.participant)}),from:o("WAWebLidStatusMigrationUtils").matWidConvert(e.from),author:e.author==null?void 0:o("WAWebLidStatusMigrationUtils").matWidConvert(e.author)})}),m=r("lodash").groupBy(d,function(e){var t;return e.from.isStatus()&&e.author!=null?e.author.toString():(t=o("WAWebMsgGetters").getSender(e))!=null?t:e.from.toString()}),p=[];for(var _ in m){var f=m[_],g=r("countWhere")(f,function(e){return e.ack0&&(yield(e||(e=n("Promise"))).all(i))}}),y.apply(this,arguments)}function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.length===0)return new Map;var t=yield o("WAWebCrosspostingSchema").getTable().anyOf(["statusMessageId"],e),n=new Map;for(var r of t){var a=n.get(r.statusMessageId);a==null&&(a=new Map,n.set(r.statusMessageId,a)),a.set(r.crosspostingDestination,{crosspostingState:r.crosspostingState})}return n}),b.apply(this,arguments)}function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=yield C([e]);return(t=n.get(e))!=null?t:null}),S.apply(this,arguments)}l.createOrReplaceCrossposting=s,l.getCrosspostingData=u,l.getCrosspostingUniqueIds=d,l.updateCrosspostingUniqueIdWithState=p,l.updateCrosspostingUniqueId=_,l.updateDirectUrlPath=f,l.updateCrosspostingState=g,l.bulkUpdateCrosspostingState=h,l.getCrosspostingInfoForMessagesBulk=C,l.getCrosspostingInfoForMessage=v}),98); __d("WAWebCrosspostingMsgHydration",["WAWebCrosspostingBackendGatingUtils","WAWebCrosspostingDBOperations","WAWebMsgGetters","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(o("WAWebMsgGetters").getIsStatus(e)&&o("WAWebCrosspostingBackendGatingUtils").statusCrosspostingEnabled()){var t=e.id.toString(),n=yield o("WAWebCrosspostingDBOperations").getCrosspostingInfoForMessage(t);n!=null&&(e.crosspostingInfo=n)}}),s.apply(this,arguments)}function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.length!==0&&o("WAWebCrosspostingBackendGatingUtils").statusCrosspostingEnabled()){var t=e.map(function(e){return e.id.toString()}),n=yield o("WAWebCrosspostingDBOperations").getCrosspostingInfoForMessagesBulk(t);for(var r of e){var a=n.get(r.id.toString());a!=null&&(r.crosspostingInfo=a)}}}),c.apply(this,arguments)}l.hydrateCrosspostingInfo=e,l.hydrateCrosspostingInfoBulk=u}),98); __d("WAWebStatusGetters",["WALogger","WAWebGetters","WAWebGettersCaches"],(function(t,n,r,o,a,i,l){var e,s=o("WAWebGetters").createGetterFactories({createCache:o("WAWebGettersCaches").createStatusCache}),u=s.clearCacheFor,c=s.computed,d=s.field,m=s.unsafeIdentityGetter,p=u,_=m,f=d("id"),g=d("t"),h=d("unreadCount"),y=d("totalCount"),C=c(function(e){var t=e[0];return t>0},[h]),b=c(function(t){var n=t[0],r=t[1],a=r-n;return Number.isFinite(a)?a:(o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Bad status read count, ",", ",""])),r,n),0)},[h,y]);l.clearStatusGetterCacheFor=p,l.getStatusUnsafe=_,l.getId=f,l.getT=g,l.getUnreadCount=h,l.getTotalCount=y,l.getHasUnread=C,l.getReadCount=b}),98); __d("WAWebWebcStatusSessionWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({WebcStatusSession:[1880,{webcStatusMutedItemCount:[4,e.TYPES.INTEGER],webcStatusMutedRowCount:[7,e.TYPES.INTEGER],webcStatusRecentItemCount:[2,e.TYPES.INTEGER],webcStatusRecentRowCount:[5,e.TYPES.INTEGER],webcStatusSessionId:[1,e.TYPES.INTEGER],webcStatusViewedItemCount:[3,e.TYPES.INTEGER],webcStatusViewedRowCount:[6,e.TYPES.INTEGER]},[1,1,1],"regular"]},{WebcStatusSession:[]});l.WebcStatusSessionWamEvent=s}),98); __d("WAWebWebcStatusSyncWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({WebcStatusSync:[1878,{webcStatusMutedItemCount:[4,e.TYPES.INTEGER],webcStatusMutedRowCount:[7,e.TYPES.INTEGER],webcStatusRecentItemCount:[2,e.TYPES.INTEGER],webcStatusRecentRowCount:[5,e.TYPES.INTEGER],webcStatusSyncT:[1,e.TYPES.TIMER],webcStatusViewedItemCount:[3,e.TYPES.INTEGER],webcStatusViewedRowCount:[6,e.TYPES.INTEGER]},[1,1,1],"regular"]},{WebcStatusSync:[]});l.WebcStatusSyncWamEvent=s}),98); __d("WAWebStatusCollection",["Promise","WAJids","WALogger","WATimeUtils","WAWebApiContact","WAWebBaseCollection","WAWebContactGetters","WAWebContactStatusBridge","WAWebCrosspostingMsgHydration","WAWebFrontendContactGetters","WAWebGroupMetadataCollection","WAWebLidMigrationUtils","WAWebLidStatusMigrationUtils","WAWebMediaOpaqueData","WAWebMsgCollection","WAWebMsgGetters","WAWebStatusGetters","WAWebStatusModel","WAWebUserPrefsMeUser","WAWebWebcStatusSessionWamEvent","WAWebWebcStatusSyncWamEvent","WAWebWidFactory","asyncToGeneratorRuntime","isStringNullOrEmpty","sumOfArray"],(function(t,n,r,o,a,i,l){var e,s,u,c=86400,d=(function(t){function a(){for(var e,r=arguments.length,a=new Array(r),i=0;i0?o.addStatusMessages(e.id,e._msgs):(u||(u=n("Promise"))).resolve()}})),i});function r(t,n){return e.apply(this,arguments)}return r})(),i.sync=function(){var t=this,n=window.performance.now();return this.findQuery({},{set:this.hasSynced()}).finally(function(){t.trigger("sync")}).then(function(r){var a=window.performance.now(),i=Math.round(a-n);t.logMetrics({type:"sync",syncTime:i});var l=t.filter(function(e){return e.msgs.length>e.totalCount});return l.length>0&&o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose([""," statuses have msgs.length > totalCount => ",""])),l.length,l.slice(0,3).map(function(e){return{totalCount:e.totalCount,msgsLength:e.msgs.length}})),r})},i.logMetrics=function(t){var e;t.type==="sync"?e=new(o("WAWebWebcStatusSyncWamEvent")).WebcStatusSyncWamEvent({webcStatusSyncT:t.syncTime}):e=new(o("WAWebWebcStatusSessionWamEvent")).WebcStatusSessionWamEvent({webcStatusSessionId:t.sessionId});var n=this.filter(function(e){return!o("WAWebContactGetters").getIsMe(e.contact)}),a=n.filter(function(e){return!o("WAWebContactGetters").getCalculatedStatusMute(e.contact)}),i=a.filter(function(e){return o("WAWebStatusGetters").getHasUnread(e)}),l=a.filter(function(e){return!o("WAWebStatusGetters").getHasUnread(e)}),s=n.filter(function(e){return o("WAWebContactGetters").getCalculatedStatusMute(e.contact)}),u=r("sumOfArray")(a.map(function(e){return e.unreadCount})),c=r("sumOfArray")(a.map(function(e){return o("WAWebStatusGetters").getReadCount(e)})),d=r("sumOfArray")(s.map(function(e){return e.totalCount}));e.webcStatusRecentItemCount=u,e.webcStatusRecentRowCount=i.length,e.webcStatusViewedItemCount=c,e.webcStatusViewedRowCount=l.length,e.webcStatusMutedItemCount=d,e.webcStatusMutedRowCount=s.length,e.commit()},i.hasSynced=function(){return!0},i.getStatusModel=function(t,n){var e=this.get(t);if(e==null&&n){var r=t!=null?o("WAWebApiContact").getAlternateUserWid(o("WAWebWidFactory").asUserWidOrThrow(t)):null;e=r!=null?this.get(r):null}return e},i.handleUpdate=function(t,n){var e,a=(e=o("WAWebMsgGetters").getSender(t))!=null?e:t.from;if(t.id.remote.isStatus()&&(a=t.id.fromMe?o("WAWebLidStatusMigrationUtils").matWidConvert(o("WAWebUserPrefsMeUser").getMePnUserOrThrow()):t.author),this.hasSynced()){if(n)return!0;var i=t.subtype==="sender_revoke",l=a?this.getStatusModel(a,i):null;if(l){var u=l.totalCount===l.msgs.length;if(i){var c=t.protocolMessageKey,d=c!=null?o("WAWebLidMigrationUtils").getAlternateMsgKey(c):null,m=!1;if(c!=null&&(m=l.containsMessage(c)||l.containsMessage(d)),m!==!0)return!0;var p=c==null?void 0:c.toString(),_=d==null?void 0:d.toString(),f={totalCount:l.totalCount-1};l!=null&&l.isUnreadMessage(p)&&(_==null||l!=null&&l.isUnreadMessage(_))&&(f.unreadCount=l.unreadCount-1),l.set(f)}else{var g={totalCount:l.totalCount+1,t:t.t};t.invis!==!0&&(g.unreadCount=l.unreadCount+1),l.set(g)}return!u&&!r("isStringNullOrEmpty")(t.body)&&r("WAWebMediaOpaqueData").createFromBase64Jpeg(t.body).then(function(e){l.pic=e}).catch(function(){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[StatusCollection] failed to create from base64 jpeg"]))).sendLogs("failed-to-create-from-base64-jpeg")}),u}if(i)return!0;if(a){var h={id:a,t:t.t,unreadCount:t.invis===!0?0:1,totalCount:1};this.add(h)}return!0}return!1},i.addStatusMessages=function(t,r){return(u||(u=n("Promise"))).all([this.$StatusCollectionImpl$p_1(o("WAWebWidFactory").createWid(o("WAJids").STATUS_JID),r.filter(function(e){return e.id.remote.isStatus()})),this.$StatusCollectionImpl$p_1(t,r.filter(function(e){return!e.id.remote.isStatus()&&o("WAWebMsgGetters").getIsStatus(e)}))]).then((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e[0],n=e[1];return yield o("WAWebCrosspostingMsgHydration").hydrateCrosspostingInfoBulk(t),t.concat(n)});return function(t){return e.apply(this,arguments)}})())},i.$StatusCollectionImpl$p_1=function(t,r){return r.length===0?(u||(u=n("Promise"))).resolve([]):o("WAWebMsgCollection").MsgCollection.processMultipleMessages(t,r,{add:"after",isHistory:!0},"addStatusMessages")},i.getValidStatus=function(){return this.filter(function(e){var t;return e.totalCount<=0||e.isExpired()||o("WAWebContactGetters").getIsMe(e.contact)?!1:o("WAWebFrontendContactGetters").getIsMyContact(e.contact)?!0:o("WAWebContactGetters").getIsPSA(e.contact)?!1:!!(o("WAWebContactGetters").getIsGroup(e.contact)&&(r("WAWebGroupMetadataCollection")==null||(t=r("WAWebGroupMetadataCollection").get(e.contact.id))==null||(t=t.participants)==null?void 0:t.iAmMember())===!0)})},i.getUnexpired=function(t){var e=t.containsAnyUnreadStatus,n=this.getValidStatus();return e?n.filter(function(e){return e.unreadCount>0}):n.filter(function(e){return e.unreadCount===0})},i.getMyStatus=function(){var e=this.filter(function(e){return o("WAWebContactGetters").getIsMe(e.contact)});if(e.length!==0&&!(o("WATimeUtils").unixTime()-e[0].t>c))return e[0]},i.getPSAStatus=function(){var e=this.filter(function(e){return o("WAWebContactGetters").getIsPSA(e.contact)});if(e.length!==0)return e[0]},a})(o("WAWebBaseCollection").BaseCollection);d.model=r("WAWebStatusModel"),d.comparator=function(e,t){return t.t-e.t};var m=new d;l.StatusCollection=m}),98); __d("WAWebFrontendStatusGetters",["WAWebGetters","WAWebGettersCaches","WAWebStatusGetters"],(function(t,n,r,o,a,i,l){var e=o("WAWebGetters").createGetterFactories({root:o("WAWebStatusGetters").getStatusUnsafe,createCache:o("WAWebGettersCaches").createFrontendStatusCache}),s=e.clearCacheFor,u=e.computed,c=e.field,d=s,m=c("msgs"),p=c("msgsChanged"),_=c("contact"),f=u(function(e){var t=e[0],n=e[1];return n.last()},[p,m]);l.clearFrontendStatusGetterCacheFor=d,l.getContact=_,l.getLastStatus=f}),98); __d("WAWebStatusPSAUtils",["WATimeUtils"],(function(t,n,r,o,a,i,l){function e(e,t){if(t.length===0)return-1;for(var n=0,r=t[0].campaignId,o=1;ot;var r=e.duration;return r!=null?o("WATimeUtils").unixTime()-e.t>r:!1}function d(e,t){var n=u(e);return Object.keys(n).every(function(e){return c(n[e],t)})}l.getPsaCampaignIndex=e,l.getPsaCampaignsString=s,l.getPSACampaigns=u,l.isCampaignExpired=c,l.isExpiredStatusPSA=d}),98); __d("WAWebStatusModel",["Promise","WALogger","WATimeUtils","WAWebAck","WAWebAlarm","WAWebAppTracker","WAWebBaseModel","WAWebCollectionConstants","WAWebCommonMsgUtils","WAWebContactCollection","WAWebContactStatusBridge","WAWebFrontendMsgGetters","WAWebFrontendStatusGetters","WAWebMsgGetters","WAWebMsgModelUtils","WAWebNoop","WAWebNotificationBackend","WAWebStatusCollection","WAWebStatusGatingUtils","WAWebStatusGetters","WAWebStatusPSAUtils","WAWebSuperChatMsgs","WAWebWid","asyncToGeneratorRuntime","gkx"],(function(t,n,r,o,a,i,l){var e,s,u,c=[o("WAWebCommonMsgUtils").EventType.DEFAULT,o("WAWebCommonMsgUtils").EventType.AMBIENT],d=3600*24,m=1e3,p=(function(t){function a(){for(var e,n=arguments.length,r=new Array(n),a=0;ad},i.setupStatusExpiration=function(){var e=this,t=this.msgs.at(0);if(t&&!(typeof this.expireTs=="number"&&this.expireTs<=t.t)){var n=1,a=t.t+d+n;athis.totalCount-1&&this.unreadCount--,this.totalCount--,e.remove(t),t.delete()},i.expireMsg=function(){if(this.id.isPSA()){this.expirePSAMsg();return}o("WAWebAppTracker").AppTracker.start(o("WAWebAppTracker").AppTrackerType.PurgeStatuses);for(var e=this.msgs;e.length>0;){var t=e.at(0);if(!t)break;var n=t.t+d>o("WATimeUtils").unixTime();if(n)break;this._removeSingleMsg(t)}r("gkx")("26258"),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.PurgeStatuses),this.expireTs=void 0,this.expireTimer=void 0,this.totalCount!==0&&this.setupStatusExpiration()},i.expirePSAMsg=function(){var e=this,t=o("WAWebStatusPSAUtils").getPSACampaigns(this.msgs.toArray());o("WAWebAppTracker").AppTracker.start(o("WAWebAppTracker").AppTrackerType.PurgeStatuses),this.msgs.forEach(function(n){var r=n.campaignId;if(r!=null){var a=o("WAWebStatusPSAUtils").isCampaignExpired(t[r],d);a&&e._removeSingleMsg(n)}}),r("gkx")("26258"),o("WAWebAppTracker").AppTracker.stop(o("WAWebAppTracker").AppTrackerType.PurgeStatuses),this.expireTs=void 0,this.expireTimer=void 0,this.totalCount!==0&&this.setupStatusExpiration()},i.isUnreadMessage=function(t){if(t==null)return!1;var e=o("WAWebMsgModelUtils").getReadMsgKeys(this.msgs.toArray()),n=e.find(function(e){return e===t})==null;return n&&this.readKeys[t]!==!0},i.revokeMsgs=function(t){var e=this,n=new Set(t),r=this.msgs.filter(function(e){return n.has(e.id.toString())});r.forEach(function(t){return e._removeSingleMsg(t)}),this.totalCount===0&&(this.expireTs=void 0,this.expireTimer=void 0)},i.delete=function(){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Status deleted with total count: ",""])),this.totalCount),t.prototype.delete.call(this),this.expireTimer&&r("WAWebAlarm").clearTimeout(this.expireTimer),this.expireTs!=null&&(this.expireTs=void 0),this.getCollection().remove(this.id),o("WAWebStatusGetters").clearStatusGetterCacheFor(this),o("WAWebFrontendStatusGetters").clearFrontendStatusGetterCacheFor(this)},i.onEmptyMRM=function(){var e=this;if(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Status onEmptyMRM with total count: ",", noEarlierMsgs: ",""])),this.totalCount,this.msgs.msgLoadState.noEarlierMsgs?"true":"false"),this.msgs.msgLoadState.noEarlierMsgs&&this.totalCount===0){this.delete();return}this.totalCount>0&&this.loadMore().catch(r("WAWebNoop")).finally(function(){e.msgs.length||e.delete()})},i.loadMore=function(t){return t===void 0&&(t=o("WAWebCollectionConstants").PAGE_SIZE),this.msgs.msgLoadState.noEarlierMsgs?(u||(u=n("Promise"))).resolve():this.msgs.msgLoadState.isLoadingEarlierMsgs?this.msgs.loadEarlierPromise:(this.msgs.msgLoadState.noEarlierMsgs=!0,(u||(u=n("Promise"))).resolve())},i.handleReadStatus=function(t){var e=t.toString();this.readKeys[e]||(this.readKeys[e]=!0,this.unreadCount>0&&this.unreadCount--)},i.sendReadStatus=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r=yield o("WAWebContactStatusBridge").sendReadStatus(e,t,n);r&&this.handleReadStatus(e.id)});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.getCollection=function(){return o("WAWebStatusCollection").StatusCollection},i.containsMessage=function(t){return t==null?!1:this.msgs.toArray().some(function(e){return e.id.toString()===t.toString()})},a})(r("WAWebSuperChatMsgs"));p.Proxy="status",p.idClass=r("WAWebWid");var _=o("WAWebBaseModel").defineModel(p);l.default=_}),98); __d("WAWebStatusNotification",["fbt","WANullthrows","WAWebABProps","WAWebBaseNotification","WAWebContactCollection","WAWebContactGetters","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebMsgGetters","WAWebMuteCollection","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebStatusCollection","WAWebStatusNotificationUtils","WAWebWamEnumNotificationTypeEnum","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){var e=(function(e){function t(t){var n,a=t.msg;return n=e.call(this)||this,n.msg=a,n.status=o("WAWebStatusCollection").StatusCollection.getStatusModel(r("WANullthrows")(o("WAWebMsgGetters").getSender(n.msg),"[WAStatusNotification]: status poster cannot be null"),!1),n}babelHelpers.inheritsLoose(t,e);var a=t.prototype;return a.shouldMute=function(t){var e,n;return o("WAWebNotificationHelpers").appIsActive()?r("WAWebNotificationMuteReason").AppState:(e=this.status)!=null&&e.contact&&o("WAWebContactGetters").getCalculatedStatusMute((n=this.status)==null?void 0:n.contact)?r("WAWebNotificationMuteReason").MutedStatus:o("WAWebNotificationHelpers").isOfflineResumeInProgress()?r("WAWebNotificationMuteReason").OfflineResumeInProgress:null},a.shouldPlaySound=function(){if(!e.prototype.shouldPlaySound.call(this))return!1;var t=o("WAWebABProps").getABPropConfigValue("wa_web_enable_granular_notifications");return t?o("WAWebMuteCollection").MuteCollection.getGlobalStatusSoundsEnabled():e.prototype.shouldPlaySound.call(this)},a.shouldShowBanner=function(){if(!e.prototype.shouldShowBanner.call(this))return!1;var t=o("WAWebABProps").getABPropConfigValue("wa_web_enable_granular_notifications");return t?o("WAWebMuteCollection").MuteCollection.getGlobalStatusNotificationsEnabled():e.prototype.shouldShowBanner.call(this)},a.getBannerOptions=function(){var e=this,t=s._(/*BTDS*/"Te mencion\u00f3 en privado en un estado").toString(),n=this.status?o("WAWebFrontendContactGetters").getFormattedName(this.status.contact):o("WAWebFrontendContactGetters").getFormattedName(r("WANullthrows")(o("WAWebContactCollection").ContactCollection.get(this.msg.author))),a=o("WAWebGetNotificationStrings").getNotificationBody({body:t,msgDir:o("WAWebFrontendMsgGetters").getDir(this.msg)}),i=function(){o("WAWebStatusNotificationUtils").openStatusViewer(e.msg)};return{wid:this.msg.author,title:r("WANullthrows")(n),body:a,onClick:i}},a.buildKey=function(){return"status-msg:"+this.msg.id.toString()},a.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebNotificationIconUtils").getNotificationIconByWid(r("WANullthrows")(o("WAWebMsgGetters").getSender(this.msg)),this.abortController.signal,o("WAWebNotificationIconUtils").USER_DEFAULT_ICON)});function t(){return e.apply(this,arguments)}return t})(),a.getNotificationDeliveryWamEventData=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return{uiNotificationType:o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.STATUS_MENTION,triggeredByOfflineMessage:this.msg.isOffline===!0}});function t(){return e.apply(this,arguments)}return t})(),t})(o("WAWebBaseNotification").WABaseNotification);l.WAStatusNotification=e}),226); __d("WAWebBackIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="back";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=24,R=24;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 24 24",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 24 24",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{fill:"currentColor",d:"M12,4l1.4,1.4L7.8,11H20v2H7.8l5.6,5.6L12,20l-8-8L12,4z"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.BackIcon=m}),98); __d("WAWebXViewerIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="x-viewer";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=24,R=24;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 24 24",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 24 24",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{fill:"currentColor",d:"M19.8,5.8l-1.6-1.6L12,10.4L5.8,4.2L4.2,5.8l6.2,6.2l-6.2,6.2l1.6,1.6l6.2-6.2l6.2,6.2l1.6-1.6L13.6,12 L19.8,5.8z"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.XViewerIcon=m}),98); __d("WAWebStatusLoadingQuoted.react",["WAWebBackIcon.react","WAWebLazyLoadLoading.react","WAWebModalManager","WAWebXViewerIcon.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react"));function u(e){var t=e.error,n=e.retry,a=e.text,i=function(){return o("WAWebModalManager").ModalManager.closeMedia()};return s.jsxs("div",{className:"x10l6tqk x13vifvy x1o0tod x1bpt9pm xh8yej3 x5yr21d x1280gxy","data-animate-status-viewer":!0,children:[s.jsx("button",{className:"x10l6tqk xoyzfg9 x1i4sgur xhtitgo x17t9dm2",onClick:i,children:s.jsx(o("WAWebXViewerIcon.react").XViewerIcon,{})}),s.jsx("button",{className:"x10l6tqk xoyzfg9 x18hw5r0 xhtitgo x78zum5 x17t9dm2",onClick:i,children:s.jsx(o("WAWebBackIcon.react").BackIcon,{directional:!0})}),s.jsx(r("WAWebLazyLoadLoading.react"),{error:t,text:a,retry:n})]})}u.displayName=u.name+" [from "+i.id+"]",l.default=u}),98); __d("WAWebStatusQuotedFlowLoadable",["JSResourceForInteraction","WAWebLazyLoadedRetriable","WAWebLoadable","WAWebStatusLoadingQuoted.react","asyncToGeneratorRuntime","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=r("WAWebLazyLoadedRetriable")(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield r("JSResourceForInteraction")("WAWebStatusQuotedFlow.react").__setRef("WAWebStatusQuotedFlowLoadable").load();return e}),"StatusQuotedFlow"),c=r("WAWebLoadable")({loader:u,loading:function(t){return s.jsx(r("WAWebStatusLoadingQuoted.react"),{error:!!t.error})}});l.requireBundle=u,l.StatusQuotedFlowLoadable=c}),98); __d("WAWebStatusNotificationUtils",["fbt","WAWebModalManager","WAWebMsgGetters","WAWebStatusCollection","WAWebStatusQuotedFlowLoadable","WAWebToast.react","WAWebToastManager","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react"));function c(e){var t=o("WAWebMsgGetters").getSender(e);if(t==null){o("WAWebToastManager").ToastManager.open(u.jsx(o("WAWebToast.react").Toast,{msg:s._(/*BTDS*/"No se encontr\u00f3 al remitente")}));return}o("WAWebStatusCollection").StatusCollection.find(t).then(function(t){var n=function(){o("WAWebToastManager").ToastManager.open(u.jsx(o("WAWebToast.react").Toast,{msg:s._(/*BTDS*/"No se encontr\u00f3 la actualizaci\u00f3n de estado")}))};o("WAWebModalManager").ModalManager.openMedia(u.jsx(o("WAWebStatusQuotedFlowLoadable").StatusQuotedFlowLoadable,{status:t,msgKey:e.id,onMsgNotFound:n,onClose:function(){return o("WAWebModalManager").ModalManager.closeMedia()}}),{transition:"quoted-status-modal"})})}l.openStatusViewer=c}),226); __d("WAWebHistorySyncStickers",["WABase64","WALogger","WALongInt","WATimeUtils","WAWebHistorySyncNotificationUtils","WAWebMediaTypes","WAWebRecentStickerCollectionMd","WAWebUserPrefsAppStateSync","WAWebUserPrefsTypes","compactMap"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m;function p(t,n){var a;if(t.recentStickers==null){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: received empty recentStickers protobuf"])));return}o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: processing recent stickers from history. total of "," stickers received."])),t.recentStickers.length);var i=0,l=r("compactMap")(t.recentStickers,function(e){var t,n=e.fileSha256;if(n==null)return i++,null;var r=e.fileEncSha256,a=e.mediaKey;return[{id:o("WABase64").encodeB64(n),directPath:e.directPath,filehash:o("WABase64").encodeB64(n),encFilehash:r!=null?o("WABase64").encodeB64(r):null,mediaKey:a!=null?o("WABase64").encodeB64(a):"",mediaKeyTimestamp:o("WATimeUtils").unixTime(),width:e.width,height:e.height,mimetype:e.mimetype,type:o("WAWebMediaTypes").OUTWARD_TYPES.STICKER,index:0,weight:e.weight},(t=o("WALongInt").maybeNumberOrThrowIfTooLarge(e.lastStickerSentTs))!=null?t:0,null]});i>0&&o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: Got "," stickers with empty filehash from initial sticker history"])),i);var p=t.recentStickers.filter(function(e){return e.fileSha256!=null&&(e.fileEncSha256==null||e.mediaKey==null)});p.length>0&&o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: Got "," stickers with empty fileEncSha256 or mediaKey from initial sticker history"])),p.length),o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: "," stickers need to be added after sticker construction."])),l.length),o("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.replaceAndEnqueue(l,!0),o("WAWebUserPrefsAppStateSync").setNonCriticalDataSyncStatus((a={},a[o("WAWebUserPrefsTypes").NonCriticalDataSyncStatusType.RECENT_STICKER_INITIALIZED]=o("WAWebUserPrefsTypes").RecentStickerInitializedStatusType.SUCCESS,a)),o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Recent Stickers completed, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(n))}l.processRecentStickers=p}),98); __d("WAWebStickerUtils",["$InternalEnum","Promise","WABase64UrlSafe","WACryptoSha256","WALogger","WAPromiseProps","WAWebABProps","WAWebFeatureDetectionDetectWebpSupport","WAWebInMemoryLottieStickerCache","WAWebMediaDataUtils","WAWebMediaMmsV4Download","WAWebStickerMetadataParsing","WAWebStickerMimeUtils","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g="metadata",h="customProps",y=512,C=512,b="196",v="MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEM5mGNNmQ2U6CxBER9IwHd9qtcshk9JKsRv9Ljq6/yPW9v35AKwmAiocRH2YWMjnacj4luB3xp6h+4XxoML/KXQ==";function S(e){var t=(4-e.length%4)%4;return e+"=".repeat(t)}function R(e){return S(o("WABase64UrlSafe").urlSafeBase64(e))}function L(e,t){var n=R(e),r=R(t);return n===r}function E(e,t){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WABase64UrlSafe").urlSafeBase64ToStandard(e),r=S(n),a=o("WABase64UrlSafe").getBytesFromBase64(r),i=new TextEncoder().encode(t).buffer,l=o("WABase64UrlSafe").getBytesFromBase64(v),s=yield crypto.subtle.importKey("spki",l,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]),u=yield crypto.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},s,a,i);return u}),k.apply(this,arguments)}var I=n("$InternalEnum").Mirrored(["WEBP","LOTTIE"]);function T(e){return o("WAWebStickerMimeUtils").WhatsAppLottieStickerMimeType===e?I.LOTTIE:I.WEBP}function D(t){if(t==null)return o("WAWebStickerMetadataParsing").DEFAULT_STICKER_METADATA;try{var n,r,a=(n=(r=t[g])==null?void 0:r[h])!=null?n:{};return o("WAWebStickerMetadataParsing").toStickerMetadata(a)}catch(t){return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["extractMetaDataFromLottieSticker: Failed to parse metadata out of lottie sticker, returning default metadata."]))),o("WAWebStickerMetadataParsing").DEFAULT_STICKER_METADATA}}function x(e,t){return $.apply(this,arguments)}function $(){return $=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(T(e.type)===I.LOTTIE){var r=t.filehash;if(r!=null){var a=o("WAWebInMemoryLottieStickerCache").InMemoryLottieStickerCache.get(r);a==null&&(a=yield o("WAWebInMemoryLottieStickerCache").extractAndSetLottieJSONInMemoryCache(r,e));var i=D(a);return(f||(f=n("Promise"))).resolve(babelHelpers.extends({},i,{size:e.size,fullWidth:y,fullHeight:C}))}}return o("WAWebFeatureDetectionDetectWebpSupport").detectWebpSupport().then(function(t){return t?o("WAPromiseProps").promiseProps({widthHeight:o("WAWebMediaDataUtils").getImageWidthHeightNoOpaque(e),webpData:o("WAWebMediaDataUtils").parseWebpNoOpaque(e)}).then(function(t){return{fullWidth:t.widthHeight.width,fullHeight:t.widthHeight.height,animationDuration:t.webpData.animationDuration,firstFrameLength:t.webpData.firstFrameLength,singleLoopDuration:t.webpData.singleLoopDuration,emojis:t.webpData.emojis,isAnimated:t.webpData.animationDuration>0,size:e.size,isFirstParty:t.webpData.isFirstParty,isFromStickerMaker:t.webpData.isFromStickerMaker,stickerPackId:t.webpData.stickerPackId,stickerPackName:t.webpData.stickerPackName,stickerPackPublisher:t.webpData.stickerPackPublisher,isAvatar:t.webpData.isAvatar,isAiSticker:t.webpData.isAiSticker,stickerMakerSourceType:t.webpData.stickerMakerSourceType,accessibilityLabel:t.webpData.accessibilityLabel}}):o("WAWebMediaDataUtils").parseWebpNoOpaque(e).then((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.accessibilityLabel,r=t.animationDuration,a=t.emojis,i=t.firstFrameLength,l=t.isAiSticker,s=t.isAvatar,u=t.isFirstParty,c=t.isFromStickerMaker,d=t.singleLoopDuration,m=t.stickerMakerSourceType,p=t.stickerPackId,_=t.stickerPackName,f=t.stickerPackPublisher;if(r>0)return{animationDuration:r,firstFrameLength:i,singleLoopDuration:d,emojis:a,isAnimated:!0,size:e.size,isFirstParty:u,isFromStickerMaker:c,stickerPackId:p,stickerPackName:_,stickerPackPublisher:f,isAvatar:s,isAiSticker:l,stickerMakerSourceType:m,accessibilityLabel:n};var g=yield o("WAWebMediaDataUtils").decodeWebpToRGBANoOpaque(e);return{animationDuration:r,rgbaBuffer:g.rgbaBuffer,rgbaWidth:g.width,rgbaHeight:g.height,emojis:a,isAnimated:!1,size:e.size,isFirstParty:u,isFromStickerMaker:c,stickerPackId:p,stickerPackName:_,stickerPackPublisher:f,isAvatar:s,isAiSticker:l,stickerMakerSourceType:m,accessibilityLabel:n}});return function(e){return t.apply(this,arguments)}})())})}),$.apply(this,arguments)}function P(e){return e.replaceAll(/\s+/g,"")}function N(e,t){return M.apply(this,arguments)}function M(){return M=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=new Blob([e],{type:o("WAWebStickerMimeUtils").WhatsAppLottieStickerMimeType}),a=yield o("WAWebMediaMmsV4Download").extractLottieJSON(n,t);if(a==null)throw r("err")("Failed to extract lottie json from zipped sticker");var i=yield w(a);return i}),M.apply(this,arguments)}function w(e){return A.apply(this,arguments)}function A(){return A=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=W(e,g),n=yield F(t);return n}),A.apply(this,arguments)}function F(e){return O.apply(this,arguments)}function O(){return O=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=new TextEncoder,n=t.encode(e).buffer,r=yield o("WACryptoSha256").sha256Base64(n);return r}),O.apply(this,arguments)}var B=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=/animation\/animation.json.trust_token$/,r=Object.keys(e).find(function(e){return n.test(e)});if(r==null)return!1;var a=e[r];try{var i=new TextDecoder("utf-8"),l=i.decode(a),f=l.split(".");if(f.length!==3)return o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Failed to verify Lottie trust token JWT: invalid number of parts"]))),!1;var g=f[1],h=o("WABase64UrlSafe").urlSafeBase64ToStandard(g),y=JSON.parse(atob(h)),C=(y==null?void 0:y.sticker_file_type)==="lottie_json"&&(y==null?void 0:y.sticker_file_trusted_origin)==="whatsapp";if(!C)return o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Failed to verify Lottie trust token JWT: payload is invalid"]))),!1;var v=y==null?void 0:y.sticker_file_sha256;if(!v)return o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Failed to verify Lottie trust token JWT: sticker_file_sha256 is missing"]))),!1;var S=yield F(t);if(!L(S,v))return o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Failed to verify Lottie trust token JWT: file hash does not match"]))),!1;var R=f[0],k=o("WABase64UrlSafe").urlSafeBase64ToStandard(R),I=JSON.parse(atob(k));if((I==null?void 0:I.kid)!==b)return o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["Failed to verify Lottie trust token JWT: invalid kid in header"]))),!1;var T=f[2],D=R+"."+g,x=yield E(T,D);return x?!0:(o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["Failed to verify Lottie trust token JWT: invalid signature"]))),!1)}catch(e){return o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["Failed to verify Lottie trust token JWT ",""])),e),!1}});return function(n,r){return e.apply(this,arguments)}})();function W(e,t){var n=P(e);try{var o=JSON.parse(n);return delete o[t],JSON.stringify(o)}catch(e){throw r("err")("removeKeyFromString: Failed to parse lottie json "+e)}}function q(){var e={},t=o("WAWebABProps").getABPropConfigValue("gimmick_phase_two_data_suffix"),n=new URLSearchParams(t);return n.forEach(function(t,n){e[n]=t}),e}l.METADATA_OBJECT=g,l.LOTTIE_STICKER_FULL_WIDTH=y,l.LOTTIE_STICKER_FULL_HEIGHT=C,l.StickerFileType=I,l.getStickerFileType=T,l.extractMetaDataFromLottieSticker=D,l.parseStickerMetadata=x,l.removeSpacesAndEmptyLines=P,l.getLottieStickerFilehashFromZippedStickerBuffer=N,l.calculateLottieStickerFilehashWithoutMetadata=w,l.calculateLottieStickerFilehash=F,l.isLottieStickerFirstParty=B,l.removeKeyFromString=W,l.getStickerFetchParamsFromABConfig=q}),98); __d("WAWebWamEnumQueryType",[],(function(t,n,r,o,a,i){var e=Object.freeze({STICKER_STORE_DATA:0,PREVIEW_IMAGE_DOWNLOAD:1,STICKER_PACK_DATA:2,STICKER_SEARCH:3,DISCOVERY_PACK:4});i.QUERY_TYPE=e}),66); __d("WAWebStickerCommonQueryToStaticServerWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumQueryType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({StickerCommonQueryToStaticServer:[2740,{httpResponseCode:[2,e.TYPES.INTEGER],params:[3,e.TYPES.STRING],queryLatencyMs:[4,e.TYPES.TIMER],queryType:[1,o("WAWebWamEnumQueryType").QUERY_TYPE]},[1,1,1],"regular"]},{StickerCommonQueryToStaticServer:[]});l.StickerCommonQueryToStaticServerWamEvent=s}),98); __d("WAWebFetchFirstPartyStickerPacksAction",["WAWebL10N","WAWebL10NCountryCodes","WAWebMiscErrors","WAWebPonyfillsFetch","WAWebPonyfillsUrlSearchParams","WAWebStickerCommonQueryToStaticServerWamEvent","WAWebStickerUtils","WAWebURLUtils","WAWebUserPrefsMeUser","WAWebWamEnumQueryType","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e="https://static.whatsapp.net/sticker";function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var a=o("WAWebStickerUtils").getStickerFetchParamsFromABConfig(),i=babelHelpers.extends({},a,t),l=r("WAWebURLUtils").build(e,i),s=new(o("WAWebStickerCommonQueryToStaticServerWamEvent")).StickerCommonQueryToStaticServerWamEvent;s.startQueryLatencyMs();var u=yield r("WAWebPonyfillsFetch")(l,{signal:n.signal});if(s.markQueryLatencyMs(),s.set({httpResponseCode:u.status,params:new(r("WAWebPonyfillsUrlSearchParams"))(i).toString(),queryType:o("WAWebWamEnumQueryType").QUERY_TYPE.STICKER_PACK_DATA}),s.commit(),!u.ok)throw new(o("WAWebMiscErrors")).InvalidServerResponseError(l,u.status.toString(),"Invalid response from WhatsApp stickers endpoint");var c=yield u.json();if(c==null||c.length===0)throw new(o("WAWebMiscErrors")).InvalidServerResponseError(l,u.status.toString(),"Invalid response from WhatsApp stickers endpoint: "+JSON.stringify(c));return c}),u.apply(this,arguments)}function c(e,t){var n={id:e["sticker-pack-id"],name:e.name,publisher:e.publisher,description:e.description,fileSize:Number(e["file-size"]),imageDataHash:e["image-data-hash"],animated:e.animated===1,previewImageIds:e["preview-image-ids"],trayImageId:e["tray-image-id"],trayImagePreview:e["tray-image-preview"],index:t!=null?t:0};return n}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=r("WAWebL10N").getNormalizedLocale(),a=o("WAWebL10NCountryCodes").getCountryShortcodeByPhone((t=o("WAWebUserPrefsMeUser").getMaybeMePnUser())==null?void 0:t.user)||"default",i={cat:"sticker_store_data",id:"all",lg:n,country:a},l=yield s(i,{signal:e.signal});return l.map(function(e,t){return c(e,t)})}),m.apply(this,arguments)}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=r("WAWebL10N").getNormalizedLocale(),n={cat:"sticker_pack_data",id:e.id,lg:t},o=yield s(n,{signal:e.signal}),a=o[0];return c(a)}),_.apply(this,arguments)}l.fetchFirstPartyStickerPacks=d,l.fetchFirstPartyStickerPack=p}),98); __d("WAWebFetchFirstPartyStickersAction",["WAWebL10N","WAWebMiscErrors","WAWebPonyfillsFetch","WAWebPonyfillsUrlSearchParams","WAWebStickerCommonQueryToStaticServerWamEvent","WAWebStickerUtils","WAWebURLUtils","WAWebWamEnumQueryType","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e="https://static.whatsapp.net/sticker";function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var a=o("WAWebStickerUtils").getStickerFetchParamsFromABConfig(),i=babelHelpers.extends({},a,{cat:"sticker_pack_data",id:t,lg:r("WAWebL10N").getNormalizedLocale()}),l=r("WAWebURLUtils").build(e,i),s=new(o("WAWebStickerCommonQueryToStaticServerWamEvent")).StickerCommonQueryToStaticServerWamEvent;s.startQueryLatencyMs();var u=yield r("WAWebPonyfillsFetch")(l,{signal:n==null?void 0:n.signal});if(s.markQueryLatencyMs(),s.set({httpResponseCode:u.status,params:new(r("WAWebPonyfillsUrlSearchParams"))(i).toString(),queryType:o("WAWebWamEnumQueryType").QUERY_TYPE.STICKER_PACK_DATA}),s.commit(),!u.ok)throw new(o("WAWebMiscErrors")).InvalidServerResponseError(l,u.status.toString(),"Invalid response from WhatsApp stickers endpoint");var c=yield u.json();if(c==null||c.length===0)throw new(o("WAWebMiscErrors")).InvalidServerResponseError(l,u.status.toString(),"Invalid response from WhatsApp stickers endpoint: "+JSON.stringify(c));return c[0].stickers.map(function(e,t){return{mimetype:e.mimetype,width:e.width,height:e.height,index:t,filehash:e["file-hash"],directPath:e["direct-path"],mediaKey:e["media-key"],id:e["file-hash"],deprecatedMms3Url:e.url,encFilehash:e["enc-file-hash"],mediaKeyTimestamp:0}})}),u.apply(this,arguments)}l.fetchFirstPartyStickers=s}),98); __d("WAWebMediaHostsUtil",["WAWebMediaHosts","asyncToGeneratorRuntime","lodash"],(function(t,n,r,o,a,i,l){var e="https://static.whatsapp.net",s=r("lodash").memoize(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=yield o("WAWebMediaHosts").mediaHosts.getHostsInfoByBucket({preferredBuckets:[1]}),n=t.selectedHost;return n!=null?"https://"+n.hostname:e}));l.getStaticMediaHostName=s}),98); __d("WAWebSearchFirstPartyStickersAction",["WAWebCurrentUser","WAWebL10NCountryCodes","WAWebLinkDevicePhoneNumberEntryInputFormatUtils","WAWebMediaHostsUtil","WAWebMiscErrors","WAWebPonyfillsFetch","WAWebPonyfillsUrlSearchParams","WAWebStickerCommonQueryToStaticServerWamEvent","WAWebStickerModel","WAWebStickerUtils","WAWebURLUtils","WAWebUserPrefsMeUser","WAWebWamEnumQueryType","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=250,s="https://static.whatsapp.net",u="/sticker",c="/wa/static/sticker";function d(e,t){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var a,i=(a=o("WAWebUserPrefsMeUser").getMaybeMePnUser())==null?void 0:a.user,l=o("WAWebL10NCountryCodes").getCountryShortcodeByPhone(i);o("WAWebCurrentUser").isEmployee()&&i!=null&&o("WAWebLinkDevicePhoneNumberEntryInputFormatUtils").compareCountryCodeOutput(i,l,"searchFirstPartyStickers");for(var d=l||"default",m=0,p=0;m<=e;)m+=3+encodeURIComponent(t[p++]).length;var _=t.slice(0,p-1).join(","),f={country:d},g=yield o("WAWebMediaHostsUtil").getStaticMediaHostName(),h=g===s?""+g+u:""+g+c,y=o("WAWebStickerUtils").getStickerFetchParamsFromABConfig(),C=r("WAWebURLUtils").build(h,babelHelpers.extends({},y,{cat:"sticker_search",terms:_,_nc_cat:1},f)),b=new(o("WAWebStickerCommonQueryToStaticServerWamEvent")).StickerCommonQueryToStaticServerWamEvent;b.startQueryLatencyMs();var v=yield r("WAWebPonyfillsFetch")(C,{signal:n==null?void 0:n.signal});if(b.markQueryLatencyMs(),b.set({httpResponseCode:v.status,params:new(r("WAWebPonyfillsUrlSearchParams"))(f).toString(),queryType:o("WAWebWamEnumQueryType").QUERY_TYPE.STICKER_SEARCH}),b.commit(),!v.ok)throw new(o("WAWebMiscErrors")).InvalidServerResponseError(C,v.status.toString(),"Invalid response from WhatsApp stickers endpoint");var S=yield v.json();if(S==null)throw new(o("WAWebMiscErrors")).InvalidServerResponseError(C,v.status.toString(),"Invalid response from WhatsApp stickers endpoint: "+JSON.stringify(S));return S.map(function(e,t){return new(o("WAWebStickerModel")).StickerModel({mimetype:e.mimetype,width:e.width,height:e.height,filehash:e["file-hash"],directPath:e["direct-path"],mediaKey:e["media-key"],id:e["file-hash"],encFilehash:e["enc-file-hash"],mediaKeyTimestamp:0,index:t})})}),m.apply(this,arguments)}l.searchFirstPartyStickers=d}),98); __d("WAWebFavoriteStickerModel",["WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0){var a=new Set(n.map(function(e){return e.id}));r.some(function(e){return!a.has(e.id)})&&this._addSaveTask()}this._hasInitializedFromCache=!0},i.updateFavoriteStickerWithNewSticker=function(t,n){var e=this.get(t);e!=null&&(e.sticker=new(o("WAWebStickerModel")).StickerModel(n.toDbData()),this.set([e],{remove:!1,add:!1,silent:!0,sort:!1}),this._addSaveTask())},i.getSuggestionsFromEmoji=function(t){var e;return(e=this._emojiToCollection.get(t))==null?void 0:e.map(function(e){return e.sticker})},a})(o("WAWebBaseCollection").BaseCollection);y.model=r("WAWebFavoriteStickerModel");var C=new y;l.FavoriteStickerCollection=C}),98); __d("WAWebRecentStickerCollection",["WALogger","WANullthrows","WAWebBaseCollection","WAWebConnModel","WAWebMobilePlatforms","WAWebStickerModel","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=32,u=(function(t){function a(){for(var e,n=arguments.length,a=new Array(n),i=0;in.index?1:-1},e._syncStatus="NONE",e._weightMap=new Map,e._sortTrimScale=function(){var t=e.length;if(t){if(e.sort(),t>s){for(var n=s;n.01||e.forEach(function(n,r){e._weightMap.set(n.id,1+3*((t-r)/t))})}},babelHelpers.assertThisInitialized(e)||babelHelpers.assertThisInitialized(e)}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i._getWeight=function(t){return r("WANullthrows")(this._weightMap.get(t.id))},i.enqueue=function(t){t.length!==0&&(o("WAWebConnModel").Conn.platform===o("WAWebMobilePlatforms").PLATFORMS.ANDROID?this._enqueueAndroid(t):this._enqueueiOS(t))},i.addStickerWithMediaData=function(t){var e=new(o("WAWebStickerModel")).StickerModel(t);e.id||(e.id=e.filehash),this.enqueue([e])},i._enqueueAndroid=function(t){var e=this;t.forEach(function(t){e.get(t.id)||(e._weightMap.set(t.id,0),e.add(t)),e.forEach(function(n){var r=e._getWeight(n);n.id===t.id?r+=1:r*=.9,e._weightMap.set(n.id,Math.round(1e3*r)/1e3)})}),this._sortTrimScale()},i._enqueueiOS=function(t){var e=this;this.forEach(function(e,t){e.index=s+t});var n=new Set(t.map(function(e){return e.id})),r=t.reduce(function(e,t){return n.has(t.id)?(n.delete(t.id),[t].concat(e)):e},[]).slice(0,s);r.forEach(function(t,n){var r=e.get(t.id);r?r.index=n:e.add({id:t.id,deprecatedMms3Url:t.deprecatedMms3Url,directPath:t.directPath,filehash:t.filehash,encFilehash:t.encFilehash,mediaKey:t.mediaKey,mediaKeyTimestamp:t.mediaKeyTimestamp,width:t.width,height:t.height,size:t.size,mimetype:t.mimetype,type:t.type,index:n})}),this.sort(),this.remove(this.slice(s))},i.sync=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield this._sync()});function t(){return e.apply(this,arguments)}return t})(),i._sync=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(this._syncStatus!=="INPROGRESS"){this._syncStatus="INPROGRESS";try{yield this.findQuery({},{set:!0}),this.sort(),this._syncStatus="SUCCESS"}catch(t){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["collection:recent_sticker:_sync error "]))),this._syncStatus="FAILURE"}}});function r(){return t.apply(this,arguments)}return r})(),i.isSynced=function(){return this._syncStatus==="SUCCESS"||this._syncStatus==="FAILURE"},i.reset=function(){return this._syncStatus="NONE",this._weightMap.clear(),t.prototype.reset.call(this)},a})(o("WAWebBaseCollection").BaseCollection);u.model=o("WAWebStickerModel").StickerModel;var c=new u;l.RecentStickerCollection=c}),98); __d("WAWebRecentStickerModel",["WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0&&(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: adjust weight and resort stickers."]))),this.adjustWeight(l),this.addAndSort(i),this._hasInitializedFromCache&&(o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: need to save collection to DB."]))),this._addSaveTask()))}},i.replaceAndEnqueue=function(t,n){if(n===void 0&&(n=!1),this.length>0){var e=this.map(function(e){return e.id});this.remove(e)}if(t.length===0){this._addSaveTask();return}this.addStickersAndPersistToDB(t,n)},i.updateDirectPath=function(t,n){var e=this.get(t);e!=null&&e.sticker?(e.sticker.directPath=n,this.set([e],{remove:!1,add:!1,silent:!0,sort:!1}),this._addSaveTask()):o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["updateDirectPaths called with a stickerId that doesn't match any in the collection"])))},i.updateStickerMediaData=function(t,n){var e=this.get(t);n==null||e==null||(n.directPath!=null&&(e.sticker.directPath=n.directPath),n.encFilehash!=null&&(e.sticker.encFilehash=n.encFilehash),n.mediaKey&&(e.sticker.mediaKey=n.mediaKey),n.mediaKeyTimestamp&&(e.sticker.mediaKeyTimestamp=n.mediaKeyTimestamp),this.set([e],{remove:!1,add:!1,silent:!0,sort:!1}),this._addSaveTask())},i.updateRecentStickerWithNewSticker=function(t,n){var e=this.get(t);e!=null&&(e.sticker=new(o("WAWebStickerModel")).StickerModel(n.toDbData()),this.set([e],{remove:!1,add:!1,silent:!0,sort:!1}),this._addSaveTask())},i.associateStickerWithMsg=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n,r=yield o("WAWebMsgCollection").MsgCollection.getMessagesById([t]),a=r.messages,i=((n=e.mediaObject)==null?void 0:n.associatedMsgs())||[];e.mediaObject&&(i.length===0||!a.some(function(e){return i.includes(e)}))&&o("WAWebMediaStorage").associateMediaWithMsg(e.mediaObject,a[a.length-1])});function t(t,n){return e.apply(this,arguments)}return t})(),i.initializeFromCache=function(t){var e=this;this._hasInitializedFromCache=!0;var n=t.map(function(t){var n=e._dbDataToModel(t);return n.msgId!=null&&e.associateStickerWithMsg(n.sticker,n.msgId),n}),r=this.toArray();if(r.length>0&&n.forEach(function(e){return e.weight=Number((e.weight*Math.pow(.9,r.length)).toFixed(2))}),this.addAndSort(n),r.length){var o=new Set(n.map(function(e){return e.id}));r.some(function(e){return!o.has(e)})&&this._addSaveTask()}},i.addAndSort=function(t){this.add(t),this.sort(),this.length>C&&this._hasInitializedFromCache&&(o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: stickers length "," is over the limit."])),this.length),this.set(this.toArray().slice(0,C)))},i.removeAndSave=function(t,n){n===void 0&&(n={});var e=this.remove(t,n);return e.length&&this._addSaveTask(),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: stickers length "," after remove."])),this.length),e},i.removeAllRecentAvatarStickers=function(){var e=this.filter(function(e){return e.sticker.isAvatar===!0});return e.length===0?(o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: no avatar stickers found, skip removing."]))),[]):(o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["Recent Stickers: removing all "," avatar stickers."])),e.length),this.removeAndSave(e))},i.adjustWeight=function(t){var e=new Set(t.map(function(e){return e.id}));this.filter(function(t){return!e.has(t.id)}).forEach(function(e){return e.weight=Number((e.weight*.9).toFixed(2))}),t.forEach(function(e){e.isNewSticker===!0?e.isNewSticker=void 0:e.weight=Number((e.weight+1).toFixed(2))})},a})(o("WAWebBaseCollection").BaseCollection);b.model=r("WAWebRecentStickerModel");var v=new b;l.RecentStickerCollectionMd=v}),98); __d("WAWebStickerCollection",["WAWebBaseCollection","WAWebStickerModel","err"],(function(t,n,r,o,a,i,l){var e={PENDING:"PENDING",SUCCESS:"SUCCESS",ERROR:"ERROR"},s=(function(e){function t(){return e.apply(this,arguments)||this}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.fetch=function(t){throw r("err")(this.constructor.name+".fetch is not implemented")},t})(o("WAWebBaseCollection").BaseCollection);s.model=o("WAWebStickerModel").StickerModel;var u=new s;l.FETCH_STATE=e,l.StickerCollectionImpl=s,l.StickerCollection=u}),98); __d("WAWebStickerDownloadCollection",["WALogger","WATimeUtils","WAWebIdleTaskRunner","WAWebSchemaStickerDownload","WAWebStickerPackCollectionMd","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p=(function(t){function r(){return t.apply(this,arguments)||this}babelHelpers.inheritsLoose(r,t);var a=r.prototype;return a.addAndPersist=function(n){if(this.get(n.id)!=null){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Sticker Download: sticker pack already exists in collection"])));return}this.add(n),this.$StickerDownloadCollectionImpl$p_2()},a.removeAndPersist=function(t){var e=this.remove(t);return e.length&&(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Sticker Download: length of stickers will be removed: ",""])),e.length),this.$StickerDownloadCollectionImpl$p_2()),e},a.$StickerDownloadCollectionImpl$p_2=function(){var e=this;(!this.$StickerDownloadCollectionImpl$p_1||!o("WAWebIdleTaskRunner").IdleCallbackTasks.isInQueue(this.$StickerDownloadCollectionImpl$p_1))&&(this.$StickerDownloadCollectionImpl$p_1=o("WAWebIdleTaskRunner").IdleCallbackTasks.enqueue(function(){e.$StickerDownloadCollectionImpl$p_3()}))},a.$StickerDownloadCollectionImpl$p_3=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=this.toArray().map(function(e){return{id:e.id,timestamp:o("WATimeUtils").unixTime()}});o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Sticker Downloads: need to save sticker downloads in DB with length: ",""])),e.length);try{var t=o("WAWebSchemaStickerDownload").getStickerDownloadTable(),n=yield t.count();o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Sticker Downloads: before save, sticker downloads in DB with length: ",""])),n),yield t.clear(),yield t.bulkCreateOrReplace(e),n=yield t.count(),o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Sticker Downloads: after save, sticker downloads in DB with length: ",""])),n)}catch(e){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["StickerDownloadCollection attempt to save to database failed"]))).sendLogs(e)}});function t(){return e.apply(this,arguments)}return t})(),r})(o("WAWebStickerPackCollectionMd").StickerPackCollection),_=new p;l.StickerDownloadCollection=_}),98); __d("WAWebStickerModel",["WALogger","WATimeUtils","WAWebABProps","WAWebBaseModel","WAWebMedia","WAWebMediaData","WAWebMediaTypes","once"],(function(t,n,r,o,a,i,l){var e,s=r("once")(function(){return new d({id:"placeholder",isPlaceholder:!0})}),u=r("once")(function(){return new d({id:"createButton",isCreateButton:!0})}),c=(function(t){function n(){for(var e,n=arguments.length,r=new Array(n),a=0;at.index?1:0};var p=new m;l.FetchState=d,l.StickerPackCollection=m,l.StickerPackCollectionMd=p}),98); __d("WAWebStickerPackModel",["Promise","WALogger","WAWebBaseModel","WAWebMedia","WAWebMediaData","WAWebMediaTypes","WAWebStickerPackStickerCollection","err"],(function(t,n,r,o,a,i,l){var e,s,u,c="placeholder:",d="image/png",m=function(t){var e=t.index,n=t.page;return new _({id:""+c+e,index:e,page:n})},p=(function(t){function a(){for(var e,n=arguments.length,i=new Array(n),l=0;l=o("WAWebStickerConstants").STICKER_PACK_FETCH_TIMEOUT;if((a===!0||l)&&this.fetchState!==o("WAWebStickerCollection").FETCH_STATE.PENDING&&delete this._fetchPromise,this._fetchPromise)return this._fetchPromise;if(this.fetchState=o("WAWebStickerCollection").FETCH_STATE.PENDING,o("WAWebStickerPackModel").StickerPackModel.isPlaceholderId(this.stickerPackId))return this._fetchPromise=new(e||(e=n("Promise")))(r("WAWebNoop")),this._fetchPromise;var s;if(this.isFirstParty)this._firstPartyFetchTimestamp=o("WATimeUtils").unixTime(),s=o("WAWebFetchFirstPartyStickersAction").fetchFirstPartyStickers(this.stickerPackId);else return(e||(e=n("Promise"))).resolve();return this._fetchPromise=s.then(function(e){var t=Math.max(i.length||e.length);i._resetRange(0,t,e),i.fetchState=o("WAWebStickerCollection").FETCH_STATE.SUCCESS}).catch(function(){i.fetchState=o("WAWebStickerCollection").FETCH_STATE.ERROR}),this._fetchPromise},i._resetRange=function(t,n,r){var e=this;this._forEachInRange(t,n,function(n,o){var a=r[o-t];n?a?n.id===a.id?n.set(a):(e.remove(n),e.add(a)):e.remove(n):a&&e.add(a)})},i._forEachInRange=function(t,n,r){for(var e=t;et.index?1:0},l.default=s}),98); __d("WAWebStickerSearchCollection",["WALogger","WAWebBaseCollection","WAWebEmoji","WAWebEmojiKeywordToUnicode","WAWebSearchFirstPartyStickersAction","WAWebStickerModel","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u={HAPPY:["\uD83D\uDE02","\uD83E\uDD23","\uD83D\uDE00","\uD83D\uDE01","\uD83D\uDE06","\uD83D\uDE42","\uD83D\uDE07","\u263A\uFE0F","\uD83D\uDE04","\uD83D\uDE03"],LOVE:["\uD83D\uDE0D","\uD83D\uDE18","\u2764\uFE0F","\uD83D\uDC95","\uD83E\uDD70","\uD83D\uDE17","\uD83D\uDE19","\uD83D\uDE3B","\uD83D\uDC69\u200D\u2764\uFE0F\u200D\uD83D\uDC69","\uD83D\uDC90","\uD83D\uDC8C","\uD83D\uDC9B","\uD83D\uDC9A","\uD83D\uDC99","\uD83D\uDC9C","\uD83D\uDC93","\uD83D\uDC98","\uD83D\uDC8F","\uD83D\uDC91","\uD83C\uDF39","\uD83E\uDD1F","\uD83C\uDFE9"],GREETINGS:["\uD83D\uDC4B","\uD83D\uDE02","\uD83E\uDD23","\uD83D\uDE4F","\u270B","\uD83E\uDDD5","\uD83D\uDEB6\u200D\u2640\uFE0F","\uD83D\uDEB6","\uD83D\uDC60","\uD83E\uDD7E","\uD83D\uDE48","\uD83E\uDD9B","\uD83C\uDF3A","\u26A1","\uD83C\uDFAF","\uD83D\uDE84","\uD83D\uDE85","\uD83D\uDC92","\uD83D\uDED5","\uD83D\uDEE3\uFE0F","\uD83D\uDD49\uFE0F","\uD83D\uDD0A"],SAD:["\uD83D\uDE2D","\uD83D\uDE14","\uD83D\uDE22","\uD83D\uDE1E","\uD83D\uDE1F","\uD83D\uDE15","\uD83D\uDE41","\u2639\uFE0F","\uD83D\uDE16","\uD83D\uDE2B","\uD83D\uDE29","\uD83E\uDD7A","\uD83D\uDE25","\uD83D\uDE13","\uD83D\uDE2A","\uD83D\uDE3F","\uD83D\uDCA7","\uD83D\uDC94"],ANGRY:["\uD83D\uDE20","\uD83D\uDE21","\uD83D\uDE24","\uD83D\uDC7A","\uD83D\uDCA2","\uD83D\uDDEF\uFE0F","\uD83D\uDC7F"],CELEBRATE:["\uD83E\uDD73","\uD83E\uDD42","\uD83C\uDF88","\uD83C\uDF8A","\uD83C\uDF89"]},c=(function(t){function r(){for(var e,n=arguments.length,r=new Array(n),o=0;o0&&(yield o("WAPromiseDelays").delayMs(n))}try{yield o("WAExponentialBackoff").exponentialBackoff(m,function(t,n){return S().catch(function(r){if(r instanceof o("WAWebBackendErrors").ServerStatusCodeError)e:{if(r.statusCode===500){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager query failed, retriable error: ",", failCount ",""])),r.message,n),t(r);break e}break e}throw r})})}catch(e){if(o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Subscriptions manager pull failed, error: ",""])),e).verbose().sendLogs("Subscriptions manager run failed"),!(e instanceof o("WAWebBackendErrors").ServerStatusCodeError&&e.statusCode===500))return}o("WAWebUserPrefsSubscription").setNextSubscriptionQuery(Date.now()+p),yield o("WAPromiseDelays").delayMs(p),o("WAWebUserPrefsMeUser").getMaybeMePnUser()&&_()}}),f.apply(this,arguments)}function g(e,t){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){yield b(e),yield y(t)}),h.apply(this,arguments)}function y(e){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(o("WAWebBizGatingUtils").subscriptionFetchEnabled()){if(e.length===0)return;var t=e.map(function(e){var t,n;return{name:e.name,enabled:e.enabled,expirationTime:(t=e.expirationTime)!=null?t:null,limit:(n=e.limit)!=null?n:null}});yield o("WAWebSchemaFeatureFlag").getFeatureFlagTable().bulkCreateOrMerge(t)}}),C.apply(this,arguments)}function b(e){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(o("WAWebBizGatingUtils").subscriptionFetchEnabled()){if(e.length===0){o("WAWebSubscriptionCollection").SubscriptionCollection.reset();try{o("WAWebPremiumAccessEngine").update()}catch(e){o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["subscription sync: error PremiumAccessEngine ",""])),e).sendLogs("PremiumAccessEngine")}return}var t=["ACTIVE","FREE_TRIAL","IN_GRACE_PERIOD"],n=e.map(function(e){var n={id:e.id,isAutoRenewing:e.status==="ACTIVE",isDeactivated:!t.includes(e.status),expirationDate:e.expirationDate!==void 0?parseInt(e.expirationDate,10):void 0,creationTime:e.creationTime!==void 0?parseInt(e.creationTime,10):void 0,newMessageCappingEnabled:e.newMessageCappingEnabled!==void 0?e.newMessageCappingEnabled:void 0};return e.status==="CANCELED"&&(n.expirationDate||0)>new Date().getTime()/1e3&&(n.isDeactivated=!1),n});yield o("WAWebSchemaSubscription").getSubscriptionTable().bulkCreateOrMerge(n),o("WAWebSubscriptionCollection").SubscriptionCollection.add(n.map(function(e){return babelHelpers.extends({},e)}),{merge:!0});try{o("WAWebPremiumAccessEngine").update()}catch(e){o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["subscription sync: error PremiumAccessEngine ",""])),e).sendLogs("PremiumAccessEngine")}}}),v.apply(this,arguments)}function S(){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebUserPrefsMeUser").getMaybeMePnUser()){var e=yield o("WAWebFetchSubscriptions").fetchSubscriptions();if(e.type==="success"&&e.subscriptions!=null){var t;g(e.subscriptions,(t=e.featureFlags)!=null?t:[])}else throw o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["subscription sync: GraphQL fetch failed with type: ",""])),e.type).verbose().sendLogs("PremiumAccessEngine",{sampling:.01}),e.type==="error"||e.type==="graphql-error"?new(o("WAWebBackendErrors")).ServerStatusCodeError(500):r("err")("Failed to fetch subscriptions via GraphQL: "+e.type)}}),R.apply(this,arguments)}l.runSubscriptionsManager=_,l.applySubscriptionsAndFeatureFlags=g,l.query=S}),98); __d("WAWebPremiumAccessEngine",["Promise","WALogger","WAWebInitFromStorage","WAWebSubscriptionCollection","asyncToGeneratorRuntime","compactMap","err","gkx"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_="{}";r("gkx")("26258")||(_='{"CUSTOM_URL": ["WA_PREMIUM_1"], "MD_EXTENSION": ["WA_PREMIUM_1"]}');var f=new Map,g=new Map,h=!1,y=null;function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e===void 0&&(e=_),!h){yield o("WAWebInitFromStorage").restoreSubscriptions(),y=T(e);var t=I();t.forEach(function(e,t){g.set(t,{subscription:e[0].clone(),hasChanged:!1})}),h=!0,yield(p||(p=n("Promise"))).resolve(),f.forEach(function(e,t){var n=g.get(t);e.forEach(function(e){try{e((n==null?void 0:n.subscription)||null,(n==null?void 0:n.hasChanged)||!1)}catch(e){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: error calling handler during initialize for feature ",", error ",""])),t,e).sendLogs("PremiumAccessEngine")}})})}}),b.apply(this,arguments)}function v(t,r){var a=f.get(t);return a||(a=new Set,f.set(t,a)),a.add(r),h&&(p||(p=n("Promise"))).resolve().then(function(){var n=g.get(t);try{r((n==null?void 0:n.subscription)||null,(n==null?void 0:n.hasChanged)||!1)}catch(n){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: error calling handler during listen for feature ",", error ",""])),t,n).sendLogs("PremiumAccessEngine")}}),function(){var e=f.get(t);e&&e.delete(r)}}function S(e){var t,n;if(!h)throw r("err")("Premium access engine getFeatureFlagState() for feature "+e+" called before initialize()");return(t=(n=g.get(e))==null?void 0:n.subscription)!=null?t:null}function R(e){var t;try{t=S(e)}catch(t){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(['isFeatureFlagEnabled: trying to read feature "','" before PremiumAccessEngine has been initialized, error ',""])),e,t).sendLogs("isFeatureFlagEnabled")}return t==null?!1:!t.isDeactivated||!1}function L(e){return h?R(e):!1}function E(){if(!h)throw r("err")("Premium access engine update() called before initialize()");var e=I(),t=new Set;g.forEach(function(n,r){if(!e.has(r))n.hasChanged=!0,n.subscription=null,k(r),t.add(r);else{var o,a,i=(o=e.get(r))==null?void 0:o[0];(a=n.subscription)!=null&&a.equal(i)?n.hasChanged&&(n.hasChanged=!1,k(r)):(n.hasChanged=!0,n.subscription=i==null?void 0:i.clone(),k(r))}}),e.forEach(function(e,t){g.has(t)||(g.set(t,{hasChanged:!0,subscription:e[0].clone()}),k(t))}),t.forEach(function(e){return g.delete(e)})}function k(e){var t=f.get(e),r=g.get(e);t&&r&&t.forEach(function(t){(p||(p=n("Promise"))).resolve().then(function(){t(r.subscription,r.hasChanged)}).catch(function(t){o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: error calling handler for feature ",", error ",""])),e,t).sendLogs("PremiumAccessEngine")})})}function I(){var e=new Map;return y&&Object.entries(y).forEach(function(t){var n=t[0],a=t[1];if(!(n!=="MD_EXTENSION"&&n!=="CUSTOM_URL")){var i=r("compactMap")(a,function(e){return o("WAWebSubscriptionCollection").SubscriptionCollection.get(e)});i.length>0&&(i.length>1&&D(i),e.set(n,i))}}),e}function T(e){var t=!1,n=JSON.parse(e),r=Object.keys(n);if(r.length>0){var a=[],i=[];r.forEach(function(e){var r=n[e];Array.isArray(r)||(t=!0,a.push(e)),r.length===0&&(t=!0,i.push(e))}),a.length>0&&o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: invalid config for "," keys, value is not an array => ",""])),a.length,a.slice(0,3)).sendLogs("PremiumAccessEngine"),i.length>0&&o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["PremiumAccessEngine: invalid config for "," keys, value is empty array => ",""])),i.length,i.slice(0,3)).sendLogs("PremiumAccessEngine")}else t=!0;return t?null:n}function D(e){e.sort(function(e,t){return e.isDeactivated&&!t.isDeactivated?1:!e.isDeactivated&&t.isDeactivated?-1:e.isDeactivated&&t.isDeactivated?0:e.isAutoRenewing&&!t.isAutoRenewing?-1:t.isAutoRenewing&&!e.isAutoRenewing?1:!e.isAutoRenewing&&!t.isAutoRenewing?(t.expirationDate||0)-(e.expirationDate||0):0})}l.initialize=C,l.listen=v,l.getFeatureFlagState=S,l.isFeatureFlagEnabled=R,l.isInitializedAndFeatureFlagEnabled=L,l.update=E}),98); __d("WAWebSubscriptionModel",["WAWebBaseModel","lodash"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;ar?-1:1:t.title0;n?this.$Call$p_3.set(e,{isReconnecting:n,option:o}):this.$Call$p_3.delete(e);var i=this.$Call$p_3.size>0;!a&&i?this.$Call$p_8():a&&!i&&this.$Call$p_9(),this.trigger("change:peerReconnecting"),r("WAWebCallCollection").trigger("change:peerReconnecting")},i.$Call$p_8=function(){var e=this;this.networkOfflineTimer!=null&&self.clearTimeout(this.networkOfflineTimer),this.networkOfflineTimer=self.setTimeout(function(){e.$Call$p_10()},3e4)},i.$Call$p_9=function(){this.networkOfflineTimer!=null&&(self.clearTimeout(this.networkOfflineTimer),this.networkOfflineTimer=null)},i.$Call$p_10=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["voip: Reconnection timeout - ending call after 30 seconds"]))),this.networkOfflineTimer=null,!this.isAnyPeerReconnecting()){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["voip: Reconnection timeout fired but no longer in reconnecting state"])));return}try{var e=yield o("WAWebVoipStackInterface").getVoipStackInterface();e!=null&&e.type==="web"&&(yield e.endCall(o("WAWebVoipSignalingEnums").EndCallReason.Timeout,!0))}catch(e){o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["voip: endCall failed during reconnection timeout: ",""])),String(e))}var t=r("WAWebCallCollection").activeCall;t!=null&&(o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["voip: Forcing call cleanup after reconnection timeout"]))),t.setState(o("WAWebVoipWaCallEnums").CallState.CallStateEnding),r("WAWebCallCollection").setActiveCall(null),r("WAWebCallCollection").setIsInConnectedCall(!1))});function t(){return e.apply(this,arguments)}return t})(),i.getPeerReconnectingState=function(t){return this.$Call$p_3.get(t.toString())},i.isAnyPeerReconnecting=function(){return this.$Call$p_3.size>0},i.setScreenShareState=function(t,n){o("WAWebUserPrefsMeUser").isMeAccount(t)?this.$Call$p_6=n:this.$Call$p_7.set(t,n),this.trigger("change:screenShareStates")},i.isSelfScreenSharing=function(){return this.$Call$p_6===o("WAWebVoipWaCallEnums").ScreenShareState.Started},i.isAnyPeerScreenSharing=function(){return new Set(this.$Call$p_7.values()).has(o("WAWebVoipWaCallEnums").ScreenShareState.Started)},i.getScreenSharingPeerJid=function(){for(var e of this.$Call$p_7){var t=e[0],n=e[1];if(n===o("WAWebVoipWaCallEnums").ScreenShareState.Started)return t}return null},i.setReactionForParticipant=function(t,n){var e=t.toString();this.$Call$p_4.set(e,n),this.trigger("change:reactionStates")},i.clearReactionForParticipant=function(t){var e=t.toString();this.$Call$p_4.delete(e),this.trigger("change:reactionStates")},i.getReactionForParticipant=function(t){return this.$Call$p_4.get(t.toString())},i.setRaisedHandForParticipant=function(t){var e=t.toString();this.$Call$p_5.set(e,!0),this.trigger("change:raisedHandStates")},i.clearRaisedHandForParticipant=function(t){var e=t.toString();this.$Call$p_5.delete(e),this.trigger("change:raisedHandStates")},i.isHandRaisedForParticipant=function(t){var e;return(e=this.$Call$p_5.get(t.toString()))!=null?e:!1},i.$Call$p_2=function(){if(!r("WAWebEnvironment").isWindows){var e=this.getState();if(!(!o("WAWebConnModel").Conn.tosShowCallNotification||!this.peerJid))if(!this.offerReceivedWhileOffline&&e===o("WAWebVoipWaCallEnums").CallState.ReceivedCall){o("WAWebCmd").Cmd.alertCall(this.peerJid,this.id,this.isVideo,this.isGroup,this.isSilenced);var t=o("WAWebPttAudioChannels").MainAudioChannel.claim(this,r("WAWebNoop"));t()}else o("WAWebCmd").Cmd.cancelCall(this.peerJid)}},i.getCollection=function(){return r("WAWebCallCollection")},a})(o("WAWebBaseModel").BaseModel);m.Proxy="call";var p=o("WAWebBaseModel").defineModel(m);l.default=p}),98); __d("WAWebVoipJsonParserNative",[],(function(t,n,r,o,a,i){"use strict";function e(e){try{return JSON.parse(e)}catch(e){return null}}i.parseJsonFromNativeBridge=e}),66); __d("WAWebVoipJsonParserPayloads",["$InternalEnum"],(function(t,n,r,o,a,i){"use strict";var e=n("$InternalEnum").Mirrored(["Call","JoinableCall"]),l=n("$InternalEnum")({Create:1,Update:2,Delete:3});i.FieldstatsPayloadType=e,i.UpdateJoinableCallLogType=l}),66); __d("WAWebVoipJsonParsersWeb",["WACamelCase","WALogger","WATimeUtils","WAWebUserPrefsMeUser","WAWebVoipJsonParserNative","WAWebVoipJsonParserPayloads","WAWebWamCodegenUtils","WAWebWidFactory","compactMap","err","isStringNullOrEmpty","nullthrows"],(function(t,n,r,o,a,i,l){"use strict";var e,s,u,c={parseCallStateChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid call ending data");var n=c.parseCallInfo(JSON.stringify(e.call_info));return{CallState:n.callState,call_info:n}},parseUpdateJoinableCallLogData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid update joinable call log data");var n=e.call_summary;return{CallId:e.call_id,CallCreatorDeviceJid:p(e.call_creator_device_jid),Type:e.type,InitialPeerJid:p(e.initial_peer_jid),GroupJid:p(e.group_jid),IsCaller:e.is_caller,VideoEnabled:e.video_enabled,IsFromOffer:e.is_from_offer,CallLinkToken:e.link_token,ScheduledId:e.scheduled_id,IsLightweight:e.is_lightweight,NumParticipants:e.num_participants,CallParticipantInfos:e.participant_infos.map(function(e){return{jid:m(e.jid),result:e.state}}),CallSummary:n!=null?{CallCreatorJid:p(n.call_creator_jid),CallId:n.call_id,IsVideo:n.is_video_call,CallDuration:n.call_duration,UsersCount:n.users_count,Users:n.users.map(function(e){return{Jid:p(e.jid),PhoneJid:p(e.phone_jid),State:e.state}})}:null,Result:e.call_log_result,LinkCreatorJid:p(e.link_creator_jid)}},parseRejectedDecryptionFailureData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid call ending data");return babelHelpers.extends({},e,{PeerDeviceJid:m(e.PeerDeviceJid)})},parseSyncDeviceData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null||e.sync_devices==null)throw r("err")("Invalid sync device data");if(!Array.isArray(e.sync_devices))throw r("err")("Invalid sync device data: expected array");return e.sync_devices.map(function(e){return{PHash:e.phash,UserRawJid:o("WAWebWidFactory").createWid(e.user_raw_jid)}})},parseCallEndingData:function(t){var e,n=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(n==null)throw r("err")("Invalid call ending data");return{peerJid:m(n.peer_jid),fromMe:n.from_me,groupJid:p(n.group_jid),callId:n.call_id,callLinkToken:n.call_link_token,isCallLink:n.is_call_link,scheduledId:n.scheduled_id,startTime:o("WATimeUtils").castToUnixTime(n.start_time),connectTime:n.connect_time!=null?Math.floor(n.connect_time/1e3):null,endTime:o("WATimeUtils").castToUnixTime(n.end_time),result:n.result,videoCall:n.video_call,participantEntries:n.participant_entries.map(function(e){return{jid:m(e.jid),result:e.result}}),callCreatorJid:p(n.call_creator_jid),initialPeerJid:p(n.initial_peer_jid),timeSeriesPath:n.time_series_path,userRatingInterval:(e=n.user_rating_interval)!=null?e:-1}},parseCallMissedData:function(t){var e,n,a,i,l,s=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(s==null)throw r("err")("Invalid call missed data");var u=(e=s.group_info)!=null&&e.participants?s.group_info.participants.map(function(e){return{jid:m(e.user_jid),result:e.state}}):(n=(a=s.call_participant_infos)==null?void 0:a.map(function(e){return{jid:m(e.jid),result:e.state}}))!=null?n:[];return{CallId:s.call_id,PeerUserJid:p(s.peer_user_jid),GroupJid:p(s.group_jid),IsVideoCall:s.is_video_call,GroupInfo:s.group_info?{Participants:(i=s.group_info.participants)==null?void 0:i.map(function(e){return{UserJid:m(e.user_jid),State:e.state}})}:null,CallParticipantInfos:u,TimeElapsedSinceCallOffer:o("WATimeUtils").castToUnixTime((l=s.time_elapsed_since_call_offer)!=null?l:0)}},parseUpdate1to1CallLogData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid update 1to1 call log data");return{CallId:e.call_id,Result:e.result,PeerJid:m(e.peer_jid)}},parseGroupInfoChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid group info changed data");var n=null;return e.participants!=null&&(n=e.participants.map(function(e){return{participant:m(e.jid),outcome:e.state,videoState:e.video_state,isMuted:e.is_muted}})),{CallId:e.call_id,CallParticipants:n}},parseSpeakerStatusChangedData:function(t){var e,n,a=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(a==null)throw r("err")("Invalid speaker status changed data");return{CallId:a.call_id,Participants:(e=(n=a.participants)==null?void 0:n.map(function(e){return{Jid:m(e.jid),AudioLevel:e.audio_level}}))!=null?e:[]}},parseRelayListUpdateData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid relay list update data");return{event_type:e.event_type,num_relays:e.num_relays,relays:e.relays,relay_key:e.relay_key,relay_tokens:e.relay_tokens,auth_tokens:e.auth_tokens}},parseFieldstatsData:function(n){var t=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(n);if(t==null)throw r("err")("Invalid field stats data");if(t.call_ended_stats!=null){var a=Object.entries(t.call_ended_stats),i=Object.fromEntries(r("compactMap")(a,function(t){var n=t[0],a=t[1],i=n==="abtest_bucket"?"callTestBucket":n==="peer_raw_jid"?null:r("WACamelCase")(n,{treatNumbersAsWordBoundaries:!1});if(i==null)return null;try{var l=o("WAWebWamCodegenUtils").metrics.getEvent("Call",i);return l.type==="boolean"?[i,!!a]:[i,a]}catch(t){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["voip: fieldstats ready: metric undefined for ",""])),i),null}}));return{eventType:o("WAWebVoipJsonParserPayloads").FieldstatsPayloadType.Call,stats:i,uploadInRealtime:t.upload_in_realtime}}if(t.joinable_call_stats!=null){var l=Object.entries(t.joinable_call_stats),u=Object.fromEntries(r("compactMap")(l,function(e){var t=e[0],n=e[1],a=r("WACamelCase")(t,{treatNumbersAsWordBoundaries:!1});try{var i=o("WAWebWamCodegenUtils").metrics.getEvent("JoinableCall",a);return i.type==="boolean"?[a,!!n]:[a,n]}catch(e){return o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["voip: fieldstats ready: metric undefined for ",""])),a),null}}));return{eventType:o("WAWebVoipJsonParserPayloads").FieldstatsPayloadType.JoinableCall,stats:u,uploadInRealtime:t.upload_in_realtime}}throw r("err")("Invalid field stats data: no stats object found")},parseVideoStateChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid video state changed data");var n=e.is_self;if(n==null&&e.jid!=null){var a=p(e.jid);n=a?o("WAWebUserPrefsMeUser").isMeAccount(a):void 0}return{videoState:e.video_state,isSelf:n,userJid:e.jid?p(e.jid):null,callMediaStateChanged:e.call_media_state_changed}},parsePeerVideoPermissionChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid peer video permission changed data");return{isBannerVisible:e.is_banner_visible,jid:r("nullthrows")(p(e.jid)),videoState:e.video_state}},parseCallRejectReceivedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid call reject received data");return{callId:e.call_id,peerUserJid:m(e.peer_user_jid),reason:e.reason}},parseCallFatalData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid call fatal data");return{reasonCode:e.reason_code}},parseRelayBindsFailedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid relay binds failed data");return{selfBadAsn:e.self_bad_asn}},parseAudioDriverRestartData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid audio driver restart data");return{reason:e.reason,audioRestartCount:e.audio_restart_count,audioRestartBeforeFallbackCount:e.audio_restart_before_fallback_count,isDueToSilenceDetected:e.is_due_to_silence_detected}},parseCallInfo:function(t){var e,n=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(n==null)throw r("err")("Invalid call info data");return{callState:n.call_state,callId:n.call_id,globalCallId:n.global_call_id,relayCallUuid:n.relay_call_uuid,selfParticipantUuid:n.self_participant_uuid,peerJid:p(n.peer_jid),initialPeerJid:p(n.initial_peer_jid),creatorJid:p(n.creator_jid),creatorDeviceJid:p(n.creator_device_jid),isCaller:n.is_caller,callDuration:n.call_duration,callActiveDuration:n.call_active_duration,audioDuration:n.audio_duration,videoDuration:n.video_duration,callEnding:n.call_ending,callEndedByMe:n.call_ended_by_me,callResult:n.call_result,callSetupErrorType:n.call_setup_error_type,bytesSent:n.bytes_sent,bytesReceived:n.bytes_received,videoEnabledAtCallStart:n.video_enabled_at_call_start,videoEnabled:n.video_enabled,videoCaptureStarted:n.video_capture_started,videoPreviewStarted:n.video_preview_started,avAutoAcceptEnabled:n.av_auto_accept_enabled,avDowngradeEnabled:n.av_downgrade_enabled,groupAvUpgradable:n.group_av_upgradable,selfCameraFrontFacing:n.self_camera_front_facing,aecMode:n.aec_mode,isGroupCall:n.is_group_call,isUpgradedGroupCallBeforeConnected:n.is_upgraded_group_call_before_connected,enableGroupCall:n.enable_group_call,isGroupCallCreatedOnServer:n.is_group_call_created_on_server,isJoinableGroupCall:n.is_joinable_group_call,initialGroupTransactionId:n.initial_group_transaction_id,connectedLimit:n.connected_limit,participantCount:n.participant_count,participants:n.participants.map(_),canInviteNewParticipant:n.can_invite_new_participant,canSwitchAudioVideo:n.can_switch_audio_video,rotateVideo:n.rotate_video,callWaitingInfo:{hasWaitingCall:n.call_waiting_info.has_waiting_call,waitingCallId:n.call_waiting_info.waiting_call_id,waitingPeerJid:p(n.call_waiting_info.waiting_peer_jid),waitingGroupJid:p(n.call_waiting_info.waiting_group_jid),waitingIsVideo:n.call_waiting_info.waiting_is_video},groupJid:p(n.group_jid),linkToken:(e=n.link_token)!=null?e:"",scheduledId:n.scheduled_id,isLightweight:n.is_lightweight,isPhashBased:n.is_phash_based,phash:n.phash,canRingAll:n.can_ring_all,offerEpochTimeMs:n.offer_epoch_time_ms,isBcall:n.is_bcall,isBcallBroadcaster:n.is_bcall_broadcaster,isBotCall:n.is_bot_call,vcExtendable:n.vc_extendable,isWaitingRoomEnabled:n.is_waiting_room_enabled,isWaitingRoomAdmin:n.is_waiting_room_admin,isInWaitingRoom:n.is_in_waiting_room}},parseReactionStateChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid reaction state changed data");return{jid:m(e.jid),callReaction:e.call_reaction,reactionState:e.reaction_state}},parseScreenShareStateChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid screen share state changed data");return{state:e.state,reason:e.reason,sharer_version:e.sharer_version,sharer_jid:m(e.screen_sharer_jid)}},parseRxTrafficStateForPeerChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid rx traffic state for peer changed data");return{jid:m(e.jid),isStateOn:e.is_state_on,reconnectingOption:e.reconnecting_option}},parseNetHealthStatusChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid net health status changed data");return{currentState:e.current_state,previousState:e.previous_state,shouldSoundAlert:e.should_sound_alert,shouldSendPoorBanner:e.should_send_poor_banner,shouldSendNoNetworkBanner:e.should_send_no_network_banner,enableSubMessage:e.enable_sub_message,maxBannerDuration:e.max_banner_duration}},parseCallLinkStateChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid call link state changed data");return{callLinkState:e.call_link_state,oldCallLinkState:e.old_call_link_state,creatorJid:p(e.creator_jid),isEventLink:e.is_event_link,linkToken:e.link_token,videoEnabled:e.video_enabled,isLidCall:e.is_lid_call,self:_(e.self)}},parseRaiseHandStateChangedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null)throw r("err")("Invalid raise hand state changed data");return{jid:m(e.jid),isHandRaised:e.is_hand_raised}},parseCallOfferNackedData:function(t){var e=o("WAWebVoipJsonParserNative").parseJsonFromNativeBridge(t);if(e==null||e.errors==null)throw r("err")("Invalid call offer nacked data");var n=e.errors.length>0&&e.errors.every(function(e){return e.error_code!==207&&e.error_code!==0});return{errors:e.errors.map(function(e){return{errorCode:e.error_code,errorJid:p(e.error_jid)}}),isCompleteNack:n}}},d=c;function m(e){return r("nullthrows")(p(e),"createVoipJid: received unexpected null")}function p(e){if(!e||r("isStringNullOrEmpty")(e.raw_jid))return null;try{return o("WAWebWidFactory").createWid(e.raw_jid)}catch(e){return o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["createVoipJid: failed to create wid from raw jid"]))).sendLogs("create-voip-jid-failed"),null}}function _(e){return{jid:m(e.jid),phoneUserJid:p(e.phone_user_jid),state:e.state,orderId:e.order_id,isSelf:e.is_self,isMuted:e.is_muted,muteRequested:e.mute_requested,isInterrupted:e.is_interrupted,arePeersInterrupted:e.are_peers_interrupted,isBackgrounded:e.is_backgrounded,videoRenderStarted:e.video_render_started,videoDecodeStarted:e.video_decode_started,videoDecodePaused:e.video_decode_paused,videoCodecPaused:e.video_codec_paused,videoState:e.video_state,videoRenderingState:e.video_rendering_state,videoWidth:e.video_width,videoHeight:e.video_height,videoOrientation:e.video_orientation,deviceOrientation:e.device_orientation,isAudioVideoSwitchEnabled:e.is_audio_video_switch_enabled,isAudioVideoSwitchSupported:e.is_audio_video_switch_supported,callGridRank:e.call_grid_rank,speakerRank:e.speaker_rank,isInvitedBySelf:e.is_invited_by_self,isCallOfferCancelled:e.is_call_offer_cancelled,isRerungBySelf:e.is_rerung_by_self,rxConnecting:e.rx_connecting,rxTimedout:e.rx_timedout,rxAudioPacketCount:e.rx_audio_packet_count,speakerStatus:e.speaker_status,isMuteable:e.is_muteable,isRxSubscribed:e.is_rx_subscribed,isOnScreen:e.is_on_screen,isScreenShared:e.is_screen_shared,updateScreenSharePending:e.update_screen_share_pending,sharerVersion:e.sharer_version,callLinkIsRemovable:e.call_link_is_removable,removeRequested:e.remove_requested,networkHealthStatus:e.network_health_status,isDominantSpeaker:e.is_dominant_speaker,callReaction:e.call_reaction,isHandRaised:e.is_hand_raised,isPinnedInViewBySelf:e.is_pinned_in_view_by_self,audioLevel:e.audio_level}}l.default=d}),98); __d("WAWebCallTimer.react",["fbt","WALogger","WAWebCallCollection","WAWebClock","WAWebVoipJsonParsersWeb","WAWebVoipStackInterface","WAWebVoipWaCallEnums","asyncToGeneratorRuntime","react","stylex","useWAWebEventTargetValue"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u,c,d,m=d||(d=o("react")),p=u||(u=r("react")),_=m.useEffect,f=m.useState,g=null;function h(){return g||(g={startTime:null,intervalId:null,subscribers:new Set}),g}function y(e){g!=null&&(g.startTime=e,g.subscribers.forEach(function(e){return e()}))}function C(){var e;((e=g)==null?void 0:e.intervalId)!=null&&window.clearInterval(g.intervalId),g=null}var b={timerContainer:{minWidth:"x2c5eco",fontSize:"x1f6kntn",fontWeight:"xo1l8bm",textAlign:"x2b8uid",$$css:!0}};function v(t){var a=t.callState,i=t.xstyle,l=f(function(){if(a!==o("WAWebVoipWaCallEnums").CallState.CallActive)return null;var e=g;if((e==null?void 0:e.startTime)!=null){var t=e.startTime;return Math.floor((Date.now()-t)/1e3)}return null}),u=l[0],d=l[1];_(function(){if(a!==o("WAWebVoipWaCallEnums").CallState.CallActive){C();return}var t=!0,i=h();i.startTime==null&&n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var n=yield o("WAWebVoipStackInterface").getVoipStackInterface();if(!t)return;if((n==null?void 0:n.type)==="web"){var a=yield n.getCallInfo();if(!t)return;if(a){var l=r("WAWebVoipJsonParsersWeb").parseCallInfo(a),s=Math.floor(l.callActiveDuration/1e3),u=Date.now()-s*1e3;y(u),t&&d(s)}}}catch(t){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["WAWebCallTimer: Failed to get initial call duration"]))),i.startTime==null&&y(Date.now())}})();var l=function(){var e=i.startTime;if(e!=null){var t=Math.floor((Date.now()-e)/1e3);d(t)}};return i.subscribers.add(l),i.intervalId==null&&(i.intervalId=window.setInterval(function(){i.subscribers.forEach(function(e){return e()})},1e3)),function(){t=!1,i.subscribers.delete(l),i.subscribers.size===0&&C()}},[a]);var m=r("useWAWebEventTargetValue")(r("WAWebCallCollection").activeCall,"change:peerReconnecting",function(){var e=r("WAWebCallCollection").activeCall;return(e==null?void 0:e.peerJid)==null?null:e.getPeerReconnectingState(e.peerJid)});if(a!==o("WAWebVoipWaCallEnums").CallState.CallActive||u==null)return null;var v=(m==null?void 0:m.isReconnecting)===!0&&(m==null?void 0:m.option)===o("WAWebVoipWaCallEnums").ReconnectingOption.Text;return p.jsx("div",babelHelpers.extends({},(c||(c=r("stylex"))).props(b.timerContainer,i),{"data-testid":void 0,role:"timer",children:v?s._(/*BTDS*/"Reconectando\u2026"):o("WAWebClock").Clock.durationStr(u)}))}v.displayName=v.name+" [from "+i.id+"]",l.default=v}),226); __d("WAWebCallLogUtils",["fbt","WALogger","WANullthrows","WATimeUtils","WAWebBotUtils","WAWebCallLogMsgData.flow","WAWebCallTimer.react","WAWebFindChatAction","WAWebFrontendMsgGetters","WAWebLid1X1MigrationGating","WAWebMsgGetters","WAWebMsgKey","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebVoipWaCallEnums","WAWebWaitForInitialChatsSynced","WAWebWidFactory","asyncToGeneratorRuntime","react"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u,c=u||(u=o("react"));function d(e){var t;if(e==null||e.length===0)return!1;var n=e.some(function(e){return e.participant.isLid()}),r=n?o("WAWebUserPrefsMeUser").getMeLidUserOrThrow():o("WAWebUserPrefsMeUser").getMePnUserOrThrow();return((t=e.find(function(e){var t;return(t=e.participant)==null?void 0:t.equals(r)}))==null?void 0:t.outcome)===o("WAWebVoipWaCallEnums").CallParticipantState.Connected}function m(e,t,n,r,a){return(e||!t)&&!n&&r!==o("WAWebCallLogMsgData.flow").CallOutcome.AcceptedElsewhere&&(a==null||a===o("WAWebCallLogMsgData.flow").CallOutcome.Missed||a===o("WAWebCallLogMsgData.flow").CallOutcome.Rejected||a===o("WAWebCallLogMsgData.flow").CallOutcome.Canceled)}function p(e,t){return e===o("WAWebVoipWaCallEnums").CallState.Calling?s._(/*BTDS*/"Llamando\u2026"):e===o("WAWebVoipWaCallEnums").CallState.PreacceptReceived?s._(/*BTDS*/"Llamando\u2026"):e===o("WAWebVoipWaCallEnums").CallState.ReceivedCall||e===o("WAWebVoipWaCallEnums").CallState.ReceivedCallWithoutOffer?t!=null&&t.isVideoCall?s._(/*BTDS*/"Videollamada"):s._(/*BTDS*/"Llamada"):e===o("WAWebVoipWaCallEnums").CallState.AcceptSent||e===o("WAWebVoipWaCallEnums").CallState.AcceptReceived?s._(/*BTDS*/"Conectando\u2026"):e===o("WAWebVoipWaCallEnums").CallState.CallActive?c.jsx(r("WAWebCallTimer.react"),{callState:e}):e===o("WAWebVoipWaCallEnums").CallState.ConnectedLonely||e===o("WAWebVoipWaCallEnums").CallState.Rejoining?s._(/*BTDS*/"Waiting for others..."):e==null?s._(/*BTDS*/"Llamada finalizada"):e!=null?o("WAWebVoipWaCallEnums").CallState.getName(e):"unknown"}p.displayName=p.name+" [from "+i.id+"]";function _(e){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t.callCreatorWid,a=t.callId,i=t.groupJid,l=t.peerWid,s=t.participants,u=s===void 0?[]:s,c,d,m=o("WAWebViewMode.flow").ViewModeType.VISIBLE,p=yield g({callDestinationWid:o("WAWebWidFactory").asUserWidOrThrow(n)}),_=o("WAWebUserPrefsMeUser").isMeAccount(p),f=u.filter(function(e){return e!=null&&!o("WAWebUserPrefsMeUser").isMeAccount(e)});if(i!=null)c=i,d=p;else if(!_)c=p;else if(f.length===1){var h=f[0];c=yield g({callDestinationWid:o("WAWebWidFactory").asUserWidOrThrow(h)})}else l!=null?c=yield g({callDestinationWid:o("WAWebWidFactory").asUserWidOrThrow(l)}):(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["voip: getCallLogTargetDetails: call log message will be added to self chat"]))),c=p,m=f.length>0?o("WAWebViewMode.flow").ViewModeType.CALL_LOG_AD_HOC_GROUP_CALL:o("WAWebViewMode.flow").ViewModeType.HIDDEN);return{msgKeyId:a!=null?a:yield r("WAWebMsgKey").newId(),fromMe:_,callCreatorUserWid:p,chatId:c,participant:d,viewMode:m}}),f.apply(this,arguments)}function g(e){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.callDestinationWid,n=e.groupJid,r=t,a=!r.isLid()&&o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated(),i=!n&&(r.isLid()||a);if(i){yield o("WAWebWaitForInitialChatsSynced").waitForInitialChatsSynced();var l=yield o("WAWebFindChatAction").findOrCreateLatestChat(t,"voipCallLog"),s=l.chat;r=o("WAWebWidFactory").asUserWidOrThrow(s.id)}return r}),h.apply(this,arguments)}function y(e){switch(e){case 0:return o("WAWebCallLogMsgData.flow").CallOutcome.Completed;case 1:return o("WAWebCallLogMsgData.flow").CallOutcome.Rejected;case 2:return o("WAWebCallLogMsgData.flow").CallOutcome.Canceled;case 3:return o("WAWebCallLogMsgData.flow").CallOutcome.AcceptedElsewhere;case 4:case 6:case 9:return o("WAWebCallLogMsgData.flow").CallOutcome.Missed;case 5:case 7:case 8:return o("WAWebCallLogMsgData.flow").CallOutcome.Failed;case 10:return o("WAWebCallLogMsgData.flow").CallOutcome.Ongoing;default:return o("WAWebCallLogMsgData.flow").CallOutcome.Unknown}}function C(e){switch(e){case 0:return o("WAWebVoipWaCallEnums").CallParticipantState.Connected;case 1:return o("WAWebVoipWaCallEnums").CallParticipantState.Rejected;case 2:return o("WAWebVoipWaCallEnums").CallParticipantState.Terminated;case 4:case 6:case 9:return o("WAWebVoipWaCallEnums").CallParticipantState.Terminated;case 10:return o("WAWebVoipWaCallEnums").CallParticipantState.Connected;case 3:case 5:case 7:case 8:return o("WAWebVoipWaCallEnums").CallParticipantState.Invalid;default:return o("WAWebVoipWaCallEnums").CallParticipantState.Invalid}}function b(e,t){switch(e){case o("WAWebVoipWaCallEnums").CallResult.Connected:return o("WAWebCallLogMsgData.flow").CallOutcome.Completed;case o("WAWebVoipWaCallEnums").CallResult.Missed:case o("WAWebVoipWaCallEnums").CallResult.MissedNotificationsMuted:return o("WAWebCallLogMsgData.flow").CallOutcome.Missed;case o("WAWebVoipWaCallEnums").CallResult.Declined:return o("WAWebCallLogMsgData.flow").CallOutcome.Rejected;case o("WAWebVoipWaCallEnums").CallResult.Canceled:return o("WAWebCallLogMsgData.flow").CallOutcome.Canceled;case o("WAWebVoipWaCallEnums").CallResult.AcceptedElsewhere:return o("WAWebCallLogMsgData.flow").CallOutcome.AcceptedElsewhere;case o("WAWebVoipWaCallEnums").CallResult.Unavailable:return t!=null&&t>0?o("WAWebCallLogMsgData.flow").CallOutcome.Failed:o("WAWebCallLogMsgData.flow").CallOutcome.Unknown;case o("WAWebVoipWaCallEnums").CallResult.Undefined:return o("WAWebCallLogMsgData.flow").CallOutcome.Unknown}}function v(e,t){switch(e){case o("WAWebVoipWaCallEnums").CallLogResult.Connected:case o("WAWebVoipWaCallEnums").CallLogResult.ConnectedLonely:return o("WAWebCallLogMsgData.flow").CallOutcome.Completed;case o("WAWebVoipWaCallEnums").CallLogResult.Missed:return o("WAWebCallLogMsgData.flow").CallOutcome.Missed;case o("WAWebVoipWaCallEnums").CallLogResult.Rejected:return o("WAWebCallLogMsgData.flow").CallOutcome.Rejected;case o("WAWebVoipWaCallEnums").CallLogResult.Canceled:return o("WAWebCallLogMsgData.flow").CallOutcome.Canceled;case o("WAWebVoipWaCallEnums").CallLogResult.AcceptedElsewhere:return o("WAWebCallLogMsgData.flow").CallOutcome.AcceptedElsewhere;case o("WAWebVoipWaCallEnums").CallLogResult.Unavailable:return t!=null&&t>0?o("WAWebCallLogMsgData.flow").CallOutcome.Failed:o("WAWebCallLogMsgData.flow").CallOutcome.Unknown;case o("WAWebVoipWaCallEnums").CallLogResult.Failed:return o("WAWebCallLogMsgData.flow").CallOutcome.Failed;case o("WAWebVoipWaCallEnums").CallLogResult.Invalid:return o("WAWebCallLogMsgData.flow").CallOutcome.Unknown}}function S(e){switch(e){case o("WAWebVoipWaCallEnums").CallState.None:return o("WAWebCallLogMsgData.flow").CallOutcome.Completed;case o("WAWebVoipWaCallEnums").CallState.CallActiveElseWhere:return o("WAWebCallLogMsgData.flow").CallOutcome.AcceptedElsewhere;case o("WAWebVoipWaCallEnums").CallState.Calling:case o("WAWebVoipWaCallEnums").CallState.PreacceptReceived:case o("WAWebVoipWaCallEnums").CallState.ReceivedCall:case o("WAWebVoipWaCallEnums").CallState.AcceptSent:case o("WAWebVoipWaCallEnums").CallState.AcceptReceived:case o("WAWebVoipWaCallEnums").CallState.CallActive:case o("WAWebVoipWaCallEnums").CallState.ReceivedCallWithoutOffer:case o("WAWebVoipWaCallEnums").CallState.Rejoining:case o("WAWebVoipWaCallEnums").CallState.Link:case o("WAWebVoipWaCallEnums").CallState.ConnectedLonely:case o("WAWebVoipWaCallEnums").CallState.PreCalling:case o("WAWebVoipWaCallEnums").CallState.CallStateEnding:case o("WAWebVoipWaCallEnums").CallState.CallBCallStarting:return o("WAWebCallLogMsgData.flow").CallOutcome.Ongoing}}function R(e){switch(e){case 1:return"scheduled";case 2:return"privacy";case 3:return"lightweight";default:return}}function L(e,t){return e!=null&&t!=null&&e.isSameAccountAndAddressingMode(t)}function E(e,t){return e.length!==t.length?!1:e.every(function(e){return t.some(function(t){return L(e,t)})})}function k(e,t){var n,r,a,i,l=(n=o("WAWebMsgGetters").getIsCallLink(e))!=null?n:!1,s=(r=o("WAWebMsgGetters").getIsCallLink(t))!=null?r:!1;if(l||s)return!1;var u=o("WAWebMsgGetters").getSender(e),c=o("WAWebMsgGetters").getSender(t);if(!L(u,c))return!1;var d=o("WAWebMsgGetters").getTo(e),m=o("WAWebMsgGetters").getTo(t);if(!L(d,m))return!1;var p=o("WAWebMsgGetters").getIsVideoCall(e)===o("WAWebMsgGetters").getIsVideoCall(t)&&o("WAWebMsgGetters").getIsSentByMe(e)===o("WAWebMsgGetters").getIsSentByMe(t)&&o("WAWebMsgGetters").getIsGroupCall(e)===o("WAWebMsgGetters").getIsGroupCall(t);if(!p)return!1;var _=o("WAWebMsgGetters").getIsMissedCall(e)===o("WAWebMsgGetters").getIsMissedCall(t);if(!_)return!1;var f=(o("WAWebMsgGetters").getIsCallSilenced(e)&&!o("WAWebMsgGetters").getIsSentByMe(e))===(o("WAWebMsgGetters").getIsCallSilenced(t)&&!o("WAWebMsgGetters").getIsSentByMe(t));if(!f||!o("WATimeUtils").sameDay(o("WATimeUtils").castToUnixTime(o("WAWebMsgGetters").getT(e)),o("WATimeUtils").castToUnixTime(o("WAWebMsgGetters").getT(t))))return!1;var g=(a=e.callParticipants)==null?void 0:a.map(function(e){return e.participant}),h=(i=t.callParticipants)==null?void 0:i.map(function(e){return e.participant}),y=g!=null&&h!=null&&E(g,h);return y}function I(e){if(e.length===0)return[];for(var t=[],n=r("WANullthrows")(o("WAWebFrontendMsgGetters").getAsCallLog(e[0]),"[mergeCallRecords] record is not a call log record"),a=[n.unsafe()],i=1;i0?o("WAWap").wap("website",null,c[0].url):null,c&&c.length>1?o("WAWap").wap("website",null,c[1].url):null,i?o("WAWap").wap("categories",null,i.map(function(e){return o("WAWap").wap("category",{id:o("WAWap").CUSTOM_STRING(e.id)})})):null,a?u(a):null)),m=yield o("WADeprecatedSendIq").deprecatedSendIq(d,e);if(!m.success)throw new(o("WAWebBackendErrors")).ServerStatusCodeError(m.errorCode)}),h.apply(this,arguments)}function y(e,t,n){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r){var a,i=(a=o("WAWap")).wap("iq",{to:a.S_WHATSAPP_NET,xmlns:"w:biz",id:a.generateId(),type:"set"},a.wap("business_profile",{v:"3",mutation_type:"delta"},a.wap("cover_photo",{op:"update",id:a.CUSTOM_STRING(t.toString()),ts:a.CUSTOM_STRING(n.toString()),token:a.CUSTOM_STRING(r)}))),l=yield o("WADeprecatedSendIq").deprecatedSendIq(i,e);if(!l.success)throw new(o("WAWebBackendErrors")).ServerStatusCodeError(l.errorCode)}),C.apply(this,arguments)}function b(e){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n,r=(n=o("WAWap")).wap("iq",{to:n.S_WHATSAPP_NET,xmlns:"w:biz",id:n.generateId(),type:"set"},n.wap("business_profile",{v:"3",mutation_type:"delta"},n.wap("cover_photo",{op:"delete",id:n.CUSTOM_STRING(t)}))),a=yield o("WADeprecatedSendIq").deprecatedSendIq(r,e);if(!a.success)throw new(o("WAWebBackendErrors")).ServerStatusCodeError(a.errorCode)}),v.apply(this,arguments)}l.updateCartEnabled=_,l.editBusinessProfile=g,l.sendCoverPhoto=y,l.deleteCoverPhoto=b}),98); __d("WAWebBizBusinessProfileAction",["WAPromiseDelays","WAWebBusinessCategoriesResultModel","WAWebBusinessProfileCategoriesBridge","WAWebBusinessProfileCollection","WAWebBusinessProfileJob","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebQueryBusinessProfile","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","cr:3128","err","gkx"],(function(t,n,r,o,a,i,l){function e(e,t){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(!r("gkx")("26258")){var a,i=(a=n("cr:3128")==null?void 0:n("cr:3128").debugSmbConfigs.delayBusinessProfileQuery)!=null?a:0;i&&(yield o("WAPromiseDelays").delayMs(i*1e3))}var l=yield o("WAWebQueryBusinessProfile").queryBusinessProfile(e,t);if(!r("gkx")("26258")){var s,u=n("cr:3128")==null?void 0:n("cr:3128").debugSmbConfigs.mockBusinessProfileId,c=n("cr:3128")==null||(s=n("cr:3128").debugSmbConfigs)==null?void 0:s.mockBusinessProfileQueryPayload;c&&l[0].wid.equals(u)&&(l[0].profile=babelHelpers.extends({},l[0].profile,c))}return l}),s.apply(this,arguments)}function u(e){return e===o("WAWebBusinessCategoriesResultModel").BUSINESS_CATEGORY_EMPTY_STR_ID?o("WAWebBusinessProfileCategoriesBridge").queryBusinessCategories(""):o("WAWebBusinessProfileCategoriesBridge").queryBusinessCategories(e)}function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebBusinessProfileJob").updateCartEnabled(e),n=o("WAWebBusinessProfileCollection").BusinessProfileCollection.getValid(o("WAWebUserPrefsMeUser").getMePnUserOrThrow()),r=n==null?void 0:n.profileOptions;n&&r&&(r.cartEnabled=t,o("WAWebBusinessProfileCollection").BusinessProfileCollection.add(n,{merge:!0}))}),d.apply(this,arguments)}function m(e){return o("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(o("WAWebPersistedJobDefinitions").jobSerializers.getPublicKey(e))}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebPersistedJobManager").getJobManager().waitUntilCompleted(o("WAWebPersistedJobDefinitions").jobSerializers.getSignedUserInfo(e)),n=t.businessDomain,a=t.phoneNumber,i=t.phoneNumberSignature,l=t.phoneNumberSignatureExpiration;if(a==null||l==null||i==null||n==null)throw r("err")("Unexpected null or undefined");return{phoneNumber:a,phoneNumberSignature:i,phoneNumberSignatureExpiration:l,businessDomain:n}}),_.apply(this,arguments)}l.queryBusinessProfile=e,l.queryBusinessCategories=u,l.updateCartEnabled=c,l.queryBusinessPublicKey=m,l.querySignedUserInfo=p}),98); __d("WAWebChatAssignmentLogEvents.flow",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum").Mirrored(["CONTACT_INFO_SCREEN","CONVERSATION_MENU","MULTI_SELECT","SYSTEM_MESSAGE"]);i.ChatAssignmentEntryPointType=e}),66); __d("WAWebChatAssignmentSystemMsg",["WAWebMsgKey","WAWebMsgType","WAWebUserPrefsMeUser","WAWebViewMode.flow"],(function(t,n,r,o,a,i,l){function e(e,t,n){var a=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),i=r("WAWebMsgKey").newId_DEPRECATED(),l=new(r("WAWebMsgKey"))({fromMe:o("WAWebUserPrefsMeUser").isMeAccount(e),remote:e,id:i});return{id:l,t:n,type:"notification_template",kind:o("WAWebMsgType").MsgKind.NotificationTemplate,viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE,subtype:t==null?"chat_assignment_unassign":"chat_assignment",from:e,to:a,templateParams:t==null?[]:[t.name]}}l.genChatAssignmentNotificationTemplateMsg=e}),98); __d("WAWebBizChatAssignmentAction",["Promise","WATimeUtils","WAWebAgentCollection","WAWebBizChatAssignmentOpenedAction","WAWebBizGatingUtils","WAWebChatAssignmentCollection","WAWebChatAssignmentLogEvents","WAWebChatAssignmentLogEvents.flow","WAWebChatAssignmentModel","WAWebChatAssignmentSync","WAWebChatAssignmentSystemMsg","WAWebChatAssignmentUtils","WAWebChatCollection","WAWebCmd","WAWebHandleSingleMsg","WAWebMobilePlatforms","WAWebNotificationController","WAWebNotificationsChatAssignmentNotification","WAWebSchemaChatAssignment","WAWebSyncdCoreApi","WAWebSyncdOrphan","WAWebUserPrefsMeUser","WAWebUserPrefsStore","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(o("WAWebChatAssignmentUtils").canAssignChats()){var n=o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow().getDeviceId(),a=e.map(function(e){var r=e.chat.id.toString({legacy:!0}),a=e.agentId,i=o("WAWebAgentCollection").AgentCollection.getByDeviceId(n),l=(i==null?void 0:i.deviceId)===n&&t!==o("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.MULTI_SELECT&&t!==o("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.CONTACT_INFO_SCREEN;return{id:r+"_"+(a||""),chatId:r,agentId:a!=null?a:"",chatOpenedByAgent:l}}),i=e.map(function(e){return e.chat.assignedAgent!=null});yield o("WAWebSyncdCoreApi").lockForSync(["chat-assignment"],yield r("WAWebChatAssignmentSync").createChatAssignmentMutations(a),function(){return d(a)}),e.forEach(function(n,r){var a;o("WAWebChatAssignmentLogEvents").logChatAssignment(n.chat,(a=n.agentId)!=null?a:"",i[r],t,e.length)}),p(e.map(function(e){var t=e.agentId,n=e.chat,r=o("WAWebAgentCollection").AgentCollection.get(t!=null?t:"");return{chatId:n.id,agent:r,timestamp:o("WATimeUtils").unixTime()}})),r("WAWebUserPrefsStore").setUser("chat_assignment_agent_has_assigned_chats",!0),a.filter(function(e){var t=e.chatOpenedByAgent;return t===!0}).forEach(function(e){var t=o("WAWebChatCollection").ChatCollection.get(e.chatId);t!=null&&o("WAWebBizChatAssignmentOpenedAction").markChatAsOpened(t,!0)})}}),u.apply(this,arguments)}function c(e){return o("WAWebChatAssignmentCollection").ChatAssignmentCollection.getModelsArray().filter(function(t){var n=t.chatId;return e.includes(n)}).map(function(e){return e.id})}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var r=c(t.map(function(e){var t=e.chatId;return t})),a=t.map(function(e){var t=e.agentId,n=e.chatId,r=e.chatOpenedByAgent,a=e.id;return new(o("WAWebChatAssignmentModel")).ChatAssignment({id:a,chatId:n,agentId:t,chatOpenedByAgent:r,agent:o("WAWebAgentCollection").AgentCollection.get(t)})});o("WAWebChatAssignmentCollection").ChatAssignmentCollection.remove(r),o("WAWebChatAssignmentCollection").ChatAssignmentCollection.add(a);var i=o("WAWebSchemaChatAssignment").getChatAssignmentTable();yield(e||(e=n("Promise"))).all([i.bulkRemove(r),i.bulkCreateOrMerge(t)])}),m.apply(this,arguments)}function p(e){o("WAWebBizGatingUtils").chatAssignmentSystemMessagesEnabled()&&e.forEach(function(e){var t=e.agent,n=e.chatId,r=e.timestamp,a=o("WAWebChatCollection").ChatCollection.get(n);o("WAWebHandleSingleMsg").handleSingleMsg({chatId:n,newMsg:o("WAWebChatAssignmentSystemMsg").genChatAssignmentNotificationTemplateMsg(n,t,r),handleSingleMsgOrigin:"chatAssignmentSystemMsg"}).then(function(){a!=null&&o("WAWebChatAssignmentLogEvents").logSystemMessageGeneratedFromCompanion(a)}).catch(function(){a!=null&&o("WAWebChatAssignmentLogEvents").logSystemMessageFailedToGenerate(a)})})}function _(e){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(o("WAWebMobilePlatforms").isSMB()){var t=c([e.toString({legacy:!0})]);yield o("WAWebSchemaChatAssignment").getChatAssignmentTable().bulkRemove(t),o("WAWebChatAssignmentCollection").ChatAssignmentCollection.remove(t)}}),f.apply(this,arguments)}function g(){o("WAWebCmd").Cmd.once("app_state_sync_completed_from_bridge",function(){o("WAWebSyncdOrphan").checkOrphanAgents(o("WAWebAgentCollection").AgentCollection.getModelsArray().map(function(e){var t=e.id;return t})),o("WAWebSyncdOrphan").checkOrphanChatAssignments(o("WAWebChatAssignmentCollection").ChatAssignmentCollection.getModelsArray().map(function(e){var t=e.id;return t}))})}function h(e,t){if(!(!o("WAWebBizGatingUtils").chatAssignmentNotificationsEnabled()||!o("WAWebChatAssignmentUtils").canAssignChats())){var n=o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow().getDeviceId(),r=e.filter(function(e){var t=o("WAWebAgentCollection").AgentCollection.get(e.agentId);return(t==null?void 0:t.deviceId)===n});r.length!==0&&o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebNotificationsChatAssignmentNotification")).WAWebNotificationsChatAssignmentNotification({chats:r.map(function(e){return o("WAWebWidFactory").createWid(e.chatId)}),assignmentTimestamps:t}))}}l.changeChatAssignment=s,l.createChatAssignmentSystemMsgs=p,l.removeChatAssignmentsForChat=_,l.checkOrphanAssignments=g,l.triggerChatAssignmentNotification=h}),98); __d("WAWebBizChatAssignmentOpenedAction",["WAWebAgentCollection","WAWebChatAssignmentCollection","WAWebChatAssignmentOpenedStatusSync","WAWebChatAssignmentUtils","WAWebSchemaChatAssignment","WAWebSyncdCoreApi","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){e.forEach(function(e){var t=e.chatOpenedByAgent,n=e.id,r=o("WAWebChatAssignmentCollection").ChatAssignmentCollection.get(n);r&&r.set("chatOpenedByAgent",t)});var t=o("WAWebSchemaChatAssignment").getChatAssignmentTable();yield t.bulkCreateOrMerge(e)}),s.apply(this,arguments)}function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){var a;if(o("WAWebChatAssignmentUtils").canAssignChats()){var i=o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow().getDeviceId(),l=t.id,s=(a=o("WAWebAgentCollection").AgentCollection.getByDeviceId(i))==null?void 0:a.id;if(s!=null){var u=[{chatId:l,agentId:s,chatOpened:n}],c=u.map(function(e){var t=e.chatId.toString({legacy:!0});return{id:t+"_"+s,chatId:t,agentId:s,chatOpenedByAgent:n}});yield o("WAWebSyncdCoreApi").lockForSync(["chat-assignment"],yield r("WAWebChatAssignmentOpenedStatusSync").createChatOpenedMutations(c),function(){return e(c)})}}}),c.apply(this,arguments)}l.updateLocalOpenedState=e,l.markChatAsOpened=u}),98); __d("WAWebBizInteractiveMessageQuickReplyAction",["WANullthrows","WAWebCarouselMsgUtils","WAWebSchemaMessage","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(e.isCarouselCard)return u(e,t);var n=d(e,t),r=o("WAWebSchemaMessage").getMessageTable(),a=yield r.get(e.id.toString());yield o("WAWebSchemaMessage").getMessageTable().bulkCreateOrMerge([{id:a==null?void 0:a.id,interactivePayload:n}]),e.set("interactivePayload",n)}),s.apply(this,arguments)}function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=d(e.interactivePayload,t),a=r("WANullthrows")(o("WAWebCarouselMsgUtils").getParentMsgFromCarouselCard(e)),i=r("WANullthrows")(a.carouselCardsParsed).slice(),l=i.findIndex(function(t){return t.id.toString()===e.id.toString()});i[l]=babelHelpers.extends({},i[l],{interactivePayload:n});var s=o("WAWebSchemaMessage").getMessageTable(),u=yield s.get(a.id.toString());yield s.bulkCreateOrMerge([{id:u==null?void 0:u.id,carouselCardsParsed:i}]),a.set("carouselCardsParsed",i),e.set("interactivePayload",n)}),c.apply(this,arguments)}function d(e,t){var n;return babelHelpers.extends({},e,{buttons:e==null||(n=e.buttons)==null?void 0:n.map(function(e,n){if(e.buttonParamsJson===void 0)return e;var r=JSON.parse(e.buttonParamsJson);return t===n&&(r.disabled=!0),{name:e.name,buttonParamsJson:JSON.stringify(r)}})})}l.markInteractiveButtonClicked=e,l.rebuildInteractivePayloadWithDisabledButton=d}),98); __d("WAWebBizProductMessageListAction",["WAWebMsgCollection"],(function(t,n,r,o,a,i,l){function e(e,t){var n,r=o("WAWebMsgCollection").MsgCollection.get(t),a=r==null||(n=r.list)==null||(n=n.productListInfo)==null||(n=n.headerImage)==null?void 0:n.productId;e.id===a&&r!=null&&(r.productHeaderImageRejected=!0)}l.updateProductListHeaderImageRejected=e}),98); __d("WAWebBizUpdateContactsWithVerifiedNamesAction",["WANullthrows","WAWebApiVerifiedBusinessName","WAWebBusinessProfileTypes","WAWebContactCollection","WAWebHandleMsgTypes.flow","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t){var n={};for(var r of e){var a=r.id;n[a.user]=r}for(var i of t){var l=i.id;if(!l.isBot()){var s=n[l.user],u=!!s,c=s||{},d=c.isApi,m=c.isSmb,p=c.level,_=c.name,f=c.privacyMode,g=!!d,h={isBusiness:u,isEnterprise:g,isSmb:!!m,verifiedLevel:o("WAWebBusinessProfileTypes").convertLevel(p),verifiedName:_,privacyMode:f};i.set(h)}}}var s=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=(yield o("WAWebApiVerifiedBusinessName").getAllVerifiedNames()).map(function(e){var t=e.id,n=e.isApi,a=e.isSmb,i=e.level,l=e.name,s=e.privacyMode;return{id:o("WAWebWidFactory").createUserWidOrThrow(t),name:l,level:i,isApi:n,isSmb:a,privacyMode:s?{actualActors:r("WANullthrows")(o("WAWebHandleMsgTypes.flow").ActualActorsEnumType.cast(s.actualActors)),hostStorage:r("WANullthrows")(o("WAWebHandleMsgTypes.flow").HostStorageEnumType.cast(s.hostStorage)),privacyModeTs:s.privacyModeTs}:null}});e(t,o("WAWebContactCollection").ContactCollection.toArray())});return function(){return t.apply(this,arguments)}})();l.updateContactsWithVerifiedNames=e,l.applyContactBusinessProps=s}),98); __d("WAWebBizVerifiedNameAction",["Promise","WAWebBizUpdateContactsWithVerifiedNamesAction","WAWebChatCollection","WAWebFrontendChatGetters","WAWebHandleBusinessNameChangeLidHelpers","WAWebHandlePrivacyModeUpdateMsgAction","WAWebSchemaVerifiedBusinessName","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(t.length!==0){yield(e||(e=n("Promise"))).all(t.map(function(e){var t=e.id,n=e.verifiedName,r=n==null?void 0:n.privacyMode;if(r!=null){var a=o("WAWebChatCollection").ChatCollection.getLatestChatForWid(t);if(!(a==null||o("WAWebFrontendChatGetters").getShouldAppearInList(a)===!0))return o("WAWebHandlePrivacyModeUpdateMsgAction").handlePrivacyModeTransition(a.id,r,{chat:a,bypassVerifiedNameUpdate:!0,shouldRunMATonWid:!1})}}));var a=o("WAWebHandleBusinessNameChangeLidHelpers").getVerifiedNamesToUpdateLidAware(t),i=r("compactMap")(a,function(e){var t=e.id,n=e.verifiedName;if(n==null)return null;var r=n.isApi,o=n.isSmb,a=n.level,i=n.name,l=n.privacyMode,s=n.serial;return{id:t.isLid()?t.toString():t.user,level:a,serial:s,name:i,isApi:r,isSmb:o,privacyMode:l?{actualActors:l.actualActors,hostStorage:l.hostStorage,privacyModeTs:l.privacyModeTs}:null}});yield o("WAWebSchemaVerifiedBusinessName").getVerifiedBusinessNameTable().bulkCreateOrReplace(i),yield o("WAWebBizUpdateContactsWithVerifiedNamesAction").applyContactBusinessProps()}}),u.apply(this,arguments)}l.handleVerifiedNameSync=s}),98); __d("WAWebBizOrderAction",["WAWebBizOrderBridge"],(function(t,n,r,o,a,i,l){function e(e,t,n,r,a){return o("WAWebBizOrderBridge").queryOrder(e,t,n,r,a)}function s(e,t){return o("WAWebBizOrderBridge").createOrder(e,t)}l.queryOrder=e,l.createOrder=s}),98); __d("WAWebFindChatAction",["WAAbortError","WALogger","WAWebApiContact","WAWebChatGetExistingBridge","WAWebCheckChatExistsOrCreate","WAWebLid1X1MigrationGating","WAWebLidMigrationUtils","WAWebMessageProcessUtils","WAWebSyncContactJob","WAWebUsernameTypes","WAWebWid","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g;function h(e,t,n){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){if(!r("WAWebWid").isUser(e))return C(e,t).then(function(e){var t=e.chat;return t});var a=yield o("WAWebChatGetExistingBridge").getExisting(e);return a||C(e,t,n).then(function(e){var t=e.chat;return t})}),y.apply(this,arguments)}function C(e,t,n){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a){var i={chatId:t};if(t.isRegularUser()){if(o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: using migration rules (chat: ",", origin: ",")"])),i.chatId.toLogString(),n);var l=o("WAWebLidMigrationUtils").toUserLid(t);l==null&&(o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: could not convert targetId to lid for chatOrigin ",""])),n).sendLogs("findOrCreateLatestChat_lid_not_found",{sampling:.01}),yield o("WAWebSyncContactJob").syncContactListJob([t],!0,"query"),l=o("WAWebLidMigrationUtils").toUserLidOrThrow(t)),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: current lid: ",""])),l.toLogString()),i=yield o("WAWebMessageProcessUtils").selectChatForOneOnOneMessage({lid:l}),o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: selected destination: ",""])),i.chatId.toLogString())}else if(t.isLid()){var h=yield o("WAWebChatGetExistingBridge").getExisting(i.chatId);if(h==null){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: applying pre-migration rules (chat: ",", origin: ",")"])),i.chatId.toLogString(),n);var y=o("WAWebApiContact").getPhoneNumber(t);if(y==null)throw o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: could not find phone number for lid while enforcing pre-migration rules. source: ",""])),n).sendLogs("findOrCreateLatestChat: could not find phone number for lid while enforcing pre-migration rules"),r("err")("findOrCreateLatestChat: could not find phone number for lid while enforcing pre-migration rules");i={chatId:y}}}}o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: after chat selection (chat: ",", origin: ",")"])),i.chatId.toLogString(),n);var C=a!=null?a:{},b=C.forceUsync,v=C.isGroupJoin,S=C.nextPrivacyMode,R=C.signal;if(R!=null&&R.aborted)throw new(o("WAAbortError")).AbortError;var L=yield o("WAWebChatGetExistingBridge").getExisting(i.chatId);if(L)return{chat:L,created:!1};var E={createdLocally:!0};v===!0&&(E.notSpam=!0);var k=i.chatId;k.isLid()&&(E.lidOriginType=o("WAWebUsernameTypes").LidOriginType.GENERAL,o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: creating lid chat with ",", origin ",""])),i.chatId.toLogString(),n),o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat will create Lid chat for origin ",""])),n).sendLogs("findOrCreateLatestChat will create Lid chat")),o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["findOrCreateLatestChat: will create chat with ",", origin ",""])),i.chatId.toLogString(),n);var I=yield o("WAWebCheckChatExistsOrCreate").checkChatExistsOrCreate({destinationChat:i,msgMeta:null,chatOriginType:n,initialProps:E,options:{forceUsync:b,nextPrivacyMode:S}}),T=yield o("WAWebChatGetExistingBridge").getExisting(i.chatId);if(T==null){var D;throw r("err")("findChat: new chat not found "+((D=i.chatId)==null?void 0:D.toLogString()))}return{chat:T,created:!I}}),b.apply(this,arguments)}l.findExistingChat=h,l.findOrCreateLatestChat=C}),98); __d("WAWebCommonCTWALogging",["WAWebABProps","WAWebConnModel","WAWebGetCTWAEligibilityFromConversion","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l){function e(e){var t,n;if(o("WAWebConnModel").Conn.isSMB&&e.ctwaContext!=null&&!(e.ctwaContext.conversionSource!==o("WAWebGetCTWAEligibilityFromConversion").SMB_DATA_SHARING_ALLOWED_SOURCE||e.ctwaContext.conversionData==null)){var r=(t=o("WAWebUserPrefsMeUser").getMaybeMePnUser())==null?void 0:t.toString();if(r===((n=e.to)==null?void 0:n.toString())&&o("WAWebABProps").getABPropConfigValue("ctwa_show_ads_data_sharing_after_message")){var a=o("WAWebUserPrefsGeneral").getCTWAMessageReceived();a!==!0&&o("WAWebUserPrefsGeneral").setCTWAMessageReceived(!0)}}}l.maybeSetCtwaMessageReceivedInUserPreferenceStore=e}),98); __d("WAWebSendNotSpamJob",["WALogger","WASmaxGroupsAcknowledgeGroupRPC","WAWebChatGetters","WAWebNoop","WAWebSchemaChat","WAWebWidToJid","err"],(function(t,n,r,o,a,i,l){var e,s;function u(t){return o("WAWebChatGetters").getIsGroup(t)&&(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[callp] acknowledging group ",""])),t.id.toLogString()),o("WASmaxGroupsAcknowledgeGroupRPC").sendAcknowledgeGroupRPC({iqTo:o("WAWebWidToJid").widToGroupJid(t.id)}).catch(r("WAWebNoop"))),o("WAWebSchemaChat").getChatTable().merge(t.id.toString(),{notSpam:!0}).catch(function(e){throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["get chat table merge failed"]))).verbose().sendLogs("get chat table merge failed when sending spam report"),r("err")("get chat table merge failed")})}l.default=u}),98); __d("WAWebSendNotSpamAction",["fbt","Promise","WAFilteredCatch","WALogger","WAWebActionToast.react","WAWebBackendErrors","WAWebChatGetters","WAWebSendNotSpamJob","WAWebStateUtils","WAWebToastManager","react"],(function(t,n,r,o,a,i,l,s){var e,u,c,d=c||(c=r("react"));function m(e,t){return p(o("WAWebStateUtils").unproxy(e),t)}function p(t,a,i){a===void 0&&(a=!1),i===void 0&&(i=o("WAWebActionToast.react").genId());var l=t.notSpam,c=t.promises;if(l)return(u||(u=n("Promise"))).resolve();if(c.sendNotSpam)return c.sendNotSpam;var m=c.sendNotSpam=r("WAWebSendNotSpamJob")(t);if(a){var _=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Marcando como no spam\u2026")),f=m.then(function(){return new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Marcado como no spam"))}).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(){return new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo marcar como no spam."))})).catch(function(n){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["models:chat:sendNotSpam dropped"]))),new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo marcar como no spam."),{actionText:s._(/*BTDS*/"Vuelve a intentarlo."),actionHandler:function(){return p(t,a,i)}})});o("WAWebToastManager").ToastManager.open(d.jsx(o("WAWebActionToast.react").ActionToast,{id:i,initialAction:_,pendingAction:f}))}return m.then(function(){if(t.set({notSpam:!0}),o("WAWebChatGetters").getIsGroup(t)){var e;(e=t.groupMetadata)==null||e.set({trusted:!0})}}).finally(function(){t.isTrusted(),c.sendNotSpam=null})}l.default=m}),226); __d("WAWebSetArchiveChatActionUtils",["WAWebSettingsGetters","WAWebSettingsModel"],(function(t,n,r,o,a,i,l){function e(e){return!o("WAWebSettingsGetters").getShowArchiveV2(r("WAWebSettingsModel"))}l.shouldUnarchiveChat=e}),98); __d("WAWebWamEnumWebcQueryTriggerType",[],(function(t,n,r,o,a,i){var e=Object.freeze({UNKNOWN:0,USER_SCROLL:1,NEW_MESSAGE_PREFETCH:2,SEARCH_RESULT_CLICK:3});i.WEBC_QUERY_TRIGGER_TYPE=e}),66); __d("WAWebHandleNewMsgAction",["Promise","WAFilteredCatch","WALogger","WATimeUtils","WAWebApiChat","WAWebBackendErrors","WAWebBotGenTypingIndicatorMsg","WAWebChangePresenceHandlerAction","WAWebChatGetters","WAWebChatLoadMessages","WAWebCmd","WAWebCollectionConstants","WAWebCommonCTWAConsumerTransparency","WAWebCommonCTWALogging","WAWebCommonMsgUtils","WAWebConversionTupleCollection","WAWebDBUpdateChatTable","WAWebEnvironment","WAWebFrontendMsgGetters","WAWebGroupUnreadMessageType","WAWebHandleMsgReceiptCommon","WAWebInvisiblePlaceholderViewModeProcessor","WAWebLidMigrationUtils","WAWebMmSignalSharingLoggingEvents","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebNoop","WAWebRichOrderStatusLogger","WAWebSchemaChat","WAWebSendNotSpamAction","WAWebSetArchiveChatActionUtils","WAWebUnreadMentionModel","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWamEnumWebcQueryTriggerType","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g;function h(){return!o("WAWebCmd").Cmd.isOfflineDeliveryEnd}var y=!1;function C(t,a){if(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["handleNewMsgForChat chatId: "," type: ",", sub type: ",""])),t.id.toLogString(),a.type,a.subtype),o("WAWebChatGetters").getIsNewsletter(t)&&!o("WAWebNewsletterGatingUtils").isNewsletterEnabled()||!a)return(g||(g=n("Promise"))).resolve();var i=(g||(g=n("Promise"))).resolve();return o("WAWebMsgGetters").getIsSentByMe(a)&&!t.notSpam&&!o("WAWebChatGetters").getIsNewsletter(t)&&(i=r("WAWebSendNotSpamAction")(t,!1)),o("WAWebFrontendMsgGetters").getEventType(a)===o("WAWebCommonMsgUtils").EventType.IGNORE?(g||(g=n("Promise"))).resolve():i.then(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e={};t.promises.updateSortTime&&t.promises.updateSortTime.abortController.abort(),o("WAWebMsgGetters").getIsSentByMeFromWeb(a)&&t.archive&&o("WAWebSetArchiveChatActionUtils").shouldUnarchiveChat(o("WAWebMsgGetters").getIsSentByMe(a))&&(e.archive=!1),t.promises.setArchive&&t.promises.setArchive.abortController.abort(),!o("WAWebChatGetters").getIsNewsletter(t)&&a.subtype!==o("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE&&(o("WAWebMsgGetters").getIsSentByMe(a)?t.markedUnread=!1:r("WAWebChangePresenceHandlerAction")({id:t.id,participant:a.author,type:"idle"},!1)),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["handleNewMsgForChat: before updating chat table ",""])),t.id.toLogString());try{yield o("WAWebDBUpdateChatTable").updateChatTable(t.id,e)}catch(e){var n=yield o("WAWebSchemaChat").getChatTable().get(t.id.toString());throw o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["handleNewMsgForChat: unable to update chat table for id:",". chat exists in db: "," error: ",""])),t.id.toLogString(),n!=null,e).sendLogs("handle-new-msg-cannot-update-chat"),e}var i=babelHelpers.extends({},e);try{var l;if(h()&&(o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.CHAT,a.viewMode)||(l=o("WAWebInvisiblePlaceholderViewModeProcessor").InvisiblePlaceholderViewModeProcessor.compatibleMessageTypes)!=null&&l.includes(a.type)))o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["handleNewMsgForChat: updating UI immediatelly ",""])),t.id.toLogString()),i.t=a.t,(o("WAWebFrontendMsgGetters").getEventType(a)===o("WAWebCommonMsgUtils").EventType.AMBIENT||o("WAWebFrontendMsgGetters").getEventType(a)===o("WAWebCommonMsgUtils").EventType.DEFAULT)&&!a.id.fromMe&&a.read!==!0&&(i.unreadCount=t.unreadCount+1||1,t.activeUnreadCount>0&&(i.activeUnreadCount=t.activeUnreadCount+1));else{var _=yield o("WAWebApiChat").getChatMeta(t.id),f=_.timestamp,g=_.unreadCount;i.unreadCount=g,i.t=f,t.activeUnreadCount>0&&(i.activeUnreadCount=t.activeUnreadCount+Number(o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.CHAT,a.viewMode)))}i.unreadDividerOffset=0}catch(e){var C=r("getErrorSafe")(e);if(o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["onNewMsg: unable to find metadata from chat table for id:",". stack: ",""])),t.id.toLogString(),C.stack),!y){var b,v;y=!0;var S=yield o("WAWebSchemaChat").getChatTable().get(t.id.toString()),R=t.accountLid?yield o("WAWebSchemaChat").getChatTable().get((b=t.accountLid)==null?void 0:b.toString()):null;o("WAWebLidMigrationUtils").logLidMetadata(),o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["onNewMsg error chat_id: ",", account_lid: ",", chat by id: ",", chat by accountLid ",""])),t.id.toLogString(),(v=t.accountLid)==null?void 0:v.toLogString(),S!=null,R!=null).tags("missing-lid"),o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["onNewMsg: unable to find metadata from chat table for id:",". stack: ",""])),t.id.toLogString(),C.stack).sendLogs("onNewMsg: unable to find metadata from chat table")}}return i})).then(function(e){t.set(e),a.ctwaContext!=null&&(o("WAWebCommonCTWAConsumerTransparency").handleConsumerTransparencyForNewMsg(t,a.ctwaContext.conversionData,a.ctwaContext.conversionSource),o("WAWebCommonCTWALogging").maybeSetCtwaMessageReceivedInUserPreferenceStore(a));var n=r("WAWebConversionTupleCollection").get(t.id);if(n)n.timestamp=o("WATimeUtils").unixTime();else if(a.ctwaContext!=null){var i=a.ctwaContext,l=i.conversionData,s=i.conversionSource;r("WAWebConversionTupleCollection").add({conversionSource:s,conversionData:l,id:t.id,timestamp:o("WATimeUtils").unixTime()},{merge:!0})}var u=o("WAWebUserPrefsMeUser").getMePnUserOrThrow();if(a.type==="gp2"&&(a.subtype==="add"||a.subtype==="create")&&t.getGroupMetadataCollection().trigger("group_participant_change_"+u.toString(),t.id),o("WAWebMsgGetters").getIsSentByMe(a))t.activeUnreadCount>0&&(t.activeUnreadCount=0,t.markedUnread=!1);else{switch(o("WAWebFrontendMsgGetters").getEventType(a)){case o("WAWebCommonMsgUtils").EventType.DEFAULT:case o("WAWebCommonMsgUtils").EventType.AMBIENT:o("WAWebFrontendMsgGetters").getEventType(a)===o("WAWebCommonMsgUtils").EventType.DEFAULT&&o("WAWebCmd").Cmd.alertNewMsg(a),t.msgs.length0&&!h()&&o("WAWebHandleMsgReceiptCommon").processOrphanPeerReceipt(a.id),o("WAWebMsgGetters").getIsImportantMessage(a)){var m,p=new(r("WAWebUnreadMentionModel"))({id:a.id.toString(),timestamp:a.t});if((m=t.groupMetadata)==null||m.unreadMentionMetadata.addUnreadMentions(p,o("WAWebGroupUnreadMessageType").UnreadMessageType.NEW_MESSAGE),t.archiveAtMentionViewedInDrawer){var g=new Map;g.set(t.id.toString(),!1),o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["handleNewMsgForChat: will mark chat for archive"]))),o("WAWebApiChat").updateChatArchiveDrawer(g),t.archiveAtMentionViewedInDrawer=!1}}}o("WAWebMmSignalSharingLoggingEvents").logMmSignalSharingNewMessageEvent({chat:t,newMsg:a}),o("WAWebRichOrderStatusLogger").logRichOrderStatusInconsistencies(a)})}l.handleNewMsgForChat=C}),98); __d("WAWebSendAddonMsgChatAction",["WAJobOrchestratorTypes","WAWebOrchestratorNonPersistedJob","WAWebSendMsgRecordAction","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebSendMsgRecordAction").sendAddonRecord(e)}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}l.addAndSendAddonToChat=e}),98); __d("WAWebBizShowOrderEphemeralSystemAction",["WAWebBizGatingUtils","WAWebDBChatEphemeralExemptionData","WAWebDBEphemeralDisplayedExemptions","WAWebOrderEphemeralExemptionUtil","WAWebOrderSystemMsg"],(function(t,n,r,o,a,i,l){function e(e,t){if(!o("WAWebBizGatingUtils").inOrderMessagesEphemeralExceptionEnabled())return null;var n=e.safe(),r=e.interactiveType,a=e.nativeFlowName;if(!o("WAWebOrderEphemeralExemptionUtil").isMessageTypeExemptedFromDisappearing(n.type,r,a))return null;var i={id:t.id.toString(),ephemeralDuration:t.ephemeralDuration,ephemeralDisplayedExemptions:t.ephemeralDisplayedExemptions};return o("WAWebOrderEphemeralExemptionUtil").shouldShowOrderExemptionSystemMessage(i)?(t.ephemeralDisplayedExemptions=o("WAWebDBEphemeralDisplayedExemptions").EphemeralExemptionType.ORDERS_AND_PAYMENTS,o("WAWebDBChatEphemeralExemptionData").persistsEphemeralDisplayedExemptions(t.id,t.ephemeralDuration,o("WAWebDBEphemeralDisplayedExemptions").EphemeralExemptionType.ORDERS_AND_PAYMENTS),o("WAWebOrderSystemMsg").getOrderEphemeralExemptionSystemMsg(t.id)):(o("WAWebOrderEphemeralExemptionUtil").shouldUnsetChatEphemeralDisplayedExemption(i)&&(t.ephemeralDisplayedExemptions=o("WAWebDBEphemeralDisplayedExemptions").EphemeralExemptionType.UNSET,o("WAWebDBChatEphemeralExemptionData").persistsEphemeralDisplayedExemptions(t.id,t.ephemeralDuration,o("WAWebDBEphemeralDisplayedExemptions").EphemeralExemptionType.UNSET)),null)}l.getMaybeSystemMsgForOrderEphemeralExemption=e}),98); __d("WAWebEmptyChatSystemMsg",["WAWebInitialSystemMsg","WAWebMsgGetters","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(!o("WAWebMsgGetters").getIsGroupMsg(e)&&t.msgs.length===0){var n;return r("WAWebInitialSystemMsg")(t.id,t.contact.privacyMode,(n=t.contact.businessProfile)==null?void 0:n.automatedType)}return null}),s.apply(this,arguments)}l.default=e}),98); __d("WAWebLidMigrationFrontendUtils",["WALogger","WAWebCurrentUser","WAWebLidMigrationUtils","WAWebSchemaChat","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d;function m(e,t,n){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r){try{if(o("WAWebLidMigrationUtils").shouldHaveAccountLid(t.id)){var a,i,l,m,p,_,f=yield o("WAWebSchemaChat").getChatTable().get(t.id.toString()),g=o("WAWebLidMigrationUtils").toLid(t.id);o("WAWebLidMigrationUtils").logLidMetadata();var h="isEmployee? "+o("WAWebCurrentUser").isEmployee().toString()+", source: "+r+",\n input chat.id: "+t.id.toLogString()+". input chat.account_lid: "+((a=(i=t.accountLid)==null?void 0:i.toLogString())!=null?a:"")+",\nchat exist in db: "+(f!=null).toString()+", db chat account lid: "+((f==null?void 0:f.accountLid)==null?"null":o("WAWebWidFactory").createWid(f==null?void 0:f.accountLid).toLogString())+"\nchat.id lid mapping: "+((l=g==null?void 0:g.toLogString())!=null?l:"")+",\nmsg kind: "+((m=n==null?void 0:n.kind)!=null?m:"")+" "+((p=n==null?void 0:n.type)!=null?p:"")+" "+((_=n==null?void 0:n.subtype)!=null?_:"");if(t.accountLid==null)o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["validateMissingAccountLid: model does not have account_lid. ",""])),h).sendLogs("no-account-lid-for-send").tags("missing-lid");else if(f==null)o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["validateMissingAccountLid: chat does not exist in DB. ",""])),h).sendLogs("chat-not-in-db-for-new-message").tags("missing-lid");else if(f.accountLid==null)o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["validateMissingAccountLid: DB does not have account_lid. ",""])),h).sendLogs("db-chat-has-empty-accountlid-for-new-message").tags("missing-lid");else{var y;o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["validateMissingAccountLid: chat is in DB and has account_lid. chat id: ",", account lid: "," ",""])),t.id.toLogString(),(y=t.accountLid)==null?void 0:y.toLogString(),r)}}}catch(e){o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["validateMissingAccountLid unexpected error while validating chat. ",""])),e)}}),p.apply(this,arguments)}l.validateMissingAccountLid=m}),98); __d("WAWebCreateAiThreadTitleForMessage",["WALogger","WAWebMsgType","fbs"],(function(t,n,r,o,a,i,l){"use strict";var e;function s(t){if(t.body!=null)return t.body;if(t.caption!=null)return t.caption;var n=t.type;switch(n){case o("WAWebMsgType").MSG_TYPE.IMAGE:return r("fbs")._(/*BTDS*/"Nueva imagen").toString();case o("WAWebMsgType").MSG_TYPE.VIDEO:return r("fbs")._(/*BTDS*/"Nuevo video").toString();case o("WAWebMsgType").MSG_TYPE.AUDIO:case o("WAWebMsgType").MSG_TYPE.PTT:return r("fbs")._(/*BTDS*/"Nuevo audio").toString();case o("WAWebMsgType").MSG_TYPE.DOCUMENT:return r("fbs")._(/*BTDS*/"Nuevo documento").toString();default:o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Encountered unexpected message type: ",""])),n).tags("ai-threads").sendLogs("createAiThreadTitleForMessage: unsupported message type");return}}l.createAiThreadTitleForMessage=s}),226); __d("WAWebMaybeGetAppendedAiThreadAttributes",["WANullthrows","WAWebAiThreadCreationUtils","WAWebAiThreadTypeUtils","WAWebBotDeviceCapabilities","WAWebBotGating","WAWebBotUtils","WAWebCreateAiThreadTitleForMessage","WAWebThreadMsgUtils","WAWebThreadUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=e.to;if(!o("WAWebBotUtils").isMetaAiBot(n))return d(e);var a=yield o("WAWebBotDeviceCapabilities").primaryHasAiThreadSupport();if(!a||!o("WAWebBotGating").isAiChatThreadsInfraEnabled())return d(e);if(u(e))return c(e);var i=e.quotedMsg;if(u(i))return c(r("WANullthrows")(i,"quotedMsg"));var l=o("WAWebAiThreadCreationUtils").getHistoricalMetaAiThreadId(),s={aiThreadType:o("WAWebAiThreadTypeUtils").AiThreadType.Default},m=(t=e==null?void 0:e.threadIds)!=null?t:[];return[[].concat(m,[l]),s]}),s.apply(this,arguments)}function u(e){return(e==null?void 0:e.threadIds)==null?!1:e.threadIds.some(function(e){return e.type===o("WAWebThreadUtils").ThreadType.AiThread})}function c(e){var t,n,r=(t=e==null?void 0:e.threadIds)!=null?t:[],a=o("WAWebAiThreadCreationUtils").getHistoricalMetaAiThreadId();if(o("WAWebThreadMsgUtils").isMsgInThread(e,a)){var i;return[r,(i=e==null?void 0:e.aiThreadInfo)!=null?i:void 0]}var l=(n=e==null?void 0:e.aiThreadInfo)!=null?n:{},s=l.aiThreadType,u=l.title,c=o("WAWebAiThreadTypeUtils").getAiThreadInfoFromType(u!=null?u:o("WAWebCreateAiThreadTitleForMessage").createAiThreadTitleForMessage(e),s!=null?s:o("WAWebAiThreadTypeUtils").AiThreadType.Default);return[r,c]}function d(e){var t;return[(t=e.threadIds)==null?void 0:t.filter(function(e){return e.type!==o("WAWebThreadUtils").ThreadType.AiThread}),void 0]}l.maybeGetAppendedAiThreadAttributes=e}),98); __d("WAWebMaybeGetBotModeSelection",["WAWebBotGating","WAWebBotUtils","WAWebGlobalBotModeSelection","WAWebThreadMsgUtils"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t){if(t!=null){var n,r=(n=e.aiThreads)==null?void 0:n.get(t);if((r==null?void 0:r.botModeSelection)!=null)return r.botModeSelection}return o("WAWebGlobalBotModeSelection").getGlobalBotModeSelection()}function s(t,n){var r=n.to;if(o("WAWebBotUtils").isMetaAiBot(r)&&o("WAWebBotGating").isAiModeSelectorMessagingEnabled()){var a=o("WAWebThreadMsgUtils").getMsgAiThread(n);return a!=null?e(t,a):o("WAWebGlobalBotModeSelection").getGlobalBotModeSelection()}}l.maybeGetBotModeSelection=s}),98); __d("WAWebEphemeralitySystemMsg",["WAWebContactSystemMsg"],(function(t,n,r,o,a,i,l){"use strict";function e(e){var t=o("WAWebContactSystemMsg").genDisappearingModeUpdateSystemMsg(e,0,e);return t}l.getEphemeralitySystemMessageForDisabledEphemerality=e}),98); __d("WAWebSendMsgChatActionUtils",["WALogger","WATimeUtils","WAWebDBUpdateChatTable","WAWebEphemeralitySystemMsg","WAWebEphemeralityTypes","WAWebEphemeralityUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e,t){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n){if(n.ephemeralDuration!=null&&n.ephemeralDuration>0&&o("WAWebEphemeralityUtils").isEphemeralityDisabledForMessagingWithContact(t.contact)){var r=0,a=t.contact.id;if(a.isRegularUser()){var i=babelHelpers.extends({},n,{ephemeralDuration:r}),l=[o("WAWebEphemeralitySystemMsg").getEphemeralitySystemMessageForDisabledEphemerality(a)],s={ephemeralDuration:r,ephemeralSettingTimestamp:o("WATimeUtils").unixTime(),disappearingModeInitiator:o("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat,disappearingModeTrigger:o("WAWebEphemeralityTypes").DisappearingModeTrigger.Unknown,disappearingModeInitiatedByMe:!1};return yield o("WAWebDBUpdateChatTable").updateChatTable(t.id,s),t.set(s),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["maybeDisableEphemeralityForMsg: chat ephemeral duration set to "," due to disabled ephemerality for contact ",""])),r,a.toLogString()),{msgData:i,systemMsgs:l}}}return{msgData:n,systemMsgs:null}}),u.apply(this,arguments)}l.maybeDisableEphemeralityForMsg=s}),98); __d("WAWebSendMsgChatAction",["Promise","WAJobOrchestratorTypes","WALogger","WATimeUtils","WAWebApiGroupInviteV4Store","WAWebAppTracker","WAWebBizAgentAction","WAWebBizShowOrderEphemeralSystemAction","WAWebDBProcessMessage","WAWebDBRevokeInviteV4","WAWebDBThreadMetadataBulkHelper","WAWebEmptyChatSystemMsg","WAWebLid1X1MigrationGating","WAWebLidMigrationFrontendUtils","WAWebLidMigrationUtils","WAWebMaybeGetAppendedAiThreadAttributes","WAWebMaybeGetBotModeSelection","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebMiscErrors","WAWebMsgCollection","WAWebMsgInfoUtils","WAWebMsgModel","WAWebMsgType","WAWebOrchestratorNonPersistedJob","WAWebPrivacyMode_WORKER_INCOMPATIBLE","WAWebSendMsgChatActionUtils","WAWebSendMsgRecordAction","WAWebStateUtils","WAWebThreadMsgUtils","WAWebWamMsgUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_;function f(e,t,n){return C(o("WAWebStateUtils").unproxy(e),t,n)}function g(e,t){return v(o("WAWebStateUtils").unproxy(e),t)}function h(e,t,n){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r){r===void 0&&(r=function(t){return(_||(_=n("Promise"))).resolve({msg:t})});var a=yield t,i=o("WAWebMsgCollection").MsgCollection.add(babelHelpers.extends({},a))[0];if(i)return b(e,r(i))}),y.apply(this,arguments)}function C(t,a,i){i===void 0&&(i=void 0),o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["_addAndSendMsgToChat start chatId: ",""])),t.id.toLogString());var l=(_||(_=n("Promise"))).resolve(a).then((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n,a;o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["_addAndSendMsgToChat consistent msg id? ",". ",", ",""])),t.id.equals(e.id.remote),t.id.toLogString(),(n=e.id.remote)==null?void 0:n.toLogString()),yield o("WAWebLidMigrationFrontendUtils").validateMissingAccountLid(t,e,"addAndSendMsgToChat");var i=o("WAWebPrivacyMode_WORKER_INCOMPATIBLE").getPrivacyModeFromModel(t.id),l=yield o("WAWebMaybeGetAppendedAiThreadAttributes").maybeGetAppendedAiThreadAttributes(e),_=l[0],f=l[1],g=o("WAWebMaybeGetBotModeSelection").maybeGetBotModeSelection(t,e),h=babelHelpers.extends({},e,{agentId:o("WAWebBizAgentAction").getAgentId(e),threadIds:_,aiThreadInfo:f,threadBotModeSelection:g});i&&(h.privacyModeWhenSent=i);var y=yield o("WAWebSendMsgChatActionUtils").maybeDisableEphemeralityForMsg(t,h),C=y.msgData,b=y.systemMsgs,v=new(o("WAWebMsgModel")).Msg(C),S=o("WAWebMsgCollection").MsgCollection.add(v)[0];if(S){var R,L,E=!!((R=t.groupMetadata)!=null&&R.isLidAddressingMode),k=o("WAWebMsgInfoUtils").getGroupMessageSendReporterOptions(t.id,o("WAWebWamMsgUtils").msgIsLid(S,t.id,E));if(S.wamMessageSendReporter=new(o("WAWebMessageSendReporter")).MessageSendReporter(S,k),S.wamMessageSendPerfReporter=new(o("WAWebMessageSendPerfReporter")).MessageSendPerfReporter({chatWid:S.to,mediaType:S.getWamMediaType(),messageType:S.getWamMessageType()}),o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["_addAndSendMsgToChat before system messages ",""])),t.id.toLogString()),a=yield r("WAWebEmptyChatSystemMsg")(S,t),!a){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["_addAndSendMsgToChat before ephemeral system messages"])));var I=o("WAWebBizShowOrderEphemeralSystemAction").getMaybeSystemMsgForOrderEphemeralExemption(S,t);I&&(a=[I])}b&&(a=[].concat(a!=null?a:[],b)),o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["_addAndSendMsgToChat after system messages"])));var T=a?[].concat(a,[C]):[C];return(L=S.wamMessageSendPerfReporter)==null||L.startSavedStage(),o("WAWebDBProcessMessage").storeMessages(T,t.id).then(function(){var e;if((e=S.wamMessageSendPerfReporter)==null||e.postSavedStage(),o("WAWebThreadMsgUtils").isThreadMsg(C)&&o("WAWebDBThreadMetadataBulkHelper").persistNewMessagesThreadMetadataInBulk([C]),S.type===o("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE){var t=parseInt(S.inviteCodeExp,10),n=S.from.isLid()?o("WAWebLidMigrationUtils").toLid(S.to):S.to;if(!n){var r=o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated();o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[group-invites] isLidMigrated: ",""])),r);var a="[group-invites] failed to get lid mapping when revoking existing duplicate group invite";o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["",""])),a).sendLogs(a);return}return o("WAWebDBRevokeInviteV4").revokeGroupInviteV4(S.from.toString(),n.toString(),S.inviteGrp,t).then(function(){return o("WAWebApiGroupInviteV4Store").persistGroupInviteV4Msg(S.id.toString(),{id:S.id.toString(),from:S.from.toString(),to:n.toString(),groupId:S.inviteGrp,expiration:t,expired:o("WATimeUtils").unixTime()>=t})})}}).then(function(){return S.waitForPrep().then(function(){return a?{msg:S,systemMsgs:a}:{msg:S}})})}throw new(o("WAWebMiscErrors")).ModelCreateError("Msg",h)});return function(t){return e.apply(this,arguments)}})()),f=b(t,l),g=i?f.then(i).then(function(){return f}):f,h=v(t,g);return[f,h]}function b(e,t){return e.addQueue.enqueue(t).then(function(t){var n,r=t.msg,a=t.systemMsgs;if(o("WAWebAppTracker").AppTracker.start(o("WAWebAppTracker").AppTrackerType.SendMessage),(n=r.wamMessageSendPerfReporter)==null||n.startRenderedStage(),a){var i=a.map(function(e){return new(o("WAWebMsgModel")).Msg(e)});e.msgs.add(i)}return e.msgs.add(r)[0]}).then(function(t){var n;return e.createdLocally=!1,(n=t.wamMessageSendPerfReporter)==null||n.postRenderedStage(),t})}function v(e,t){return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var n=yield e.sendQueue.enqueue(t);return o("WAWebSendMsgRecordAction").sendMsgRecord(n)}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}l.addAndSendMsgToChat=f,l.resendMsgToChat=g,l.addMsgToChat=h}),98); __d("WAWebSendTcTokenChatAction",["WALogger","WATimeUtils","WAWebABProps","WAWebChatCollection","WAWebLidMigrationUtils","WAWebSchemaChat","WAWebSetPrivacyTokensJob","WAWebTrustedContactsUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(!(!t.isUserNotPSA()||t.isBot())){var n=o("WAWebChatCollection").ChatCollection.get(t);if(n!=null&&o("WAWebTrustedContactsUtils").shouldSendNewToken(n.tcTokenSenderTimestamp))try{var r=o("WATimeUtils").unixTime(),a;if(o("WAWebABProps").getABPropConfigValue("lid_trusted_token_issue_to_lid")?a=o("WAWebLidMigrationUtils").toLid(t):a=o("WAWebLidMigrationUtils").toPn(t),a==null)return;yield o("WAWebSetPrivacyTokensJob").issuePrivacyToken(a,[o("WAWebSetPrivacyTokensJob").TokenType.TrustedContact],r);var i={tcTokenSenderTimestamp:r};n.set(i),yield o("WAWebSchemaChat").getChatTable().merge(t.toString(),i)}catch(t){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["sendTcToken failed - ",""])),t).verbose().sendLogs("send-tc-token-failed")}}}),u.apply(this,arguments)}l.sendTcToken=s}),98); __d("WAWebSendTextMsgChatAction",["WAJobOrchestratorTypes","WALogger","WAWebAppTracker","WAWebBizAgentAction","WAWebBizBotTosUtils","WAWebBotGating","WAWebBotGroupGatingUtils","WAWebBotMessageSecret","WAWebBotProfileCollection","WAWebBotSystemMsg","WAWebBotUtils","WAWebChatGetters","WAWebDBProcessMessage","WAWebDBThreadMetadataBulkHelper","WAWebEmptyChatSystemMsg","WAWebGetEphemeralFieldsMsgActionsUtils","WAWebLidMigrationFrontendUtils","WAWebLimitSharingPropMappingUtils","WAWebMaybeGetAppendedAiThreadAttributes","WAWebMaybeGetBotModeSelection","WAWebMessagePluginGenerateReportingTokenContent","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebMessagingGatingUtils","WAWebMsgDataUtils","WAWebMsgInfoUtils","WAWebMsgModel","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebNonJidMentionType","WAWebOrchestratorNonPersistedJob","WAWebPresenceChatAction","WAWebPrivacyMode_WORKER_INCOMPATIBLE","WAWebProductCatalogLogEvents","WAWebQuestionsGatingUtils","WAWebSendMsgChatActionUtils","WAWebSendMsgRecordAction","WAWebStateUtils","WAWebThreadMsgUtils","WAWebUserPrefsMeUser","WAWebWamMsgUtils","WAWebWid","asyncToGeneratorRuntime","isEmptyObject"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e,t,n){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){n===void 0&&(n={});var r=o("WAWebStateUtils").unproxy(e),a=yield m(r,t,n);if(a){yield o("WAWebBizBotTosUtils").maybeShowBizBot1pTos(r);var i=yield o("WAWebSendMsgChatActionUtils").maybeDisableEphemeralityForMsg(r,a),l=i.msgData,s=i.systemMsgs;return _(r,l,s)}}),d.apply(this,arguments)}function m(e,t,n){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a){var i,l,u,c;a===void 0&&(a={});var d=(n||"").trim();if(d==="")return null;var m=a,p=m.aiThreadInfo,_=m.ctwaContext,f=m.encryptedCommentFields,g=m.groupMentions,h=m.isQuestion,y=m.isWamoSub,C=m.linkPreview,b=m.mentionedJidList,v=m.paymentLinkMetadata,S=m.questionReplyQuotedMessage,R=m.quotedMsg,L=m.quotedMsgAdminGroupJid,E=m.quotedMsgAdminGroupSubject,k=m.quotedMsgAdminParentGroupJid,I=m.selectedCarouselCardIndex,T=m.selectedId,D=m.selectedIndex,x=m.threadIds;o("WAWebPresenceChatAction").clearPresence(t);var $;if(R)$=R.msgContextInfo(t.id);else if(L!=null&&E!=null&&k!=null)$={quotedRemoteJid:L,quotedGroupSubject:E,quotedParentGroupJid:k};else if(L!=null)$={quotedRemoteJid:L};else if(h===!0)if(o("WAWebQuestionsGatingUtils").isQuestionSenderEnabledForMsgType(o("WAWebMsgType").MSG_TYPE.CHAT))$={isQuestion:!0};else return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[questions] Unsupported question message type: ",""])),o("WAWebMsgType").MSG_TYPE.CHAT).tags("questions").sendLogs("questions-unsupported-message-type-"+o("WAWebMsgType").MSG_TYPE.CHAT),null;else if(S)if(o("WAWebQuestionsGatingUtils").isQuestionReplySenderEnabledForMsgType(o("WAWebMsgType").MSG_TYPE.CHAT))$={questionReplyQuotedMessage:S};else return o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[questions] Unsupported question reply message type: ",""])),o("WAWebMsgType").MSG_TYPE.CHAT).tags("questions").sendLogs("questions-unsupported-reply-message-type-"+o("WAWebMsgType").MSG_TYPE.CHAT),null;var P;t.limitSharing!=null&&(P=t.limitSharing,P.initiatedByMe=o("WAWebUserPrefsMeUser").isMeAccount(P.initiatedBy),r("WAWebWid").isGroup(t.id)&&typeof P.trigger=="string"&&(P.trigger=o("WAWebLimitSharingPropMappingUtils").getLimitSharingTriggerFromGroupSettingsChange(P.trigger)),delete P.initiatedBy);var N=babelHelpers.extends({},C),M=babelHelpers.extends({},N,$,{mentionedJidList:b,groupMentions:g,ctwaContext:_,body:d,subtype:r("isEmptyObject")(N)?null:"url",urlText:t.urlText,urlNumber:t.urlNumber,botMsgBodyType:a.botMsgBodyType},yield o("WAWebMsgDataUtils").genOutgoingMsgData(t,"chat"),{paymentLinkMetadata:v,limitSharing:P,threadIds:x,aiThreadInfo:p},o("WAWebGetEphemeralFieldsMsgActionsUtils").getEphemeralFields(t)),w=yield o("WAWebMaybeGetAppendedAiThreadAttributes").maybeGetAppendedAiThreadAttributes(M),A=w[0],F=w[1],O=o("WAWebMaybeGetBotModeSelection").maybeGetBotModeSelection(t,M);M.threadIds=A,M.aiThreadInfo=F,M.threadBotModeSelection=O,t.urlText&&(t.urlText=void 0),t.urlNumber&&(t.urlNumber=void 0),D!=null&&(M.type="template_button_reply",M.selectedId=T,M.selectedIndex=D,M.selectedCarouselCardIndex=I);var B=o("WAWebPrivacyMode_WORKER_INCOMPATIBLE").getPrivacyModeFromModel(t.id);if(B!=null&&(M.privacyModeWhenSent=B),M.agentId=o("WAWebBizAgentAction").getAgentId(M),o("WAWebBotGating").isBotEnabled()&&(!o("WAWebBotGroupGatingUtils").isOpenGroupBotSendEnabled()||((i=t.groupMetadata)==null?void 0:i.isOpenBotGroup)!==!0)){var W=b==null?void 0:b.find(function(e){return e.isBot()});if(W!=null&&W.isBot()){M.invokedBotWid=W;var q=R==null?void 0:R.botTargetSenderJid;q!=null&&!o("WAWebUserPrefsMeUser").isMeAccount(q)&&(M.botTargetSenderJid=R==null?void 0:R.botTargetSenderJid)}}var U=t.isCAGAdmin(),V=M.subtype==="url",H=!!(o("WAWebBotGating").isBotEnabled()&&((l=M.invokedBotWid)!=null&&l.isBot())),G=!!(o("WAWebBotGating").isBotEnabled()&&M.to.isBot()),z=o("WAWebMessagingGatingUtils").isReportingTokenSendingEnabled()&&o("WAWebMessagePluginGenerateReportingTokenContent").isMsgTypeReportingTokenCompatible(M.type,M.subtype);if((U||V||H||G||z)&&(M.messageSecret=self.crypto.getRandomValues(new Uint8Array(32))),(H||o("WAWebBotGroupGatingUtils").isOpenGroupBotSendEnabled()&&((u=t.groupMetadata)==null?void 0:u.isOpenBotGroup)===!0)&&(M.botMessageSecret=yield o("WAWebBotMessageSecret").genBotMsgSecretFromMsgSecret(M.messageSecret)),o("WAWebBotGroupGatingUtils").isOpenGroupBotSendEnabled()&&((c=t.groupMetadata)==null?void 0:c.isOpenBotGroup)===!0&&(M.botGroupParticipant=o("WAWebBotUtils").META_BOT_FBID_WID),H||G){var j;if(H?j=M.invokedBotWid:G&&(j=M.to),j!=null){var K,Q=(K=o("WAWebBotProfileCollection").BotProfileCollection.get(j))==null?void 0:K.personaId;Q!=null&&(M.botPersonaId=Q)}}R&&R.type===o("WAWebMsgType").MSG_TYPE.PRODUCT&&o("WAWebProductCatalogLogEvents").logProductMessageBusinessSend(R,R.sessionId),f&&(M.type=o("WAWebMsgType").MSG_TYPE.COMMENT,M.encIv=f==null?void 0:f.encIv,M.encPayload=f==null?void 0:f.encPayload,M.targetMessageKey=f==null?void 0:f.targetMessageKey),y===!0&&o("WAWebChatGetters").getIsNewsletter(t)&&o("WAWebNewsletterGatingUtils").isWamoSubCreatorExperienceSupported()&&(M.isWamoSub=!0);var X=0;return a.maybeNonJidMentioned===!0&&/@all\b/g.test(d)&&(X|=r("WAWebNonJidMentionType").MENTION_ALL),X>0&&(M.nonJidMentions=X),M}),p.apply(this,arguments)}function _(e,t,n){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a){var i,l,s,c;o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["addAndSendTextMsg chat: ",""])),e.id.toLogString()),yield o("WAWebLidMigrationFrontendUtils").validateMissingAccountLid(e,t,"addAndSendTextMsg");var d=new(o("WAWebMsgModel")).Msg(t),m=o("WAWebBotSystemMsg").getMaybeSysMsgForBotInvoke(d,e),p=[].concat((i=yield r("WAWebEmptyChatSystemMsg")(d,e))!=null?i:[],[m],a!=null?a:[]).filter(Boolean),_=!!((l=e.groupMetadata)!=null&&l.isLidAddressingMode),f=o("WAWebMsgInfoUtils").getGroupMessageSendReporterOptions(e.id,o("WAWebWamMsgUtils").msgIsLid(t,e.id,_));d.wamMessageSendReporter=new(o("WAWebMessageSendReporter")).MessageSendReporter(d,f),d.wamMessageSendPerfReporter=new(o("WAWebMessageSendPerfReporter")).MessageSendPerfReporter({chatWid:d.to,mediaType:d.getWamMediaType(),messageType:d.getWamMessageType()}),o("WAWebAppTracker").AppTracker.start(o("WAWebAppTracker").AppTrackerType.SendMessage),(s=d.wamMessageSendPerfReporter)==null||s.startRenderedStage(),p.length>0&&e.msgs.add(p),e.msgs.add(d),(c=d.wamMessageSendPerfReporter)==null||c.postRenderedStage(),e.createdLocally=!1;var g=p.length>0?[].concat(p,[t]):[t];return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var n,r;(n=d.wamMessageSendPerfReporter)==null||n.startSavedStage(),yield o("WAWebDBProcessMessage").storeMessages(g,e.id),m&&(yield e.updateBotInvokeSystemMsgCreated()),(r=d.wamMessageSendPerfReporter)==null||r.postSavedStage(),o("WAWebThreadMsgUtils").isThreadMsg(t)&&(yield o("WAWebDBThreadMetadataBulkHelper").persistNewMessagesThreadMetadataInBulk([t]));var a=yield o("WAWebSendMsgRecordAction").sendMsgRecord(d);return a}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}),f.apply(this,arguments)}l.sendTextMsgToChat=c,l.createTextMsgData=m,l.addAndSendTextMsg=_}),98); __d("WAWebSendUnstarAllChatAction",["fbt","WAFilteredCatch","WALogger","WAWebActionToast.react","WAWebBackendErrors","WAWebChatCollection","WAWebChatSendStarMsgsBridge","WAWebStarredMsgCollection","WAWebStateUtils","WAWebToastManager","react"],(function(t,n,r,o,a,i,l,s){var e,u,c=u||(u=r("react"));function d(e,t){return m(e,t&&o("WAWebStateUtils").unproxy(t))}function m(t,n){var r=n?n.promises:o("WAWebChatCollection").ChatCollection.promises,a=n?n.id:void 0;if(r.sendUnstarAll)return r.sendUnstarAll;var i=r.sendUnstarAll=o("WAWebChatSendStarMsgsBridge").sendUnstarAll(t,a),l=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Dejando de destacar todos los mensajes\u2026")),u=i.then(function(){return new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Todos los mensajes no destacados"))}).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){if(e.statusCode>=400)return new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudieron dejar de destacar todos los mensajes."))})).catch(function(r){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["models:chat:sendUnstarAll dropped"]))),new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudieron dejar de destacar todos los mensajes."),{actionText:s._(/*BTDS*/"Vuelve a intentarlo."),actionHandler:function(){return m(t,n)}})});return o("WAWebToastManager").ToastManager.open(c.jsx(o("WAWebActionToast.react").ActionToast,{initialAction:l,pendingAction:u})),i.then(function(){t.forEach(function(e){e.set("star",!1)}),n?o("WAWebStarredMsgCollection").removeStarredMsgs(t):(o("WAWebStarredMsgCollection").AllStarredMsgsCollection.reset(),o("WAWebChatCollection").ChatCollection.forEach(function(e){e.starredMsgs&&e.starredMsgs.reset()}))}).finally(function(){r.sendUnstarAll=null})}l.unstarAllMessages=d}),226); __d("WAWebUpdateDraftMessageChatJob",["WAAbortError","WAJobOrchestratorTypes","WAWebDBChatSerialization","WAWebDBUpdateChatTable","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.abortSignal,n=e.chatId,r=e.draftMessage,a=o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("updateDraftMessageChat",function(e){if(e.abortSignal.aborted)throw new(o("WAAbortError")).AbortError;return o("WAWebDBUpdateChatTable").updateChatTable(e.chatId,o("WAWebDBChatSerialization").serializeChat({draftMessage:e.draftMessage}))},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({chatId:n,draftMessage:r,abortSignal:t});yield a}),s.apply(this,arguments)}l.updateDraftMessageChat=e}),98); __d("WAWebUpdateDraftMessageChatAction",["WAWebChatCollection","WAWebNewsletterCollection","WAWebUpdateDraftMessageChatJob","WAWebWid"],(function(t,n,r,o,a,i,l){function e(e,t){var n=r("WAWebWid").isNewsletter(e)?r("WAWebNewsletterCollection").get(e):o("WAWebChatCollection").ChatCollection.get(e),a=new AbortController,i=o("WAWebUpdateDraftMessageChatJob").updateDraftMessageChat({chatId:e,draftMessage:t,abortSignal:a.signal});if(i.finally(function(){if(n){var e;(n==null||(e=n.promises.updateDraftMessage)==null?void 0:e.promise)===i&&(n.promises.updateDraftMessage=null)}}),n){var l=n.promises;l.updateDraftMessage!=null&&l.updateDraftMessage.abortController.abort(),n.draftMessage=t,n.promises.updateDraftMessage={promise:i,abortController:a}}return i}l.updateDraftMessageChat=e}),98); __d("WAWebUpdateLastAddOnPreviewChatAction",["WAWebChatCollection","WAWebMsgKey","WAWebNewsletterCollection","WAWebWid"],(function(t,n,r,o,a,i,l){function e(e){e.forEach(function(e,t){var n=r("WAWebWid").isNewsletter(t)?r("WAWebNewsletterCollection").get(t):o("WAWebChatCollection").ChatCollection.get(t);n!=null&&n.set({chatlistPreview:e,lastReactionPreview:void 0})})}function s(e){var t=new Set(e.map(function(e){return r("WAWebMsgKey").fromString(e).remote.toString()}));t.forEach(function(t){var n,a,i=(n=o("WAWebChatCollection").ChatCollection.get(t))!=null?n:r("WAWebNewsletterCollection").get(t);if(i!=null){var l=(a=i.chatlistPreview)==null?void 0:a.parentMsgKey;l!=null&&e.includes(l)&&i.unset(["chatlistPreview","lastReactionPreview"])}})}l.updateModelsForLastAddOnPreview=e,l.deleteModelsForLastAddOnPreview=s}),98); __d("WAWebUpdateUnreadChatAction",["fbt","Promise","WAFilteredCatch","WALogger","WAShiftTimer","WAWebABProps","WAWebActionToast.react","WAWebApiChat","WAWebBackendErrors","WAWebChatGetters","WAWebChatSeenBridge","WAWebCmd","WAWebConstantsDeprecated","WAWebCurrentUser","WAWebDBUpdateChatTable","WAWebNoop","WAWebPromiseQueue","WAWebSendReadReceiptJob","WAWebStateUtils","WAWebStreamModel","WAWebToastManager","WAWebUim","asyncToGeneratorRuntime","err","gkx","react"],(function(t,n,r,o,a,i,l,s){var e,u,c,d,m,p,_,f,g=f||(f=r("react"));function h(e,t,n){return n===void 0&&(n=!0),E(o("WAWebStateUtils").unproxy(e),t,n)}function y(){var e=null,t=new(o("WAShiftTimer")).ShiftTimer(function(t){v(t),e=null});return(function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n){var r=n.afterAvailable,a=r===void 0?!0:r,i=n.chat,l=n.threadId,s=e;if(s!=null){var u=s.chat.id.toString(),c=i.id.toString();u!==c&&(t.cancel(),v(s),e=null)}if(!t.isScheduled()){var d=o("WAWebABProps").getABPropConfigValue("web_resume_optimized_read_receipt_send_interval");t.onOrAfter(d,{chat:i,threadId:l,afterAvailable:a})}e={chat:i,threadId:l,afterAvailable:a}});return function(e){return r.apply(this,arguments)}})()}var C=y(),b=function(t){return o("WAWebCmd").Cmd.isOfflineDeliveryEnd?v(t):C(t)};function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.afterAvailable,r=t===void 0?!0:t,a=e.chat,i=e.threadId,l=i===void 0?null:i;if(o("WAWebCurrentUser").isEmployee()&&o("WAWebUim").isCmdPressed()){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["sendSeen: skip since cmd is pressed"])));return}var s=o("WAWebStateUtils").unproxy(a);yield(_||(_=n("Promise"))).all([I({chat:s,threadId:l,afterAvailable:r}),B({chat:s,threadId:l,afterAvailable:r})]).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){o("WALogger").WARN(p||(p=babelHelpers.taggedTemplateLiteralLoose(["sendSeen: got status ",""])),e.status)}))}),S.apply(this,arguments)}function R(e,t,n){return x(o("WAWebStateUtils").unproxy(e),t,n)}function L(e){return P(o("WAWebStateUtils").unproxy(e))}function E(t,a,i,l){l===void 0&&(l=o("WAWebActionToast.react").genId()),a?t.active&&(t.markedUnread=!0):t.markedUnread=!1;var u=t.promises;if(u.markUnread)return u.markUnread;var c=u.markUnread=a?T(t):(_||(_=n("Promise"))).all([I({chat:t}),B({chat:t})]),d=a?new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Marcando como no le\u00eddo\u2026")):new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Marcando como le\u00eddo\u2026")),m=c.then(function(){var e=a?s._(/*BTDS*/"Marcado como no le\u00eddo"):s._(/*BTDS*/"Marcado como le\u00eddo");return i?new(o("WAWebActionToast.react")).ActionType(e,{actionText:s._(/*BTDS*/"Deshacer"),actionHandler:function(){return E(t,!a,i,l)}}):new(o("WAWebActionToast.react")).ActionType(e)}).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){if(e.status>=400)return a?new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo marcar el chat como no le\u00eddo.")):new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo marcar el chat como le\u00eddo."));throw r("err")("invalid response status")})).catch(function(){var e=a?s._(/*BTDS*/"No se pudo marcar el chat como no le\u00eddo."):s._(/*BTDS*/"No se pudo marcar el chat como le\u00eddo.");return i?new(o("WAWebActionToast.react")).ActionType(e,{actionText:s._(/*BTDS*/"Vuelve a intentarlo."),actionHandler:function(){return E(t,a,i,l)}}):new(o("WAWebActionToast.react")).ActionType(e)});return o("WAWebToastManager").ToastManager.open(g.jsx(o("WAWebActionToast.react").ActionToast,{id:l,initialAction:d,pendingAction:m})),c.then(r("WAWebNoop")).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(t){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["markUnread: got status ",""])),t.status)})).finally(function(){u.markUnread=null})}function k(e){r("gkx")("26258")||o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[update-unread]: ",""])),e)}function I(e){var t=e.afterAvailable,a=t===void 0?!0:t,i=e.chat,l=e.threadId,s=l===void 0?null:l;if(k("sendSeen: start"),i.markedUnread||i.unreadCount===0)return k("markedUnread: "+String(i.markedUnread)),k("unreadCount: "+i.unreadCount),k("sendSeen: end-1"),(_||(_=n("Promise"))).resolve();if(!o("WAWebStreamModel").Stream.available&&a)return k("stream unavailable"),i.listenToOnce(o("WAWebStreamModel").Stream,"change:available",function(){return I({chat:i,threadId:s})}),k("sendSeen: end-2"),(_||(_=n("Promise"))).resolve();k("stream available"),k("unreadCount: "+i.unreadCount),k("pendingSeenCount: "+i.pendingSeenCount);var u=i.unreadCount-i.pendingSeenCount;k("unreadCountDelta: "+u);var d=i.unreadCount===-1&&u===-1;if(u<=0&&!d&&s==null)return k("sendSeen: end-3"),(_||(_=n("Promise"))).resolve();i.disableUnreadAnchor=!0,i.pendingSeenCount=i.unreadCount,k("pendingSeenCount set to: "+i.unreadCount);var m=function(){i.pendingSeenCount-=u,k("pendingSeenCount set to "+i.pendingSeenCount),i.pendingSeenCount<0&&(o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["models:chat:sendSeen unread "," pending: "," delta: ",""])),i.unreadCount,i.pendingSeenCount,u),i.pendingSeenCount=0)},p=r("gkx")("26258")?i.getLastMsgKeyForAction():i.lastReceivedKey;return o("WAWebChatSeenBridge").sendConversationSeen(i,p,u,s!=null?s:void 0).then((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.fullyReadThreadIds;yield M(i,u);for(var n of t){var r,o=(r=i.aiThreads)==null?void 0:r.get(n);o&&o.set({unreadCount:0})}});return function(t){return e.apply(this,arguments)}})()).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){return m(),(_||(_=n("Promise"))).reject(e)})).then(function(){k("sendSeen: end-4")})}function T(e){return D.apply(this,arguments)}function D(){return D=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.getLastMsgKeyForAction();try{yield o("WAWebChatSeenBridge").sendConversationUnseen(e.id,t),yield L(e)}catch(t){return o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(t){return e.markedUnread=!1,(_||(_=n("Promise"))).reject(t)})(t)}}),D.apply(this,arguments)}function x(e,t,n){return $.apply(this,arguments)}function $(){return $=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r){r===void 0&&(r=!1),k("markSeen: start - "+String(t));var a=null;t!=null?t>0&&t<=e.unreadCount?a=e.unreadCount-t:t===-1&&e.unreadCount<=0&&(a=0):a=0;var i=a==null?(_||(_=n("Promise"))).resolve():o("WAWebChatSeenBridge").markConversationSeen(e.id,a);if(yield i,t!=null&&r){var l=e.pendingSeenCount-t;e.pendingSeenCount=Math.max(0,l),k("pendingSeenCount set to "+e.pendingSeenCount)}a!=null&&(e.unreadCount=a,k("unreadCount set to "+a)),e.unreadMsgAnchor=void 0,e.markedUnread=!1,e.unreadDividerOffset=0,k("markSeen: end")}),$.apply(this,arguments)}function P(e){return N.apply(this,arguments)}function N(){return N=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(e.unreadCount===0||e.unreadCount===r("WAWebConstantsDeprecated").MARKED_AS_UNREAD)return e.active&&(e.markedUnread=!0),o("WAWebChatSeenBridge").markConversationUnseen(e.id).then(function(){e.unreadCount=r("WAWebConstantsDeprecated").MARKED_AS_UNREAD})}),N.apply(this,arguments)}function M(e,t,n){return w.apply(this,arguments)}function w(){return w=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){n===void 0&&(n=!0);var r=yield o("WAWebApiChat").getChatMeta(e.id),a=r.unreadCount;if(k("updateUnreadCount: old "+e.unreadCount+", new "+a),e.unreadCount=a,e.unreadDividerOffset=0,e.unreadMsgAnchor=void 0,e.markedUnread=!1,n){var i=e.pendingSeenCount-t;e.pendingSeenCount=Math.max(0,i)}}),w.apply(this,arguments)}function A(e){if(o("WAWebChatGetters").getIsGroup(e)){var t;(t=e.groupMetadata)==null||t.unreadMentionMetadata.reset()}}function F(e){r("gkx")("26258")||o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[message-edit/send-seen] ",""])),e)}var O=new(o("WAWebPromiseQueue")).PromiseQueue;function B(e){return W.apply(this,arguments)}function W(){return W=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e.afterAvailable,r=t===void 0?!0:t,a=e.chat,i=e.threadId,l=i===void 0?null:i;if(a.unreadEditTimestampMs!=null){if(F("sendSeen: start - "+String(a.unreadEditTimestampMs)),!o("WAWebStreamModel").Stream.available&&r){a.listenToOnce(o("WAWebStreamModel").Stream,"change:available",function(){return B({chat:a,threadId:l})}),F("sendSeen: end - stream unavailable");return}var s=a.unreadEditTimestampMs;yield O.enqueue(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(a.unreadEditTimestampMs==null){F("sendSeen: end - no unread edits");return}var e=yield o("WAWebSendReadReceiptJob").markEditedMsgsRead(a.id,{trusted:a.trusted},l!=null?l:void 0),t=e.fullyReadThreadIds;if(t.length>0){for(var n of t){var r;(r=a.aiThreads)==null||(r=r.get(n))==null||r.set({unreadCount:0})}F("sendSeen: updated "+t.length+" thread unread counts")}if(F("sendSeen: marked edit as read"),s!==a.unreadEditTimestampMs){F("sendSeen: end - has new unread edits");return}a.unreadEditTimestampMs=null,yield o("WAWebDBUpdateChatTable").updateChatTable(a.id,{unreadEditTimestampMs:null}),F("sendSeen: end - all edits are marked as read")}))}}),W.apply(this,arguments)}l.markUnread=h,l.sendSeenDebounced=b,l.sendSeen=v,l.markSeen=R,l.markUnseen=L,l.updateUnreadCountMD=M,l.clearUnreadMentions=A}),226); __d("WAWebUpdateSubgroupsCommunityAction",["WAWebApiUnjoinedSubgroupMetadataStore","WAWebChatCollection","WAWebGroupMetadataCollection","WAWebGroupQueryBridge","WAWebGroupUnjoinedSubgroupJob","WAWebUnjoinedSubgroupMetadataCollection","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){e.joinedSubgroups=r("WAWebGroupMetadataCollection").filter(function(t){var n;return((n=t.parentGroup)==null?void 0:n.equals(e.id))&&t.participants.iAmMember()}).map(function(e){return e.id})}function s(e){e.unjoinedSubgroups=r("WAWebUnjoinedSubgroupMetadataCollection").filter(function(t){return t.parentGroupId.equals(e.id)}).map(function(e){return e.id})}function u(t,n){o("WAWebApiUnjoinedSubgroupMetadataStore").removeUnjoinedSubgroupMetadataFromStorage(n),m(n),s(t),e(t)}function c(t,n){r("WAWebGroupMetadataCollection").add({id:n,parentGroup:null},{merge:!0}),e(t)}function d(t,n){var r=o("WAWebChatCollection").ChatCollection.get(n.toString()),a=r==null?void 0:r.groupMetadata;if(!(r==null||a==null)&&(e(t),!(a.participants.length===0||!t.participants.iAmAdmin()&&a.hiddenSubgroup===!0||!t.hasJoined()))){var i={id:n,subject:r.formattedTitle,defaultSubgroup:!!a.defaultSubgroup,generalSubgroup:!!a.generalSubgroup,parentGroupId:t.id,membershipApprovalMode:a.membershipApprovalMode,hiddenSubgroup:!!a.hiddenSubgroup};o("WAWebGroupUnjoinedSubgroupJob").updateUnjoinedSubgroupsJob([i],t.id),p([i],t.id)}}function m(e){r("WAWebUnjoinedSubgroupMetadataCollection").remove(e.toString())}function p(e,t,n){n===void 0&&(n=!0),e.forEach(function(e){if(!n){m(e.id);return}var o=e.subject,a=e.subjectTime,i=r("WAWebUnjoinedSubgroupMetadataCollection").get(e.id.toString());i&&(i.subjectTime||0)>(a||0)&&(o=i.subject,a=i.subjectTime),r("WAWebUnjoinedSubgroupMetadataCollection").add(babelHelpers.extends({},e,{parentGroupId:t,subject:o,subjectTime:a}),{merge:!0})});var o=r("WAWebGroupMetadataCollection").get(t.toString());o&&s(o)}function _(e,t){var n=r("WAWebUnjoinedSubgroupMetadataCollection").filter(function(e){return e.parentGroupId.equals(t)}).map(function(e){return e.id}),o=n.filter(function(t){return!e.includes(t)});r("WAWebUnjoinedSubgroupMetadataCollection").remove(o)}function f(t,n,a){a===void 0&&(a=!0),t.forEach(function(e){var t=e.generalSubgroup,i=e.hiddenSubgroup,l=e.id,s=e.subject;s!=null&&o("WAWebGroupQueryBridge").updateSubject(l,s),r("WAWebGroupMetadataCollection").add(babelHelpers.extends({},e,{parentGroup:a?n:null,generalSubgroup:a?t:null,hiddenSubgroup:a?i:null}),{merge:!0})}),e(r("WAWebGroupMetadataCollection").assertGet(n.toString()))}function g(e){var t,n=o("WAWebChatCollection").ChatCollection.get(e.toString());return n==null||!((t=n.groupMetadata)!=null&&t.participants.iAmMember())}function h(e){return e.filter(function(e){return g(e)})}function y(e){var t=h(e.map(function(e){var t=e.id;return t}));return e.filter(function(e){return t.includes(e.id)})}function C(e,t){var n=r("WAWebUnjoinedSubgroupMetadataCollection").get(e);n!=null&&(n.membershipApprovalRequest=t)}function b(e,t){o("WAWebApiUnjoinedSubgroupMetadataStore").updateMembershipApprovalRequestinDB(e,t),C(e,t)}function v(e){var t=e.map(function(e){return{id:e.id,size:e.participantCount}});r("WAWebUnjoinedSubgroupMetadataCollection").add(t,{merge:!0})}function S(e){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield o("WAWebApiUnjoinedSubgroupMetadataStore").updateSizeInDB(e),v(e)}),R.apply(this,arguments)}l.updateJoinedSubgroups=e,l.updateUnjoinedSubgroups=s,l.subgroupUnjoinedToJoined=u,l.unlinkParentGroup=c,l.subgroupJoinedToUnjoined=d,l.updateUnjoinedSubgroupsInCollection=p,l.cleanUnjoinedSubgroupsInCollection=_,l.updateJoinedSubgroupsInCollection=f,l.determineUnjoined=g,l.getUnjoinedSubgroups=y,l.updateMembershipApprovalRequest=b,l.updateUnjoinedSubgroupSize=S}),98); __d("WAWebAddMeContactAction",["WAJids","WAWebContactCollection","WAWebLidAwareContactsDB","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAJids").toPhoneUserJid(e.user);yield r("WAWebLidAwareContactsDB").createOrMerge(t,{id:t}),o("WAWebContactCollection").ContactCollection.gadd(e)}),s.apply(this,arguments)}l.addMeToContacts=e}),98); __d("WAWebBizVerifiedLevelToString",["WAWebBusinessProfileTypes"],(function(t,n,r,o,a,i,l){function e(e){switch(e){case o("WAWebBusinessProfileTypes").VERIFIED_LEVEL.HIGH:return"high";case o("WAWebBusinessProfileTypes").VERIFIED_LEVEL.LOW:return"low";case o("WAWebBusinessProfileTypes").VERIFIED_LEVEL.UNKNOWN:default:return"unknown"}}l.default=e}),98); __d("WAWebGetOrQueryUsyncInfoContactAction",["Promise","WALogger","WAPromiseCache","WAWebBackendErrors","WAWebBizUpdateVerifiedInfoAction","WAWebBizVerifiedLevelToString","WAWebChatCollection","WAWebContactCollection","WAWebQueryExistsJob","WAWebUpdateDisappearingModeForContact","WAWebUsync","WAWebUsyncUser","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e,t){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a=t===void 0?{forceUsync:!1}:t,i=a.forceUsync,l=o("WAWebContactCollection").ContactCollection.get(e);if(i!==!0&&l!=null&&(l.name!=null||o("WAWebChatCollection").ChatCollection.get(e)!=null)){var s,c;return{wid:e,biz:l.isBusiness,bizInfo:l.isBusiness?{verifiedName:{level:r("WAWebBizVerifiedLevelToString")(l.verifiedLevel),serial:null,name:l.verifiedName,isApi:!!l.isEnterprise,isSmb:!!l.isSmb,privacyMode:l.privacyMode}}:null,disappearingMode:{duration:(s=l.disappearingModeDuration)!=null?s:0,settingTimestamp:(c=l.disappearingModeSettingTimestamp)!=null?c:0}}}var d=yield o("WAWebQueryExistsJob").queryWidExists(e);if(d){var m=d.biz,p=d.bizInfo,_=d.disappearingMode;return m&&p!=null&&(yield o("WAWebBizUpdateVerifiedInfoAction").updateVerifiedInfo(e,p.verifiedName)),_&&l!=null&&(yield o("WAWebUpdateDisappearingModeForContact").updateDisappearingModeForContact({contactId:e,newDuration:_.duration,newSettingTimestamp:_.settingTimestamp,newEphemeralityDisabled:_.isEphemeralityDisabled===!0})),d}return(u||(u=n("Promise"))).reject(r("err")("Invalid number"))}),d.apply(this,arguments)}function m(){var e=new(r("WAPromiseCache"))(o("WAWebQueryExistsJob").queryPhoneExists,{maxCached:100,maxAge:36e4,shouldCache:function(t){return!!t}});return e}function p(e){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[usync] querying for biz info"])));var n=new(o("WAWebUsyncUser")).USyncUser,r=new(o("WAWebUsync")).USyncQuery;t.isLid()?n.withId(t):n.withPhone(t.toString()),r.withUser(n),r.withBusinessProtocol();var a=yield r.execute(),i=a.error.all;if(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[usync] biz info response"]))),i)throw new(o("WAWebBackendErrors")).ServerStatusCodeError(i.errorCode,i.errorText);var l=a.list;if(l.length!==1)return null;var u=l[0],c=u.business,d=u.id;c!=null&&(yield o("WAWebBizUpdateVerifiedInfoAction").updateVerifiedInfo(t,c.verifiedName));var m={wid:d,biz:c!=null,bizInfo:c};return m}),_.apply(this,arguments)}l.getOrQueryUsyncInfo=c,l.usyncContactCached=m,l.queryUsyncBusiness=p}),98); __d("WAWebWamEnumPhoneNumHyperlinkActionType",[],(function(t,n,r,o,a,i){var e=Object.freeze({PHONE_NUM_HYPERLINK_MSG_RECEIVED:1,LONG_PRESS_PHONE_NUM_HYPERLINK:2,CLICK_PHONE_NUM_HYPERLINK:3,CLICK_CALL:4,CLICK_ADD_TO_CONTACTS:5,CLICK_MESSAGE_ON_WHATSAPP:6,CLICK_COPY_PHONE_NUMBER:7,CLOSE_DIALOG_BOX:8,MESSAGE_SENT:9,CLICK_CALL_ON_WHATSAPP:10,CLICK_INVITE_TO_WHATSAPP:11});i.PHONE_NUM_HYPERLINK_ACTION_TYPE=e}),66); __d("WAWebPsPhoneNumberHyperlinkWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumPhoneNumHyperlinkActionType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({PsPhoneNumberHyperlink:[3266,{isPhoneNumHyperlinkOwner:[1,e.TYPES.BOOLEAN],phoneNumHyperlinkAction:[2,o("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE],phoneNumberStatusOnWa:[3,e.TYPES.BOOLEAN],sequenceNumber:[4,e.TYPES.INTEGER]},[1,1,1],"private",113760892]},{PsPhoneNumberHyperlink:[]});l.PsPhoneNumberHyperlinkWamEvent=s}),98); __d("WAWebPhoneNumberContactAction",["fbt","WAWebComposeBoxActions","WAWebCopyToClipboard","WAWebModalManager","WAWebOpenChatFlow.react","WAWebPsPhoneNumberHyperlinkWamEvent","WAWebToast.react","WAWebToastManager","WAWebUserPrefsMeUser","WAWebWamEnumPhoneNumHyperlinkActionType","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react"));function c(e,t,n){o("WAWebModalManager").ModalManager.open(u.jsx(o("WAWebOpenChatFlow.react").OpenChatFlow,{target:{wid:t},onSuccess:function(t){var e=t.chat;_(e,n)},msgText:null}),{transition:"modal-flow"}),new(o("WAWebPsPhoneNumberHyperlinkWamEvent")).PsPhoneNumberHyperlinkWamEvent({phoneNumHyperlinkAction:o("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.CLICK_MESSAGE_ON_WHATSAPP,isPhoneNumHyperlinkOwner:o("WAWebUserPrefsMeUser").isMeAccount(t),phoneNumberStatusOnWa:!0}).commit()}function d(e,t,n){o("WAWebCopyToClipboard").copyTextToClipboard(e),o("WAWebToastManager").ToastManager.open(u.jsx(o("WAWebToast.react").Toast,{msg:s._(/*BTDS*/"Se copi\u00f3 al portapapeles.")})),new(o("WAWebPsPhoneNumberHyperlinkWamEvent")).PsPhoneNumberHyperlinkWamEvent({phoneNumHyperlinkAction:o("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.CLICK_COPY_PHONE_NUMBER,isPhoneNumHyperlinkOwner:n,phoneNumberStatusOnWa:!!t}).commit()}function m(e,t){new(o("WAWebPsPhoneNumberHyperlinkWamEvent")).PsPhoneNumberHyperlinkWamEvent({phoneNumHyperlinkAction:o("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.CLICK_PHONE_NUM_HYPERLINK,isPhoneNumHyperlinkOwner:t,phoneNumberStatusOnWa:!!e}).commit()}function p(e,t){new(o("WAWebPsPhoneNumberHyperlinkWamEvent")).PsPhoneNumberHyperlinkWamEvent({phoneNumHyperlinkAction:o("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.CLOSE_DIALOG_BOX,isPhoneNumHyperlinkOwner:t,phoneNumberStatusOnWa:!!e}).commit()}function _(e,t){e&&o("WAWebComposeBoxActions").ComposeBoxActions.addMsgSendingLogAttributes(e,{handleOnce:function(){new(o("WAWebPsPhoneNumberHyperlinkWamEvent")).PsPhoneNumberHyperlinkWamEvent({phoneNumHyperlinkAction:o("WAWebWamEnumPhoneNumHyperlinkActionType").PHONE_NUM_HYPERLINK_ACTION_TYPE.MESSAGE_SENT,isPhoneNumHyperlinkOwner:t,phoneNumberStatusOnWa:!0}).commit()}})}l.handleOpenChat=c,l.handleCopyPhoneNumber=d,l.logClickOnPhoneNumber=m,l.logCloseDialog=p}),226); __d("WAWebStatusContactAction",["fbt","Promise","WALogger","WAWebActionToast.react","WAWebChatCollection","WAWebContactStatusBridge","WAWebMiscErrors","WAWebTextStatusCollection","WAWebToastManager","WAWebUserPrefsMeUser","asyncToGeneratorRuntime","react"],(function(t,n,r,o,a,i,l,s){var e,u,c,d=c||(c=r("react"));function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n,r=(t=o("WAWebChatCollection").ChatCollection.getLatestChatForWid(e))==null?void 0:t.tcToken,a={wid:e,tcToken:r},i=yield o("WAWebContactStatusBridge").getStatus(a);if(i.stale===!0){var l=o("WAWebTextStatusCollection").TextStatusCollection.get(e);if(l)return{id:e,status:l.status}}var s=(n=i.status)!=null?n:o("WAWebTextStatusCollection").getDefaultTextStatus();return{id:e,status:s}}),p.apply(this,arguments)}function _(e,t,n,r){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r,a,i){a===void 0&&(a=o("WAWebActionToast.react").genId()),i===void 0&&(i=!1);var l=t.trim();if(!l)return(u||(u=n("Promise"))).reject(new(o("WAWebMiscErrors")).ActionError);var c=o("WAWebContactStatusBridge").setMyStatus(l),m=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Cambiando secci\u00f3n Info\u2026")),p=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),f=o("WAWebTextStatusCollection").TextStatusCollection.assertGet(p).status,g=c.then(function(e){if(e.status===200){var t=i?void 0:{actionText:s._(/*BTDS*/"Deshacer"),actionHandler:function(){return _(f,r,a,!0)}};return new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Secci\u00f3n Info. cambiada"),t)}else if(e.status>=400)return new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo cambiar tu secci\u00f3n Info."))}).catch(function(n){throw o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["models:statusCollection:setMyStatus dropped"]))),new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo cambiar tu secci\u00f3n Info."),{actionText:s._(/*BTDS*/"Vuelve a intentarlo."),actionHandler:function(){return _(t,r,a)}})});o("WAWebToastManager").ToastManager.open(d.jsx(o("WAWebActionToast.react").ActionToast,{id:a,initialAction:m,pendingAction:g,onDismiss:r}));var h=yield c;h.status===200&&(o("WAWebTextStatusCollection").TextStatusCollection.assertGet(p).status=t)}),f.apply(this,arguments)}l.getStatus=m,l.setMyStatus=_}),226); __d("WAWebFindGroupMetadataAction",["Promise","WALogger","WAWebDBParticipantTypes","WAWebGroupDatabaseJob","WAWebGroupMetadataCollection","WAWebGroupQueryBridge","WAWebWamNumberToSizeBucket","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=["hasIncompleteParticipantInformation"],s,u,c,d,m,p;function _(e){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=null,i=null,l=function(){},_=r("WAWebGroupMetadataCollection").get(t);if(_){if(_.participantQueryPromise)return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: "," - pending participant query"])),t),_.participantQueryPromise.then(function(){return{id:t}});_.participantQueryPromise=new(p||(p=n("Promise")))(function(e){l=e})}else{if(a=yield o("WAWebGroupDatabaseJob").getGroupMetadataJob(t),!a)return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: "," - query missing group participant"])),t),o("WAWebGroupQueryBridge").sendQueryGroup(t);a.subject!=null&&o("WAWebGroupQueryBridge").updateSubject(t,a.subject)}try{var f,g,h,y,C;if((!_||_.stale)&&(i=yield o("WAWebGroupDatabaseJob").getGroupParticipantJob(t),!i))return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: "," - query missing group participant"])),t),o("WAWebGroupQueryBridge").sendQueryGroup(t);var b;if(a){var v=a,S=v.hasIncompleteParticipantInformation,R=babelHelpers.objectWithoutPropertiesLoose(v,e);b=R}var L=babelHelpers.extends({id:t},b,{participants:(f=i)==null?void 0:f.participants,pastParticipants:(g=i)==null?void 0:g.pastParticipants,deviceStale:i?i.staleType===o("WAWebDBParticipantTypes").STALE_TYPES.DEVICE:void 0,cachedDeviceCount:(h=i)==null?void 0:h.deviceCount,cachedDeviceSizeBucket:(y=i)!=null&&y.deviceCount?r("WAWebWamNumberToSizeBucket")(i.deviceCount):null});if(((C=i)==null?void 0:C.staleType)===o("WAWebDBParticipantTypes").STALE_TYPES.PARTICIPANT){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: "," - query stale group participant"])),t);var E=yield o("WAWebGroupQueryBridge").sendQueryGroup(t);(E==null?void 0:E.participants)!=null&&(L.participants=E.participants)}return L}catch(e){throw o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["findGroupMetadata: "," - query group participant error: ",""])),t,e),e}finally{l(),_&&(_.participantQueryPromise=null)}}),f.apply(this,arguments)}l.findGroupMetadata=_}),98); __d("WAWebSendForNeededAddRequest",["WAWebCmd","WAWebContactCollection"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t,n){if(e.participants){var r=e.gid,a=[];e.participants.forEach(function(e){if(e.code==="403"){var t=o("WAWebContactCollection").ContactCollection.gadd(e.userWid,{silent:!0});a.push(babelHelpers.extends({},e,{contact:t}))}}),a.length>0&&r&&o("WAWebCmd").Cmd.openGroupsV4InviteRequestFlow(a,r,t,n)}}l.sendForNeededAddRequest=e}),98); __d("WAWebGroupInviteV4Job",["WALogger","WASmaxGroupsAcceptGroupAddRPC","WASmaxGroupsGetGroupInfoRPC","WASmaxGroupsRevokeRequestCodeRPC","WAWebGroupsQueryApi","WAWebJidToWid","WAWebSetUsernameJob","WAWebUsernameGatingUtils","WAWebWidToJid","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m;function p(e,t,n,r,o){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r,a,i){var l=yield o("WASmaxGroupsGetGroupInfoRPC").sendGetGroupInfoRPC({addRequestArgs:{addRequestExpiration:parseInt(n,10),addRequestAdmin:o("WAWebWidToJid").widToUserJid(a),addRequestCode:t},iqTo:r,queryPhash:i});e:{var u=l;if((typeof u=="object"&&u!==null||typeof u=="function")&&u.name==="GetGroupInfoResponseSuccess"&&(typeof u.value=="object"&&u.value!==null||typeof u.value=="function")&&"group"in u.value){var c=u.value.group;if(c==null)return{status:200,phashMatch:!0};var d=o("WAWebGroupsQueryApi").parseGroupSmax(c);return{status:200,groupMetadata:d}}if((typeof u=="object"&&u!==null||typeof u=="function")&&u.name==="GetGroupInfoResponseClientError"&&(typeof u.value=="object"&&u.value!==null||typeof u.value=="function")&&(typeof u.value.errorGetGroupInfoClientErrors=="object"&&u.value.errorGetGroupInfoClientErrors!==null||typeof u.value.errorGetGroupInfoClientErrors=="function")&&(typeof u.value.errorGetGroupInfoClientErrors.value=="object"&&u.value.errorGetGroupInfoClientErrors.value!==null||typeof u.value.errorGetGroupInfoClientErrors.value=="function")&&"code"in u.value.errorGetGroupInfoClientErrors.value&&"text"in u.value.errorGetGroupInfoClientErrors.value){var m=u.value.errorGetGroupInfoClientErrors.value.code,p=u.value.errorGetGroupInfoClientErrors.value.text;return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["queryGroupInviteV4: failed ",":",""])),Number(m),p),{status:Number(m)};break e}if((typeof u=="object"&&u!==null||typeof u=="function")&&u.name==="GetGroupInfoResponseServerError"&&(typeof u.value=="object"&&u.value!==null||typeof u.value=="function")&&(typeof u.value.errorServerErrors=="object"&&u.value.errorServerErrors!==null||typeof u.value.errorServerErrors=="function")&&(typeof u.value.errorServerErrors.value=="object"&&u.value.errorServerErrors.value!==null||typeof u.value.errorServerErrors.value=="function")&&"code"in u.value.errorServerErrors.value&&"text"in u.value.errorServerErrors.value){var _=u.value.errorServerErrors.value.code,f=u.value.errorServerErrors.value.text;return o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["queryGroupInviteV4: failed ",":",""])),_,f),{status:Number(_)};break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+u)}}),_.apply(this,arguments)}function f(e,t,n,r){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r){var a=yield o("WASmaxGroupsAcceptGroupAddRPC").sendAcceptGroupAddRPC({iqTo:n,acceptCode:e,acceptExpiration:parseInt(t,10),acceptAdmin:o("WAWebWidToJid").widToUserJid(r)});switch(a.name){case"AcceptGroupAddResponseSuccess":return{status:200,gid:o("WAWebJidToWid").groupJidToWid(n)};case"AcceptGroupAddResponseGroupJoinRequestSuccess":return{status:200,gid:o("WAWebJidToWid").groupJidToWid(n)};case"AcceptGroupAddResponseClientError":{var i=a.value.errorAcceptGroupAddClientErrors.value,l=i.code,s=i.text;return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["joinGroupViaInviteV4: failed ",":",""])),l,s),{status:Number(l)}}case"AcceptGroupAddResponseServerError":{var d=a.value.errorServerErrors.value,m=d.code,p=d.text;return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["joinGroupViaInviteV4: failed ",":",""])),m,p),{status:Number(m)}}}}),g.apply(this,arguments)}function h(e,t){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=yield o("WASmaxGroupsRevokeRequestCodeRPC").sendRevokeRequestCodeRPC({participantArgs:e.map(function(e){return{participantJid:o("WAWebWidToJid").widToUserJid(e)}}),iqTo:t});switch(n.name){case"RevokeRequestCodeResponseSuccess":{var r=n.value.revokeParticipant;if(o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()){var a=r.reduce(function(e,t){var n,r=t.jid,a=(n=t.usernameAttMixin)==null?void 0:n.username;return a!=null&&e.push({userId:o("WAWebJidToWid").userJidToUserWid(r),username:a}),e},[]);a.length>0&&(yield o("WAWebSetUsernameJob").setUsernamesJob(a))}return{status:200}}case"RevokeRequestCodeResponseClientError":{var i=n.value.errorClientErrors.value,l=i.code,s=i.text;return o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["revokeGroupInviteV4: failed ",":",""])),l,s),{status:Number(l)}}case"RevokeRequestCodeResponseServerError":{var u=n.value.errorServerErrors.value,c=u.code,p=u.text;return o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["revokeGroupInviteV4: failed ",":",""])),c,p),{status:Number(c)}}}}),y.apply(this,arguments)}l.queryGroupInviteV4=p,l.joinGroupViaInviteV4=f,l.revokeGroupInviteV4=h}),98); __d("WAWebInviteV4QueryGroupAction",["WAWebApiGroupInviteV4Store","WAWebChatCollection","WAWebContactCollection","WAWebGroupInviteV4Job","WAWebGroupMetadataCollection","WAWebLidMappingUsernameLearnUtils","WAWebPhashUtils","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e,t,n,r){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a){var i=null,l=r("WAWebGroupMetadataCollection").get(n);return l&&(i=yield o("WAWebPhashUtils").phashV1(l.participants.map(function(e){return e.id}))),o("WAWebGroupInviteV4Job").queryGroupInviteV4(e,t,n,a,i).then(function(e){if(e.phashMatch===!0)return{status:200,phashMatch:!0};if(e.groupMetadata!=null){var t=babelHelpers.extends({},e.groupMetadata);return o("WAWebLidMappingUsernameLearnUtils").processParsedGroupInfosForLidMappingAndUsernames([t]).then(function(){return t})}return{status:e.status}}).then(function(e){if(e.status!=null&&e.status>0)return e;if(e.id!=null)return o("WAWebContactCollection").ContactCollection.gadd(e.id),e;var t=r("WAWebGroupMetadataCollection").assertGet(o("WAWebWidFactory").createWidFromWidLike(n)),a=o("WAWebChatCollection").ChatCollection.assertGet(t.id).contact.name;return{id:t.id,owner:t.owner,creation:t.creation,desc:t.desc,descId:t.descId,descOwner:t.descOwner,descTime:t.descTime,restrict:t.restrict,announce:t.announce,ephemeralDuration:t.ephemeralDuration,membershipApprovalMode:t.membershipApprovalMode,reportToAdminMode:t.reportToAdminMode,growthLockExpiration:t.growthLockExpiration,growthLockType:t.growthLockType,noFrequentlyForwarded:t.noFrequentlyForwarded,subject:a,participants:t.participants.map(function(e){return{id:e.id,isAdmin:e.isAdmin,isSuperAdmin:e.isSuperAdmin}})}})}),s.apply(this,arguments)}function u(e,t,n,r){return o("WAWebGroupInviteV4Job").joinGroupViaInviteV4(e,t,n,r)}function c(e,t){return o("WAWebGroupInviteV4Job").revokeGroupInviteV4(e,t)}function d(e,t){return o("WAWebApiGroupInviteV4Store").getPendingParticipants(e,t)}l.queryGroupInviteV4Info=e,l.joinGroupViaInviteV4=u,l.revokeGroupInviteV4=c,l.getPendingParticipants=d}),98); __d("WAWebChangePresenceHandlerAction",["Promise","WAWebChatCollection","WAWebLidMigrationUtils","WAWebPresenceCollection","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=25e3;function u(e,t){var n=e.type;(n==="typing"||n==="recording_audio")&&(e.type=t.isOnline?"available":"unavailable")}function c(e,t){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r){r===void 0&&(r=!0);var a=t.id;if(!o("WAWebUserPrefsMeUser").isMeAccount(a)){var i=o("WAWebPresenceCollection").PresenceCollection.get(a);i&&(m(i,t),r&&i.set({stale:!1}))}return(e||(e=n("Promise"))).resolve()}),d.apply(this,arguments)}function m(e,t){var n=!1;typeof t.type=="undefined"?t.type=e.chatstate.type||"unavailable":t.type==="idle"&&(n=!0,t.type=e.isOnline?"available":"unavailable"),e.isGroup&&t.type!=="available"&&!n&&(t.updateTime=Date.now());var r;if(e.isGroup){var a=t.participant;if(a==null)return;var i=t.id,l=o("WAWebChatCollection").ChatCollection.get(i);if(l==null||o("WAWebLidMigrationUtils").toPn(a)==null)return;t.id=a,t.participant=void 0,r=e.chatstates.gadd(t.id)}else r=e.chatstate;(!n||r.type==="typing"||r.type==="recording_audio")&&r.set(t),r.expireTimerId&&self.clearTimeout(r.expireTimerId),r.type==="typing"||r.type==="recording_audio"?r.expireTimerId=self.setTimeout(function(){return u(r,e)},s):r.expireTimerId=void 0;var c=e.forceDisplay||e.isOnline||e.isUser&&!e.chatstate.deny;e.set({hasData:!0,isSubscribed:!0,forceDisplay:c})}l.default=c}),98); __d("WAWebAddOnsUpdateAddOnAcksApi",["Promise","WAAckLevel","WANullthrows","WATypeUtils","WAWebBackendApi","WAWebBoolFunc","WAWebDBAddOnProviders","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){var e;function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=yield(e||(e=n("Promise"))).allSettled(Array.from(t.entries(),function(e){var t=e[0],n=e[1],a=r("WANullthrows")(o("WAWebDBAddOnProviders").getProviderForAddOnType(t));return a.updateAcks==null?void 0:a.updateAcks(n,o("WAWebBoolFunc").returnTrue)}));for(var i of a)if(i.status==="rejected")throw i.reason}),u.apply(this,arguments)}function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var a=yield(e||(e=n("Promise"))).allSettled(Array.from(t,(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=e[0],n=e[1],a=r("WANullthrows")(o("WAWebDBAddOnProviders").getProviderForAddOnType(t)),i=yield a.updateAcks==null?void 0:a.updateAcks(n,function(e,t){return m(e.ack,t.ack)});if(!(i==null||i.length===0))return[t,i]});return function(t){return e.apply(this,arguments)}})())),i=new Map(r("compactMap")(a,function(e){return e.value}));o("WAWebBackendApi").frontendFireAndForget("updateAddOnCollectionAcks",{updatesByType:i});for(var l of a)if(l.status==="rejected")throw l.reason}),d.apply(this,arguments)}function m(e,t){return o("WATypeUtils").isNumber(t)&&(e==null||t>e||t===o("WAAckLevel").ACK.FAILED)}l.updateAddOnAcks=s,l.maybeUpdateAddOnAcks=c}),98); __d("WAWebAddOnsUpdateSendStatesAction",["Promise","WAWebAddOnsUpdateAddOnAcksApi","WAWebCommentCollection","WAWebMessageAddOnType","WAWebMsgKey","WAWebMsgType","WAWebPinInChatCollection","WAWebPollsPollVoteCollection","WAWebReactionsCollection","asyncToGeneratorRuntime","compactMap"],(function(t,n,r,o,a,i,l){var e;function s(e,t){var n=p(e);n!=null&&o("WAWebAddOnsUpdateAddOnAcksApi").maybeUpdateAddOnAcks(new Map([[n,[{msgKey:e.id.toString(),ack:t}]]]))}function u(t,r){var o=p(t);return o==null?(e||(e=n("Promise"))).resolve():c(new Map([[o,[babelHelpers.extends({msgKey:t.id.toString()},r)]]]))}function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=new Map;for(var n of e){var a=n[0],i=n[1],l=r("compactMap")(i,function(e){return e.ack==null?null:{msgKey:e.msgKey,ack:e.ack}});t.set(a,l)}yield o("WAWebAddOnsUpdateAddOnAcksApi").updateAddOnAcks(t),m(e)}),d.apply(this,arguments)}function m(e){for(var t of e){var n=t[0],o=t[1];for(var a of o){var i=_(n,r("WAWebMsgKey").from(a.msgKey));i!=null&&(a.ack!=null&&(i.ack=a.ack),a.isSendFailure!=null&&(i.isSendFailure=a.isSendFailure))}}}function p(e){switch(e.type){case o("WAWebMsgType").MSG_TYPE.REACTION:case o("WAWebMsgType").MSG_TYPE.REACTION_ENC:return o("WAWebMessageAddOnType").MessageAddOnType.Reaction;case o("WAWebMsgType").MSG_TYPE.POLL_UPDATE:if(e.subtype==="poll_vote")return o("WAWebMessageAddOnType").MessageAddOnType.PollVote;break;case o("WAWebMsgType").MSG_TYPE.PIN_MESSAGE:return o("WAWebMessageAddOnType").MessageAddOnType.PinMessage;case o("WAWebMsgType").MSG_TYPE.COMMENT:return o("WAWebMessageAddOnType").MessageAddOnType.Comment}return null}function _(e,t){switch(e){case o("WAWebMessageAddOnType").MessageAddOnType.Reaction:return o("WAWebReactionsCollection").ReactionsCollection.getSenderByMsgKey(t);case o("WAWebMessageAddOnType").MessageAddOnType.PollVote:return o("WAWebPollsPollVoteCollection").PollVoteCollection.getByMsgKey(t);case o("WAWebMessageAddOnType").MessageAddOnType.PinMessage:return o("WAWebPinInChatCollection").PinInChatCollection.getByMsgKey(t);case o("WAWebMessageAddOnType").MessageAddOnType.Comment:return o("WAWebCommentCollection").CommentCollection.getByMsgKey(t);case o("WAWebMessageAddOnType").MessageAddOnType.KeepInChat:case o("WAWebMessageAddOnType").MessageAddOnType.MessageEdit:case o("WAWebMessageAddOnType").MessageAddOnType.ReactionEnc:case o("WAWebMessageAddOnType").MessageAddOnType.Unknown:return null}}l.maybeUpdateAddOnAckForMsgAction=s,l.updateAddOnSendStatesForMsgAction=u,l.updateAddOnSendStatesAction=c,l.updateAddOnCollectionsSendStatesAction=m}),98); __d("WAWebFutureproofReparseMsgsAction",["Promise","WALogger","WAWebAddonGatingUtils","WAWebDBAddOnProviders","WAWebDBMessageSerialization","WAWebHandleMsgProcess","WAWebLidMigrationUtils","WAWebMsgGetters","WAWebMsgType","WAWebNewsletterReparseMsgAction","WAWebProcessMsgInfoForLid","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){try{var n=t.futureproofBuffer,r=t.futureproofParams;if(o("WAWebMsgGetters").getIsNewsletterMsg(t))return yield o("WAWebNewsletterReparseMsgAction").reparseNewsletterMsg(t);if(n!=null){if(r){var a=r.info,i=r.msgMeta;o("WAWebLidMigrationUtils").shouldHaveAccountLid(a.chat)&&a.accountLid==null&&(yield o("WAWebProcessMsgInfoForLid").maybeProcesMsgInfoForLid({msgInfo:a,msgMeta:i})),yield o("WAWebHandleMsgProcess").processDecryptedMessageProto(babelHelpers.extends({},r,{decrypted:n,reparsing:!0}))}return t}return null}catch(t){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["reparseFutureproof: reparse error: ",""])),t).sendLogs("reparse-futureproof-error"),null}}),d.apply(this,arguments)}function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){try{var t=[],r=[];e.forEach(function(e){var n=o("WAWebDBMessageSerialization").messageFromDbRow(e),a=o("WAWebAddonGatingUtils").isUnifiedInfraEnabledForType(e.type)||!!o("WAWebDBAddOnProviders").getAddOnProviderForFutureproofMsg(n);a?t.push(n):e.type===o("WAWebMsgType").MSG_TYPE.UNKNOWN&&r.push(n)}),yield(u||(u=n("Promise"))).all(r.map(function(e){return c(e)})),yield u.all(t.map(function(e){return c(e)}))}catch(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["reparseFutureproof: processFutureproof error"])))}}),p.apply(this,arguments)}l.processFutureproof=m}),98); __d("WAWebAvatarGatingUtils",["WAWebABProps"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebABProps").getABPropConfigValue("enable_avatars_on_web_companion")}l.avatarsOnWebEnabled=e}),98); __d("WAWebMediaLinkPreviewUtils",["WATimeUtils","WAWebDisplayType"],(function(t,n,r,o,a,i,l){var e=2592e3;function s(t){var n=o("WATimeUtils").unixTime()-t>e;return n}var u=7/5;function c(e,t){var n,r;if(e){var o=d(e.unsafe(),t);if(o&&(e==null?void 0:e.thumbnailHeight)!=null&&(e==null?void 0:e.thumbnailWidth)!=null){var a=e.thumbnailHeight/e.thumbnailWidth;r=a>=1?"portrait":"landscape",n="high-quality"}}return{bubbleTheme:r,linkPreviewTheme:n}}function d(e,t){var n=!!(e.thumbnailDirectPath||e.thumbnailHQ)&&e.thumbnailHeight!=null&&e.thumbnailWidth!=null;if(!n)return!1;var r=s(e.t);if(r)return!1;var a=t===o("WAWebDisplayType").DISPLAY_TYPE.GALLERY;return a?!1:t===o("WAWebDisplayType").DISPLAY_TYPE.STATUS&&e.thumbnailHeight!=null&&e.thumbnailWidth!=null?e.thumbnailWidth/e.thumbnailHeight>=u:!0}l.HQ_PREVIEW_LIFESPAN=e,l.hqLinkPreviewExpired=s,l.getLinkPreviewThemes=c,l.displayHighQualityLinkPreview=d}),98); __d("WAWebProcessMultipleMsgsAction",["Promise","WALogger","WATimeUtils","WAWebABProps","WAWebAddAndReorderMsgsActionsUtils","WAWebAvatarGatingUtils","WAWebBotGenTypingIndicatorMsg","WAWebBotTypes","WAWebChatCollection","WAWebFindChatAction","WAWebFrontendMsgGetters","WAWebGetMsgUpdatesActionsUtils","WAWebLidStatusMigrationGating","WAWebLidStatusMigrationUtils","WAWebMedia","WAWebMediaAutoDownloadQueue","WAWebMediaDownloadMmsThumbnail","WAWebMediaLinkPreviewUtils","WAWebMediaTypes","WAWebMiscGatingUtils","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgModelUtils","WAWebMsgType","WAWebNewsletterCollection","WAWebRecentStickerCollection","WAWebRecentStickerCollectionMd","WAWebStatusCollection","WAWebStickerModel","WAWebTPPdfViewerGatingUtils","WAWebUserPrefsGeneral","WAWebUserPrefsMeUser","WAWebWid","asyncToGeneratorRuntime","compactMap","cr:11804"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m;function p(e,t,n,r,o){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,a,i,l,c){var d,p,_=yield r("WAWebGetMsgUpdatesActionsUtils")(t,a,i,c),g=_.filteredRecs,h=_.reorderRecs,y=_.updates,C=yield(m||(m=n("Promise"))).all(y),b=C.filter(function(e){return(e==null?void 0:e.associationType)!=null});if(o("WAWebMsgCollection").MsgCollection.makeParentMessagesVisibleInChat(b),g.length===0&&h.length===0){if(t&&i.pendingMsgsDone===!0){var v,S=(v=o("WAWebChatCollection").ChatCollection.get(t))!=null?v:r("WAWebNewsletterCollection").get(t);S&&(S.pendingMsgs=!1)}return r("compactMap")(a,function(e){return o("WAWebMsgCollection").MsgCollection.get(e.id)})}if(!t)return f(g).then(function(){return a.reduce(function(e,t){var n=o("WAWebMsgCollection").MsgCollection.get(t.id);return n!=null&&o("WAWebFrontendMsgGetters").getChat(n)!=null&&e.push(n),e},[])});var R,L=a[0];if(o("WAWebMsgGetters").getIsStatus(L)){var E,k=(E=o("WAWebMsgGetters").getSender(L))!=null?E:L.from;if(r("WAWebWid").isStatus(t)&&(k=L.id.fromMe?o("WAWebLidStatusMigrationUtils").matWidConvert(o("WAWebUserPrefsMeUser").getMePnUserOrThrow()):L.author),k==null){var I,T,D;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["status id is null. chat: ",", sender: ",", from: ",",\n fromMe: ",", author: ",""])),t.toLogString(),(I=o("WAWebMsgGetters").getSender(L))==null?void 0:I.toLogString(),(T=L.from)==null?void 0:T.toLogString(),L.id.fromMe,(D=L.author)==null?void 0:D.toLogString())}R=o("WAWebStatusCollection").StatusCollection.find(k)}else R=yield o("WAWebFindChatAction").findExistingChat(t,l);var x=yield R,$=yield f(g),P=i.add==="after"||i.add==="last",N=!i.isHistory,M,w,A=!1,F=x.id.isBot(),O=((d=x.contact.businessProfile)==null?void 0:d.isBizBot3p)===!0;if((F||O)&&i.isHistory===!1){var B=x.msgs.last();(B==null?void 0:B.subtype)===o("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE&&(B==null||B.delete({skipUpdatingSortTime:!0}))}if($.forEach(function(e){e.subtype==="biz_bot_1p_disclosure"?x.set({bizBotSystemMsgType:o("WAWebBotTypes").BizBotType.BIZ_1P}):e.subtype==="biz_bot_3p_disclosure"&&x.set({bizBotSystemMsgType:o("WAWebBotTypes").BizBotType.BIZ_3P})}),i.add==="unread"?(M=c,x.msgChunks.push(M),w=i.firstUnreadKey):i.add==="last"&&i.resume===!0?(M=c,A=!0):M=typeof c=="function"?c():c,r("WAWebAddAndReorderMsgsActionsUtils")(a,$,h,x,P,M||x.msgs,w,A,i.anchorMsgKey),i.pendingMsgsDone===!0&&(x.pendingMsgs=!1),N&&r("WAWebWid").isBroadcast(t)&&!r("WAWebWid").isStatus(t)&&$.forEach(function(e){e&&e.recvFresh&&!o("WAWebMsgGetters").getIsNotification(e)&&o("WAWebMsgModelUtils").broadcastFanout(e)}),!((p=i.isHistory)!=null&&p)){var W=r("compactMap")($,function(e){var t,n,r,a=o("WAWebMsgGetters").getIsSentByMe(e)&&e.type===o("WAWebMsgType").MSG_TYPE.STICKER;if(a&&!(e.isAvatar===!0&&!o("WAWebAvatarGatingUtils").avatarsOnWebEnabled())){var i=e.mediaData,l=e.mediaObject,s=e.id.toString(),u=l==null?void 0:l.entries.entries[0];return{sticker:new(o("WAWebStickerModel")).StickerModel({id:i.filehash,directPath:i.directPath,filehash:i.filehash,encFilehash:(t=u==null?void 0:u.getEncfilehash())!=null?t:i.encFilehash,mediaKey:(n=u==null?void 0:u.getMediaKey())!=null?n:i.mediaKey,mediaKeyTimestamp:i.mediaKeyTimestamp!=null?i.mediaKeyTimestamp:o("WATimeUtils").unixTime(),width:i.fullWidth,height:i.fullHeight,size:i.size,mimetype:i.mimetype,isAvatar:e.isAvatar,type:o("WAWebMediaTypes").OUTWARD_TYPES.STICKER,index:0}),timestamp:(r=e.stickerSentTs)!=null?r:0,msgId:s}}});o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["processed "," recent sticker messages"])),W.length),W.forEach(function(e){return o("WAWebRecentStickerCollectionMd").RecentStickerCollectionMd.addNewSticker(e.sticker,e.msgId,e.timestamp)})}var q=0,U=r("compactMap")($,function(e){var t=e.isNewMsg&&o("WAWebMsgGetters").getIsSentByMe(e)&&e.type===o("WAWebMsgType").MSG_TYPE.STICKER,n=e.mediaData;if(t){var r=e.mediaKey;if(r==null){q++;return}return{id:n.filehash,directPath:n.directPath,filehash:n.filehash,encFilehash:n.encFilehash,mediaKey:r,mediaKeyTimestamp:n.mediaKeyTimestamp!=null?n.mediaKeyTimestamp:o("WATimeUtils").unixTime(),width:n.fullWidth,height:n.fullHeight,size:n.size,mimetype:n.mimetype,type:o("WAWebMediaTypes").OUTWARD_TYPES.STICKER,index:0}}});if(q>0&&o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[sticker] Unexpected null media key"]))).sendLogs("sticker-unexpected-null-media-key"),o("WAWebRecentStickerCollection").RecentStickerCollection.enqueue(U),o("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()){var V=$.filter(function(e){return!o("WAWebMsgGetters").getIsStatus(e)});r("compactMap")(V,function(e){return o("WAWebFrontendMsgGetters").getAsAutoDownloadableMedia(e)}).forEach(function(e){o("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(e,o("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MEDIA)})}if(o("WAWebABProps").getABPropConfigValue("download_document_thumb_mms_enabled")&&r("compactMap")($,function(e){return o("WAWebFrontendMsgGetters").getAsDoc(e)}).forEach(function(e){o("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()?o("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(e,o("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MMS_THUMBNAIL):r("WAWebMediaDownloadMmsThumbnail")({chat:null,msg:e,isPreload:!0})}),o("WAWebTPPdfViewerGatingUtils").isWebTPPdfViewerEnabled()){var H=r("compactMap")($,function(e){return o("WAWebFrontendMsgGetters").getAsDoc(e)}),G=H.some(function(e){return o("WAWebTPPdfViewerGatingUtils").isWebTPPdfViewerEnabledForMimeType(e.mimetype)});G&&(n("cr:11804")==null||n("cr:11804").maybePreloadWebTPIframeForPDFs(void 0,{source:"appStart",force:!0}))}if(r("compactMap")($,function(e){return o("WAWebFrontendMsgGetters").getAsUrl(e)}).forEach(function(e){o("WAWebMediaLinkPreviewUtils").hqLinkPreviewExpired(e.t)||(o("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()?o("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(e,o("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MMS_THUMBNAIL,null):r("WAWebMediaDownloadMmsThumbnail")({msg:e,isPreload:!0,chat:null}))}),o("WAWebABProps").getABPropConfigValue("download_status_thumb_mms_enabled")){var z=o("WAWebUserPrefsGeneral").getLastStatusUsage(),j=1e3*60*60*24;if(z==null||Date.now()-z<14*j){var K=$.filter(function(e){return o("WAWebMsgGetters").getIsStatus(e)});r("compactMap")(K,function(e){return o("WAWebFrontendMsgGetters").getAsImage(e)||o("WAWebFrontendMsgGetters").getAsVideo(e)}).forEach(function(e){o("WAWebMiscGatingUtils").webMediaAutoDownloadEnabled()?o("WAWebMediaAutoDownloadQueue").AutoDownloadQueue.enqueue(e,o("WAWebMediaAutoDownloadQueue").AutoDownloadTypes.MMS_THUMBNAIL):o("WAWebMedia").downloadStatusThumbnail({msg:e,isPreload:!0})})}}return r("compactMap")(a,function(e){return o("WAWebMsgCollection").MsgCollection.get(e.id)})}),_.apply(this,arguments)}function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebMsgCollection").MsgCollection.add(e,{merge:!0}),r=0,a=t.reduce(function(e,t){return t==null&&r++,t!=null&&t.subtype!=="is_hosted_group"&&e.push(t),e},[]);if(r>0){var i=e.filter(function(e,n){return t[n]==null}).slice(0,3).map(function(e){return e.id});o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Get "," empty messages with ids => ",""])),r,i).sendLogs("msgPrepWork-empty-message")}var l=null,s=null;return yield(m||(m=n("Promise"))).all(a.map(function(e){return e.waitForPrep().catch(function(t){l=t,s=e})})),l!=null&&s!=null&&o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["Assertion failed! ",". id: ",", type: ",", subtype: ",", has media data: ",", is status migrated: ",""])),String(l),s.id.toString(),s.type,s.subtype,s.mediaData!=null,o("WAWebLidStatusMigrationGating").getLidStatusSendEnabled()).sendLogs("bad-msg-prep"),a}),g.apply(this,arguments)}l._processMultipleMessages=p}),98); __d("WAWebSendRevokeMessageWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumMediaType","WAWebWamEnumMessageType"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({SendRevokeMessage:[1348,{messageMediaType:[2,o("WAWebWamEnumMediaType").MEDIA_TYPE],messageType:[1,o("WAWebWamEnumMessageType").MESSAGE_TYPE],revokeSendDelay:[3,o("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{SendRevokeMessage:[]});l.SendRevokeMessageWamEvent=e}),98); __d("WAWebRevokeMsgAction",["Promise","WAJobOrchestratorTypes","WALogger","WATimeUtils","WAWebAck","WAWebAddonProcessRevoke","WAWebApiChat","WAWebAssociationProcessor","WAWebAssociationProcessorConstants","WAWebBotGating","WAWebCmd","WAWebDBProcessMessage","WAWebDBStoreRevokeMsgs","WAWebErrorType","WAWebFrontendMsgGetters","WAWebFtsClient","WAWebLabelCollection","WAWebMedia","WAWebMessageAssociationGatingUtils","WAWebMessageSendPerfReporter","WAWebMsgActionCapability","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModel","WAWebMsgModelUtils","WAWebMsgType","WAWebNoop","WAWebOrchestratorNonPersistedJob","WAWebPersistedJobDefinitions","WAWebPersistedJobManager","WAWebRevoke","WAWebSendMsgRecordAction","WAWebSendMsgResultAction","WAWebSendRevokeMessageWamEvent","WAWebSimpleSignalPNToFBIDMigration","WAWebStateUtils","WAWebUpdateLastAddOnPreviewChatAction","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebWamMsgUtils","WAWebWid","asyncToGeneratorRuntime","err","lodash"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p;function _(e,t,n){return e.type==="message"?g({type:"message",data:o("WAWebStateUtils").unproxy(e.data)},t,n):g(e,t,n)}function f(e,t){return v(o("WAWebStateUtils").unproxy(e),t)}function g(e,t,n,r){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i){var l;i===void 0&&(i=!1);var s=e.data;if(t===o("WAWebCmd").Revoke.Sender&&!s.id.fromMe&&!o("WAWebMsgActionCapability").canBotResponseBeRevokeByInvoker(s))return(p||(p=n("Promise"))).reject(r("err")("revoking received message"));var u=s.id.remote.isGroup()&&e.type==="addon"?o("WAWebUserPrefsMeUser").getMeLidUserOrThrow():o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),_=s.id.remote.isGroup()&&((l=o("WAWebFrontendMsgGetters").getChat(s).groupMetadata)==null?void 0:l.isLidAddressingMode),g=void 0;s.id.remote.isGroup()&&(g=_===!0?o("WAWebUserPrefsMeUser").getMeLidUserOrThrow():u);var h=new(r("WAWebMsgKey"))({id:yield r("WAWebMsgKey").newId(),remote:s.id.remote,fromMe:!0,participant:g}),y=b(t),C=o("WATimeUtils").unixTime(),v=C-o("WAWebMsgGetters").getT(s),S={id:h,from:_===!0?o("WAWebUserPrefsMeUser").getMeLidUserOrThrow():u,to:s.id.remote,author:g,t:C,type:o("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:o("WAWebMsgType").MsgKind.ProtocolRevoke,subtype:b(t),protocolMessageKey:s.id,clearMedia:!!a,local:!0,revokeDuration:v,revokeTimestamp:C,viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE};if(e.type==="addon")return o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var t=e.data;if(t.kind!==o("WAWebMsgType").MsgKind.CommentDecrypted)throw r("err")("_sendRevoke: only decrypted comment can be revoked from the UI");var n=babelHelpers.extends({},S,{kind:o("WAWebMsgType").MsgKind.ProtocolAddonRevoke,targetMessageKey:t.parentMsgKey,revokeAddonType:t.type}),a=yield o("WAWebSendMsgRecordAction").sendAddonRecord(n),i=a.messageSendResult;return i===o("WAWebSendMsgResultAction").SendMsgResult.OK?(new(o("WAWebSendRevokeMessageWamEvent")).SendRevokeMessageWamEvent({messageType:o("WAWebWamMsgUtils").getWamMessageType(s),messageMediaType:o("WAWebWamMsgUtils").getWamMediaType(s),revokeSendDelay:v}).commit(),yield o("WAWebAddonProcessRevoke").processSentRevokeMsg(babelHelpers.extends({},n,{t:o("WAWebMsgGetters").getT(s),ack:o("WAWebAck").ACK.SENT}),t)):o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["failed to send revoke addon"]))).tags("addons","messaging").sendLogs("failedSendRevokeMsg: "+t.type),a}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted();var R=babelHelpers.extends({},S);if(o("WAWebBotGating").isBotEnabled()){var L,E=null,k=(L=s.mentionedJidList)==null?void 0:L.find(function(e){return e.isBot()}),I=o("WAWebMsgGetters").getSender(s);if(I&&I.isBot()?E=I:k!=null&&s.isForwarded!==!0&&(E=k),E!=null){var T;E=(T=o("WAWebSimpleSignalPNToFBIDMigration").getDeprecatedPnChatForFbidInvoke(E))!=null?T:E}R.botRespOrInvocationRevokeBotWid=E,s.botTargetSenderJid instanceof r("WAWebWid")&&(R.botTargetSenderJid=s.botTargetSenderJid)}var D=new(o("WAWebMsgModel")).Msg(R);return D.wamMessageSendPerfReporter=new(o("WAWebMessageSendPerfReporter")).MessageSendPerfReporter({chatWid:D.to,mediaType:D.getWamMediaType(),messageType:D.getWamMessageType()}),D.wamMessageSendPerfReporter.setIsRevokeMessage(!0),o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessage",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var t,a;(t=D.wamMessageSendPerfReporter)==null||t.startSavedStage(),yield o("WAWebDBProcessMessage").storeMessages([R],o("WAWebFrontendMsgGetters").getChat(s).id),(a=D.wamMessageSendPerfReporter)==null||a.postSavedStage()}catch(e){throw o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["_sendRevoke: failed to storeMessages into storage"]))).verbose().sendLogs("storeMessages failed"),e}var l=yield o("WAWebSendMsgRecordAction").sendMsgRecord(D),c=l.messageSendResult;if(i)throw o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["_sendRevoke path for associated with bot plugin msg"]))),r("err")("Expected exit for associated with bot plugin msg");return c===o("WAWebSendMsgResultAction").SendMsgResult.OK?(new(o("WAWebSendRevokeMessageWamEvent")).SendRevokeMessageWamEvent({messageType:o("WAWebWamMsgUtils").getWamMessageType(s),messageMediaType:o("WAWebWamMsgUtils").getWamMediaType(s),revokeSendDelay:v}).commit(),o("WAWebDBStoreRevokeMsgs").processRevokeMsgs([{revokeMsgKey:s.id,newMsgKey:h,timestamp:o("WAWebMsgGetters").getT(s),revokeTimestamp:C,subtype:y,sender:u,viewMode:D.viewMode}]).then(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview([s.id.toString()]),yield o("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(o("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(o("WAWebFrontendMsgGetters").getChat(s).id.toString(),[s.id.toString()])),f(e.data,{msgKey:h,subtype:y,sender:u,revokeTimestamp:C,viewMode:D.viewMode}),{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.OK}}))):(p||(p=n("Promise"))).resolve({messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN})}),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}),h.apply(this,arguments)}function y(t,n){g({type:"message",data:o("WAWebStateUtils").unproxy(t)},n,!1,!0).catch(function(t){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[bot revoke] sendAssociatedBotPluginRevoke: ",""])),t.message)})}function C(e,t,n){return g({type:"message",data:o("WAWebStateUtils").unproxy(e)},t,n,!1)}function b(e){switch(e){case o("WAWebCmd").Revoke.Sender:return"sender_revoke";case o("WAWebCmd").Revoke.Admin:return"admin_revoke"}}function v(e,t){var n,a,i,l=o("WAWebFrontendMsgGetters").getMaybeChat(e);if(!o("WAWebRevoke").isWithinRevokeWindow({revokedMsgKey:e.id,revokedMsgTimestamp:e.t,revokeTimestamp:o("WATimeUtils").unixTime()})){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["revoke: outside of revoke window, "," has not been revoked"])),e.id.toString());return}o("WAWebLabelCollection").LabelCollection.removeAllLabelsMD(e),o("WAWebMsgModelUtils").typeIsMms(e)&&o("WAWebMedia").deregisterMsg(e),l==null||l.removeFromCollection(e),e.trigger("revoked"),o("WAWebMsgGetters").clearMsgGetterCacheFor(e),o("WAWebFrontendMsgGetters").clearFrontendMsgGetterCacheFor(e);var c=e.getCollection(),d=e.id,m=o("WAWebRevoke").getMsgKeyAfterRevoke({originalKey:d,revokeKey:t.msgKey});e.msgChunk&&e.msgChunk.replaceId(d,m),c.replaceId(d,m);var p=(n=l==null?void 0:l.isUnreadMsg(e))!=null?n:!1,_=(a=l==null?void 0:l.isActiveUnreadMsg(e))!=null?a:!1,g=e.associationType;if(g!=null&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var h=o("WAWebAssociationProcessor").getAssociationProcessorByAssociationType(g);h&&h.processorType===o("WAWebAssociationProcessorConstants").AssociationProcessorType.WithDetachedMessages&&e.detachAssociatedMsg()}var y={isOverwrittenByRevoke:!0,id:m,type:o("WAWebMsgType").MSG_TYPE.REVOKED,subtype:t.subtype==="admin_revoke"?"admin":"sender",revokeSender:t.sender,revokeTimestamp:t.revokeTimestamp,protocolMessageKey:d,body:void 0,caption:void 0,clientUrl:void 0,deprecatedMms3Url:void 0,loc:void 0,lat:void 0,lng:void 0,isLive:void 0,accuracy:void 0,speed:void 0,degrees:void 0,comment:void 0,sequence:void 0,shareDuration:void 0,finalLat:void 0,finalLng:void 0,finalAccuracy:void 0,finalThumbnail:void 0,finalSpeed:void 0,finalDegrees:void 0,finalTimeOffset:void 0,title:void 0,description:void 0,matchedText:void 0,thumbnail:void 0,richPreviewType:void 0,doNotPlayInline:void 0,paymentLinkMetadata:void 0,quotedMsg:void 0,quotedStanzaID:void 0,quotedRemoteJid:void 0,quotedParticipant:void 0,mediaData:void 0,mentionedJidList:void 0,groupMentions:void 0,vcardList:void 0,star:!1,kicState:void 0,kicTimestampMs:void 0,kicKey:void 0,errorCode:o("WAWebErrorType").SendFailureErrorCode.NoError,isSendFailure:!1,viewMode:(i=t.viewMode)!=null?i:o("WAWebViewMode.flow").ViewModeType.VISIBLE,associationType:void 0,parentMsgKey:void 0};if(e.set(y),e.trigger("change:msgKey",{newKey:m,oldKey:d}),l&&(d.equals(l.lastReceivedKey)&&(l.lastReceivedKey=m),l.composeQuotedMsg===e&&(l.composeQuotedMsg=null),p&&(l.unreadCount=Math.max(l.unreadCount-1,0),l.unreadDividerOffset+=1,o("WAWebApiChat").reduceChatUnreadCount(l.id.toString())),_&&(l.activeUnreadCount=Math.max(l.activeUnreadCount-1,0))),r("WAWebWid").isBroadcast(d.remote)){var C=o("WAWebMsgModelUtils").getBroadcastFanoutKeys(d),b=o("WAWebMsgModelUtils").getBroadcastFanoutKeys(m);if(!C||!b||C.length!==b.length){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["cannot fanout revoke: "," ",""])),String(C),String(b));return}r("lodash").zip(C,b).forEach(function(e){var n=c.get(e[0]);n&&f(n,{msgKey:e[1],subtype:t.subtype,sender:t.sender})}),o("WAWebFtsClient").ftsClient.purge([String(e.rowId)]).catch(r("WAWebNoop"));var v=l?l.id.toString():e.id.remote.toString();o("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview([d.toString()]),o("WAWebPersistedJobManager").getJobManager().fireAndForget(o("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(v.toString(),[d.toString()]))}}l.sendRevoke=_,l.revoke=f,l.sendAssociatedBotPluginRevoke=y,l.sendAssociatedChildMsgRevoke=C}),98); __d("WAWebCodeMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react"));function u(e){var t=e.children,n=t===void 0?"":t,r=e.selectable;return s.jsx(o("WAWebCopyPasteSelectable.react").SelectableCode,{selectable:r,appTextTemplate:"```${appText}```",children:n})}u.displayName=u.name+" [from "+i.id+"]",l.default=u}),98); __d("WAWebExtractRangeFromMatch",[],(function(t,n,r,o,a,i){function e(e,t){t===void 0&&(t=0);var n=e.index,r=e[0],o=n+r.length-1,a=[n,n,o,o,e];if(t){var i,l=(i=e[t])!=null?i:"";a[1]=n+r.indexOf(l),a[2]=a[1]+l.length-1}return a}i.default=e}),66); __d("WAWebExtractRangesUsingRegex",["WAWebExtractRangeFromMatch"],(function(t,n,r,o,a,i,l){function e(e,t,n,o){n===void 0&&(n=0);var a=[];t.lastIndex=0;for(var i;(i=t.exec(e))&&t.lastIndex>0;)o&&(i=o(i,t)),i&&a.push(r("WAWebExtractRangeFromMatch")(i,n));return a}l.default=e}),98); __d("WAWebFormatMutator",["WAWebBoolFunc","err"],(function(t,n,r,o,a,i,l){var e=(function(){function e(){}return e.match=function(t,n,o){throw r("err")("Subclasses of `Mutator` must override `match()`")},e.mutate=function(t,n,r){return t},e})();e.nestable=o("WAWebBoolFunc").returnTrue,e.format=!0,e.fragment=!1,e.compatibility=!1,e.mutates=!1,l.default=e}),98); __d("WAWebCreateRegexMutator",["WAWebExtractRangesUsingRegex","WAWebFormatMutator"],(function(t,n,r,o,a,i,l){function e(e,t,n){return t===void 0&&(t=0),(function(o){function a(){return o.apply(this,arguments)||this}return babelHelpers.inheritsLoose(a,o),a.match=function(a){return r("WAWebExtractRangesUsingRegex")(a,e,t,n)},a})(r("WAWebFormatMutator"))}l.default=e}),98); __d("WAWebCodeFormatMutator",["WAWebCodeMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=/```([\s\S]*?\S[\s\S]*?)```/g,c=r("WAWebCreateRegexMutator")(u,1),d=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){var e=o.selectable,a=e===void 0?!1:e;return s.jsx(r("WAWebCodeMutatorComponent.react"),{selectable:a,children:t})},t})(c);d.format=!1;var m=function(t){return t.replace(u," ")};l.Code=d,l.removeCodeBlocks=m}),98); __d("WAWebCoexEditDeleteAlertUtils",["WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsMultiDevice","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){"use strict";var e="WACoexEditAlertShownBusiness",s="WACoexDeleteAlertShownBusiness",u="WACoexEditAlertShownThreads",c="WACoexDeleteAlertShownThreads";function d(){return o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(e)===!0}function m(){return o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(s)===!0}function p(){return _.apply(this,arguments)}function _(){return _=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(e,!0)}),_.apply(this,arguments)}function f(){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(s,!0)}),g.apply(this,arguments)}function h(e){var t=o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(u)||[];return t.includes(e)}function y(e){var t=o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(c)||[];return t.includes(e)}function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(u)||[];t.includes(e)||(yield o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(u,[].concat(t,[e])))}),b.apply(this,arguments)}function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.get(c)||[];t.includes(e)||(yield o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set(c,[].concat(t,[e])))}),S.apply(this,arguments)}function R(e,t){t===void 0&&(t=!1);var n=o("WAWebUserPrefsMultiDevice").getIsHostedMeAccountFromLocalStorage();return n?!d():t?!h(e):!1}function L(e,t){t===void 0&&(t=!1);var n=o("WAWebUserPrefsMultiDevice").getIsHostedMeAccountFromLocalStorage();return n?!m():t?!y(e):!1}function E(e){return k.apply(this,arguments)}function k(){return k=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebUserPrefsMultiDevice").getIsHostedMeAccountFromLocalStorage();t?yield p():yield C(e)}),k.apply(this,arguments)}function I(e){return T.apply(this,arguments)}function T(){return T=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebUserPrefsMultiDevice").getIsHostedMeAccountFromLocalStorage();t?yield f():yield v(e)}),T.apply(this,arguments)}l.COEX_EDIT_ALERT_BUSINESS_KEY=e,l.COEX_DELETE_ALERT_BUSINESS_KEY=s,l.COEX_EDIT_ALERT_THREADS_KEY=u,l.COEX_DELETE_ALERT_THREADS_KEY=c,l.hasShownBusinessEditAlert=d,l.hasShownBusinessDeleteAlert=m,l.markBusinessEditAlertShown=p,l.markBusinessDeleteAlertShown=f,l.hasShownConsumerEditAlertForThread=h,l.hasShownConsumerDeleteAlertForThread=y,l.markConsumerEditAlertShownForThread=C,l.markConsumerDeleteAlertShownForThread=v,l.shouldShowCoexEditAlert=R,l.shouldShowCoexDeleteAlert=L,l.markCoexEditAlertShown=E,l.markCoexDeleteAlertShown=I}),98); __d("WAWebCreateEncryptedMessageEditMsgData",["WALongInt","WANullthrows","WAWebAck","WAWebAddonEncryption","WAWebE2EProtoUtils","WAWebMessageEditValidationError","WAWebMsgGetters","WAWebMsgKeyUtils","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebViewMode.flow","WAWebWamEnumE2eFailureReason","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){function e(e,t){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n,a,i,l,s,u=self.crypto.getRandomValues(new Uint8Array(12)),c=o("WAWebMsgGetters").getOriginalSender(t),d=e.messageSecret,m=o("WALongInt").maybeNumberOrThrowIfTooLarge(e.latestEditSenderTimestampMs);if(d==null)throw new(o("WAWebMessageEditValidationError")).MessageEditValidationError(o("WAWebMessageEditValidationError").MessageEditValidationErrorCode.MISSING_MESSAGE_SECRET,o("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.MISSING_MESSAGE_SECRET);if(c==null)throw new(o("WAWebMessageEditValidationError")).MessageEditValidationError(o("WAWebMessageEditValidationError").MessageEditValidationErrorCode.MISSING_ORIGINAL_SENDER,o("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);if(m==null)throw new(o("WAWebMessageEditValidationError")).MessageEditValidationError(o("WAWebMessageEditValidationError").MessageEditValidationErrorCode.MISSING_SENDER_TIMESTAMP,o("WAWebWamEnumE2eFailureReason").E2E_FAILURE_REASON.INVALID_MESSAGE);var p=(n=e.editMsgType)!=null?n:o("WAWebMsgType").MSG_TYPE.CHAT,_;switch(p){case o("WAWebMsgType").MSG_TYPE.CHAT:{var f,g=(f=e.body)!=null?f:"",h=e.matchedText!=null||e.description!=null||e.title!=null;if(h){var y,C,b;_={type:o("WAWebMsgType").MsgKind.MessageEditDecrypted,encode:{protocolMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.id),type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT,timestampMs:m,editedMessage:{extendedTextMessage:{text:g,matchedText:(y=e.matchedText)!=null?y:void 0,description:(C=e.description)!=null?C:void 0,title:(b=e.title)!=null?b:void 0}}}}}}else _={type:o("WAWebMsgType").MsgKind.MessageEditDecrypted,encode:{protocolMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.id),type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT,timestampMs:m,editedMessage:{extendedTextMessage:{text:g}}}}};break}case o("WAWebMsgType").MSG_TYPE.IMAGE:_={type:o("WAWebMsgType").MsgKind.MessageEditDecrypted,encode:{protocolMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.id),type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT,timestampMs:m,editedMessage:{imageMessage:{caption:(a=e.caption)!=null?a:""}}}}};break;case o("WAWebMsgType").MSG_TYPE.VIDEO:_={type:o("WAWebMsgType").MsgKind.MessageEditDecrypted,encode:{protocolMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.id),type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT,timestampMs:m,editedMessage:{videoMessage:{caption:(i=e.caption)!=null?i:""}}}}};break;case o("WAWebMsgType").MSG_TYPE.DOCUMENT:_={type:o("WAWebMsgType").MsgKind.MessageEditDecrypted,encode:{protocolMessage:{key:o("WAWebE2EProtoUtils").encodeKey(t.id),type:o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.MESSAGE_EDIT,timestampMs:m,editedMessage:{documentWithCaptionMessage:{message:{documentMessage:{caption:(l=e.caption)!=null?l:""}}}}}}};break;default:throw r("err")("Unsupported edit msg type: "+p)}var v=yield o("WAWebAddonEncryption").encryptAddOn(_,{messageSecret:d,iv:u,stanzaId:t.id.id,originalMessageSender:c,addOnSender:o("WAWebWidFactory").asUserWidOrThrow(r("WANullthrows")(o("WAWebMsgGetters").getSender(e)))}),S=v.encPayload,R=v.reportingTokenContent;return babelHelpers.extends({id:e.id},o("WAWebMsgKeyUtils").msgKeyToTargetInfo(e.id,o("WAWebMsgKeyUtils").TranslateMsgKeyType.EditMessage),{type:o("WAWebMsgType").MSG_TYPE.MESSAGE_EDIT_ENCRYPTED,kind:o("WAWebMsgType").MsgKind.MessageEditEncrypted,subtype:"message_edit",t:Math.floor(m/1e3),ack:(s=e.ack)!=null?s:o("WAWebAck").ACK.CLOCK,targetMessageKey:t.id,protocolMessageKey:t.id,viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE,encPayload:S,encIv:u.buffer,latestEditMsgKey:e.latestEditMsgKey,latestEditSenderTimestampMs:m,editMsgType:e.editMsgType,mentionedJidList:e.mentionedJidList,groupMentions:e.groupMentions,errorCode:e.errorCode,messageSecret:d,reportingTokenContent:R})}),s.apply(this,arguments)}l.createEncryptedMessageEditMsgData=e}),98); __d("WAWebCoexEditDeleteAlertModal.react",["fbt","WAWebConfirmPopup.react","WAWebExternalLink.react","WAWebFbtCommon","WAWebModal.react","WAWebModalManager","react"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u=e||(e=r("react")),c={BUSINESS_DELETE:"business_delete",BUSINESS_EDIT:"business_edit",CONSUMER_DELETE:"consumer_delete",CONSUMER_EDIT:"consumer_edit"},d={DELETE:"https://faq.whatsapp.com/8122483904494954",EDIT:"https://faq.whatsapp.com/1520500555178162"};function m(e){return e==="consumer_edit"?{body:s._(/*BTDS*/"El mensaje se edit\u00f3 en este chat de WhatsApp. Es posible que la empresa a\u00fan pueda ver el mensaje original en otras plataformas."),title:s._(/*BTDS*/"Es posible que las ediciones solo aparezcan en WhatsApp")}:e==="business_edit"?{body:s._(/*BTDS*/"El mensaje se edit\u00f3 en este chat de WhatsApp. Es posible que no aparezca en otras plataformas."),title:s._(/*BTDS*/"Es posible que las ediciones solo aparezcan en WhatsApp")}:e==="consumer_delete"?{body:s._(/*BTDS*/"El mensaje se elimin\u00f3 de este chat de WhatsApp. Es posible que la empresa a\u00fan pueda verlo en otras plataformas."),title:s._(/*BTDS*/"Los mensajes solo se pueden eliminar en WhatsApp")}:e==="business_delete"?{body:s._(/*BTDS*/"El mensaje se elimin\u00f3 de este chat de WhatsApp. Es posible que a\u00fan aparezca en otras plataformas."),title:s._(/*BTDS*/"Los mensajes solo se pueden eliminar en WhatsApp")}:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+e)})()}function p(e){var t=e.alertType,n=e.onClose,a=m(t),i=a.body,l=a.title,c=t==="consumer_edit"||t==="business_edit",p=c?d.EDIT:d.DELETE,_=function(){o("WAWebModalManager").ModalManager.close("none"),self.setTimeout(function(){return o("WAWebExternalLink.react").openExternalLink(p)},10)},f=function(){n!=null?n():o("WAWebModalManager").ModalManager.close("none")},g={onClick:_,text:s._(/*BTDS*/"M\u00e1s informaci\u00f3n")};return u.jsxs(o("WAWebConfirmPopup.react").ConfirmPopup,{testid:void 0,onOK:f,buttonsDirection:"horizontal",okText:r("WAWebFbtCommon")("OK"),type:o("WAWebModal.react").ModalTheme.Multiline,extraButtonProps:g,children:[u.jsx("strong",{children:l}),u.jsx("br",{}),u.jsx("br",{}),i]})}p.displayName=p.name+" [from "+i.id+"]",l.CoexAlertType=c,l.WAWebCoexEditDeleteAlertModal=p}),226); __d("WAWebOpenCoexEditDeleteAlertModal",["WAWebCoexEditDeleteAlertModal.react","WAWebModalManager","react"],(function(t,n,r,o,a,i,l){"use strict";var e,s=e||(e=o("react"));function u(e,t){o("WAWebModalManager").ModalManager.open(s.jsx(o("WAWebCoexEditDeleteAlertModal.react").WAWebCoexEditDeleteAlertModal,{alertType:e,onClose:t}))}function c(e,t){var n=e?o("WAWebCoexEditDeleteAlertModal.react").CoexAlertType.BUSINESS_EDIT:o("WAWebCoexEditDeleteAlertModal.react").CoexAlertType.CONSUMER_EDIT;u(n,t)}function d(e,t){var n=e?o("WAWebCoexEditDeleteAlertModal.react").CoexAlertType.BUSINESS_DELETE:o("WAWebCoexEditDeleteAlertModal.react").CoexAlertType.CONSUMER_DELETE;u(n,t)}l.openCoexEditDeleteAlertModal=u,l.openCoexEditAlertModal=c,l.openCoexDeleteAlertModal=d}),98); __d("WAWebProcessAddonsJob",["WAJobOrchestratorTypes","WAWebDBProcessEditProtocolMsgs","WAWebOrchestratorNonPersistedJob","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("processEditProtocolMsgs",function(e){return o("WAWebDBProcessEditProtocolMsgs").processEditProtocolMsgs(e.msgs)},{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({msgs:e});yield t}),s.apply(this,arguments)}l.processEditProtocolMsgsJob=e}),98); __d("WAWebSendMessageEditAction",["PaymentLink","Promise","WAJobOrchestratorTypes","WALogger","WANullthrows","WATimeUtils","WAWebBizCoexGatingUtils","WAWebChatGetters","WAWebCodeFormatMutator","WAWebCoexEditDeleteAlertUtils","WAWebCreateEncryptedMessageEditMsgData","WAWebDBMessageDelete","WAWebDBMsgUtils","WAWebDBProcessMessage","WAWebDBUpdateMessageTable","WAWebErrorType","WAWebFrontendMsgGetters","WAWebLidMigrationUtils","WAWebMessageEditGatingUtils","WAWebMessageEditUtils","WAWebMessageSendPerfReporter","WAWebMessageSendReporter","WAWebMessagingGatingUtils","WAWebMsgActionCapability","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebMsgInfoUtils","WAWebMsgKey","WAWebMsgKeyUtils","WAWebMsgModel","WAWebMsgModelFromData","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebNewsletterSendMsgAction","WAWebOpenCoexEditDeleteAlertModal","WAWebOrchestratorNonPersistedJob","WAWebProcessAddonsJob","WAWebSendMsgRecordAction","WAWebSendMsgResultAction","WAWebSerializeError","WAWebStateUtils","WAWebUserPrefsMultiDevice","WAWebViewMode.flow","WAWebWamMsgUtils","WAWebWidFactory","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e,t,n){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){o("WAWebMessageEditUtils").isParentWithinEditProcessingWindow({parentTsInSeconds:e.t,editTsInSeconds:n,msgKey:e.id})?yield t.updateErrorCode(o("WAWebErrorType").SendFailureErrorCode.NoError):(yield e.updateErrorCode(o("WAWebErrorType").SendFailureErrorCode.EditWindowExpired),yield t.updateErrorCode(o("WAWebErrorType").SendFailureErrorCode.EditWindowExpired))}),d.apply(this,arguments)}function m(e,t){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){t!=null&&(yield o("WAWebDBUpdateMessageTable").updateMessageTable(e.id,{count:t}))}),p.apply(this,arguments)}function _(e){var t=o("WAWebMsgGetters").getLatestEditMsgKey(e);return t==null||!o("WAWebMsgActionCapability").canEditText(e)?(u||(u=n("Promise"))).resolve():o("WAWebDBMsgUtils").getMsgByMsgKey(t).then(function(t){if(t)return C(o("WAWebStateUtils").unproxy(e),o("WAWebMsgModelFromData").msgModelFromMsgData(t))}).catch(function(e){})}function f(e,t,a){var i,l,s;if(o("WAWebMsgGetters").getIsNewsletterMsg(e)&&!o("WAWebNewsletterGatingUtils").isNewsletterMessageEditingEnabled())return(u||(u=n("Promise"))).resolve();if(!o("WAWebMsgActionCapability").canEditText(e)&&!o("WAWebMsgActionCapability").canEditCaption(e))return(u||(u=n("Promise"))).reject(r("err")("Cannot edit message"));var c=g(o("WAWebStateUtils").unproxy(e),t,a),d=o("WAWebFrontendMsgGetters").getChat(e),m=(i=d==null||(l=d.id)==null?void 0:l.toString())!=null?i:"",p=(d==null||(s=d.contact)==null?void 0:s.isHosted)===!0,_=o("WAWebUserPrefsMultiDevice").getIsHostedMeAccountFromLocalStorage()===!0;return v(o("WAWebStateUtils").unproxy(e),c).then(function(){o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&o("WAWebCoexEditDeleteAlertUtils").shouldShowCoexEditAlert(m,p)&&(o("WAWebCoexEditDeleteAlertUtils").markCoexEditAlertShown(m),o("WAWebOpenCoexEditDeleteAlertModal").openCoexEditAlertModal(_))})}function g(e,t,n){var a,i,l,s,u,c,d=o("WAWebFrontendMsgGetters").getChat(e),m=o("WAWebLidMigrationUtils").getMeUserLidOrJidForChat(d,o("WAWebMsgKeyUtils").TranslateMsgKeyType.EditMessage),p=o("WAWebChatGetters").getIsGroup(d)?o("WAWebWidFactory").asUserWidOrThrow(m):void 0,_=new(r("WAWebMsgKey"))({id:r("WAWebMsgKey").newId_DEPRECATED(),remote:e.id.remote,fromMe:!0,participant:p}),f=n.groupMentions,g=n.linkPreview,h=n.mentionedJidList,y={id:_,from:m,to:e.id.remote,type:o("WAWebMsgType").MSG_TYPE.PROTOCOL,kind:o("WAWebMsgType").MsgKind.Protocol,subtype:"message_edit",viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE,protocolMessageKey:e.id,local:!0,t:o("WATimeUtils").unixTime(),mentionedJidList:h,groupMentions:f,latestEditMsgKey:_,latestEditSenderTimestampMs:o("WATimeUtils").unixTimeMs(),editMsgType:e.type,errorCode:o("WAWebErrorType").SendFailureErrorCode.NoError,messageSecret:o("WAWebMessagingGatingUtils").isReportingTokenSendingEnabled()?e.messageSecret:null};switch(r("WANullthrows")(o("WAWebMessageEditUtils").getMsgEditType(e.type))){case o("WAWebMessageEditUtils").MsgEditType.TextEdit:y=babelHelpers.extends({},y,{body:t.trim(),title:(a=g==null?void 0:g.title)!=null?a:void 0,matchedText:(i=g==null?void 0:g.matchedText)!=null?i:void 0,description:g==null?void 0:g.description,thumbnail:(l=g==null?void 0:g.thumbnail)!=null?l:void 0,richPreviewType:g==null?void 0:g.richPreviewType,doNotPlayInline:g==null?void 0:g.doNotPlayInline,inviteGrpType:g==null?void 0:g.inviteGrpType,thumbnailDirectPath:g==null?void 0:g.thumbnailDirectPath,thumbnailSha256:g==null?void 0:g.thumbnailSha256,thumbnailEncSha256:g==null?void 0:g.thumbnailEncSha256,thumbnailHeight:g==null?void 0:g.thumbnailHeight,thumbnailWidth:g==null?void 0:g.thumbnailWidth,mediaKey:(s=g==null?void 0:g.mediaKey)!=null?s:void 0,mediaKeyTimestamp:(u=g==null?void 0:g.mediaKeyTimestamp)!=null?u:void 0,paymentLinkMetadata:(c=o("PaymentLink").getPaymentLinkMessageMetadata(g,o("WAWebCodeFormatMutator").removeCodeBlocks(t)))!=null?c:void 0});break;case o("WAWebMessageEditUtils").MsgEditType.CaptionEdit:y=babelHelpers.extends({},y,{caption:t.trim()});break;case o("WAWebMessageEditUtils").MsgEditType.EventEdit:case o("WAWebMessageEditUtils").MsgEditType.RichResponseEdit:case o("WAWebMessageEditUtils").MsgEditType.LoadingMediaEdit:break}return y}function h(e,t,n,r,o){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,r,a,i){t.latestEditMsgKey&&(yield o("WAWebDBMessageDelete").removeMessagesFromHistory([t.latestEditMsgKey.toString()]));try{i.startSavedStage(),yield o("WAWebDBProcessMessage").storeMessages([r!=null?r:n],a),i.postSavedStage()}catch(t){throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[message-edit][sendMessageEdit] failed to store protocol msg data in message table"]))).verbose().sendLogs("storeSentMessageEdit failed"),t}i.startRenderedStage(),yield o("WAWebProcessAddonsJob").processEditProtocolMsgsJob([n]),i.postRenderedStage()}),y.apply(this,arguments)}function C(e,t){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=o("WAWebMsgGetters").getIsNewsletterMsg(e)?yield o("WAWebNewsletterSendMsgAction").sendNewsletterEditMsg(e,t):yield o("WAWebSendMsgRecordAction").sendMsgRecord(t),r=n.count,a=n.messageSendResult,i=n.t;a===o("WAWebSendMsgResultAction").SendMsgResult.OK&&(yield c(e,t,i),yield m(e,r),e.updateAck(t.ack),e.isSendFailure=t.isSendFailure===!0||t.errorCode===o("WAWebErrorType").SendFailureErrorCode.EditWindowExpired)}),b.apply(this,arguments)}function v(e,t){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a,i=o("WAWebFrontendMsgGetters").getChat(e),l=!!((a=i.groupMetadata)!=null&&a.isLidAddressingMode),u=o("WAWebWamMsgUtils").msgIsLid(e,i.id,l),c=o("WAWebMsgInfoUtils").getGroupMessageSendReporterOptions(i.id,u);c.originalMessage=e;var d=e.messageSecret!=null&&o("WAWebMessageEditGatingUtils").isMessageEditToMessageSecretSenderEnabled(),m=t;if(d)try{m=yield o("WAWebCreateEncryptedMessageEditMsgData").createEncryptedMessageEditMsgData(t,e)}catch(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[message-edit] Failed to create encrypted message edit ",""])),r("WAWebSerializeError")(e)).sendLogs("encrypted-message-edit-failed")}var p=new(o("WAWebMsgModel")).Msg(m!=null?m:t);p.wamMessageSendReporter=new(o("WAWebMessageSendReporter")).MessageSendReporter(p,c),p.wamMessageSendPerfReporter=new(o("WAWebMessageSendPerfReporter")).MessageSendPerfReporter({chatWid:p.to,mediaType:p.getWamMediaType(),messageType:p.getWamMessageType()});var _=p.wamMessageSendPerfReporter;yield o("WAWebOrchestratorNonPersistedJob").createNonPersistedJob("sendMessageEdit",(function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n){var r=n.chatId,o=n.msgData;yield h(o,t,m,r,_),yield C(e,p)});return function(e){return r.apply(this,arguments)}})(),{priority:o("WAJobOrchestratorTypes").JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({msgData:o("WAWebMsgDataFromModel").msgDataFromMsgModel(e),chatId:o("WAWebFrontendMsgGetters").getChat(e).id})}),S.apply(this,arguments)}l.resendLatestEdit=_,l.sendMessageEdit=f,l.createEditMsgData=g,l.addAndSendMessageEdit=v}),98); __d("WAWebContactBlockedErrorAction",["WACustomError"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(t,n){var r;return r=e.call(this,t)||this,r.name="ContactBlocked",r.contact=n,r}return babelHelpers.inheritsLoose(t,e),t})(o("WACustomError").CustomError);l.default=e}),98); __d("WAWebOutgoingMessageTone",["WAWebNoop","WAWebUserPrefsNotifications","bx"],(function(t,n,r,o,a,i,l){var e=new window.Audio(r("bx").getURL(r("bx")("9562")));function s(){o("WAWebUserPrefsNotifications").getOutgoingMessageSound()&&e.play().catch(r("WAWebNoop"))}l.playOutgoingMessageTone=s}),98); __d("WAWebChatUtmCache",[],(function(t,n,r,o,a,i){var e=(function(){function e(){this.utmReadChatIds=new Set}var t=e.prototype;return t.deleteChatId=function(t){this.utmReadChatIds.delete(t)},t.hasRead=function(t){return this.utmReadChatIds.has(t)},t.read=function(t){this.utmReadChatIds.add(t)},t.clearAll=function(){this.utmReadChatIds.clear()},e})(),l=new e;i.default=l}),66); __d("WAWebUpdateUtmAction",["WAWebBizGatingUtils","WAWebChatUtmCache","WAWebUtmBizPrefs"],(function(t,n,r,o,a,i,l){function e(e,t){if(o("WAWebBizGatingUtils").isUtmTrackingEnabled()){var n=e.toString();o("WAWebUtmBizPrefs").persistUtmtoLocalStorage(n,t),r("WAWebChatUtmCache").deleteChatId(n)}}function s(e){var t=e.toString();o("WAWebUtmBizPrefs").removeUtmFromLocalStorage(t),r("WAWebChatUtmCache").read(t)}function u(e){if(!o("WAWebBizGatingUtils").isUtmTrackingEnabled())return null;var t=e.toString();if(r("WAWebChatUtmCache").hasRead(t))return null;var n=o("WAWebUtmBizPrefs").getUtmFromLocalStorage(t);return n==null&&r("WAWebChatUtmCache").read(t),n}l.addUtmToChat=e,l.clearUtmAfterMessageSent=s,l.getUtmForChat=u}),98); __d("WAWebSendMsgRecordAction",["Promise","WAErrors","WAFilteredCatch","WALogger","WANullthrows","WAWebABProps","WAWebAck","WAWebAddOnsUpdateSendStatesAction","WAWebAddonSendMsgData","WAWebBackendErrors","WAWebBlocklistCollection","WAWebBotGating","WAWebBotGenTypingIndicatorMsg","WAWebCommonMsgSubtypeTypes","WAWebConstantsDeprecated","WAWebContactBlockedErrorAction","WAWebContactCollection","WAWebExternalCtxConfig","WAWebExternalEntryPointPrefs","WAWebFindChatAction","WAWebGroupMetadataCollection","WAWebHandleMsgError","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgType","WAWebMsgUtilsBridge","WAWebNoop","WAWebOutgoingMessageTone","WAWebReactionsBEUtils","WAWebSendMsgMetricReporter","WAWebSendMsgRecordBridge","WAWebSendMsgResultAction","WAWebSendNotSpamAction","WAWebSingleEmojiDailyUtils","WAWebThreadMsgUtils","WAWebUpdateUnreadChatAction","WAWebUpdateUtmAction","WAWebUserPrefsMeUser","WAWebUtmBizUtils","WAWebWamEnumMessageSendResultType","WAWebWamMsgUtils","WAWebWebcMessageSendWamEvent","WAWebWid","asyncToGeneratorRuntime","gkx"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_;function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["sendMsgRecord"])));var r=o("WAWebSendMsgMetricReporter").createMsgModelMetricReporter(t);r.sendReporter=(n=r.sendReporter)!=null?n:r.createSendReporter();var a=t.id.remote,i=yield o("WAWebFindChatAction").findExistingChat(a,"sendMsgRecord");if(i.contact.isEnterprise&&!o("WAWebMsgGetters").getIsGroupMsg(t)){var l=o("WAWebUpdateUtmAction").getUtmForChat(a);l!=null&&o("WAWebUtmBizUtils").isUtmValid(i,l)&&(t.utm=l)}return t.isNewMsg=!0,C({type:"message",data:t},i,r)}),g.apply(this,arguments)}function h(e){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebSendMsgMetricReporter").createAddonMetricReporter(e),n=yield o("WAWebFindChatAction").findExistingChat(e.id.remote,"sendMsgRecord");return C({type:"addon",data:e},n,t)}),y.apply(this,arguments)}function C(e,t,n){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a){var i=e.data,l=r("WANullthrows")(i.to),f=i.id,g=f.remote;r("WAWebWid").isGroup(l)&&(yield r("WAWebGroupMetadataCollection").find(l)),t.isTrusted()||r("WAWebSendNotSpamAction")(t).catch(r("WAWebNoop"));var h=i.type===o("WAWebMsgType").MSG_TYPE.PROTOCOL&&["sender_revoke","admin_revoke"].includes(i.subtype),y=i.type===o("WAWebMsgType").MSG_TYPE.PROTOCOL&&i.subtype===o("WAWebCommonMsgSubtypeTypes").MsgSubtype.EphemeralSyncResponse,C=o("WAWebMsgGetters").getIsReaction(i)&&i.reactionText===o("WAWebReactionsBEUtils").REVOKED_REACTION_TEXT;if(!o("WAWebMsgGetters").getIsGroupMsg(i)&&!h&&!C&&o("WAWebBlocklistCollection").BlocklistCollection.get(l))return(_||(_=n("Promise"))).reject(new(r("WAWebContactBlockedErrorAction"))("Contact is blocked",o("WAWebContactCollection").ContactCollection.assertGet(l)));var b;return h||(b=new(o("WAWebWebcMessageSendWamEvent")).WebcMessageSendWamEvent({messageType:o("WAWebWamMsgUtils").getWamMessageType(i),messageMediaType:o("WAWebWamMsgUtils").getWamMediaType(i),messageIsForward:!!i.isForwarded})),y||o("WAWebUpdateUnreadChatAction").sendSeen({chat:t,threadId:o("WAWebBotGating").isAiChatThreadsEnabled()?o("WAWebThreadMsgUtils").getMsgAiThread(i):void 0}),e.type!=="addon"&&i.type!==o("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT&&!y&&!h&&o("WAWebMsgCollection").MsgCollection.trigger(r("WAWebConstantsDeprecated").NEW_MSG_SENT),(_||(_=n("Promise"))).resolve().then(function(){return e.type==="message"?o("WAWebSendMsgRecordBridge").sendMsgRecord(e.data,a):o("WAWebAddonSendMsgData").sendAddonProcess(e.data,a)}).then((function(){var a=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n){var a=f.fromMe&&o("WAWebUserPrefsMeUser").isMePrimary(g)?o("WAWebAck").ACK.READ:o("WAWebAck").ACK.SENT;return e.type==="message"&&(e.data.updateAck(a),o("WAWebAddOnsUpdateSendStatesAction").maybeUpdateAddOnAckForMsgAction(e.data,a)),o("WAWebBotGenTypingIndicatorMsg").maybeGenBotTypingIndicatorMessage(t,i),b&&(b.markMessageSendT(),b.commit()),!h&&o("WAWebABProps").getABPropConfigValue("single_emoji_logging_enabled")&&o("WAWebSingleEmojiDailyUtils").maybeIncrementSingleEmojiDailyStatsCount(i),i.utm!=null&&o("WAWebUpdateUtmAction").clearUtmAfterMessageSent(g),yield o("WAWebMsgUtilsBridge").logMessageSendForChatThreadLogging(i),[o("WAWebMsgType").MSG_TYPE.PROTOCOL,o("WAWebMsgType").MSG_TYPE.REACTION,o("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT].includes(i.type)||(t.lastReceivedKey=f),!r("gkx")("26258")&&!h&&!y&&o("WAWebOutgoingMessageTone").playOutgoingMessageTone(),o("WAWebExternalCtxConfig").isCtxLoggingEnabled()&&o("WAWebExternalEntryPointPrefs").deleteExternalEntryPoint(g),{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.OK,t:n.t,count:n.count}});return function(e){return a.apply(this,arguments)}})()).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").ServerStatusCodeError,function(e){var t;return e.status!==408&&o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Phone responded ",""])),e.status).sendLogs("send-not-200"),(t=a.sendReporter)==null||t.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_NETWORK,isTerminal:!1}),a.sendReporter=null,{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_NETWORK}})).catch(o("WAFilteredCatch").filteredCatch(o("WAErrors").BufferTooLargeError,function(){var e;return(e=a.sendReporter)==null||e.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_PAYLOAD_TOO_BIG,isTerminal:!0}),a.sendReporter=null,{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}})).catch(o("WAFilteredCatch").filteredCatch(o("WAWebHandleMsgError").MessageValidationError,function(){var e;return(e=a.sendReporter)==null||e.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_INVALID_PROTOBUF,isTerminal:!0}),a.sendReporter=null,{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}})).catch(o("WAFilteredCatch").filteredCatch(o("WAWebHandleMsgError").MessageSentAckError,function(e){var t;return o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["model:msg:createRecord dropped msg: ",""])),i.id.toString()),o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Got error ",""])),String(e)).sendLogs("send-msg-server-nack-error"),(t=a.sendReporter)==null||t.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!0}),a.sendReporter=null,{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}})).catch(function(t){var n;return o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["model:msg:createRecord dropped msg: ",""])),i.id.toString()),e.type==="message"?o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["Got error ",""])),String(t)).tags("messaging").sendLogs("send-msg-error"):o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["Got error ",""])),String(t)).tags("messaging","addons").sendLogs("send-addon-error: "+i.type),(n=a.sendReporter)==null||n.postFailure({result:o("WAWebWamEnumMessageSendResultType").MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!0}),a.sendReporter=null,{messageSendResult:o("WAWebSendMsgResultAction").SendMsgResult.ERROR_UNKNOWN}})}),b.apply(this,arguments)}l.sendMsgRecord=f,l.sendAddonRecord=h}),98); __d("WAWebUpdateMessageUIAction",["WALogger","WAWebBackendErrors","WAWebCommonMsgUtils","WAWebDBProcessMessage","WAWebHandleForMessageRange","WAWebHandleForMessageRangeEnums","WAWebHandleMsgTypes.flow","WAWebMsgCollection","WAWebMsgGetters","WAWebStatusCollection","asyncToGeneratorRuntime","getErrorSafe","gkx"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e,t,n,r,o){return d.apply(this,arguments)}function d(){return d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,n,a,i,l){a===void 0&&(a=o("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE),i===void 0&&(i=!0),l===void 0&&(l=!1);var c={add:"after",update:a!==o("WAWebHandleMsgTypes.flow").MessageOverwriteOption.NO_OVERWRITE,isHistory:!1},d=!l,m=yield o("WAWebHandleForMessageRange").handleForActiveMessageRange(t,n,d);if(!m.has(o("WAWebHandleForMessageRangeEnums").ActiveRangeHandlerAction.DropMessage)){var p=m.has(o("WAWebHandleForMessageRangeEnums").ActiveRangeHandlerAction.SkipUI),_=o("WAWebMsgCollection").MsgCollection.get(n.id);_&&((o("WAWebCommonMsgUtils").isPlaceholderMsg(_.type)||o("WAWebCommonMsgUtils").isFutureproofMsg(_.type))&&!(o("WAWebCommonMsgUtils").isPlaceholderMsg(n.type)||o("WAWebCommonMsgUtils").isFutureproofMsg(n.type))||o("WAWebCommonMsgUtils").isRichResponseMsg(_.type)&&o("WAWebCommonMsgUtils").isSomewhatParsedRichResponseMsg(n)?c.update=!0:_.fromQuotedMsg?o("WAWebMsgCollection").MsgCollection.remove(_):p=!0);try{o("WAWebMsgGetters").getIsStatus(n)&&o("WAWebStatusCollection").StatusCollection.handleUpdate(n,!1),p||(yield o("WAWebMsgCollection").MsgCollection.processMultipleMessages(t,[babelHelpers.extends({},n,{recvFresh:!0,isNewMsg:!0})],c,"updateMessageUIAction",null,i))}catch(a){if(a instanceof o("WAWebBackendErrors").LogoutDrop)return;if(a instanceof o("WAWebDBProcessMessage").PreviousMsgNotUpdatableError){o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Msg: "," chat: "," Error: PreviousMsgNotUpdatableError"])),String(n.id),String(t));return}var f=r("getErrorSafe")(a);r("gkx")("26258")?o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Msg: "," chat: "," Error: ",", message: ",", stack: ",""])),String(n.id),String(t),f.name,f.message,f.stack).tags("messaging"):o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Msg: "," chat: "," Error: ",", message: ",", stack: ",""])),String(n.id),String(t),f.name,f.message,f.stack).tags("messaging").sendLogs("msg_handler for MD: error storing/processing single message")}}}),d.apply(this,arguments)}function m(e){return p.apply(this,arguments)}function p(){return p=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebMsgCollection").MsgCollection.get(e.id);t!=null&&t.delete()}),p.apply(this,arguments)}l.updateUI=c,l.removePlaceholder=m}),98); __d("WAWebHandleAddChats",["Promise","WAAsyncSleep","WALogger","WALongInt","WAWebBackendApi","WAWebChatConstants","WAWebCollectionConstants","WAWebConnModel","WAWebDBChatValidation","WAWebLid1X1MigrationGating","WAWebLogoutReasonConstants","WAWebMobilePlatforms","WAWebSchemaChat","WAWebSchemaMessage","WAWebSocketLogoutJob","asyncToGeneratorRuntime","isEmptyIterable"],(function(t,n,r,o,a,i,l){var e=["accountLid","disappearingModeInitiator","disappearingModeTrigger","pendingInitialLoading"],s,u,c,d,m;function p(e){return{ephemeralSettingTimestamp:o("WALongInt").maybeNumberOrThrowIfTooLarge(e.ephemeralSettingTimestamp),tcTokenSenderTimestamp:o("WALongInt").maybeNumberOrThrowIfTooLarge(e.tcTokenSenderTimestamp),tcTokenTimestamp:o("WALongInt").maybeNumberOrThrowIfTooLarge(e.tcTokenTimestamp)}}function _(e){if(o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated())try{var t=e.filter(function(e){return e.id.isRegularUser()&&e.accountLid==null});t.length>0&&o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["handleAddChats: no account_lid for "," chats. first: ",""])),t.length,t[0].id.toLogString()).sendLogs("add-chats-no-account-lid").tags("missing-lid")}catch(e){}}function f(e){return g.apply(this,arguments)}function g(){return g=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["handleAddChats: "," chats"])),t.length),_(t),o("WAWebSchemaChat").getChatTable().bulkCreateOrMerge(t.map(function(t){var n=t.accountLid,r=t.disappearingModeInitiator,a=t.disappearingModeTrigger,i=t.pendingInitialLoading,l=babelHelpers.objectWithoutPropertiesLoose(t,e),s=babelHelpers.extends({},l,{id:t.id.toString(),muteExpiration:0,isAutoMuted:!1},p(l),{endOfHistoryTransferType:t.endOfHistoryTransferType});return n!=null&&(s.accountLid=n.toString()),r!=null&&(s.disappearingModeInitiator=r),a!=null&&(s.disappearingModeTrigger=a),o("WAWebDBChatValidation").validateAccountLidInChatRow(s,"handleAddChats"),s})).catch((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return h(e,t)});return function(t){return e.apply(this,arguments)}})()).then(function(){return o("WAWebBackendApi").frontendSendAndReceive("chatCollectionAdd",{things:t.map(function(e){var t;return babelHelpers.extends({},e,{accountLid:(t=e.accountLid)!=null?t:void 0},p(e),{endOfHistoryTransferType:o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.cast(e.endOfHistoryTransferType)})}),options:{merge:!0}})}).then(function(){(o("WAWebConnModel").Conn.platform===o("WAWebMobilePlatforms").PLATFORMS.IPHONE||o("WAWebConnModel").Conn.platform===o("WAWebMobilePlatforms").PLATFORMS.SMBI)&&(r("isEmptyIterable")(t)?o("WAWebBackendApi").frontendFireAndForget("msgCollectionTrigger",{name:o("WAWebCollectionConstants").COLLECTION_HAS_SYNCED}):self.setTimeout(function(){o("WAWebBackendApi").frontendFireAndForget("msgCollectionTrigger",{name:o("WAWebCollectionConstants").COLLECTION_HAS_SYNCED})},2500)),o("WAWebBackendApi").frontendFireAndForget("chatCollectionTrigger",{name:o("WAWebCollectionConstants").COLLECTION_HAS_SYNCED,args:{count:t.length}})})}),g.apply(this,arguments)}function h(e,t){return y.apply(this,arguments)}function y(){return y=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){return yield C(t),o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["handleAddChats: bulkCreateOrMerge failed: is lid migrated: ",""])),o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()).catching(e).sendLogs("fail-to-add-chats-history-sync",{sendLogsType:o("WALogger").SendLogsType.USER_FORCEFULLY_LOGGED_OUT_SAD}),yield o("WAAsyncSleep").asyncSleep(5e3),o("WAWebSocketLogoutJob").socketLogout(o("WAWebLogoutReasonConstants").LogoutReason.WebFailAddChat)}),y.apply(this,arguments)}function C(e){return b.apply(this,arguments)}function b(){return b=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebSchemaChat").getChatTable().all(),r=t.map(function(e){return e.id}),a=new Set(t.map(function(e){return e.accountLid})),i=[],l=function*(){var e=u.accountLid;if(e==null)return 0;if(a.has(e.toString())){var n=t.find(function(t){return t.accountLid===e.toString()});if(!n)return 0;i.push(v(n.id))}},s;for(var u of e)s=yield*l();yield(m||(m=n("Promise"))).all(i)}),b.apply(this,arguments)}function v(e){return S.apply(this,arguments)}function S(){return S=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebSchemaMessage").getMessageTable().between(["internalId"],e+"_",e+"_z",{lowerInclusive:!0,upperInclusive:!1,shouldDecrypt:!1}),n=t.map(function(e){return{type:e.type,subtype:e.subtype}}).map(function(e){return JSON.stringify(e)}).join(",");o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["messages pre-existing before history for chat ",": [","]"])),e,n)}),S.apply(this,arguments)}l.default=f}),98); __d("WAWebHistoryMsgHandlerAction",["Promise","WAAckLevel","WAFilteredCatch","WAJids","WALogger","WALongInt","WANullthrows","WATimeUtils","WAWebABProps","WAWebAddonProcessMsgs","WAWebAddonProcessMsgsUtils","WAWebAdvHostedAccountTypeSystemMsg","WAWebApiContact","WAWebApiFilterAndReplaceMessages","WAWebApiHistorySyncNotification","WAWebBackendApi","WAWebBackendErrors","WAWebBackendJobs.flow","WAWebBizAiAgentGating","WAWebBizCoexGatingUtils","WAWebBizCoexUtils","WAWebBizGatingUtils","WAWebBotTypes","WAWebChatConstants","WAWebCheckUpdateOrphanReactions","WAWebContactCollection","WAWebCountriesUtils","WAWebCryptoCurve25519","WAWebCurrentUser","WAWebDBCreateLidPnMappings","WAWebDBProcessInitialHistorySyncMessage","WAWebDBReportingTokenUtils","WAWebEphemeralityTypes","WAWebEphemeralityUtils","WAWebHandleAddChats","WAWebHandleMsgTypes.flow","WAWebHandleSingleMsg","WAWebHistorySyncNotificationUtils","WAWebHistorySyncStickers","WAWebLidAwareContactsDB","WAWebLidMigrationUtils","WAWebLidStatusMigrationUtils","WAWebLimitSharingProtoUtils","WAWebMemberLabelHistorySync","WAWebMessageAssociationGatingUtils","WAWebMessageReceiptBatcher","WAWebMessagingGatingUtils","WAWebMmSignalSharingExpirationWindowUtils","WAWebMobilePlatforms","WAWebMsgAGMProcessing","WAWebMsgKey","WAWebMsgProcessingApiUtils","WAWebMsgType","WAWebNoop","WAWebProcessMessageAssociationMessages","WAWebProtobufsAdv.pb","WAWebProtobufsE2E.pb","WAWebProtobufsHistorySync.pb","WAWebReportingTokenUtils","WAWebSignalCommonUtils","WAWebSignalProtocolStore","WAWebSyncBootstrap","WAWebSyncdOrphan","WAWebUserPrefsHistorySync","WAWebUserPrefsIndexedDBStorage","WAWebUserPrefsMeUser","WAWebUserPrefsModelStorage","WAWebUserPrefsMultiDevice","WAWebUsernameTypes","WAWebVoipActionWriteCallLogSync","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T,D,x,$,P,N,M;function w(e,t,n,r,o,a,i,l){return A.apply(this,arguments)}function A(){return A=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i,l,s,u,c){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[history sync] starts hanlding initial sync msgs"])));var I=[],T={},D={},x=new Map,$={},P=[],N=0,w=[],A=o("WAWebHistorySyncNotificationUtils").getLidMappingAsStringSet(c);o("WAWebCurrentUser").isEmployee()&&o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["first lid mappings for initial sync. count: ",". ","..."])),A==null?void 0:A.size,o("WAWebHistorySyncNotificationUtils").getLidsForLogging(A)).verbose();var F=new Map,O=o("WAWebBizCoexGatingUtils").smbHostedLazySystemMsgInsertInHistorySyncEnabled()&&(yield o("WAWebUserPrefsMultiDevice").getIsHostedMeAccount())===!0,B=function*(n){var e,i,l,s;o("WAWebCurrentUser").isEmployee()&&o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["[history sync] processing conversation "," with "," messages"])),n.id,n.messages.length);var u=o("WAWebWidFactory").createWid(n.id);if(u.isNewsletter())return 0;if(u.isUser()){if(u.isLid()){var c=n.pnJid;c!=null&&I.push({lid:u,pn:o("WAWebWidFactory").createUserWidOrThrow(c)});var d=n.displayName,m=n.shareOwnPn;if(d!=null||m!=null){var p={};d!=null&&(p.displayNameLID=d),m!=null&&(p.shareOwnPn=m),a.push({lid:u,data:p})}}else if(n.lidJid!=null){var _=o("WAWebWidFactory").createUserLidOrThrow(n.lidJid);I.push({lid:_,pn:u})}}var f=[];N+=n.messages.length;var g=[],h=new Set,y=[];n.messages.length===0&&(T[n.id]=-1),r("isStringNullOrEmpty")(n.pHash)||($[n.id]=n.pHash);var M,B=[];n.messages.forEach(function(e,a){var i,l,s,c;if(a===n.messages.length-1){var d=o("WALongInt").maybeNumberOrThrowIfTooLarge(e.msgOrderId);d!=null&&(T[n.id]=d)}var m=(e==null||(i=e.message)==null||(i=i.message)==null||(i=i.protocolMessage)==null?void 0:i.type)===o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.REQUEST_WELCOME_MESSAGE;if(m){o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping request welcome message"])));return}var p=(e==null||(l=e.message)==null||(l=l.message)==null||(l=l.protocolMessage)==null?void 0:l.type)===o("WAWebProtobufsE2E.pb").Message$ProtocolMessage$Type.BOT_MEMU_ONBOARDING_MESSAGE;if(p){o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Dropping memu onboarding message"])));return}if(o("WAWebMobilePlatforms").isSMB()&&o("WAWebBizCoexGatingUtils").smbHostedLazySystemMsgInsertInHistorySyncEnabled()&&a===0&&u.isUser()&&n.systemMessageToInsert!=null)switch(n.systemMessageToInsert){case o("WAWebProtobufsHistorySync.pb").PrivacySystemMessage.E2EE_MSG:{if(O)break;var _=o("WAWebAdvHostedAccountTypeSystemMsg").genAdvAccountTypeChangeNotificationMsg(u,o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),o("WAWebProtobufsAdv.pb").ADVEncryptionType.E2EE);g.push(_),o("WAWebBizCoexUtils").sendWamCoexPrivacySysMsgHistorySyncInsert(_);break}case o("WAWebProtobufsHistorySync.pb").PrivacySystemMessage.NE2EE_SELF:{if(!O)break;var C=o("WAWebAdvHostedAccountTypeSystemMsg").genAdvAccountTypeSelfTransitionToCoexNotificationMsg(u,o("WAWebUserPrefsMeUser").getMePnUserOrThrow());g.push(C),o("WAWebBizCoexUtils").sendWamCoexPrivacySysMsgHistorySyncInsert(C);break}case o("WAWebProtobufsHistorySync.pb").PrivacySystemMessage.NE2EE_OTHER:{var S=o("WAWebAdvHostedAccountTypeSystemMsg").genAdvAccountTypeChangeNotificationMsg(u,o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),o("WAWebProtobufsAdv.pb").ADVEncryptionType.HOSTED);g.push(S),o("WAWebBizCoexUtils").sendWamCoexPrivacySysMsgHistorySyncInsert(S)}}var R=o("WAWebHistorySyncNotificationUtils").parseWebMsgInfoAndReturnNullOnFailure(u,e.message,t,A,F),L=((s=e.message)==null||(s=s.message)==null||(s=s.commentMessage)==null?void 0:s.targetMessageKey)==null,E=(R==null?void 0:R.associationType)!=null;if(L){var k;R!=null&&h.has(R.id.toString())&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()&&h.delete(R==null?void 0:R.id.toString()),R!=null&&R.type===o("WAWebMsgType").MSG_TYPE.INTERACTIVE&&R.ctwaContext!=null||g.push(R);var I=(k=e.message)==null||(k=k.message)==null||(k=k.extendedTextMessage)==null||(k=k.contextInfo)==null?void 0:k.externalAdReply,D=R!=null?R:{},x=D.from,$=D.id,P=D.to;if(I!=null&&($==null?void 0:$.fromMe)!=null&&x!=null&&P!=null&&o("WAWebBizGatingUtils").shouldGenerateAGMMsgs(I)){var N,w=new(r("WAWebMsgKey"))({fromMe:!$.fromMe,remote:u,id:r("WAWebMsgKey").newId_DEPRECATED()}),W=o("WAWebMsgAGMProcessing").genHistoryAutomatedGreetingMsg({msgKey:w,ctwaContext:I,to:x,from:P,msgTimestamp:(N=e.message)==null?void 0:N.messageTimestamp});g.push(W)}}if(R!=null&&E&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var q=R.parentMsgKey.toString();h.add(q),y.push(R)}f=f.concat(o("WAWebAddonProcessMsgsUtils").parseHistorySyncMsg({webMsgInfo:e.message,parsedWebMsgInfo:R,isFromCag:(c=n.isDefaultSubgroup)!=null?c:!1})),(R==null?void 0:R.subtype)==="biz_bot_1p_disclosure"&&(M=o("WAWebBotTypes").BizBotType.BIZ_1P),(R==null?void 0:R.subtype)==="biz_bot_3p_disclosure"&&(M=o("WAWebBotTypes").BizBotType.BIZ_3P),B=o("WAWebMmSignalSharingExpirationWindowUtils").getUpdatedMmSignalSharingExpirationWindowFromHistorySync(e.message,B)});var W;if(h.size>0&&o("WAWebMessageAssociationGatingUtils").isMessageAssociationInfraEnabled()){var q=o("WAWebProcessMessageAssociationMessages").classifyAssociatedMsgsFromHistorySyncUsingMissingParentsCache(y,h);q!=null&&q.validAssociatedMsgs&&(W=o("WAWebApiFilterAndReplaceMessages").validateMsgFn(q==null?void 0:q.validAssociatedMsgs))}g=o("WAWebApiFilterAndReplaceMessages").filterAndReplaceMessagesInitialHistorySync(g,W),g=g.reverse();var U=n.contactPrimaryIdentityKey;if(U&&r("WAWebWid").isUser(u)){var V=o("WAWebSignalCommonUtils").bufferToStr(o("WAWebCryptoCurve25519").toSignalCurvePubKey(U));w.push({userId:o("WAWebWidFactory").asUserWidOrThrow(u),identityKey:V})}var H,G,j;if(((e=n.disappearingMode)==null?void 0:e.initiator)!=null)switch(n.disappearingMode.initiator){case o("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.CHANGED_IN_CHAT:H=o("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat,G=o("WAWebEphemeralityTypes").DisappearingModeTrigger.ChatSettings;break;case o("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_ME:H=o("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByMe,G=o("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings,j=!0;break;case o("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.INITIATED_BY_OTHER:case o("WAWebProtobufsE2E.pb").DisappearingMode$Initiator.BIZ_UPGRADE_FB_HOSTING:H=o("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByOther,G=o("WAWebEphemeralityTypes").DisappearingModeTrigger.AccountSettings,j=!1;break}if(o("WAWebABProps").getABPropConfigValue("dm_initiator_trigger_daily_logs")){var K,Q;if(((K=n.disappearingMode)==null?void 0:K.trigger)!=null){var X=o("WAWebEphemeralityUtils").getDisappearingModeTriggerFromProtobuf(n.disappearingMode.trigger);X!=null&&(G=X)}((Q=n.disappearingMode)==null?void 0:Q.initiatedByMe)!=null&&(j=n.disappearingMode.initiatedByMe)}var Y=n.tcToken!=null&&n.tcTokenTimestamp!=null,J=z(u,n);if(J.result==="skip-chat")return 0;if(J.result==="extracted"){var Z=J.accountLid;if(x.has(Z))return o("WALogger").ERROR(S||(S=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: Found duplicated accountLid during initial sync"]))).sendLogs("duplicated-account-lid-in-history-sync"),0;x.set(Z,u)}if(o("WAWebCurrentUser").isEmployee()){var ee;o("WALogger").LOG(R||(R=babelHelpers.taggedTemplateLiteralLoose(["handleInitialSyncMsgs: incoming chat info: ",", ",", ",""])),u,(ee=J.accountLid)!=null?ee:"n/a",u.isRegularUser()?o("WAWebApiContact").getAlternateUserWid(o("WAWebWidFactory").asUserWidOrThrow(u)):"n/a")}var te=J.accountLid,ne={t:o("WALongInt").maybeNumberOrThrowIfTooLarge((i=n.conversationTimestamp)!=null?i:n.lastMsgTimestamp),accountLid:te,id:u,unreadCount:n.unreadCount,ephemeralDuration:n.ephemeralExpiration,ephemeralSettingTimestamp:n.ephemeralSettingTimestamp,disappearingModeInitiator:H,disappearingModeTrigger:G,disappearingModeInitiatedByMe:j,endOfHistoryTransferType:(l=n.endOfHistoryTransferType)!=null?l:o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.INCOMPLETE,name:n.name,notSpam:n.notSpam,pendingInitialLoading:!1,unreadMentionCount:n.unreadMentionCount,tcToken:Y?n.tcToken:null,tcTokenTimestamp:Y?n.tcTokenTimestamp:null,tcTokenSenderTimestamp:n.tcTokenSenderTimestamp,bizBotSystemMsgType:M,isLocked:n.locked,limitSharing:o("WAWebLimitSharingProtoUtils").getLimitSharingFromProtocolHistorySyncConversation(n),capiThreadControl:o("WAWebBizAiAgentGating").isAiAgentThreadStatusHistorySyncEnabled()?n.maibaAiThreadEnabled===!0?o("WAWebProtobufsE2E.pb").Message$CloudAPIThreadControlNotification$CloudAPIThreadControl.CONTROL_TAKEN:n.maibaAiThreadEnabled===!1?o("WAWebProtobufsE2E.pb").Message$CloudAPIThreadControlNotification$CloudAPIThreadControl.CONTROL_PASSED:n.maibaAiThreadEnabled===void 0?o("WAWebProtobufsE2E.pb").Message$CloudAPIThreadControlNotification$CloudAPIThreadControl.UNKNOWN:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+n.maibaAiThreadEnabled)})():o("WAWebProtobufsE2E.pb").Message$CloudAPIThreadControlNotification$CloudAPIThreadControl.UNKNOWN};if(u.isLid()){var re=n.lidOriginType;if(re!=null){var oe=o("WAWebUsernameTypes").LidOriginType.cast(re);oe!==o("WAWebUsernameTypes").LidOriginType.PNH_CTWA&&oe!==o("WAWebUsernameTypes").LidOriginType.GENERAL&&o("WALogger").ERROR(L||(L=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: invalid lidOriginType received."]))).sendLogs("handleInitialSyncMsgs: invalid lidOriginType received: "+re),ne.lidOriginType=oe}else ne.lidOriginType=o("WAWebUsernameTypes").LidOriginType.GENERAL}n.archived!=null&&(ne.archive=n.archived),(s=B)!=null&&s.length&&(ne.mmSignalSharingExpirationWindow=B);try{o("WAWebHistorySyncNotificationUtils").saveGroupMetadataForLeftGroup(n,ne.id)}catch(e){o("WALogger").WARN(E||(E=babelHelpers.taggedTemplateLiteralLoose(["[history sync] history_sync_notification_handler: saveGroupMetadataForLeftGroup failed"]))).tags("history-sync")}Object.prototype.hasOwnProperty.call(D,n.id)?o("WALogger").LOG(k||(k=babelHelpers.taggedTemplateLiteralLoose(["[history sync] found duplicated conversation id during initial sync"]))):P.push(ne),D[n.id]={chatInfo:ne,msgs:g,unifiedAddons:f}},W;for(var q of e.conversations)W=yield*B(q);for(var U of e.accounts){var V=j(U);V&&u.push(V)}I.length>0&&(o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[history sync] saving "," LIDxPN mappings obtained from conversations"])),I.length),yield o("WAWebDBCreateLidPnMappings").createLidPnMappings({mappings:I,flushImmediately:!0,identityChangeHandlingEnabled:!1,learningSource:"other"})),i.mdBootstrapMessagesCount=N,i.mdBootstrapChatsCount=e.conversations.length,o("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(i,t.historySyncStepStartedTs,!0,s),r("WAWebSyncBootstrap").markInitialHistorySyncCountDebugStats(N,P.length);var H=0,K=[];w.forEach(function(e){var t=e.identityKey,n=e.userId;!n.isLid()&&o("WAWebApiContact").getCurrentLid(n)==null&&n.isRegularUser()&&H++;try{var r=o("WAWebSignalCommonUtils").createSignalAddress(n).toString();n.equals(o("WAWebUserPrefsMeUser").getMePnUserOrThrow())?o("WAWebHistorySyncNotificationUtils").checkSelfHistorySyncIdentity(r,t).catch(function(){o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: can't save the identity key."],["[history sync] handleInitialSyncMsgs: can\\'t save the identity key."]))).sendLogs("failed-self-identity-check-from-history-sync")}):K.push({identifier:r,identityKey:t})}catch(e){o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: can't save the identity key."],["[history sync] handleInitialSyncMsgs: can\\'t save the identity key."])))}}),yield o("WAWebSignalProtocolStore").getPersistSignalProtocolStore().bulkCreateIdentity(K),H>0&&o("WALogger").ERROR(g||(g=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: there are Identities with missing LIDs: ",""])),H).sendLogs("handleInitialSyncMsgs: there are Identities with missing LIDs",{sampling:.01}),yield r("WAWebHandleAddChats")(P),yield G(D),yield o("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(t.msgKey,t.syncType,t.chunkOrder),o("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric({historySyncDataAppliedMetric:l,startTs:t.historySyncStepStartedTs,isSuccess:!0,forceFlushWamBuffer:!0}),o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing initial sync messages complete, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(t,N,P.length)),o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["[history sync] set history initial sync boundary with length ",""])),Object.keys(T).length),yield(M||(M=n("Promise"))).all([o("WAWebHistorySyncNotificationUtils").handleChatThreadLoggingMetadata(e),o("WAWebUserPrefsHistorySync").setHistoryInitialSyncBoundary(T),e.companionMetaNonce!=null?o("WAWebUserPrefsIndexedDBStorage").userPrefsIdb.set("WAWebCompanionMetaNonce",e.companionMetaNonce):null]),o("WAWebUserPrefsModelStorage").setInitialGroupPhash($),o("WAWebHistorySyncNotificationUtils").reportMissingMapping(F)}),A.apply(this,arguments)}function F(e,t,n,r,o){return O.apply(this,arguments)}function O(){return O=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,a,i,l){o("WALogger").LOG(I||(I=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start processing status"]))),a.mdBootstrapMessagesCount=e.statusV3Messages.length,o("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(a,t.historySyncStepStartedTs,!0,l),e.statusV3Messages.sort(function(e,t){var n=e.messageTimestamp,r=t.messageTimestamp;return o("WATimeUtils").castToUnixTime(parseInt(n,10))-o("WATimeUtils").castToUnixTime(parseInt(r,10))});var s=[];yield(M||(M=n("Promise"))).all(e.statusV3Messages.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,a=null,i=[];e.key.fromMe===!0?(a=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),i=e.userReceipt.filter(function(e){return e.readTimestamp!=null&&e.readTimestamp!==0})):a=o("WAWebWidFactory").createWid(r("WANullthrows")(e.participant));var l={type:o("WAWebHandleMsgTypes.flow").MESSAGE_TYPE.OTHER_STATUS,externalId:r("WANullthrows")(e.key.id),ts:o("WATimeUtils").castToUnixTime(parseInt(e.messageTimestamp,10)),edit:-1,isHsm:!1,count:null,chat:o("WAWebWidFactory").createWid(o("WAJids").STATUS_JID),author:r("WANullthrows")(a),pushname:null,isDirect:!1},u=o("WAWebBackendJobs.flow").CiphertextType.Skmsg,c=yield o("WAWebMsgProcessingApiUtils").parseMessage({info:l,ciphertextType:u,msgProtobuf:r("WANullthrows")(e.message),hsmInfo:null}),d=c.renderableMsgs&&c.renderableMsgs;if(!d||d.length!==1)return(M||(M=n("Promise"))).resolve();var m=d[0].id,p=d[0].author,_=babelHelpers.extends({},d[0],{author:p&&o("WAWebLidStatusMigrationUtils").matWidConvert(p),id:new(r("WAWebMsgKey"))({fromMe:m.fromMe,remote:m.remote,id:m.id,participant:m.participant==null?void 0:o("WAWebLidStatusMigrationUtils").matWidConvert(m.participant)})});if(e.participant==="0@s.whatsapp.net")return(M||(M=n("Promise"))).resolve();var f=e.ignore===!0;if(f&&(_=babelHelpers.extends({},_,{invis:!0,ack:o("WAAckLevel").ACK.READ})),yield o("WAWebHandleSingleMsg").handleSingleMsg({chatId:_.id.remote,newMsg:_,handleSingleMsgOrigin:"historyStatusMessages"}),i.forEach(function(e){var t,n=o("WALongInt").numberOrThrowIfTooLarge((t=e.readTimestamp)!=null?t:0),r=o("WAWebWidFactory").createWid(e.userJid);o("WAWebMessageReceiptBatcher").receiptBatcher.acceptOtherReceipt({ts:n,ack:o("WAAckLevel").ACK.READ,receiverId:r,msgKeys:[_.id.toString()]})}),o("WAWebMessagingGatingUtils").isReportingTagSyncingEnabled()&&((t=e.reportingTokenInfo)==null?void 0:t.reportingTag)!=null){var g;_=babelHelpers.extends({},_,{reportingTokenInfo:{reportingTag:new Uint8Array((g=e.reportingTokenInfo)==null?void 0:g.reportingTag),version:o("WAWebReportingTokenUtils").REPORTING_TOKEN_VERSION.HISTORY_SYNC}})}return s.push(_),!0});return function(t){return e.apply(this,arguments)}})())),yield o("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(t.msgKey,t.syncType,t.chunkOrder),o("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric({historySyncDataAppliedMetric:i,startTs:t.historySyncStepStartedTs,isSuccess:!0}),o("WALogger").LOG(T||(T=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing Status complete, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(t,e.statusV3Messages.length)),o("WAWebDBReportingTokenUtils").handleHistorySyncedReportingInfo(s)}),O.apply(this,arguments)}function B(e,t,n,r,o){return W.apply(this,arguments)}function W(){return W=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,r,a){o("WALogger").LOG(D||(D=babelHelpers.taggedTemplateLiteralLoose(["[history sync] processing history non blocking data"]))),o("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(n,t.historySyncStepStartedTs,!0,a),e.pastParticipants!=null&&e.pastParticipants.length>0&&(yield o("WAWebHistorySyncNotificationUtils").processPastParticipants(e,t)),e.callLogRecords!=null&&e.callLogRecords.length>0&&(yield q(e,t)),e.conversations!=null&&(yield o("WAWebMemberLabelHistorySync").processMemberLabels(e)),o("WAWebHistorySyncStickers").processRecentStickers(e,t),o("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric({historySyncDataAppliedMetric:r,startTs:t.historySyncStepStartedTs,isSuccess:!0})}),W.apply(this,arguments)}function q(e,t){return U.apply(this,arguments)}function U(){return U=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){o("WALogger").LOG(x||(x=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start processing call log records"]))),e.callLogRecords.sort(function(e,t){var n=e.startTime,r=t.startTime;return o("WATimeUtils").castToUnixTime(parseInt(n,10))-o("WATimeUtils").castToUnixTime(parseInt(r,10))}),yield(M||(M=n("Promise"))).all(e.callLogRecords.map((function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield o("WAWebVoipActionWriteCallLogSync").generateCallLogFromCallSyncRecord({callLogRecord:e,fromHistorySync:!0})});return function(t){return e.apply(this,arguments)}})())),o("WALogger").LOG($||($=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing call log records complete, ",""])),o("WAWebHistorySyncNotificationUtils").getHistorySyncLogDetailsString(t,e.callLogRecords.length))}),U.apply(this,arguments)}function V(e,t,n,r,o){return H.apply(this,arguments)}function H(){return H=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n,a,i){o("WALogger").LOG(P||(P=babelHelpers.taggedTemplateLiteralLoose(["[history sync] start processing initial pushname"]))),o("WAWebHistorySyncNotificationUtils").commitHistoryDownloadedMetric(n,t.historySyncStepStartedTs,!0,i);var l=e.pushnames.map(function(e){return{id:e.id||"",pushname:e.pushname||""}});yield r("WAWebLidAwareContactsDB").bulkCreateOrMerge(l,"HistoryMsgHandlerAction.handlePushName"),yield o("WAWebApiHistorySyncNotification").updateCurrentlyProcessed(t.msgKey,t.syncType,t.chunkOrder);var s=[];e.pushnames.forEach(function(e){var t=o("WAWebWidFactory").createWid(e.id||""),n=o("WAWebContactCollection").ContactCollection.get(t);if(s.push({id:t,pushname:e.pushname||"",type:(n==null?void 0:n.type)||"out",name:n==null?void 0:n.name}),!t.isLid()){var r=o("WAWebApiContact").getCurrentLid(o("WAWebWidFactory").asUserWidOrThrow(t));r!=null&&s.push({id:r,pushname:e.pushname||"",type:(n==null?void 0:n.type)||"out",name:n==null?void 0:n.name})}}),o("WAWebContactCollection").ContactCollection.add(s,{merge:!0}),o("WAWebHistorySyncNotificationUtils").commitHistoryDataAppliedMetric({historySyncDataAppliedMetric:a,startTs:t.historySyncStepStartedTs,isSuccess:!0}),o("WALogger").LOG(N||(N=babelHelpers.taggedTemplateLiteralLoose(["[history sync] storing initial pushname complete with "," records"])),e.pushnames.length)}),H.apply(this,arguments)}function G(t){var a={add:"last",isHistory:!0},i=Object.keys(t).map(function(e){return o("WAWebBackendApi").frontendSendAndReceive("processMultipleMessages",{chatId:o("WAWebWidFactory").createWid(e),msgObjs:t[e].msgs,meta:a,processMessagesOrigin:"historyMsgHandlerAction",chatMsgsCollection:null})});return(M||(M=n("Promise"))).all([].concat(i,[o("WAWebDBProcessInitialHistorySyncMessage").storeInitialSyncMessages(t)])).then(function(){var n,r=(n=Array.prototype).concat.apply(n,Object.keys(t).map(function(e){return t[e].msgs.map(function(e){return e.id.toString()})}));return o("WAWebCheckUpdateOrphanReactions").checkUpdateForOrphanReactions(r).catch(function(){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Failed update for orphan reactions"]))).sendLogs("failed-update-for-orphan-reactions")}),o("WAWebSyncdOrphan").checkOrphanMutations(r,Object.keys(t))}).then(function(){var e;return(M||(M=n("Promise"))).all((e=Array.prototype).concat.apply(e,Object.keys(t).map(function(e){return t[e].unifiedAddons}))).then(function(e){var t;return o("WAWebAddonProcessMsgs").processHistoryMsgs((t=[]).concat.apply(t,e))})}).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").LogoutDrop,r("WAWebNoop"))).catch(function(e){o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[history sync] Error: ",", message: ",", stack: ",""])),e.name,e.message,e.stack).sendLogs("msg_handler for MD: error storing/processing multiple messages")})}function z(e,t){if(!o("WAWebLidMigrationUtils").shouldHaveAccountLid(e))return{result:"not-needed"};if(t.accountLid!=null){var n=o("WAWebWidFactory").createUserLidOrThrow(t.accountLid);return{result:"extracted",accountLid:n}}return e.isLid()?{result:"extracted",accountLid:e}:(o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[history sync] handleInitialSyncMsgs: Migrated account not sending accountLid for a PN chat in history sync"]))).sendLogs("missing-account-lid-in-history-sync"),{result:"skip-chat"})}function j(e){var t=e.lid,n=e.username,r=e.countryCode;if(!(t==null||n==null&&r==null)){var a=o("WAWebWidFactory").createUserWidOrThrow(t),i;if(r!=null&&(i=o("WAWebCountriesUtils").asISOCountryCode(r),!i&&o("WAWebCurrentUser").isEmployee()&&o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[history sync] invalid country code retrieved"]))).sendLogs("invalid-country-code-for-username-history-sync",{sampling:.01})),n!=null){var l={userId:a,username:n};return i!=null&&(l.usernameCountryCode=i),l}else if(i!=null)return{userId:a,usernameCountryCode:i}}}l.handleInitialSyncMsgs=w,l.handleStatusMessages=F,l.handleNonBlockingData=B,l.handlePushName=V,l.getUsernameUpdate=j}),98); __d("WAWebAddAndReorderMsgsActionsUtils",["WALogger","WAWebMsgModelUtils"],(function(t,n,r,o,a,i,l){var e;function s(e,t,n,r,a,i,l,s,c){var d=u(e,t,n,r,i);o("WAWebMsgModelUtils").addRecordsToChat(d.msgs,r,a,d.collection,l,s,c)}function u(t,n,r,a,i){var l={},s={},u,c,d,m=r.length,p=i;if(m===0)return{msgs:n,collection:p};for(u=0;u0){var y=f.slice(0,3).map(function(e){return e.id});o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["models:Msg:reorder trying to merge CMC of "," orphaned messages => ",""])),f.length,y)}return{msgs:_,collection:p}}l.default=s}),98); __d("WAWebButtonModel",["WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a "+u.id.toString()))}break}case"bot_request_welcome":case"bot_memu_onboarding":case"member_label":break;default:q++,U.length<3&&U.push(n.id.toString());break}else if(u&&!o("WAWebFrontendMsgGetters").getAsRevoked(u)){n.ack0&&(o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: "," messages not revoked (non-group)"])),x),o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: admin revoke was sent to "," non-group chats"])),x)),$>0&&(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: "," messages not revoked (remote mismatch)"])),$),o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: admin revoke came for "," different groups than the original messages were in"])),$)),P>0&&o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: admin revoked "," messages => ",""])),P,N),M>0&&o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["[system message] msg updates - ADD - ADMIN: "," messages"])),M),w>0&&o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: bot invoker revoked "," bot responses => ",""])),w,A),F>0&&o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: sender revoked "," messages => ",""])),F,O),B>0&&o("WALogger").WARN(g||(g=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: sender revoke: "," sender mismatches => ",""])),B,W),q>0&&o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["unknown protocolMessage: "," messages => ",""])),q,U),V>0&&o("WALogger").WARN(y||(y=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:handle:processMM: "," dup/overlap messages => ",""])),V,H),G>0&&o("WALogger").WARN(C||(C=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:handle:processMM load search as history: "," messages => ",""])),G,z),j>0&&o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["ephemeralOutOfSync: "," messages => ",""])),j,K),Q>0&&(o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: el.id is not a MsgKey: "," of "," messages"])),Q,a.length),r("gkx")("26258")||o("WALogger").ERROR(S||(S=babelHelpers.taggedTemplateLiteralLoose(["getMsgUpdates: el.id is not a MsgKey"]))).sendLogs("forgot-to-create-msgkey")),{filteredRecs:R,reorderRecs:E,updates:k}}),k.apply(this,arguments)}function I(e){var t=function(t,n){var e,o,a=t.index!=null?t.index:n,i=""+a;return t.quickReplyButton?new(r("WAWebTemplateButtonModel"))({id:i,displayText:t.quickReplyButton.displayText,selectionId:t.quickReplyButton.id,subtype:"quick_reply"}):t.callButton?new(r("WAWebTemplateButtonModel"))({id:i,displayText:t.callButton.displayText,phoneNumber:t.callButton.phoneNumber,subtype:"call"}):new(r("WAWebTemplateButtonModel"))({id:i,displayText:(e=t.urlButton)==null?void 0:e.displayText,url:(o=t.urlButton)==null?void 0:o.url,subtype:"url"})};e.buttons=new(o("WAWebTemplateButtonCollection")).TemplateButtonCollection,e.buttons.add(e.hydratedButtons.map(t))}function T(e){var t=function(t){var e=t.buttonId,n=t.buttonText;return new(r("WAWebButtonModel"))({id:e,displayText:n==null?void 0:n.displayText})};e.replyButtons=new(o("WAWebButtonCollection")).ButtonCollection,e.replyButtons.add(e.dynamicReplyButtons.map(t))}function D(e,t){return x.apply(this,arguments)}function x(){return x=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){if(!e.isNewMsg||!e.recvFresh)return o("WALogger").WARN(R||(R=babelHelpers.taggedTemplateLiteralLoose(["processLiveMessage should not be called with history message id: ",", type: ",", subType: ",", isNewMsg: ",", recvFresh: ",""])),e.id.toString(),e.type,e.subtype,e.isNewMsg,e.recvFresh).sendLogs("bad-process-live-message-call",{sampling:.001}),(L||(L=n("Promise"))).resolve();e.type===o("WAWebMsgType").MSG_TYPE.GP2&&e.subtype==="delete"&&(t.isReadOnly=!0,o("WAWebPollsInvalidateChatPollMsgsAction").invalidateChatPollMsgs(t),o("WAWebInvalidateEventsAction").invalidateEventMsgsForChat(t)),yield o("WAWebEphemeralSyncResponse").syncEphemeralSetting(e,t)}),x.apply(this,arguments)}l.default=E}),98); __d("WAWebAppScreen",["$InternalEnum","WAWebAppMutex","WAWebBuildConstants","WAWebStreamModel","err"],(function(t,n,r,o,a,i,l){var e=n("$InternalEnum").Mirrored(["ANOTHER_SESSION","UNSUPPORTED_TAKEOVER","CALL_TAKEOVER_PREVENTION","QR","SYNCING","OFFLINE","PROXYBLOCK","CONFLICT","TOS_BLOCK","SMB_TOS_BLOCK","DEPRECATED_VERSION","MAIN","STARTUP","TEMP_BAN","LOGOUT","SCREEN_LOCK","SERVICE_UNAVAILABLE"]);function s(t){var n,a=t.anotherSession,i=t.isUnsupportedTakeover,l=t.mainLoaded,s=t.mode,u=t.screenLocked;if((n=t.temporaryBan)!=null&&n.banned)return e.TEMP_BAN;if(t.serviceUnavailable===!0)return e.SERVICE_UNAVAILABLE;if(t.startLogout)return e.LOGOUT;if(i)return e.UNSUPPORTED_TAKEOVER;if(r("WAWebAppMutex").hasShownCallTakeoverModal())return e.CALL_TAKEOVER_PREVENTION;if(a)return e.ANOTHER_SESSION;if(u)return l?e.SCREEN_LOCK:e.STARTUP;switch(s){case o("WAWebStreamModel").StreamMode.QR:return e.QR;case o("WAWebStreamModel").StreamMode.SYNCING:return e.SYNCING;case o("WAWebStreamModel").StreamMode.OFFLINE:return l&&o("WAWebBuildConstants").WINDOWS_OFFLINE?e.MAIN:e.OFFLINE;case o("WAWebStreamModel").StreamMode.PROXYBLOCK:return e.PROXYBLOCK;case o("WAWebStreamModel").StreamMode.CONFLICT:return e.CONFLICT;case o("WAWebStreamModel").StreamMode.TOS_BLOCK:return e.TOS_BLOCK;case o("WAWebStreamModel").StreamMode.SMB_TOS_BLOCK:return e.SMB_TOS_BLOCK;case o("WAWebStreamModel").StreamMode.DEPRECATED_VERSION:return e.DEPRECATED_VERSION;case o("WAWebStreamModel").StreamMode.MAIN:return o("WAWebBuildConstants").WINDOWS_OFFLINE?e.MAIN:l?t.stayInSync?e.SYNCING:e.MAIN:e.STARTUP}throw r("err")("[app] render Error invalid StreamMode: "+s)}l.AppScreen=e,l.getScreen=s}),98); __d("WAWebBusinessProfileSMBUserJourneyLogger",["$InternalEnum","WAWebBusinessProfileUtils","WAWebSMBUserJourneyLogger","WAWebWamEnumSmbFeatureNameEnum","WAWebWamEnumSmbUserActionTypeEnum","WAWebWamEnumSurfaceType"],(function(t,n,r,o,a,i,l){"use strict";var e={ABOUT_INFO:"about_info",ADD_ANOTHER_WEBSITE:"add_another_website",ADDRESS:"address",BACK:"back",BIZ_DESCRIPTION:"biz_description",BIZ_HOURS:"biz_hours",BIZ_NAME:"biz_name",CATALOG_PRODUCT:"catalog_product",CATEGORY:"category",CONFIRM_DIALOG_CANCEL_BUTTON:"confirm_dialog_cancel_button",CONFIRM_DIALOG_CONTINUE_BUTTON:"confirm_dialog_continue_button",COVER_PHOTO:"cover_photo",EMAIL:"email",ERROR_DIALOG_OK_BUTTON:"error_dialog_ok_button",FB_ACCOUNT:"fb_account",FB_IG_ACCOUNT:"fb_ig_account",IG_ACCOUNT:"ig_account",MANAGE_CATALOG:"manage_catalog",MANAGE_SERVICES:"manage_services",PHONE_NUMBER:"phone_number",PRICE_RANGE:"price_range",PROFILE_PHOTO:"profile_photo",SAVE_ABOUT_INFO:"save_about_info",SAVE_ADDRESS:"save_address",SAVE_BIZ_DESCRIPTION:"save_biz_description",SAVE_BIZ_HOURS:"save_biz_hours",SAVE_BIZ_NAME:"save_biz_name",SAVE_CATEGORY:"save_category",SAVE_COVER_PHOTO:"save_cover_photo",SAVE_EMAIL:"save_email",SAVE_FB_ACCOUNT:"save_fb_account",SAVE_IG_ACCOUNT:"save_ig_account",SAVE_MANAGE_SERVICES:"save_manage_services",SAVE_PHONE_NUMBER:"save_phone_number",SAVE_PRICE_RANGE:"save_price_range",SAVE_PRIMARY_WEBSITE:"save_primary_website",SAVE_PROFILE_PHOTO:"save_profile_photo",SAVE_SECONDARY_WEBSITE:"save_secondary_website",SAVE_USER_NAME:"save_user_name",SAVE_WEBSITE:"save_website",USER_NAME:"user_name",WEBSITE:"website"},s=n("$InternalEnum")({ADD:"add",MODIFY:"modify",REMOVE:"remove",UNCHANGED:"unchanged"}),u=(function(){function t(){}var n=t.prototype;return n.viewProfile=function(t){this.$1(babelHelpers.extends({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.VIEW},t!=null?{entryPoint:t}:{}))},n.clickBusinessName=function(){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,userActionTarget:e.BIZ_NAME})},n.saveBusinessName=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{biz_name_edit_op:n},userActionTarget:e.SAVE_BIZ_NAME})},n.clickBusinessHours=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{has_biz_hours:n},userActionTarget:e.BIZ_HOURS})},n.saveBusinessHours=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{biz_hour_edit_op:n},userActionTarget:e.SAVE_BIZ_HOURS})},n.clickCategory=function(){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,userActionTarget:e.CATEGORY})},n.saveCategory=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{category_edit_op:n},userActionTarget:e.SAVE_CATEGORY})},n.clickAddress=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{has_address:n},userActionTarget:e.ADDRESS})},n.clickDescription=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{has_biz_description:n},userActionTarget:e.BIZ_DESCRIPTION})},n.clickEmail=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{has_email:n},userActionTarget:e.EMAIL})},n.clickAboutInfo=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{has_about_info:n},userActionTarget:e.ABOUT_INFO})},n.saveProfilePhoto=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{profile_photo_edit_op:n},userActionTarget:e.SAVE_PROFILE_PHOTO})},n.saveCoverPhoto=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{cover_photo_edit_op:n},userActionTarget:e.SAVE_COVER_PHOTO})},n.clickProfilePhoto=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{has_profile_photo:n},userActionTarget:e.PROFILE_PHOTO})},n.clickCoverPhoto=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{has_cover_photo:n},userActionTarget:e.COVER_PHOTO})},n.saveBizDescription=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{biz_description_edit_op:n},userActionTarget:e.SAVE_BIZ_DESCRIPTION})},n.saveAddress=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{address_edit_op:n},userActionTarget:e.SAVE_ADDRESS})},n.saveEmail=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{email_edit_op:n},userActionTarget:e.SAVE_EMAIL})},n.savePrimaryWebsite=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{website_edit_op:n},userActionTarget:e.SAVE_PRIMARY_WEBSITE})},n.saveSecondaryWebsite=function(n){this.$1({action:o("WAWebWamEnumSmbUserActionTypeEnum").SMB_USER_ACTION_TYPE_ENUM.CLICK,extraAttributes:{website_edit_op:n},userActionTarget:e.SAVE_SECONDARY_WEBSITE})},n.logProfileFieldsSave=function(t,n){var e=o("WAWebBusinessProfileUtils").getEditOperationType(t.description,n.description);e!=null&&this.saveBizDescription(e);var r=o("WAWebBusinessProfileUtils").getEditOperationType(t.address,n.address);r!=null&&this.saveAddress(r);var a=o("WAWebBusinessProfileUtils").getEditOperationType(t.email,n.email);a!=null&&this.saveEmail(a);var i=o("WAWebBusinessProfileUtils").getEditOperationType(t.primaryWebsite,n.primaryWebsite);i!=null&&this.savePrimaryWebsite(i);var l=o("WAWebBusinessProfileUtils").getEditOperationType(t.secondaryWebsite,n.secondaryWebsite);l!=null&&this.saveSecondaryWebsite(l)},n.$1=function(t){o("WAWebSMBUserJourneyLogger").SMBUserJourneyLogger.log({entryPoint:t.entryPoint,extraAttributes:t.extraAttributes,featureName:o("WAWebWamEnumSmbFeatureNameEnum").SMB_FEATURE_NAME_ENUM.BUSINESS_PROFILE,surface:o("WAWebWamEnumSurfaceType").SURFACE_TYPE.EDIT_BIZ_PROFILE,userActionTarget:t.userActionTarget,userActionType:t.action})},t})(),c=new u;l.OperationType=s,l.BusinessProfileUserJourneyLogger=c}),98); __d("WAWebWamEnumErrorType",[],(function(t,n,r,o,a,i){var e=Object.freeze({ERROR_FETCHING_AGENT_NAME:0,ERROR_FETCHING_CHAT:1,ERROR_OTHER:2});i.ERROR_TYPE=e}),66); __d("WAWebWamEnumMdChatAssignmentAssignmentType",[],(function(t,n,r,o,a,i){var e=Object.freeze({ASSIGNED:0,UNASSIGNED:1});i.MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE=e}),66); __d("WAWebWamEnumMdChatAssignmentChatType",[],(function(t,n,r,o,a,i){var e=Object.freeze({GROUP:0,BROADCAST_LIST:1,INDIVIDUAL:2,COMMUNITY:3,CHANNEL:4,INTEROP:5});i.MD_CHAT_ASSIGNMENT_CHAT_TYPE=e}),66); __d("WAWebWamEnumMdChatAssignmentSecondaryActionType",[],(function(t,n,r,o,a,i){var e=Object.freeze({ACTION_SYSTEM_MESSAGE_ADDED_TO_CHAT_HISTORY:0,ACTION_SYSTEM_MESSAGE_CREATION_ERROR:1,ACTION_SYSTEM_MESSAGE_RENDERED:2,ACTION_CHAT_STATUS_TICKER_SHOWN:3,ACTION_TOOLTIP_SHOWN:4});i.MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE=e}),66); __d("WAWebWamEnumMdChatAssignmentSourceType",[],(function(t,n,r,o,a,i){var e=Object.freeze({NONE:0,BOOTSTRAP:1});i.MD_CHAT_ASSIGNMENT_SOURCE_TYPE=e}),66); __d("WAWebMdChatAssignmentSecondaryActionWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumErrorType","WAWebWamEnumMdChatAssignmentAssignmentType","WAWebWamEnumMdChatAssignmentChatType","WAWebWamEnumMdChatAssignmentSecondaryActionType","WAWebWamEnumMdChatAssignmentSourceType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({MdChatAssignmentSecondaryAction:[3716,{mdChatAssignmentSecondaryActionAgentId:[1,e.TYPES.STRING],mdChatAssignmentSecondaryActionAssignmentType:[8,o("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE],mdChatAssignmentSecondaryActionBrowserId:[2,e.TYPES.STRING],mdChatAssignmentSecondaryActionChatType:[3,o("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE],mdChatAssignmentSecondaryActionError:[4,o("WAWebWamEnumErrorType").ERROR_TYPE],mdChatAssignmentSecondaryActionMdId:[5,e.TYPES.INTEGER],mdChatAssignmentSecondaryActionSource:[6,o("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE],mdChatAssignmentSecondaryActionType:[7,o("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE]},[1,1,1],"regular"]},{MdChatAssignmentSecondaryAction:[]});l.MdChatAssignmentSecondaryActionWamEvent=s}),98); __d("WAWebWamEnumChatAssignmentActionType",[],(function(t,n,r,o,a,i){var e=Object.freeze({ACTION_ASSIGNED:0,ACTION_UNASSIGNED:1,ACTION_REASSIGNED:2});i.CHAT_ASSIGNMENT_ACTION_TYPE=e}),66); __d("WAWebWamEnumChatAssignmentChatType",[],(function(t,n,r,o,a,i){var e=Object.freeze({INDIVIDUAL:0,GROUP:1,COMMUNITY:2,CHANNEL:3});i.CHAT_ASSIGNMENT_CHAT_TYPE=e}),66); __d("WAWebWamEnumChatAssignmentEntryPointType",[],(function(t,n,r,o,a,i){var e=Object.freeze({CONVERSATION_OVERFLOW_MENU:0,CONTACT_INFO_SCREEN:1,MULTI_SELECT:2,SYSTEM_MESSAGE:3,CHAT_LIST_SWIPE:4,AI_REPLIES:5});i.CHAT_ASSIGNMENT_ENTRY_POINT_TYPE=e}),66); __d("WAWebMdChatAssignmentWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumChatAssignmentActionType","WAWebWamEnumChatAssignmentChatType","WAWebWamEnumChatAssignmentEntryPointType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({MdChatAssignment:[3752,{assignerAgentId:[1,e.TYPES.STRING],assignerBrowserId:[2,e.TYPES.STRING],assignerMdId:[3,e.TYPES.INTEGER],chatAssignmentAction:[4,o("WAWebWamEnumChatAssignmentActionType").CHAT_ASSIGNMENT_ACTION_TYPE],chatAssignmentAgentId:[5,e.TYPES.STRING],chatAssignmentBrowserId:[6,e.TYPES.STRING],chatAssignmentChatType:[7,o("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE],chatAssignmentEntryPoint:[8,o("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE],chatAssignmentMdId:[9,e.TYPES.INTEGER],chatsCnt:[10,e.TYPES.INTEGER]},[1,1,1],"regular"]},{MdChatAssignment:[]});l.MdChatAssignmentWamEvent=s}),98); __d("WAWebChatAssignmentLogEvents",["WAWebABProps","WAWebAgentCollection","WAWebBizGatingUtils","WAWebChatAssignmentLogEvents.flow","WAWebChatCollection","WAWebMdChatAssignmentSecondaryActionWamEvent","WAWebMdChatAssignmentWamEvent","WAWebMiscBrowserUtils","WAWebUserPrefsMeUser","WAWebWamEnumChatAssignmentActionType","WAWebWamEnumChatAssignmentEntryPointType","WAWebWamEnumMdChatAssignmentAssignmentType","WAWebWamEnumMdChatAssignmentSecondaryActionType","WAWebWamEnumMdChatAssignmentSourceType"],(function(t,n,r,o,a,i,l){function e(){var e=o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow().getDeviceId();return o("WAWebAgentCollection").AgentCollection.getModelsArray().find(function(t){return t.deviceId===e})}function s(t,n){var a,i,l=e(),s=o("WAWebABProps").getABPropConfigValue("smb_md_agent_chat_assignment_system_messages_logging_v2_enabled");return s||delete n.mdChatAssignmentSecondaryActionAssignmentType,new(o("WAWebMdChatAssignmentSecondaryActionWamEvent")).MdChatAssignmentSecondaryActionWamEvent(babelHelpers.extends({mdChatAssignmentSecondaryActionAgentId:(a=l==null?void 0:l.id)!=null?a:"",mdChatAssignmentSecondaryActionBrowserId:r("WAWebMiscBrowserUtils").persistentExpiringId(),mdChatAssignmentSecondaryActionChatType:t==null?void 0:t.getMdChatAssignmentChatType(),mdChatAssignmentSecondaryActionMdId:(i=l==null?void 0:l.deviceId)!=null?i:-1},n))}function u(e){o("WAWebBizGatingUtils").chatAssignmentEnabled()&&s(e,{mdChatAssignmentSecondaryActionSource:o("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE.NONE,mdChatAssignmentSecondaryActionType:o("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_TOOLTIP_SHOWN}).commit()}function c(e){o("WAWebBizGatingUtils").chatAssignmentEnabled()&&s(e,{mdChatAssignmentSecondaryActionAssignmentType:e.assignedAgent==null?o("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.ASSIGNED:o("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.UNASSIGNED,mdChatAssignmentSecondaryActionSource:o("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE.BOOTSTRAP,mdChatAssignmentSecondaryActionType:o("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_SYSTEM_MESSAGE_ADDED_TO_CHAT_HISTORY}).commit()}function d(e){o("WAWebBizGatingUtils").chatAssignmentEnabled()&&s(e,{mdChatAssignmentSecondaryActionAssignmentType:e.assignedAgent==null?o("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.ASSIGNED:o("WAWebWamEnumMdChatAssignmentAssignmentType").MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.UNASSIGNED,mdChatAssignmentSecondaryActionSource:o("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE.NONE,mdChatAssignmentSecondaryActionType:o("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_SYSTEM_MESSAGE_CREATION_ERROR}).commit()}function m(e){if(o("WAWebBizGatingUtils").chatAssignmentEnabled()){var t=o("WAWebChatCollection").ChatCollection.get(e);t!=null&&s(t,{mdChatAssignmentSecondaryActionSource:o("WAWebWamEnumMdChatAssignmentSourceType").MD_CHAT_ASSIGNMENT_SOURCE_TYPE.NONE,mdChatAssignmentSecondaryActionType:o("WAWebWamEnumMdChatAssignmentSecondaryActionType").MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_CHAT_STATUS_TICKER_SHOWN}).commit()}}function p(t,n,a){var i,l,s,u=e(),c=o("WAWebAgentCollection").AgentCollection.get(n),d=o("WAWebUserPrefsMeUser").getMeDevicePnOrThrow().getDeviceId(),m=n===(u==null?void 0:u.id);return new(o("WAWebMdChatAssignmentWamEvent")).MdChatAssignmentWamEvent(babelHelpers.extends({assignerAgentId:(i=u==null?void 0:u.id)!=null?i:"",assignerBrowserId:r("WAWebMiscBrowserUtils").persistentExpiringId(),assignerMdId:d,chatAssignmentAgentId:(l=c==null?void 0:c.id)!=null?l:"",chatAssignmentBrowserId:m?r("WAWebMiscBrowserUtils").persistentExpiringId():"",chatAssignmentChatType:t.getChatAssignmentChatType(),chatAssignmentMdId:(s=c==null?void 0:c.deviceId)!=null?s:-1},a))}function _(e){switch(e){case o("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.MULTI_SELECT:return o("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.MULTI_SELECT;case o("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.SYSTEM_MESSAGE:return o("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.SYSTEM_MESSAGE;case o("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.CONVERSATION_MENU:return o("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.CONVERSATION_OVERFLOW_MENU;case o("WAWebChatAssignmentLogEvents.flow").ChatAssignmentEntryPointType.CONTACT_INFO_SCREEN:return o("WAWebWamEnumChatAssignmentEntryPointType").CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.CONTACT_INFO_SCREEN}}function f(e,t,n,r,a){if(o("WAWebBizGatingUtils").chatAssignmentEnabled()){var i;t===""?i=o("WAWebWamEnumChatAssignmentActionType").CHAT_ASSIGNMENT_ACTION_TYPE.ACTION_UNASSIGNED:n?i=o("WAWebWamEnumChatAssignmentActionType").CHAT_ASSIGNMENT_ACTION_TYPE.ACTION_REASSIGNED:i=o("WAWebWamEnumChatAssignmentActionType").CHAT_ASSIGNMENT_ACTION_TYPE.ACTION_ASSIGNED,p(e,t,{chatAssignmentAction:i,chatAssignmentEntryPoint:_(r),chatsCnt:a}).commit()}}l.logNuxShown=u,l.logSystemMessageGeneratedFromCompanion=c,l.logSystemMessageFailedToGenerate=d,l.logChatStatusTickerShown=m,l.logChatAssignment=f}),98); __d("WAWebWamEnumChatsFolderType",[],(function(t,n,r,o,a,i){var e=Object.freeze({INBOX:1,ARCHIVED:2});i.CHATS_FOLDER_TYPE=e}),66); __d("WAWebWamEnumContactType",[],(function(t,n,r,o,a,i){var e=Object.freeze({CONSUMER:1,SMB:2,ENTERPRISE:3});i.CONTACT_TYPE=e}),66); __d("WAWebBusinessTemplateRichOrderStatusWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumChatsFolderType","WAWebWamEnumContactType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({BusinessTemplateRichOrderStatus:[7076,{actionTypeRichOrderStatus:[1,e.TYPES.STRING],businessJid:[2,e.TYPES.STRING],chatsFolderType:[3,o("WAWebWamEnumChatsFolderType").CHATS_FOLDER_TYPE],contactType:[4,o("WAWebWamEnumContactType").CONTACT_TYPE],isBizIntent:[5,e.TYPES.BOOLEAN],isInsubContact:[6,e.TYPES.BOOLEAN],isMuted:[7,e.TYPES.BOOLEAN],readReceiptsEnabled:[8,e.TYPES.BOOLEAN],templateId:[9,e.TYPES.STRING]},[1,1,1],"private",113760892]},{BusinessTemplateRichOrderStatus:[]});l.BusinessTemplateRichOrderStatusWamEvent=s}),98); __d("WAWebPsRichOrderStatusMessageInconsistentPayloadReceivedWamEvent",["WAWebWamCodegenUtils"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({PsRichOrderStatusMessageInconsistentPayloadReceived:[6938,{businessJid:[1,e.TYPES.STRING],hasCurrencyChanged:[2,e.TYPES.BOOLEAN],hasHeaderImageChanged:[3,e.TYPES.BOOLEAN],hasItemImageChanged:[4,e.TYPES.BOOLEAN],hasItemNameChanged:[5,e.TYPES.BOOLEAN],hasItemNumberChanged:[6,e.TYPES.BOOLEAN],hasItemPriceChanged:[7,e.TYPES.BOOLEAN],hasItemQuantityChanged:[8,e.TYPES.BOOLEAN],hasItemVariantChanged:[9,e.TYPES.BOOLEAN]},[1,1,1],"private",113760892]},{PsRichOrderStatusMessageInconsistentPayloadReceived:[]});l.PsRichOrderStatusMessageInconsistentPayloadReceivedWamEvent=s}),98); __d("WAWebWamEnumQbmFlag",[],(function(t,n,r,o,a,i){var e=Object.freeze({OTHER:0,TRANSACTIONAL:1,PROMOTIONAL:2,OTP:3,MARKETING_MESSAGE_SMB:4});i.QBM_FLAG=e}),66); __d("WAWebQbmRichOrderStatusInteractionWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumChatsFolderType","WAWebWamEnumContactType","WAWebWamEnumEntryPoint","WAWebWamEnumQbmFlag"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({QbmRichOrderStatusInteraction:[6940,{actionTypeRichOrderStatus:[1,e.TYPES.STRING],chatsFolderType:[2,o("WAWebWamEnumChatsFolderType").CHATS_FOLDER_TYPE],contactType:[3,o("WAWebWamEnumContactType").CONTACT_TYPE],decisionId:[4,e.TYPES.STRING],deltaTime:[5,e.TYPES.INTEGER],deltaTimeReceived:[6,e.TYPES.INTEGER],entryPoint:[7,o("WAWebWamEnumEntryPoint").ENTRY_POINT],hsmTagStr:[8,e.TYPES.STRING],isBizIntent:[9,e.TYPES.BOOLEAN],isBroadcastMessage:[10,e.TYPES.BOOLEAN],isInsubContact:[11,e.TYPES.BOOLEAN],isMuted:[12,e.TYPES.BOOLEAN],messageIdHmac:[13,e.TYPES.STRING],qbmFlag:[14,o("WAWebWamEnumQbmFlag").QBM_FLAG],readReceiptsEnabled:[15,e.TYPES.BOOLEAN],threadIdHmac:[16,e.TYPES.STRING],unifiedSessionId:[17,e.TYPES.STRING]},[1,1,1],"regular"]},{QbmRichOrderStatusInteraction:[]});l.QbmRichOrderStatusInteractionWamEvent=s}),98); __d("WAWebRichOrderStatusLogger",["$InternalEnum","Promise","WAWebABProps","WAWebBusinessTemplateRichOrderStatusWamEvent","WAWebChatGetters","WAWebChatThreadLogging","WAWebContactCollection","WAWebContactGetters","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebMsgGetters","WAWebOrderStatus","WAWebOrderStatusButton","WAWebPsRichOrderStatusMessageInconsistentPayloadReceivedWamEvent","WAWebQbmRichOrderStatusInteractionWamEvent","WAWebUnifiedSession","WAWebUserPrefsGeneral","WAWebUtilsPnhSmbLoggingHelper","WAWebWamEnumChatsFolderType","WAWebWamEnumContactType","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=n("$InternalEnum")({ORDER_TRACKING_URL_CLICK:"order_tracking_url_click",VIEW_ORDER_PRIMARY_CLICK:"view_order_primary_click",VIEW_ORDER_SECONDARY_CLICK:"view_order_secondary_click",VIEW_ORDER_ITEM_PLACEHOLDER_CLICK:"view_order_item_placeholder_click",ORDER_ITEM_ROW_CLICK:"order_item_row_click",ORDER_NUMBER_COPY:"order_number_copy",TRACKING_NUMBER_COPY:"tracking_number_copy",MESSAGE_HEADER_CLICK:"message_header_click",MESSAGE_CTA_CLICK:"message_cta_click"});function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t,r){var a;if(o("WAWebABProps").getABPropConfigValue("utility_order_status_logging_enabled")){var i=o("WAWebFrontendMsgGetters").getChat(t),l=o("WAWebContactCollection").ContactCollection.get(i.id),s=l?o("WAWebContactGetters").getIsBusiness(l):!1,u=s?o("WAWebWamEnumContactType").CONTACT_TYPE.SMB:o("WAWebWamEnumContactType").CONTACT_TYPE.ENTERPRISE,c=i.archive?o("WAWebWamEnumChatsFolderType").CHATS_FOLDER_TYPE.ARCHIVED:o("WAWebWamEnumChatsFolderType").CHATS_FOLDER_TYPE.INBOX,d=o("WAWebUnifiedSession").UnifiedSessionManager.getSessionId(),m=o("WAWebChatGetters").getMuteExpiration(i),p=m>Date.now(),_=l?o("WAWebFrontendContactGetters").getIsMyContact(l):!1,f=Date.now(),g=o("WAWebMsgGetters").getT(t),h=Math.round((f-g*1e3)/1e3),y=o("WAWebChatGetters").getId(i).toString(),C=o("WAWebMsgGetters").getId(t),b=yield(e||(e=n("Promise"))).all([o("WAWebChatThreadLogging").getMessageIDHMAC(C.toString()),o("WAWebChatThreadLogging").getChatThreadIDHMAC(y)]),v=b[0],S=b[1],R=o("WAWebMsgGetters").getClientReceivedTsMillis(t),L=R!=null?Math.round((f-R)/1e3):void 0,E=o("WAWebUserPrefsGeneral").getUserPrivacySettings(),k=E.readReceipts!=="none";new(o("WAWebQbmRichOrderStatusInteractionWamEvent")).QbmRichOrderStatusInteractionWamEvent({actionTypeRichOrderStatus:r,chatsFolderType:c,contactType:u,deltaTime:h,deltaTimeReceived:L,isInsubContact:_,isMuted:p,messageIdHmac:v!=null?v:void 0,readReceiptsEnabled:k,threadIdHmac:S!=null?S:void 0,unifiedSessionId:d!=null?d:void 0}).commit(),new(o("WAWebBusinessTemplateRichOrderStatusWamEvent")).BusinessTemplateRichOrderStatusWamEvent({actionTypeRichOrderStatus:r,businessJid:o("WAWebUtilsPnhSmbLoggingHelper").jidToPnString(o("WAWebChatGetters").getId(i)),chatsFolderType:c,contactType:u,isBizIntent:s,isInsubContact:_,isMuted:p,readReceiptsEnabled:k,templateId:(a=t.templateId)!=null?a:void 0}).commit()}}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(o("WAWebABProps").getABPropConfigValue("utility_order_status_logging_enabled")){var t=o("WAWebOrderStatusButton").getOrderStatusButton(e);if(t){var n=o("WAWebFrontendMsgGetters").getChat(e),r=o("WAWebOrderStatus").getMergedOrderStatus(n,t),a=r.firstMessage;if(a){var i=o("WAWebOrderStatusButton").getOrderStatusButton(a);if(i){for(var l=e.mediaData.filehash!==a.mediaData.filehash,s=t.order.items||[],u=i.order.items||[],c=t.order.currency!==i.order.currency,d=s.length!==u.length,m=!1,p=!1,_=!1,f=!1,g=!1,h=0;h0?i=t.trim().replace(a,"").trim():i=t==null?void 0:t.trim();var l=r("WAWebL10N").getFullLocale(),s=a==null?void 0:a.toLocaleUpperCase(l),u=(o=i)==null?void 0:o.toLocaleUpperCase(l),c=n==null?void 0:n.toLocaleUpperCase(l);return{firstName:s,lastName:u,pushname:c}}function P(e){var t=e.charAt(0),n=e.charAt(1),r=null,o=null;if(p.test(t)?(r=p,o=y):f.test(t)?(r=f,o=C):m.test(t)&&(r=m,o=b),!(r==null||o==null))return n!=null&&r.test(t)&&!o.test(t)&&o.test(n)?t+n:r.test(t)?t:null}function N(e,t){var n=e.charAt(0);if(R.test(e))return P(e);if(n!=null&&d.test(n)&&v.test(n)){var r=e==null?void 0:e.slice(1).trim(),o=r==null?void 0:r.charAt(0);return T(o)&&!v.test(o)?o:null}return I(e)&&!t?e.slice(0,2):T(n)?n:null}function M(e){var t=$(e.shortName,e.name,e.pushname),n=x(t),r=null,o=null,a=t.firstName,i=n.showFirstNameInitial===!0&&n.showLastNameInitial===!1;return n.showFirstNameInitial===!0&&a!=null&&(r=N(a,i)),n.showLastNameInitial===!0&&t.lastName!=null&&(o=N(t.lastName,i)),n.showPushnameInitial===!0&&t.pushname!=null&&(r=N(t.pushname,!0),o=null),r!=null&&o!=null&&E(r)!==E(o)&&(o=null),{firstInitial:r,secondInitial:o}}function w(e){return M({shortName:e==null?void 0:e.shortName,name:e==null?void 0:e.name,pushname:e==null?void 0:e.pushname})}l.InitialsAlphabets=e,l.supportedAlphabetsMap=h,l.getInitialsFromNames=M,l.getInitialsFromContact=w}),98); __d("useWAWebDefaultProfileColors",["WALogger","WAWebABProps","WAWebLidMigrationUtils","WAWebThemeContext"],(function(t,n,r,o,a,i,l){var e,s,u={foreground_light_0:{fill:"xpeijrx",color:"x1n2m9b9",$$css:!0},foreground_light_1:{fill:"xexpjjz",color:"x1kqjlw6",$$css:!0},foreground_light_2:{fill:"x188zirx",color:"xwqu2pk",$$css:!0},foreground_light_3:{fill:"x1t468e5",color:"x1r8uoeu",$$css:!0},foreground_light_4:{fill:"xbc7xj4",color:"xpn0nk7",$$css:!0},foreground_light_5:{fill:"xd9is5k",color:"x13chq93",$$css:!0},foreground_light_6:{fill:"x1kqagn2",color:"x1n05ped",$$css:!0},foreground_light_7:{fill:"xkm4go3",color:"x5e9l22",$$css:!0},foreground_light_8:{fill:"x1srln1p",color:"xvwrcih",$$css:!0},foreground_light_9:{fill:"xanjk8j",color:"xfb0nyn",$$css:!0},background_light_0:{backgroundColor:"x1n1x9ff",$$css:!0},background_light_1:{backgroundColor:"x12sjp1n",$$css:!0},background_light_2:{backgroundColor:"x8keij6",$$css:!0},background_light_3:{backgroundColor:"x12133zs",$$css:!0},background_light_4:{backgroundColor:"x1jm9hjs",$$css:!0},background_light_5:{backgroundColor:"x160328e",$$css:!0},background_light_6:{backgroundColor:"x1oo8p90",$$css:!0},background_light_7:{backgroundColor:"x1eslsoh",$$css:!0},background_light_8:{backgroundColor:"x1h3j3vg",$$css:!0},background_light_9:{backgroundColor:"x16e27g8",$$css:!0},foreground_dark_0:{fill:"x1bfbhdb",color:"x12yyfci",$$css:!0},foreground_dark_1:{fill:"x93r2cv",color:"xxf7ff0",$$css:!0},foreground_dark_2:{fill:"x5ytfuy",color:"x1xys54w",$$css:!0},foreground_dark_3:{fill:"xuhhb12",color:"xpuqgcd",$$css:!0},foreground_dark_4:{fill:"x1m7lzmn",color:"xupum3x",$$css:!0},foreground_dark_5:{fill:"x44mdgp",color:"x1yo833s",$$css:!0},foreground_dark_6:{fill:"xxedggd",color:"x1l5hh2",$$css:!0},foreground_dark_7:{fill:"x4gg93y",color:"x1cs9g36",$$css:!0},foreground_dark_8:{fill:"x1xt2dww",color:"x446drw",$$css:!0},foreground_dark_9:{fill:"xw0s12w",color:"x1y4xi8",$$css:!0},background_dark_0:{backgroundColor:"x150ih4e",$$css:!0},background_dark_1:{backgroundColor:"xin3ion",$$css:!0},background_dark_2:{backgroundColor:"x1irhbf4",$$css:!0},background_dark_3:{backgroundColor:"x1f4sk58",$$css:!0},background_dark_4:{backgroundColor:"xv9odtk",$$css:!0},background_dark_5:{backgroundColor:"xjvoycj",$$css:!0},background_dark_6:{backgroundColor:"xby4qiw",$$css:!0},background_dark_7:{backgroundColor:"x1ydycr4",$$css:!0},background_dark_8:{backgroundColor:"x1otzlqf",$$css:!0},background_dark_9:{backgroundColor:"x6g3lej",$$css:!0},accent_light_0:{backgroundColor:"x1ugvjbv",$$css:!0},accent_light_1:{backgroundColor:"xc0hbaw",$$css:!0},accent_light_2:{backgroundColor:"xuiuhh6",$$css:!0},accent_light_3:{backgroundColor:"x1u08djq",$$css:!0},accent_light_4:{backgroundColor:"xhw09ix",$$css:!0},accent_light_5:{backgroundColor:"x1cjtxrm",$$css:!0},accent_light_6:{backgroundColor:"xeh0b9z",$$css:!0},accent_light_7:{backgroundColor:"xch5qog",$$css:!0},accent_light_8:{backgroundColor:"xe39q9i",$$css:!0},accent_light_9:{backgroundColor:"xr2cgwq",$$css:!0},accent_dark_0:{backgroundColor:"x15pc0x0",$$css:!0},accent_dark_1:{backgroundColor:"x7g9zlq",$$css:!0},accent_dark_2:{backgroundColor:"xz8tqu9",$$css:!0},accent_dark_3:{backgroundColor:"x1q3ucki",$$css:!0},accent_dark_4:{backgroundColor:"x12bhq1d",$$css:!0},accent_dark_5:{backgroundColor:"x1j4n4e0",$$css:!0},accent_dark_6:{backgroundColor:"x1k99n7x",$$css:!0},accent_dark_7:{backgroundColor:"x1a4nqah",$$css:!0},accent_dark_8:{backgroundColor:"x14qg5qx",$$css:!0},accent_dark_9:{backgroundColor:"xq4q3us",$$css:!0}};function c(t){var n=t.user;if(t.isUser()&&!t.isPSA()){var r=o("WAWebLidMigrationUtils").toLid(t);r!=null&&(n=r.user)}if(n==null||n.length===0)return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getColorIndexFromWid: user is null or empty, returning fallback color index"]))),0;var a=n.charAt(n.length-1),i=parseInt(a,10);return isNaN(i)?(o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["getColorIndexFromWid: last character is not a digit, returning fallback color index"]))),0):i}function d(e,t){var n=e%10;return t==="light"?n===0?{background:u.background_light_0,foreground:u.foreground_light_0,accent:u.accent_light_0}:n===1?{background:u.background_light_1,foreground:u.foreground_light_1,accent:u.accent_light_1}:n===2?{background:u.background_light_2,foreground:u.foreground_light_2,accent:u.accent_light_2}:n===3?{background:u.background_light_3,foreground:u.foreground_light_3,accent:u.accent_light_3}:n===4?{background:u.background_light_4,foreground:u.foreground_light_4,accent:u.accent_light_4}:n===5?{background:u.background_light_5,foreground:u.foreground_light_5,accent:u.accent_light_5}:n===6?{background:u.background_light_6,foreground:u.foreground_light_6,accent:u.accent_light_6}:n===7?{background:u.background_light_7,foreground:u.foreground_light_7,accent:u.accent_light_7}:n===8?{background:u.background_light_8,foreground:u.foreground_light_8,accent:u.accent_light_8}:{background:u.background_light_9,foreground:u.foreground_light_9,accent:u.accent_light_9}:n===0?{background:u.background_dark_0,foreground:u.foreground_dark_0,accent:u.accent_dark_0}:n===1?{background:u.background_dark_1,foreground:u.foreground_dark_1,accent:u.accent_dark_1}:n===2?{background:u.background_dark_2,foreground:u.foreground_dark_2,accent:u.accent_dark_2}:n===3?{background:u.background_dark_3,foreground:u.foreground_dark_3,accent:u.accent_dark_3}:n===4?{background:u.background_dark_4,foreground:u.foreground_dark_4,accent:u.accent_dark_4}:n===5?{background:u.background_dark_5,foreground:u.foreground_dark_5,accent:u.accent_dark_5}:n===6?{background:u.background_dark_6,foreground:u.foreground_dark_6,accent:u.accent_dark_6}:n===7?{background:u.background_dark_7,foreground:u.foreground_dark_7,accent:u.accent_dark_7}:n===8?{background:u.background_dark_8,foreground:u.foreground_dark_8,accent:u.accent_dark_8}:{background:u.background_dark_9,foreground:u.foreground_dark_9,accent:u.accent_dark_9}}function m(e){var t=o("WAWebThemeContext").useTheme(),n=t.theme;if(e==null||!o("WAWebABProps").getABPropConfigValue("default_profile_pics_m1"))return{};var r=c(e);return d(r,n)}l.useDefaultProfileColors=m}),98); __d("WAWebInitialsProfilePicture.react",["$InternalEnum","WABidi","WAWebInitialsFromNameUtils","react","stylex","useWAWebDefaultProfileColors","useWAWebGroupColors"],(function(t,n,r,o,a,i,l){var e,s,u=e||(e=r("react")),c=n("$InternalEnum").Mirrored(["Default","GroupChatProfilePicture","NewsletterQuestionsResponses"]),d={initialsBackground:{borderStartStartRadius:"x1c9tyrk",borderStartEndRadius:"xeusxvb",borderEndEndRadius:"x1pahc9y",borderEndStartRadius:"x1ertn4p",color:"x1awj2ng",display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"xl56j7k",$$css:!0},initialsNewsletterResponses:{width:"x100vrsf",height:"x1vqgdyp",$$css:!0},initialsDefault:{width:"xh8yej3",height:"x5yr21d",$$css:!0}};function m(e){var t=e.backgroundColorId,n=e.initialsData,a=e.theme,i=a===void 0?c.Default:a,l=e.wid,m=o("useWAWebDefaultProfileColors").useDefaultProfileColors(l),p=m.background,_=m.foreground,f=o("useWAWebGroupColors").useGroupsColorStyle(t,"background");f=p!=null?p:f;var g=n.firstInitial!=null&&n.secondInitial!=null,h=o("WAWebInitialsFromNameUtils").supportedAlphabetsMap.get(o("WAWebInitialsFromNameUtils").InitialsAlphabets.HAN),y=!1;if(h&&n.secondInitial!=null&&h.test(n==null?void 0:n.secondInitial)){var C,b=((C=n.secondInitial)==null?void 0:C.length)||0;y=b>1}var v=n.firstInitial!=null&&o("WABidi").dir(n.firstInitial)==="rtl"?"rtl":"ltr",S=i===c.NewsletterQuestionsResponses?d.initialsNewsletterResponses:d.initialsDefault;return u.jsx("div",babelHelpers.extends({},(s||(s=r("stylex"))).props(d.initialsBackground,S,f,_),{children:u.jsxs("div",babelHelpers.extends({dir:v},{0:{},8:{className:"x1aueamr"},4:{className:"x1f6kntn"},12:{className:"x1f6kntn"},2:{className:"x1nxh6w3"},10:{className:"x1nxh6w3"},6:{className:"x1nxh6w3"},14:{className:"x1nxh6w3"},1:{className:"x1ncwhqj"},9:{className:"x1ncwhqj"},5:{className:"x1ncwhqj"},13:{className:"x1ncwhqj"},3:{className:"x1ncwhqj"},11:{className:"x1ncwhqj"},7:{className:"x1ncwhqj"},15:{className:"x1ncwhqj"}}[(i===c.Default)<<3|(i===c.GroupChatProfilePicture)<<2|!!(i===c.GroupChatProfilePicture&&g)<<1|!!y<<0],{children:[u.jsx("div",{"data-testid":void 0,className:"x1rg5ohu xk50ysn",children:n.firstInitial}),u.jsx("div",{"data-testid":void 0,className:"x1rg5ohu xk50ysn",children:n.secondInitial})]}))}))}m.displayName=m.name+" [from "+i.id+"]",l.ThemeType=c,l.InitialsProfilePicture=m}),98); __d("WAWebMetaAIIcon.react",["WAWebImg.react","bx","react"],(function(t,n,r,o,a,i,l){"use strict";var e,s=e||(e=r("react"));function u(e){var t=e.height,n=t===void 0?20:t,o=e.width,a=o===void 0?20:o;return s.jsx(r("WAWebImg.react"),{src:r("bx").getURL(r("bx")("14943")),style:{width:a,height:n},draggable:!1})}u.displayName=u.name+" [from "+i.id+"]",l.default=u}),98); __d("WAWebSingleChevronInCircleIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="single-chevron-in-circle";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=20,R=20;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 20 20",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),fill:"none",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0034 1.66992C14.6034 1.66992 18.3367 5.40326 18.3367 10.0033C18.3367 14.6033 14.6034 18.3366 10.0034 18.3366C5.40338 18.3366 1.67004 14.6033 1.67004 10.0033C1.67004 5.40326 5.40338 1.66992 10.0034 1.66992ZM10.0034 3.33659C6.32004 3.33659 3.33671 6.31992 3.33671 10.0033C3.33671 13.6866 6.32004 16.6699 10.0034 16.6699C13.6867 16.6699 16.67 13.6866 16.67 10.0033C16.67 6.31992 13.6867 3.33659 10.0034 3.33659ZM10.7327 9.99904L8.57734 12.1565C8.25234 12.4815 8.26068 13.0148 8.57734 13.3398C8.90234 13.6648 9.42734 13.6648 9.75234 13.3398L12.4994 10.5907C12.8244 10.2657 12.8244 9.74071 12.4994 9.41571L9.75563 6.67319C9.43063 6.34819 8.90563 6.34819 8.58063 6.67319C8.25563 6.99819 8.25563 7.52319 8.58063 7.84819L10.7327 9.99904Z",fill:"currentColor "})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.SingleChevronInCircleIcon=m}),98); __d("WAWebSquircleStroke.react",["WDSVars.stylex","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u="100,50 100,56.6 100,59.3 100,61.4 99.9,63.2 99.9,64.8 99.9,66.2 99.8,67.5 99.8,68.7 99.7,69.8 99.6,70.8 99.5,71.8 99.5,72.8 99.4,73.7 99.3,74.6 99.1,75.4 99,76.3 98.9,77 98.8,77.8 98.6,78.5 98.5,79.2 98.3,79.9 98.1,80.6 98,81.3 97.8,81.9 97.6,82.5 97.4,83.1 97.2,83.7 97,84.3 96.8,84.8 96.5,85.4 96.3,85.9 96,86.4 95.8,86.9 95.5,87.4 95.3,87.9 95,88.3 94.7,88.8 94.4,89.2 94.1,89.7 93.8,90.1 93.4,90.5 93.1,90.9 92.8,91.3 92.4,91.7 92,92 91.7,92.4 91.3,92.8 90.9,93.1 90.5,93.4 90.1,93.8 89.7,94.1 89.2,94.4 88.8,94.7 88.3,95 87.9,95.3 87.4,95.5 86.9,95.8 86.4,96 85.9,96.3 85.4,96.5 84.8,96.8 84.3,97 83.7,97.2 83.1,97.4 82.5,97.6 81.9,97.8 81.3,98 80.6,98.1 79.9,98.3 79.2,98.5 78.5,98.6 77.8,98.8 77,98.9 76.3,99 75.4,99.1 74.6,99.3 73.7,99.4 72.8,99.5 71.8,99.5 70.8,99.6 69.8,99.7 68.7,99.8 67.5,99.8 66.2,99.9 64.8,99.9 63.2,99.9 61.4,100 59.3,100 56.6,100 50,100 43.4,100 40.7,100 38.6,100 36.8,99.9 35.2,99.9 33.8,99.9 32.5,99.8 31.3,99.8 30.2,99.7 29.2,99.6 28.2,99.5 27.2,99.5 26.3,99.4 25.4,99.3 24.6,99.1 23.7,99 23,98.9 22.2,98.8 21.5,98.6 20.8,98.5 20.1,98.3 19.4,98.1 18.7,98 18.1,97.8 17.5,97.6 16.9,97.4 16.3,97.2 15.7,97 15.2,96.8 14.6,96.5 14.1,96.3 13.6,96 13.1,95.8 12.6,95.5 12.1,95.3 11.7,95 11.2,94.7 10.8,94.4 10.3,94.1 9.9,93.8 9.5,93.4 9.1,93.1 8.7,92.8 8.3,92.4 8,92 7.6,91.7 7.2,91.3 6.9,90.9 6.6,90.5 6.2,90.1 5.9,89.7 5.6,89.2 5.3,88.8 5,88.3 4.7,87.9 4.5,87.4 4.2,86.9 4,86.4 3.7,85.9 3.5,85.4 3.2,84.8 3,84.3 2.8,83.7 2.6,83.1 2.4,82.5 2.2,81.9 2,81.3 1.9,80.6 1.7,79.9 1.5,79.2 1.4,78.5 1.2,77.8 1.1,77 1,76.3 0.9,75.4 0.7,74.6 0.6,73.7 0.5,72.8 0.5,71.8 0.4,70.8 0.3,69.8 0.2,68.7 0.2,67.5 0.1,66.2 0.1,64.8 0.1,63.2 0,61.4 0,59.3 0,56.6 0,50 0,43.4 0,40.7 0,38.6 0.1,36.8 0.1,35.2 0.1,33.8 0.2,32.5 0.2,31.3 0.3,30.2 0.4,29.2 0.5,28.2 0.5,27.2 0.6,26.3 0.7,25.4 0.9,24.6 1,23.7 1.1,23 1.2,22.2 1.4,21.5 1.5,20.8 1.7,20.1 1.9,19.4 2,18.7 2.2,18.1 2.4,17.5 2.6,16.9 2.8,16.3 3,15.7 3.2,15.2 3.5,14.6 3.7,14.1 4,13.6 4.2,13.1 4.5,12.6 4.7,12.1 5,11.7 5.3,11.2 5.6,10.8 5.9,10.3 6.2,9.9 6.6,9.5 6.9,9.1 7.2,8.7 7.6,8.3 8,8 8.3,7.6 8.7,7.2 9.1,6.9 9.5,6.6 9.9,6.2 10.3,5.9 10.8,5.6 11.2,5.3 11.7,5 12.1,4.7 12.6,4.5 13.1,4.2 13.6,4 14.1,3.7 14.6,3.5 15.2,3.2 15.7,3 16.3,2.8 16.9,2.6 17.5,2.4 18.1,2.2 18.7,2 19.4,1.9 20.1,1.7 20.8,1.5 21.5,1.4 22.2,1.2 23,1.1 23.7,1 24.6,0.9 25.4,0.7 26.3,0.6 27.2,0.5 28.2,0.5 29.2,0.4 30.2,0.3 31.3,0.2 32.5,0.2 33.8,0.1 35.2,0.1 36.8,0.1 38.6,0 40.7,0 43.4,0 50,0 56.6,0 59.3,0 61.4,0 63.2,0.1 64.8,0.1 66.2,0.1 67.5,0.2 68.7,0.2 69.8,0.3 70.8,0.4 71.8,0.5 72.8,0.5 73.7,0.6 74.6,0.7 75.4,0.9 76.3,1 77,1.1 77.8,1.2 78.5,1.4 79.2,1.5 79.9,1.7 80.6,1.9 81.3,2 81.9,2.2 82.5,2.4 83.1,2.6 83.7,2.8 84.3,3 84.8,3.2 85.4,3.5 85.9,3.7 86.4,4 86.9,4.2 87.4,4.5 87.9,4.7 88.3,5 88.8,5.3 89.2,5.6 89.7,5.9 90.1,6.2 90.5,6.6 90.9,6.9 91.3,7.2 91.7,7.6 92,8 92.4,8.3 92.8,8.7 93.1,9.1 93.4,9.5 93.8,9.9 94.1,10.3 94.4,10.8 94.7,11.2 95,11.7 95.3,12.1 95.5,12.6 95.8,13.1 96,13.6 96.3,14.1 96.5,14.6 96.8,15.2 97,15.7 97.2,16.3 97.4,16.9 97.6,17.5 97.8,18.1 98,18.7 98.1,19.4 98.3,20.1 98.5,20.8 98.6,21.5 98.8,22.2 98.9,23 99,23.7 99.1,24.6 99.3,25.4 99.4,26.3 99.5,27.2 99.5,28.2 99.6,29.2 99.7,30.2 99.8,31.3 99.8,32.5 99.9,33.8 99.9,35.2 99.9,36.8 100,38.6 100,40.7 100,43.4";function c(e){var t=e.strokeColor,n=t===void 0?o("WDSVars.stylex").WDSVars["--WDS-components-outline-profile-photo"]:t,r=e.strokeWidth,a=r===void 0?4:r;return s.jsx("svg",{className:"x10l6tqk x13vifvy x1o0tod xh8yej3 x5yr21d x47corl",viewBox:"0 0 100 100",preserveAspectRatio:"none",fill:"none","aria-hidden":!0,children:s.jsx("polygon",{points:u,stroke:n,strokeWidth:a,fill:"none"})})}c.displayName=c.name+" [from "+i.id+"]",l.default=c}),98); __d("WAWebWaChatPsaIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="wa-chat-psa";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=360,R=360;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 360 360",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),version:"1.1",id:"Layer_1",x:"0px",y:"0px",enableBackground:"new 0 0 360 360",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{fill:"#25D366",opacity:1,stroke:"none",d:" M173.000000,361.000000 C115.353172,361.000000 58.206341,361.000000 1.029757,361.000000 C1.029757,241.061493 1.029757,121.122963 1.029757,1.092220 C120.896820,1.092220 240.793732,1.092220 360.845337,1.092220 C360.845337,120.999847 360.845337,240.999893 360.845337,361.000000 C298.456329,361.000000 235.978165,361.000000 173.000000,361.000000 M197.063446,92.379547 C195.411438,92.174431 193.762665,91.937508 192.106949,91.768898 C156.937073,88.187309 128.342728,100.457565 108.074654,129.217316 C87.867386,157.890823 86.575523,188.910645 101.408730,220.531891 C102.965797,223.851242 103.232262,226.553955 102.266563,229.950317 C98.463707,243.324921 94.899605,256.767395 91.084465,270.781311 C93.123474,270.351715 94.548683,270.112305 95.941422,269.748505 C108.650543,266.428864 121.320129,262.946716 134.088593,259.875153 C136.551529,259.282684 139.727280,259.569855 142.010056,260.646881 C157.967712,268.175995 174.705978,270.917206 192.102615,268.776276 C234.755585,263.527069 268.624664,226.903122 270.011841,184.898880 C271.516479,139.337418 241.558502,101.014793 197.063446,92.379547 z"}),c.jsx("path",{fill:"#FCFEFD",opacity:1,stroke:"none",d:" M197.474182,92.506378 C241.558502,101.014793 271.516479,139.337418 270.011841,184.898880 C268.624664,226.903122 234.755585,263.527069 192.102615,268.776276 C174.705978,270.917206 157.967712,268.175995 142.010056,260.646881 C139.727280,259.569855 136.551529,259.282684 134.088593,259.875153 C121.320129,262.946716 108.650543,266.428864 95.941422,269.748505 C94.548683,270.112305 93.123474,270.351715 91.084465,270.781311 C94.899605,256.767395 98.463707,243.324921 102.266563,229.950317 C103.232262,226.553955 102.965797,223.851242 101.408730,220.531891 C86.575523,188.910645 87.867386,157.890823 108.074654,129.217316 C128.342728,100.457565 156.937073,88.187309 192.106949,91.768898 C193.762665,91.937508 195.411438,92.174431 197.474182,92.506378 M253.181854,196.536774 C255.711929,186.169617 256.004150,175.664429 253.541946,165.353546 C246.119568,134.271210 226.847565,114.125397 195.518936,107.758392 C164.775314,101.510277 138.969528,111.918282 120.761078,137.417480 C102.516304,162.967529 102.122711,190.360199 117.175308,217.804871 C119.110695,221.333557 119.630486,224.226303 118.452988,227.999252 C116.305588,234.880005 114.631348,241.908432 112.534187,249.714706 C121.244263,247.449783 128.886383,245.269287 136.634216,243.571182 C138.823502,243.091385 141.697876,243.342087 143.623520,244.406097 C187.851929,268.844574 240.426270,246.301453 253.181854,196.536774 z"}),c.jsx("path",{fill:"#26D367",opacity:1,stroke:"none",d:" M253.113434,196.950668 C240.426270,246.301453 187.851929,268.844574 143.623520,244.406097 C141.697876,243.342087 138.823502,243.091385 136.634216,243.571182 C128.886383,245.269287 121.244263,247.449783 112.534187,249.714706 C114.631348,241.908432 116.305588,234.880005 118.452988,227.999252 C119.630486,224.226303 119.110695,221.333557 117.175308,217.804871 C102.122711,190.360199 102.516304,162.967529 120.761078,137.417480 C138.969528,111.918282 164.775314,101.510277 195.518936,107.758392 C226.847565,114.125397 246.119568,134.271210 253.541946,165.353546 C256.004150,175.664429 255.711929,186.169617 253.113434,196.950668 M159.161896,144.300629 C157.596588,142.566147 156.289551,139.760483 154.415009,139.308472 C149.758347,138.185654 145.465286,139.125748 141.936844,143.335083 C135.938049,150.491486 133.889008,158.646042 136.794312,167.095337 C139.180939,174.036118 142.985977,180.714874 147.247849,186.742218 C159.314850,203.807953 175.066055,216.142273 195.540466,221.815857 C205.004898,224.438538 213.684128,223.322174 221.218109,216.594635 C225.301636,212.948212 226.861237,207.950836 225.754288,203.034790 C225.255310,200.818695 221.393539,199.207153 218.857986,197.645233 C216.319427,196.081421 213.584717,194.800613 210.844025,193.606903 C202.134613,189.813538 203.863739,189.749985 198.366028,196.614182 C197.431046,197.781570 196.301865,198.814072 195.495682,200.059845 C193.532318,203.093781 191.249756,202.866211 188.234161,201.544495 C177.255371,196.732590 168.560989,189.383530 161.641464,179.587280 C158.640030,175.338043 158.010895,172.193756 162.204178,168.482956 C166.102249,165.033386 166.959518,160.921555 164.134537,156.022842 C162.157837,152.595093 161.014969,148.686508 159.161896,144.300629 z"}),c.jsx("path",{fill:"#FCFEFD",opacity:1,stroke:"none",d:" M159.330811,144.646652 C161.014969,148.686508 162.157837,152.595093 164.134537,156.022842 C166.959518,160.921555 166.102249,165.033386 162.204178,168.482956 C158.010895,172.193756 158.640030,175.338043 161.641464,179.587280 C168.560989,189.383530 177.255371,196.732590 188.234161,201.544495 C191.249756,202.866211 193.532318,203.093781 195.495682,200.059845 C196.301865,198.814072 197.431046,197.781570 198.366028,196.614182 C203.863739,189.749985 202.134613,189.813538 210.844025,193.606903 C213.584717,194.800613 216.319427,196.081421 218.857986,197.645233 C221.393539,199.207153 225.255310,200.818695 225.754288,203.034790 C226.861237,207.950836 225.301636,212.948212 221.218109,216.594635 C213.684128,223.322174 205.004898,224.438538 195.540466,221.815857 C175.066055,216.142273 159.314850,203.807953 147.247849,186.742218 C142.985977,180.714874 139.180939,174.036118 136.794312,167.095337 C133.889008,158.646042 135.938049,150.491486 141.936844,143.335083 C145.465286,139.125748 149.758347,138.185654 154.415009,139.308472 C156.289551,139.760483 157.596588,142.566147 159.330811,144.646652 z"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.WaChatPsaIcon=m}),98); __d("WDSIconWdsIcBroadcastMessageFill.react",["WDSSvgComponentBase.react","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","viewBox","width"],s,u,c=s||(s=r("react")),d="wds-ic-broadcast-message-fill";function m(t){var n=t.height,o=t.iconXstyle,a=t.viewBox,i=t.width,l=babelHelpers.objectWithoutPropertiesLoose(t,e),s;if(a){var m=a.height,p=m===void 0?0:m,_=a.width,f=_===void 0?0:_,g=a.x,h=g===void 0?0:g,y=a.y,C=y===void 0?0:y;s=[h,C,f,p].join(" ")}var b=24,v=24;return(n!=null||i!=null)&&(b=n,v=i),c.jsx(r("WDSSvgComponentBase.react"),babelHelpers.extends({},l,{children:c.jsxs("svg",{viewBox:s!=null?s:"0 0 24 24",height:b,width:v,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(o),fill:"none",children:[c.jsx("title",{children:d}),c.jsx("path",{d:"M17.5195 3.00586C19.0193 3.00601 20.2196 4.20628 20.2197 5.70605V7.28516C19.6201 7.30601 19.0224 7.50395 18.5137 7.88965L18.3926 7.98633C17.8916 8.40823 17.5648 8.9592 17.417 9.54883C16.7102 9.49545 15.9837 9.69053 15.3809 10.1475L15.2598 10.2441C14.8101 10.6226 14.502 11.1063 14.3359 11.6279C13.4641 11.5337 12.559 11.82 11.8906 12.4883C10.7193 13.6598 10.7192 15.559 11.8906 16.7305C12.5181 17.3579 13.3544 17.6453 14.1758 17.6006C14.2709 18.0254 14.4589 18.4338 14.7412 18.7939H10.8047L7.30469 21.7939C7.22637 21.8614 7.00455 21.9939 6.80469 21.9941C6.3049 21.9941 5.80511 21.5937 5.80469 20.9941V18.7939H4.50488C3.00499 18.7939 1.80485 17.5936 1.80469 16.0938L1.59082 5.70605C1.59098 4.20619 2.79209 3.00586 4.29199 3.00586H17.5195Z",fill:"currentColor"}),c.jsx("path",{d:"M16.5476 11.7747C16.9702 11.4191 17.6007 11.4736 17.9563 11.8962C19.511 13.7444 19.2266 16.2913 17.7905 17.6649C17.3915 18.0465 16.7587 18.0327 16.377 17.6339C15.9953 17.2348 16.0097 16.6014 16.4088 16.2196C17.0822 15.5753 17.3017 14.2242 16.426 13.1834C16.0706 12.7608 16.125 12.1302 16.5476 11.7747Z",fill:"currentColor"}),c.jsx("path",{d:"M19.6804 9.5163C20.103 9.16077 20.7343 9.21453 21.0898 9.63715L21.3453 9.95617C23.8057 13.1837 23.33 17.3998 21.0608 19.8073L20.8274 20.0421C20.4283 20.4237 19.7949 20.4094 19.4132 20.0103C19.0317 19.6112 19.0459 18.9778 19.4449 18.5961L19.6079 18.4318C21.2566 16.6783 21.6469 13.407 19.5589 10.925L19.4974 10.8428C19.2123 10.4241 19.2846 9.8496 19.6804 9.5163Z",fill:"currentColor"}),c.jsx("path",{d:"M14.7188 15.3164C14.3283 15.707 13.6951 15.707 13.3046 15.3164C12.9141 14.9259 12.9141 14.2928 13.3046 13.9022C13.6951 13.5117 14.3283 13.5117 14.7188 13.9022C15.1094 14.2928 15.1094 14.9259 14.7188 15.3164Z",fill:"currentColor"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.default=m}),98); __d("WAWebDetailImage.react",["fbt","$InternalEnum","WAShiftTimer","WAWebAnnouncementSpeakerIcon.react","WAWebAvatarSpinner.react","WAWebBizGatingUtils","WAWebBotGroupGatingUtils","WAWebChatCollection","WAWebChatCommunityUtils","WAWebChatEphemerality","WAWebChatGetters","WAWebChatProfilePictureGatingUtils","WAWebClassnames","WAWebCommonCTWAConsumerTransparency","WAWebCommunityGatingUtils","WAWebCommunityGeneralChatImage.react","WAWebContactCollection","WAWebDefaultCommunityRefreshedIcon.react","WAWebDefaultContactRefreshedIcon.react","WAWebDefaultGroupRefreshedIcon.react","WAWebDefaultNewsletterIcon.react","WAWebDefaultUserColorIcon.react","WAWebDefaultUserSquareIcon.react","WAWebDisappearingMessagesRefreshedIcon.react","WAWebDoubleChevronInCircleIcon.react","WAWebEnvironment","WAWebEphemeralityFrontendUtils","WAWebGroupType","WAWebHasAcceptedBizBotTos","WAWebIcVisibilityOffIcon.react","WAWebIdleComponent.react","WAWebImg.react","WAWebInitialsFromNameUtils","WAWebInitialsProfilePicture.react","WAWebKeyboardIsKeyActivation","WAWebLidMigrationUtils","WAWebMetaAIIcon.react","WAWebMiscErrors","WAWebMiscGatingUtils","WAWebMmsClientIsErrorRetryable","WAWebPREGatingUtils","WAWebProfilePicThumbCollection","WAWebPsaVerifiedBlueIcon.react","WAWebPsaVerifiedIcon.react","WAWebSingleChevronInCircleIcon.react","WAWebSquircleStroke.react","WAWebStateUtils","WAWebUISpacing","WAWebUnjoinedSubgroupMetadataCollection","WAWebUseIsKeyboardUser","WAWebUserPrefsMeUser","WAWebWaChatPsaIcon.react","WAWebWid","WDSFocusStateStyles","WDSIconWdsIcBroadcastMessageFill.react","cr:5981","gkx","isStringNullOrEmpty","react","stylex","useLazyRef","useWAWebDefaultProfileColors","useWAWebEventTargetValue","useWAWebForceUpdate","useWAWebGroupColors","useWAWebListener","useWAWebModelValues"],(function(t,n,r,o,a,i,l,s){var e,u,c,d=c||(c=o("react")),m=e||(e=r("react")),p=d.useEffect,_=d.useMemo,f=d.useRef,g=d.useState,h=d.useTransition,y=new Set,C=n("cr:5981")==null?void 0:n("cr:5981").InternalStatusWarningImageOverlay,b=n("$InternalEnum").Mirrored(["ExtraSmall","Small","Medium","Large","Refresh","None"]),v=n("$InternalEnum").Mirrored(["Low","High"]),S=n("$InternalEnum").Mirrored(["Circle","Square","Squircle"]),R=n("$InternalEnum").Mirrored(["GroupChatProfilePicture","Status","MediaHub","GroupStatus"]),L={announcementSpeaker:{color:"xo1mcw5",$$css:!0},communitySquircle:{color:"x17k9de1",$$css:!0},newsletter:{color:"x17k9de1",$$css:!0},avatarDefaultPSA:{borderStartStartRadius:"x1c9tyrk",borderStartEndRadius:"xeusxvb",borderEndEndRadius:"x1pahc9y",borderEndStartRadius:"x1ertn4p",$$css:!0},dimmed:{opacity:"xavfwda",$$css:!0},avatar:{position:"x1n2onr6",borderStartStartRadius:"x1c9tyrk",borderStartEndRadius:"xeusxvb",borderEndEndRadius:"x1pahc9y",borderEndStartRadius:"x1ertn4p",$$css:!0},status:{backgroundColor:"x1gle93d",$$css:!0},avatarSquare:{borderStartStartRadius:"x1bczwif",borderStartEndRadius:"x17un8ov",borderEndEndRadius:"x1e7945m",borderEndStartRadius:"x11o6v7j",$$css:!0},avatarImage:{position:"x1n2onr6",display:"x1lliihq",width:"xh8yej3",height:"x5yr21d",overflowX:"x6ikm8r",overflowY:"x10wlt62",borderStartStartRadius:"x1c9tyrk",borderStartEndRadius:"xeusxvb",borderEndEndRadius:"x1pahc9y",borderEndStartRadius:"x1ertn4p",objectFit:"xl1xv1r",objectPosition:"x115dhu7",opacity:"xg01cxk",transition:"x17vty23",$$css:!0},isLoaded:{opacity:"x1hc1fzr",$$css:!0},avatarImageNoTransition:{transition:"xq2gx43",$$css:!0},avatarSquircle:{clipPath:"x1f2iure",borderStartStartRadius:"x1bczwif",borderStartEndRadius:"x17un8ov",borderEndEndRadius:"x1e7945m",borderEndStartRadius:"x11o6v7j",$$css:!0},groupProfilePicture:{position:"x10l6tqk",insetInlineStart:"x1nobqc8",left:null,right:null,width:"xgd8bvy",height:"x1fgtraw",$$css:!0},groupProfilePictureInBubble:{width:"x14qfxbe",height:"xc9qbxq",$$css:!0},svgSize:{width:"xh8yej3",height:"x5yr21d",$$css:!0},profilePictureOutlineRefreshed:{outline:"x4u6w88",outlineOffset:"x1g40iwv",$$css:!0},circleIconRefreshed:{borderStartStartRadius:"x1c9tyrk",borderStartEndRadius:"xeusxvb",borderEndEndRadius:"x1pahc9y",borderEndStartRadius:"x1ertn4p",backgroundColor:"x1od0jb8",$$css:!0},squircleIconBackground:{width:"xh8yej3",height:"x5yr21d",backgroundColor:"x1od0jb8",$$css:!0},avatarBorder:{borderTopWidth:"x1ktv7sr",borderInlineEndWidth:"x142x0oa",borderBottomWidth:"xv7zg05",borderInlineStartWidth:"x12dgle5",borderTopStyle:"x13fuv20",borderInlineEndStyle:"x18b5jzi",borderBottomStyle:"x1q0q8m5",borderInlineStartStyle:"x1t7ytsu",borderTopColor:"x16jw5py",borderInlineEndColor:"x13dr7gu",borderBottomColor:"xd9srri",borderInlineStartColor:"x1ia0k5z",$$css:!0},avatarProfileRingBorder:{borderTopWidth:"x1ktv7sr",borderInlineEndWidth:"x142x0oa",borderBottomWidth:"xv7zg05",borderInlineStartWidth:"x12dgle5",borderTopStyle:"x13fuv20",borderInlineEndStyle:"x18b5jzi",borderBottomStyle:"x1q0q8m5",borderInlineStartStyle:"x1t7ytsu",borderTopColor:"x1y9zq84",borderInlineEndColor:"xt9xd2u",borderBottomColor:"x3tsejo",borderInlineStartColor:"x1ahzpo1",boxSizing:"x9f619",$$css:!0},avatarDefaultAnnouncementGroup:{backgroundColor:"xfn3atn",$$css:!0},inviteModal:{borderTopWidth:"x1ktv7sr",borderInlineEndWidth:"x142x0oa",borderBottomWidth:"xv7zg05",borderInlineStartWidth:"x12dgle5",borderTopStyle:"x13fuv20",borderInlineEndStyle:"x18b5jzi",borderBottomStyle:"x1q0q8m5",borderInlineStartStyle:"x1t7ytsu",borderTopColor:"x19bsprb",borderInlineEndColor:"x2cy9dh",borderBottomColor:"x1eeqclz",borderInlineStartColor:"x1mx0rqa",backgroundColor:"x16w0wmm",$$css:!0},outline:{borderTopColor:"xx42vgk",borderInlineEndColor:"xbogo7e",borderBottomColor:"x120ee7l",borderInlineStartColor:"x1vb5itz",borderTopStyle:"x13fuv20",borderInlineEndStyle:"x18b5jzi",borderBottomStyle:"x1q0q8m5",borderInlineStartStyle:"x1t7ytsu",borderTopWidth:"x178xt8z",borderInlineEndWidth:"x1lun4ml",borderBottomWidth:"xso031l",borderInlineStartWidth:"xpilrb4",$$css:!0},badge:{position:"x10l6tqk",insetInlineEnd:"xhu3bip",bottom:"x48lskh",zIndex:"x16uhe5s",boxSizing:"x9f619",width:"xw4jnvo",height:"x1qx5ct2",pointerEvents:"x47corl",borderStartStartRadius:"x1c9tyrk",borderStartEndRadius:"xeusxvb",borderEndEndRadius:"x1pahc9y",borderEndStartRadius:"x1ertn4p",$$css:!0},chatList:{backgroundColor:"x1280gxy",$$css:!0},chatListHoveredOrActive:{background:"x8b8lpe",$$css:!0},conversationHeader:{backgroundColor:"x1280gxy",$$css:!0},subgroupJoinModal:{backgroundColor:"x1280gxy",width:"x1849jeq",height:"x1gnnpzl",insetInlineEnd:"xtijo5x",left:null,right:null,bottom:"x1ey2m1c",$$css:!0},adsDataSharingIconBackground:{backgroundColor:"x1c7u0tx",$$css:!0},badgeIconSVG:{width:"x1xp8n7a",height:"xmix8c7",$$css:!0},polls:{borderTopWidth:"x178xt8z",borderInlineEndWidth:"x1lun4ml",borderBottomWidth:"xso031l",borderInlineStartWidth:"xpilrb4",borderTopStyle:"x13fuv20",borderInlineEndStyle:"x18b5jzi",borderBottomStyle:"x1q0q8m5",borderInlineStartStyle:"x1t7ytsu",$$css:!0},pollsSender:{borderTopColor:"x3ewwah",borderInlineEndColor:"xzt7qbt",borderBottomColor:"x1xnb2cf",borderInlineStartColor:"xphqdy3",$$css:!0},pollsReceiver:{borderTopColor:"xm7onvi",borderInlineEndColor:"xxy6lca",borderBottomColor:"x4728lr",borderInlineStartColor:"x4bbfdb",$$css:!0},backgroundFill:{fill:"x1flh12g",$$css:!0},primaryFill:{fill:"xvt3oi1",$$css:!0},broadcastIconContainer:{display:"x78zum5",alignItems:"x6s0dn4",justifyContent:"xl56j7k",$$css:!0},broadcastIconOuter:{width:"xycev2y",height:"x39lw6i",color:"xhslqc4",$$css:!0},badgeIconPathSVG:{color:"xhslqc4",$$css:!0},dataSharingUpdatedStyleIcon:{color:"xrl28ub",$$css:!0},dataSharingNewStyleIcon:{backgroundColor:"x1c7u0tx",borderStartStartRadius:"x1c9tyrk",borderStartEndRadius:"xeusxvb",borderEndEndRadius:"x1pahc9y",borderEndStartRadius:"x1ertn4p",color:"xhslqc4",$$css:!0},subgroupJoinModalSvgStyle:{width:"xgd8bvy",height:"x1fgtraw",$$css:!0},groupProfilePictureSticky:{position:"x7wzq59",top:"x1eu8d0j",$$css:!0}},E=100;function k(e){var t,n=e.alt,a=e.id,i=e.imgClassName,l=e.imgXstyle,s=e.loader,c=s===void 0?!1:s,d=e.loadingAnimation,_=d===void 0?!0:d,C=e.onLoad,b=e.profilePicThumb,v=e.profilePicThumbImg,R=e.spinnerClassName,k=e.spinnerSize,I=e.spinnerXstyle,T=e.theme,D=g(!1),x=D[0],$=D[1],P=g(v),N=P[0],M=P[1],w=N!=null&&o("WAWebPREGatingUtils").isPREChatMovingEnabled()?y.has(N):!1,A=g(w?!1:(a instanceof r("WAWebWid")&&(a==null?void 0:a.isBot()))!==!0),F=A[0],O=A[1],B=g(w),W=B[0],q=B[1],U=f(!!v),V=f(!1),H=T!=="business",G=r("useLazyRef")(function(){return c&&H?new(o("WAShiftTimer")).ShiftTimer(function(){$(!0)}):null}),z=h(),j=z[0],K=z[1];v!==N&&(M(v),O(!0),q(!1));var Q=function(t){K(function(){var e;(e=G.current)==null||e.cancel(),b.markMms4HostSuccess(),O(!1),q(!0),C==null||C();var n=t.target;N!=null&&n instanceof HTMLImageElement&&n.complete&&o("WAWebPREGatingUtils").isPREChatMovingEnabled()&&y.add(N)})},X=function(t){var e;if((e=G.current)==null||e.cancel(),t instanceof o("WAWebMiscErrors").ServerStatusError)switch(t.status){case 403:b.markStale({eurl:!0}),V.current||(V.current=!0,b.validate());break;case 410:b.markStale();break;default:o("WAWebMmsClientIsErrorRetryable").isRetriableStatusCode(t.status)&&b.markMms4HostFailure();break}O(!1),q(!1)};p(function(){var e,t=G;return(e=t.current)==null||e.onOrAfter(E),function(){var e;(e=t.current)==null||e.cancel()}},[b,G]);var Y=function(){return H?!!c&&x&&F&&!(!o("WAWebStateUtils").unproxy(b).stale&&!N):!1},J=o("WAWebClassnames").classnamesConvertMeToStylexPlease((t={},t[i]=typeof i=="string",t),(u||(u=r("stylex")))(_===!1&&U.current&&L.avatarImageNoTransition,L.avatarImage,e.shape===S.Square&&L.avatarSquare,e.shape===S.Squircle&&L.avatarSquircle,!F&&L.isLoaded,e.shape!==S.Squircle&&L.profilePictureOutlineRefreshed,l)),Z,ee;if(Y()&&(Z=m.jsx(r("WAWebAvatarSpinner.react"),{className:R,xstyle:I,size:k})),!r("isStringNullOrEmpty")(N)){var te=m.jsx(r("WAWebImg.react"),{src:N,hasPrivacyChecks:!0,crossOrigin:!1,className:J,draggable:!1,onLoad:Q,onError:X,alt:n});e.shape===S.Squircle?ee=m.jsxs("div",{className:"x1n2onr6 xh8yej3 x5yr21d x1f2iure",children:[te,m.jsx(r("WAWebSquircleStroke.react"),{})]}):ee=te}var ne=W?null:e.defaultIcon;return _===!1&&(ne=ee!=null?null:e.defaultIcon),m.jsxs(m.Fragment,{children:[Z,ne,ee]})}k.displayName=k.name+" [from "+i.id+"]";function I(e){var t=o("useWAWebModelValues").useModelValues(e.profilePicThumb,["imgFull"]);return m.jsx(k,babelHelpers.extends({},e,{profilePicThumbImg:t.imgFull}))}I.displayName=I.name+" [from "+i.id+"]";function T(e){var t=o("useWAWebModelValues").useModelValues(e.profilePicThumb,["img"]);return m.jsx(k,babelHelpers.extends({},e,{profilePicThumbImg:t.img}))}T.displayName=T.name+" [from "+i.id+"]";function D(e){return e==="group_profile_picture"||e==="group_profile_picture_in_bubble"?R.GroupChatProfilePicture:e==="status"?R.Status:e==="media_hub"?R.MediaHub:e==="group_status"?R.GroupStatus:null}var x=28;function $(e){if(typeof e=="string")switch(e){case b.ExtraSmall:return 40;case b.Small:return 49;case b.Medium:return 100;case b.Large:return 200;case b.Refresh:return 128;case b.None:return}else return e}function P(e){"use no forget";var t,n,a,i,l,c=e.id,d=e.size,p=e.quality,g=p===void 0?v.Low:p,h=e.loader,R=e.onClick,E=e.onLoad,k=e.quoted,P=e.shape,F=e.border,O=e.waitIdle,B=e.ephemeralIcon,W=e.isHoveredOrActive,q=W===void 0?!1:W,U=e.checkmarkIcon,V=e.hiddenSubgroupIcon,H=e.theme,G=e.alt,z=e.xstyle,j=e.authorColor,K=e.loadPicture,Q=K===void 0?!0:K,X=e.loadAnimation,Y=X===void 0?!0:X,J=e.tabIndex,Z=e.ariaLabel,ee=e.testId,te=e.tabOrder,ne=e.showOutline,re=ne===void 0?!1:ne,oe=e.enableAdsDataSharingIcon,ae=e.enableBizAiDataSharingIcon,ie=ae===void 0?!1:ae,le=e.groupProfilePictureSticky,se=le===void 0?!1:le,ue=e.customDimensionsStyle,ce=ue===void 0?!1:ue,de=o("useWAWebForceUpdate").useForceUpdateDONOTUSE(),me=f(null),pe=r("WAWebUseIsKeyboardUser")(),_e=pe.isKeyboardUser,fe=o("WAWebHasAcceptedBizBotTos").useHasAcceptedBizBotTos(),ge=_(function(){var e=c,t=o("WAWebChatCollection").ChatCollection.get(e);if(!t&&e.isRegularUser())try{var n=e.isLid()?o("WAWebLidMigrationUtils").toPn(e):o("WAWebLidMigrationUtils").toLid(e);n&&(t=o("WAWebChatCollection").ChatCollection.get(n),t&&(e=n))}catch(e){}return{id:e,chat:t}},[c]),he=ge.chat,ye=ge.id,Ce;typeof d=="number"?Ce=d>0?d:b.Small:Ce=d!=null?d:b.Small;var be=ce?{}:{height:(t=$(Ce))!=null?t:void 0,width:(n=$(Ce))!=null?n:void 0};R&&(be.cursor="pointer");var ve,Se;if(he!=null&&(a=he.groupMetadata)!=null&&(a=a.participants)!=null&&a.iAmMember()){if(o("WAWebChatGetters").getIsGroup(he)){var Re;ve=(Re=he.groupMetadata)==null?void 0:Re.groupType,Se=he.groupMetadata}}else{var Le=r("WAWebUnjoinedSubgroupMetadataCollection").get(ye.toString());ve=Le==null?void 0:Le.groupType,Se=Le}o("useWAWebListener").useListener(he!=null&&o("WAWebChatGetters").getIsGroup(he)?Se:he,"change:ephemeralDuration",de);var Ee=r("useWAWebEventTargetValue")(Se,"change:hiddenSubgroup",function(){var e;return((e=Se)==null?void 0:e.hiddenSubgroup)===!0}),ke=(u||(u=r("stylex"))).props(L.avatar,H==="status"&&L.status,P===S.Square&&L.avatarSquare,P===S.Squircle&&L.avatarSquircle,H==="group_profile_picture"&&L.groupProfilePicture,H==="group_profile_picture_in_bubble"&&L.groupProfilePictureInBubble,H==="status_profile_photo_ring"&&L.avatarProfileRingBorder,H==="invite_modal"&&L.inviteModal,(H==="polls_sender"||H==="polls_receiver")&&L.polls,H==="polls_sender"&&L.pollsSender,H==="polls_receiver"&&L.pollsReceiver,o("WAWebChatCommunityUtils").isIntegrityDeactivatedCommunity(he)&&L.dimmed,F===!0&&L.avatarBorder,ve===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&L.avatarDefaultAnnouncementGroup,R!=null&&_e&&o("WDSFocusStateStyles").WDSFocusStateStyles.genericFocus,re&&L.outline,H==="group_profile_picture"&&se&&L.groupProfilePictureSticky,z),Ie=babelHelpers.extends({},ke.style,be),Te=function(t){if(r("WAWebKeyboardIsKeyActivation")(t)){var e;(e=me.current)==null||e.click()}},De=R!=null?{tabIndex:J,role:"button","aria-label":Z,onKeyDown:Te}:{},xe=D(H),$e=m.jsx(M,{id:ye,quoted:k,groupType:ve,theme:xe,authorColor:j,shape:e.shape});if((H==="group_profile_picture"||H==="typing_indicator"||H==="reaction_details")&&o("WAWebChatProfilePictureGatingUtils").shouldDisplayInitialsInProfilePicture(ye)){var Pe=o("WAWebContactCollection").ContactCollection.get(ye);if(Pe){var Ne=o("WAWebInitialsFromNameUtils").getInitialsFromContact(Pe);(Ne.firstInitial!=null||Ne.secondInitial!=null)&&($e=m.jsx(o("WAWebInitialsProfilePicture.react").InitialsProfilePicture,{initialsData:Ne,theme:o("WAWebInitialsProfilePicture.react").ThemeType.GroupChatProfilePicture,backgroundColorId:j!=null?j:1,wid:ye}))}}var Me=function(){var e=null,t;return Q?t=o("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.gadd(ye):t=o("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.get(ye),t?g===v.High?e=m.jsx(I,{profilePicThumb:t,defaultIcon:$e,loader:h,onLoad:E,alt:G,shape:P,id:ye}):e=m.jsx(T,{profilePicThumb:t,defaultIcon:$e,loader:h,onLoad:E,alt:G,loadingAnimation:Y,shape:P,id:ye}):e=$e,m.jsxs("div",babelHelpers.extends({"data-testid":void 0,ref:me,"data-tab":te},De,ke,{style:Ie,onClick:R,children:[e,!r("gkx")("26258")&&(typeof d!="number"||d>=x)&&C?m.jsx(C,{id:ye}):null]}))},we=_(function(){if(!Q)return!1;var e=o("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.get(ye),t=e==null?void 0:e.img;return t!=null&&t!==""?(y.add(t),!0):!1},[ye,Q]),Ae=(!r("WAWebEnvironment").isWindows||O===!0)&&!we,Fe=Ae?m.jsx(r("WAWebIdleComponent.react"),{id:ye,onComplex:Me,waitIdle:O,children:m.jsx("div",babelHelpers.extends({ref:me},De,ke,{style:Ie,onClick:R,children:$e}))}):Me();if(e.emojiBadge!=null&&o("WAWebUserPrefsMeUser").isMeAccount(ye))return m.jsxs("div",{className:"x1n2onr6","aria-label":s._(/*BTDS*/"Profile picture, text status emoji set"),children:[m.jsx("div",{className:"x10l6tqk xhu3bip x48lskh x16uhe5s x9f619 xw4jnvo x1qx5ct2 x47corl x1c9tyrk xeusxvb x1pahc9y x1ertn4p x1h3rtpe",children:e.emojiBadge}),Fe]});var Oe=(i=he==null||(l=he.contact.businessProfile)==null?void 0:l.isBizBot1p)!=null?i:!1,Be=fe&&o("WAWebBizGatingUtils").isUpdatedConsumerDisclosureUiRowEnabled(),We=ie&&Oe&&Be,qe=w(B,he),Ue=A(he),Ve=oe===!0&&he!=null&&o("WAWebCommonCTWAConsumerTransparency").shouldShowConsumerTransparencyDisclosure(he),He=V!=null&&U==null&&Ee;if(We||qe===!0||U||Ve||He||Ue){var Ge,ze=(Ge=B!=null?B:U)!=null?Ge:V;return m.jsxs("div",{className:"x1n2onr6","aria-hidden":"true",children:[m.jsx("div",babelHelpers.extends({},(u||(u=r("stylex"))).props(L.badge,o("WAWebUISpacing").uiPadding.all1,ze==="chat-list"&&!q&&L.chatList,ze==="chat-list"&&q&&L.chatListHoveredOrActive,ze==="conversation-header"&&L.conversationHeader,ze==="subgroup-join-modal"&&L.subgroupJoinModal,Ve&&L.adsDataSharingIconBackground),{children:m.jsx(N,{iconScheme:ze,shouldShowEphemeralIcon:qe,shouldShowHiddenSubgroupIcon:He,shouldShowAdsDataSharingIcon:Ve,shouldShowBizAiDataSharingIcon:We,shouldShowAIGroupIcon:Ue})})),Fe]})}return Fe}P.displayName=P.name+" [from "+i.id+"]";function N(e){var t=e.iconScheme,n=e.shouldShowAdsDataSharingIcon,a=n===void 0?!1:n,i=e.shouldShowAIGroupIcon,l=i===void 0?!1:i,s=e.shouldShowBizAiDataSharingIcon,u=s===void 0?!1:s,c=e.shouldShowEphemeralIcon,d=c===void 0?!1:c,p=e.shouldShowHiddenSubgroupIcon,_=p===void 0?!1:p;if(u)return m.jsx(o("WAWebDoubleChevronInCircleIcon.react").DoubleChevronInCircleIcon,{iconXstyle:[L.svgSize,L.badgeIconSVG,L.dataSharingUpdatedStyleIcon]});if(a)return m.jsx(o("WAWebSingleChevronInCircleIcon.react").SingleChevronInCircleIcon,{iconXstyle:[L.svgSize,L.badgeIconSVG,L.dataSharingNewStyleIcon]});if(o("WAWebBotGroupGatingUtils").isOpenGroupBotParticipantAddEnabled()&&l)return m.jsx(r("WAWebMetaAIIcon.react"),{height:17,width:17});var f=o("WAWebMiscGatingUtils").isBlueEnabled()?o("WAWebPsaVerifiedBlueIcon.react").PsaVerifiedBlueIcon:o("WAWebPsaVerifiedIcon.react").PsaVerifiedIcon,g;return d===!0?g=o("WAWebDisappearingMessagesRefreshedIcon.react").DisappearingMessagesRefreshedIcon:_?g=o("WAWebIcVisibilityOffIcon.react").IcVisibilityOffIcon:g=f,m.jsx(g,{xstyle:L.badgeIconPathSVG,iconXstyle:[L.svgSize,L.badgeIconSVG,t==="subgroup-join-modal"&&L.subgroupJoinModalSvgStyle]})}N.displayName=N.name+" [from "+i.id+"]";function M(e){var t=e.authorColor,n=e.groupType,a=e.id,i=e.quoted,l=e.shape,s=e.theme,c=e.xstyle,d=o("useWAWebDefaultProfileColors").useDefaultProfileColors(a),p=d.background,_=d.foreground,f=o("useWAWebGroupColors").useGroupsColorStyle(t!=null?t:1,"color"),g=m.jsx(o("WAWebDefaultContactRefreshedIcon.react").DefaultContactRefreshedIcon,{iconXstyle:[L.svgSize,L.circleIconRefreshed,L.profilePictureOutlineRefreshed,p,c],"aria-hidden":!0,innerStyles:{primary:_!=null?_:L.primaryFill}});r("WAWebWid").isUser(a)&&!r("WAWebWid").isPSA(a)&&i?g=m.jsx(o("WAWebDefaultUserSquareIcon.react").DefaultUserSquareIcon,{iconXstyle:[L.svgSize,c],"aria-hidden":!0,innerStyles:{primary:L.primaryFill,background:L.backgroundFill}}):r("WAWebWid").isGroup(a)?n===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?g=m.jsx(o("WAWebAnnouncementSpeakerIcon.react").AnnouncementSpeakerIcon,{iconXstyle:[L.svgSize,L.announcementSpeaker,c],directional:!0,"aria-hidden":!0}):n===o("WAWebGroupType").GroupType.COMMUNITY||l===S.Squircle?g=m.jsxs("div",{className:"x1n2onr6 xh8yej3 x5yr21d x1f2iure",children:[m.jsx("div",babelHelpers.extends({},(u||(u=r("stylex"))).props(L.squircleIconBackground,p),{children:m.jsx(o("WAWebDefaultCommunityRefreshedIcon.react").DefaultCommunityRefreshedIcon,{iconXstyle:[L.svgSize,L.communitySquircle,c],"aria-hidden":!0,innerStyles:{primary:_!=null?_:L.primaryFill}})})),m.jsx(r("WAWebSquircleStroke.react"),{})]}):n===o("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP&&o("WAWebCommunityGatingUtils").communityGeneralChatUIEnabled()?g=m.jsx(o("WAWebCommunityGeneralChatImage.react").CommunityGeneralChatImage,{}):g=m.jsx(o("WAWebDefaultGroupRefreshedIcon.react").DefaultGroupRefreshedIcon,{iconXstyle:[L.svgSize,L.circleIconRefreshed,L.profilePictureOutlineRefreshed,p,c],"aria-hidden":!0,innerStyles:{primary:_!=null?_:L.primaryFill}}):r("WAWebWid").isBroadcast(a)?g=m.jsx("div",babelHelpers.extends({},(u||(u=r("stylex"))).props(L.svgSize,L.circleIconRefreshed,L.profilePictureOutlineRefreshed,L.broadcastIconContainer,c),{children:m.jsx(r("WDSIconWdsIcBroadcastMessageFill.react"),{xstyle:L.broadcastIconOuter,iconXstyle:L.svgSize,"aria-hidden":!0})})):r("WAWebWid").isPSA(a)?g=m.jsx(o("WAWebWaChatPsaIcon.react").WaChatPsaIcon,{iconXstyle:[L.svgSize,L.avatarDefaultPSA,c],"aria-hidden":!0}):r("WAWebWid").isNewsletter(a)&&(g=m.jsx(o("WAWebDefaultNewsletterIcon.react").DefaultNewsletterIcon,{iconXstyle:[L.svgSize,L.newsletter,c],"aria-hidden":!0,innerStyles:{primary:L.primaryFill,background:L.backgroundFill}}));var h=m.createElement("div",babelHelpers.extends({},{0:{className:"x10l6tqk x13vifvy x1o0tod x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d"},4:{className:"x10l6tqk x13vifvy x1o0tod x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xfimr68 x1jpgh95"},2:{className:"x10l6tqk x13vifvy x1o0tod x78zum5 x6s0dn4 xl56j7k xgd8bvy x1fgtraw"},6:{className:"x10l6tqk x13vifvy x1o0tod x78zum5 x6s0dn4 xl56j7k xfimr68 x1jpgh95 xgd8bvy x1fgtraw"},1:{className:"x13vifvy x1o0tod x6s0dn4 xl56j7k xh8yej3 x5yr21d x1n2onr6 x1lliihq"},5:{className:"x13vifvy x1o0tod x6s0dn4 xl56j7k xh8yej3 x5yr21d xfimr68 x1jpgh95 x1n2onr6 x1lliihq"},3:{className:"x13vifvy x1o0tod x6s0dn4 xl56j7k xgd8bvy x1fgtraw x1n2onr6 x1lliihq"},7:{className:"x13vifvy x1o0tod x6s0dn4 xl56j7k xfimr68 x1jpgh95 xgd8bvy x1fgtraw x1n2onr6 x1lliihq"}}[(s===R.Status)<<2|(s===R.MediaHub)<<1|(s===R.GroupStatus)<<0],{key:"default"}),g);return s===R.GroupChatProfilePicture&&(h=m.jsx("div",{className:"x10l6tqk x13vifvy x1o0tod x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d",children:m.jsx(o("WAWebDefaultUserColorIcon.react").DefaultUserColorIcon,{iconXstyle:[L.svgSize,c],xstyle:f})},"default")),h}M.displayName=M.name+" [from "+i.id+"]";function w(e,t){return!!(e!=null&&t&&o("WAWebChatEphemerality").isEphemeralSettingOn(t)&&!o("WAWebEphemeralityFrontendUtils").isEphemeralityDisabledInUIForChat(t))}function A(e){var t;return o("WAWebBotGroupGatingUtils").isOpenGroupBotParticipantAddEnabled()&&(e==null||(t=e.groupMetadata)==null?void 0:t.isOpenBotGroup)===!0}l.DetailImageSize=b,l.DetailImageQuality=v,l.DetailImageShape=S,l.DefaultIconThemeType=R,l.DetailImageCommon=k,l.getSize=$,l.DetailImage=P,l.ImageIcon=N,l.DefaultIcon=M}),226); __d("WAWebFormatComponentUtils",[],(function(t,n,r,o,a,i){function e(e){var t=typeof e=="string"?[e]:[].concat(e);return typeof t[0]=="string"&&(t[0]=t[0].replace(" ","")),t}i.removeFirstLeadingSpace=e}),66); __d("WAWebBlockQuoteMutatorComponent.react",["WABidi","WAWebCopyPasteSelectable.react","WAWebFormatComponentUtils","WAWebL10N","WAWebUISpacing","react","stylex"],(function(t,n,r,o,a,i,l){var e,s,u=e||(e=r("react")),c={quote:{display:"x1rg5ohu",position:"x1n2onr6",width:"xh8yej3",color:"xhslqc4",$$css:!0},quotedColor:{color:"x15rks2t",borderTopColor:"x1b4hy2t",borderInlineEndColor:"x1273586",borderBottomColor:"x1tnzt7h",borderInlineStartColor:"x1mi4oqr",$$css:!0}};function d(e){var t=e.children,n=t===void 0?"":t,a=e.inline,i=a===void 0?!1:a,l=e.quoted,d=l===void 0?!1:l,m=e.selectable,p=e.text,_=o("WABidi").dir(p),f=_==="rtl"!==r("WAWebL10N").isRTL(),g="> ";return i?u.jsx(o("WAWebCopyPasteSelectable.react").SelectableSpan,{dir:_,selectable:m,prePlainText:g,className:{0:"xt0psk2 x14atkfc xhslqc4 xct1zlm x1t7ytsu x19mw7rs x7phf20 xaso8d8",2:"xt0psk2 x14atkfc x15rks2t x1b4hy2t x1273586 x1tnzt7h xct1zlm x1t7ytsu x19mw7rs x7phf20 xaso8d8",1:"xt0psk2 x14atkfc xct1zlm x1t7ytsu x7phf20 xaso8d8 xhslqc4 x1if355w x18b5jzi xp93uhy x1p8j9ns x1gabggj",3:"xt0psk2 x14atkfc xct1zlm x1t7ytsu x7phf20 xaso8d8 x15rks2t x1b4hy2t x1tnzt7h x1mi4oqr x1if355w x18b5jzi xp93uhy x1p8j9ns x1gabggj"}[!!d<<1|!!f<<0],children:n}):u.jsxs(o("WAWebCopyPasteSelectable.react").SelectableBlockQuote,{dir:_,selectable:m,prePlainText:g,className:(s||(s=r("stylex")))([c.quote,d&&c.quotedColor,!d&&o("WAWebUISpacing").uiMargin.vert4]),children:[u.jsx("div",babelHelpers.extends({},{0:{className:"x10l6tqk x1o0tod x13vifvy x5yr21d x1g8rjiy x1518k6t xkqq1k2 x91jh78 x1xkn691 x4oqio7"},2:{className:"x10l6tqk x1o0tod x13vifvy x5yr21d x1g8rjiy x1518k6t xkqq1k2 x91jh78 x1xkn691 x4oqio7 xtijo5x"},1:{className:"x10l6tqk x1o0tod x13vifvy x5yr21d x1g8rjiy xkqq1k2 x91jh78 x1xkn691 x4oqio7 xtwfq29"},3:{className:"x10l6tqk x1o0tod x13vifvy x5yr21d x1g8rjiy xkqq1k2 x91jh78 x1xkn691 x4oqio7 xtijo5x xtwfq29"}}[!!f<<1|!!d<<0])),u.jsx("div",babelHelpers.extends({},{0:{className:"x1rg5ohu x1gx403c xj0a0fe xeaf4i8"},1:{className:"x1rg5ohu xj0a0fe xeaf4i8 x1c1uobl x1q3ajuy"}}[!!f<<0],{children:o("WAWebFormatComponentUtils").removeFirstLeadingSpace(n)}))]})}d.displayName=d.name+" [from "+i.id+"]",l.default=d}),98); __d("WAWebBulletedListItemMutatorComponent.react",["fbt","WABidi","WAWebCopyPasteSelectable.react","WAWebFormatComponentUtils","WAWebL10N","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react"));function c(e){if(!(e==null||e===""))return o("WABidi").dir(e)}function d(e){var t=c(e)==="rtl";return t!==r("WAWebL10N").isRTL()}function m(e){var t=e.children,n=t===void 0?"":t,r=e.inline,a=r===void 0?!1:r,i=e.selectable,l=e.symbol,c=e.text;if(a)return u.jsxs(o("WAWebCopyPasteSelectable.react").SelectableSpan,{selectable:i,children:[s._(/*BTDS*/"\u2022"),n]});var m=l+" ";return u.jsx("li",babelHelpers.extends({dir:"auto"},{0:{className:"x1g0dm76 x1jieuv1 xo7wnuk x1gznph8 x1rkpvhg xlu7um4 xm78dhd x1r4uxqn"},1:{className:"x1jieuv1 xo7wnuk xlu7um4 xm78dhd x1r4uxqn xp4054r x1c1uobl xpdmqnj xh6kr0w xl717p"}}[!!d(c)<<0],{children:u.jsx(o("WAWebCopyPasteSelectable.react").SelectableSpan,{selectable:i,prePlainText:m,children:o("WAWebFormatComponentUtils").removeFirstLeadingSpace(n)})}))}m.displayName=m.name+" [from "+i.id+"]",l.default=m}),226); __d("WAWebNumberedListItemMutatorComponent.react",["WABidi","WAWebCopyPasteSelectable.react","WAWebFormatComponentUtils","WAWebL10N","WAWebUISpacing","react","stylex"],(function(t,n,r,o,a,i,l){var e,s,u=e||(e=r("react")),c={dirMismatch:{textAlign:"xp4054r",listStylePosition:"x1cy9i3i",$$css:!0}};function d(e){if(!(e==null||e===""))return o("WABidi").dir(e)}function m(e){var t=d(e)==="rtl";return t!==r("WAWebL10N").isRTL()}function p(e){var t=e.children,n=t===void 0?"":t,a=e.inline,i=a===void 0?!1:a,l=e.numbering,d=e.selectable,p=e.text;if(i)return u.jsxs(o("WAWebCopyPasteSelectable.react").SelectableSpan,{selectable:d,children:[l,n]});var _=l+" ";return u.jsx("li",babelHelpers.extends({dir:"auto",value:l.replace(".","")},(s||(s=r("stylex"))).props([m(p)&&c.dirMismatch,o("WAWebUISpacing").uiPadding.start2]),{children:u.jsx(o("WAWebCopyPasteSelectable.react").SelectableSpan,{selectable:d,prePlainText:_,children:o("WAWebFormatComponentUtils").removeFirstLeadingSpace(n)})}))}p.displayName=p.name+" [from "+i.id+"]",l.default=p}),98); __d("WAWebTextMutatorComponentUtils",["WAWebBulletedListItemMutatorComponent.react","WAWebNumberedListItemMutatorComponent.react"],(function(t,n,r,o,a,i,l){function e(e){var t=Array.isArray(e)?e:[e],n=[],o=[];for(var a of t)if(typeof a=="string"&&a.match(/^\r?\n$/)&&o.length)o.push(a);else if(a!=null&&typeof a=="object"&&(a.type===r("WAWebBulletedListItemMutatorComponent.react")||a.type===r("WAWebNumberedListItemMutatorComponent.react")))o.push(a);else{var i=a;o.length&&(n.push({isList:!0,children:o}),o=[],typeof i=="string"&&(i=i.replace(/^\r?\n/g,""))),n.push({isList:!1,children:i})}return o.length&&n.push({isList:!0,children:o}),n}l.groupListChildren=e}),98); __d("WAWebBulletedListMutatorComponent.react",["WAWebL10N","WAWebTextMutatorComponentUtils","WAWebUISpacing","react","stylex"],(function(t,n,r,o,a,i,l){var e,s,u=e||(e=r("react")),c={ul:{wordBreak:"x13faqbe",whiteSpace:"xeaf4i8",position:"x1n2onr6",$$css:!0}};function d(e){var t=e.children,n=t===void 0?"":t,a=e.inline,i=a===void 0?!1:a,l=e.largerIndentation,d=l===void 0?!1:l,m=e.quoted,p=m===void 0?!1:m;if(i)return n;var _=[];return o("WAWebTextMutatorComponentUtils").groupListChildren(n).forEach(function(e,t){e.isList?_.push(u.jsx("ul",babelHelpers.extends({},(s||(s=r("stylex"))).props(c.ul,!p&&o("WAWebUISpacing").uiMargin.vert4,o("WAWebUISpacing").uiMargin.start18,d?o("WAWebUISpacing").uiMargin.start18:o("WAWebUISpacing").uiMargin.start8),{dir:r("WAWebL10N").isRTL()?"rtl":"ltr",children:e.children}),t)):_.push(e.children)}),_}d.displayName=d.name+" [from "+i.id+"]",l.default=d}),98); __d("WAWebFormatFilter",[],(function(t,n,r,o,a,i){function e(e,t){if(e.length===1)return e;for(var n=[],r;r=e.pop();){for(var o=r,a=o[0],i=o[3],l=o[4],s=t[l],u=s[0],c=s[2],d=!0,m=n.length,p=m-1;p>=0;--p){var _=n[p],f=_[2],g=_[3],h=_[4];if(!(a>g)){var y=t[h],C=y[0],b=y[2];if(i>f){if(cR&&(v=S,R=r[S][y[S]][0]);b.push(r[v][y[v]]),--y[v]<0&&(r.splice(v,1),y.splice(v,1))}return b}i.default=e}),66); __d("WAWebFormatParse",["WAUnicodeUtils","WAWebFormatFilter","WAWebFormatFlatten","WAWebFormatMatch","WAWebFormatParseTree"],(function(t,n,r,o,a,i,l){function e(e,t,n){return n===void 0&&(n=1/0),s(e,r("WAWebFormatFlatten")(t),n)}function s(e,t,n){n===void 0&&(n=1/0);var a=r("WAWebFormatMatch")(e,t,n),i=a.length?r("WAWebFormatParseTree")(e,r("WAWebFormatFilter")(a,t),t):{children:[{type:"text",value:e}]},l=o("WAUnicodeUtils").numCodepoints(e);return n=t.limit){var n=o("WAUnicodeUtils").toArray(e.value);n.length>=t.limit&&(n=n.slice(0,t.limit)),e.value=n.join(""),t.limit-=n.length}else t.limit-=e.value.length;return}else if(e.type&&e.type==="delimiter")return;for(var r=0;r(l=i.match[2]);){if(a<=l&&i.children.push({type:"text",value:e.substring(a,l+1)}),a=i.match[3]+1,i.mutator.fragment){var p=i.parent.children;p.pop(),p.push.apply(p,i.children)}l!==i.match[3]&&i.parent.children.push({type:"delimiter",value:e.substring(l+1,a)}),i=i.parent}a=10)for(var c=0;ch&&x>h&&(x=h);var $=c===!0&&!g,P=o("WAWebClassnames").classnamesConvertMeToStylexPlease(t.props.className,(s||(s=r("stylex")))(p&&f.ellipsify,y&&f.inlineblock,m&&f.displayBlock,b&&f.clickable,$&&f.dirMismatch,C&&f.multiline,S===!0&&f.preserveWhitespace,v===!0&&f.preformatted,l&&f.breakWord,t.props.xstyle)),N=k,M=r("WAWebFormat")(N,D,r("WAWebJsxSerializer.react"),void 0,x),w=t.state.ellipsified!=null||k.length>x,A=t.props.inferLinesDirection?t.$5(M,w):M,F=(e=t.props.title)!=null?e:t.state.text;return d.jsx(o("WAWebCopyPasteSelectable.react").Selectable,{"data-testid":void 0,className:P,dir:I,element:t.props.element,onClick:b,onKeyDown:b!=null?E:void 0,ref:t.refContainer,role:t.props.role,selectable:T,tabIndex:R!=null?Number(R):void 0,"aria-label":(n=t.props.ariaLabel)!=null?n:void 0,title:t.props.titlify?F:void 0,style:{minHeight:((a=t.props.minTextHeight)!=null?a:0)+"px"},children:A})},babelHelpers.assertThisInitialized(t)||babelHelpers.assertThisInitialized(t)}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.getElement=function(){return this.refContainer.current},t.getDerivedStateFromProps=function(t,n){var e,r=null,a=String((e=t.text)!=null?e:"");return a!==n.text&&(r={text:a}),o("WAWebUA").UA.supportsEmojiEllipsification||!t.ellipsify||r==null||C(a)||(r=babelHelpers.extends({},r,{ellipsified:null})),r},n.getWidth=function(){var e=this.refContainer.current;return e?e.getBoundingClientRect().width:0},n.componentDidUpdate=function(t,n){o("WAWebUA").UA.supportsEmojiEllipsification||!this.props.ellipsify||n.text===this.state.text||(C(this.state.text)?(this.$2(),this.$6()):this.$7())},n.componentWillUnmount=function(){this.$2.cancel()},t})(m);b.defaultProps={element:"span",emojiSize:g.SMALL,textLimit:1/0};var v=o("WAWebListenerHoc_DEPRECATED").ListenerHOC(b),S=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o=t||!n&&o.offsetLeft<=t)break;r++}return r}function E(e){if(e instanceof Element)switch(e.tagName){case"CODE":return["```","```"];case"STRONG":return["*","*"];case"EM":return["_","_"];case"DEL":return["~","~"];case"LI":return["* ",""];default:return null}return null}function k(e,t){for(var n=0,r=e.childNodes,o=0;o0){var a=s._(/*BTDS*/"Asignado a {agentName}",[s._param("agentName",t[0].name)]);n=f.jsx(o("WAWebChatAssignmentIcon.react").ChatAssignmentIcon,{width:18,height:12,xstyle:[o("WAWebUISpacing").uiMargin.end4,g.chatAssignmentIconAssignedToOthers],title:a})}else n=null;return n};function C(e){var t=e.contact,a=e.element,i=a===void 0?"span":a,l=e.highlightText,u=e.titlify,c=e.ellipsify,d=e.breakWord,p=e.you,C=p===void 0?!1:p,b=e.selectable,v=e.useShortName,S=v===void 0?!1:v,R=e.useDisplayName,L=R===void 0?!1:R,E=e.onClick,k=e.showLabelIcon,I=k===void 0?!1:k,T=e.showBusinessCheckmark,D=e.showNotifyName,x=D===void 0?!1:D,$=e.elevatedPushNamesEnabled,P=$===void 0?!1:$,N=e.useLiftMeUp,M=N===void 0?!1:N,w=e.useVerifiedName,A=w===void 0?!1:w,F=e.firstLabel,O=e.xstyle,B=e.showChatAssignmentIcon,W=B===void 0?!1:B,q=e.assignedAgents,U=q===void 0?[]:q,V=e.skipCheckMark,H=V===void 0?!1:V,G=e.showMessageYourselfName,z=G===void 0?!1:G,j=e.testid,K=e.isVerifiedNewsletter,Q=e.makeCheckmarkClickable,X=Q===void 0?!1:Q,Y=e.checkmarkLarge,J=Y===void 0?!1:Y,Z=e.truncateName,ee=e.emojiXstyle,te=e.containerXstyle,ne=e.tabIndex,re=o("useWAWebContactValues").useOptionalContactValues(t.id,[o("WAWebContactGetters").getIsPSA,o("WAWebContactGetters").getIsIAS,o("WAWebContactGetters").getIsCAPISupportAccount,o("WAWebFrontendContactGetters").getFormattedUser,o("WAWebFrontendContactGetters").getFormattedName,o("WAWebFrontendContactGetters").getFormattedShortName,o("WAWebFrontendContactGetters").getFormattedUsernameOrPhone,o("WAWebFrontendContactGetters").getDisplayName,o("WAWebContactGetters").getLabels,o("WAWebContactGetters").getName,o("WAWebContactGetters").getNotifyName,o("WAWebContactGetters").getIsMe,o("WAWebContactGetters").getVerifiedName,o("WAWebContactGetters").getId,o("WAWebFrontendContactGetters").getIsUsernameContact]);if(re==null)return"";var oe=re[0],ae=re[1],ie=re[2],le=re[3],se=re[4],ue=re[5],ce=re[6],de=re[7],me=re[8],pe=re[9],_e=re[10],fe=re[11],ge=re[12],he=re[13],ye=re[14],Ce;l!=null&&l!==""&&(Ce=o("WAWebFormatConfiguration").SearchName({terms:[l]}));var be=h({contact:t,showNotifyName:x,elevatedPushNamesEnabled:P,useLiftMeUp:M,useDisplayName:L,useShortName:S,useVerifiedName:A,you:C,showMessageYourselfName:z,isUsernameContact:ye}),ve=be.displayName,Se=be.displayNameAriaLabel;if(!ve)return o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["displayName:",",\n formattedName:",",\n name:",",\n formattedShortName:",",\n formattedUser:",""])),ve,se,pe,ue,le).sendLogs("display name is null or undefined"),"";var Re=o("WAWebLidMigrationUtils").getShouldShowLidDebugUI(he)&&n("cr:17281"),Le=r("WAReplaceRepeatingWhitespace")(ve.toString()),Ee=f.jsxs("div",babelHelpers.extends({},{0:{className:"x78zum5"},1:{className:"xuxw1ft x6ikm8r x10wlt62 xlyipyv x78zum5"}}[(Z===!0)<<0],{children:[f.jsx(o("WAWebEmojiText.react").EmojiText,{text:Le,ariaLabel:Se!=null?r("WAReplaceRepeatingWhitespace")(Se.toString()):void 0,element:i,className:o("WAWebClassnames").classnamesConvertMeToStylexPlease(null,e.className),formatters:Ce,titlify:u,ellipsify:c,breakWord:d,tabIndex:ne,direction:"auto",selectable:b,inlineblock:!0,onClick:E,role:E!=null?"link":void 0,xstyle:O,testid:void 0,emojiXstyle:ee}),z&&f.jsx(o("WAWebEmojiText.react").EmojiText,{emojiXstyle:ee,testid:void 0,text:s._(/*BTDS*/"(T\u00fa)"),xstyle:g.spaceBefore}),Re&&n("cr:17281")&&f.jsx(n("cr:17281"),{})]})),ke=e.labels||me;ke!=null&&ke.length&&F!=null&&r("WAArrayMoveToFirst")(ke,F);var Ie=o("WAWebListsGatingUtils").isListsEnabled(),Te=I===!0&&ke!=null&&ke.length?f.jsx(o("WAWebLabels.react").Labels,{labels:ke,showName:!1,iconXstyle:o("WAWebUISpacing").uiPadding.start4,isListsFeatureEnabled:Ie}):null,De=!H&&(oe||ae||ie||!!T||K),xe=W?y(U):null;if(De===!0){var $e;if(o("WAWebMiscGatingUtils").isBlueEnabled()){var Pe=J?24:16;$e=X&&E?f.jsx(r("WAWebSvgButton.react"),{height:Pe,width:Pe,Icon:o("WAWebPsaVerifiedBlueIcon.react").PsaVerifiedBlueIcon,"aria-label":s._(/*BTDS*/"Informaci\u00f3n verificada"),onClick:E}):f.jsx(o("WAWebPsaVerifiedBlueIcon.react").PsaVerifiedBlueIcon,{height:Pe,width:Pe})}else $e=f.jsx(o("WAWebPsaVerifiedIcon.react").PsaVerifiedIcon,{});return f.jsxs("div",babelHelpers.extends({},(_||(_=r("stylex"))).props(o("WAWebNewsletterName.react").styles.verified),{children:[Ee,f.jsx("div",babelHelpers.extends({},_.props(K===!0?o("WAWebNewsletterName.react").styles.newsletterIcon:[g.icon,o("WAWebUISpacing").uiMargin.top1,o("WAWebUISpacing").uiMargin.start3]),{children:$e})),f.jsxs("div",{className:"x3nfvp2 x6s0dn4 x5yr21d x1eqw3am x16dsc37",children:[xe,Te]})]}))}return xe||Te?f.jsxs("div",babelHelpers.extends({},(_||(_=r("stylex"))).props(o("WAWebNewsletterName.react").styles.verified),{children:[Ee,f.jsxs("div",{className:"x3nfvp2 x6s0dn4 x5yr21d x1eqw3am x16dsc37",children:[xe,Te]})]})):f.jsx("div",babelHelpers.extends({},(_||(_=r("stylex"))).props(o("WAWebNewsletterName.react").styles.verified,te),{children:Ee}))}C.displayName=C.name+" [from "+i.id+"]";function b(e){"use no forget";var t,a=e.chat,i=e.element,l=e.highlightText,u=e.titlify,c=e.ellipsify,d=e.breakWord,m=e.onClick,p=e.showLabelIcon,h=e.firstLabel,C=e.className,b=e.xstyle,v=e.showChatAssignmentIcon,S=v===void 0?!1:v,R=e.assignedAgents,L=R===void 0?[]:R,E=e.testid,k=e.overrideCommunityAnnouncementGroupName,I=k===void 0?!1:k,T=e.checkmarkLarge,D=T===void 0?!1:T,x,$=o("useWAWebChatValues").useChatValues(e.chat.id,[o("WAWebFrontendChatGetters").getFormattedTitle,o("WAWebChatGetters").getLabels]),P=$[0],N=$[1],M=o("useWAWebModelValues").useModelValues(e.groupMetadata,["support","isUnnamed","participants","groupType","isLidAddressingMode","isCag","parentGroup"]),w=o("useWAWebForceUpdate").useForceUpdateDONOTUSE();o("useWAWebListener").useListener(M.participants,"bulk_add bulk_remove reset sort change:isAdmin change:isSuperAdmin remove add",w),l!=null&&l!==""&&(x=o("WAWebFormatConfiguration").SearchName({terms:[l]}));var A=e.labels||N;A!=null&&A.length&&h!=null&&r("WAArrayMoveToFirst")(A,h);var F=p===!0&&A!=null&&A.length?f.jsx(o("WAWebLabels.react").Labels,{labels:A,showName:!1}):null,O=I&&M.groupType===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?s._(/*BTDS*/"Avisos"):r("WAReplaceRepeatingWhitespace")(M!=null&&M.isUnnamed?o("WAWebParticipantListUtils").calculateUnnamedGroupFullParticipantsList(M,!0):a.title()),B=o("WAWebLidMigrationUtils").getShouldShowLidDebugUIForGroups(M.isLidAddressingMode),W=M.parentGroup,q=W?((t=r("WAWebGroupMetadataCollection").get(W))==null?void 0:t.isLidAddressingMode)===!0:!1,U=o("WAWebLidMigrationUtils").getShouldShowLidDebugUIForGroups(q),V=f.jsxs(f.Fragment,{children:[f.jsx(o("WAWebEmojiText.react").EmojiText,{text:O,element:i,className:C,xstyle:b,formatters:x,titlify:u,ellipsify:c,breakWord:d,direction:"auto",inlineblock:!0,onClick:m,testid:void 0}),B&&n("cr:17281")&&f.jsx(n("cr:17281"),{isCAG:M.isCag}),U&&n("cr:17281")&&f.jsx(n("cr:17281"),{isParentGroup:!0})]}),H=M.support;if(H){var G=D?24:20;return f.jsxs("div",babelHelpers.extends({},(_||(_=r("stylex"))).props(o("WAWebNewsletterName.react").styles.verified,!!F&&g.hasLabels),{children:[V,f.jsx("div",babelHelpers.extends({},_.props(g.icon,o("WAWebUISpacing").uiMargin.top1,o("WAWebUISpacing").uiMargin.start3),{children:o("WAWebMiscGatingUtils").isBlueEnabled()?f.jsx(o("WAWebPsaVerifiedBlueIcon.react").PsaVerifiedBlueIcon,{width:G,height:G}):f.jsx(o("WAWebPsaVerifiedIcon.react").PsaVerifiedIcon,{})})),f.jsx("div",babelHelpers.extends({},_.props(g.labels,o("WAWebUISpacing").uiMargin.start8),{children:F}))]}))}var z=S?y(L):null;return z||F?f.jsxs("span",{className:"x1jfb8zj xuce83p x1bft6iq x1i7k8ik xq9mrsl x11t971q",children:[V,f.jsxs("div",babelHelpers.extends({},(_||(_=r("stylex"))).props(g.labels,o("WAWebUISpacing").uiMargin.start8),{children:[z,F]}))]}):V}b.displayName=b.name+" [from "+i.id+"]";function v(t){var n,r,a=(n=o("useWAWebChatValues").useOptionalChatValues((r=t.chat)==null?void 0:r.id,[o("WAWebChatGetters").getIsUser,o("WAWebChatGetters").getIsNewsletter,o("WAWebChatGetters").getIsBroadcast,o("WAWebFrontendChatGetters").getGroupMetadata,o("WAWebFrontendChatGetters").getFormattedTitle]))!=null?n:[!1,!1,!1,null,null],i=a[0],l=a[1],s=a[2],m=a[3],p=a[4];if(t.chat&&m!=null&&!i&&!l&&!s){var _=t.chat,g=t.selectable,h=babelHelpers.objectWithoutPropertiesLoose(t,e);return f.jsx(o("WAWebErrorBoundary.react").ErrorBoundary,{name:"group-name",fallback:function(){return f.jsx("span",{children:p})},children:f.jsx(b,babelHelpers.extends({chat:_,groupMetadata:m},h))})}if(t.chat&&!i&&l){var y=t.chat,v=t.selectable,S=babelHelpers.objectWithoutPropertiesLoose(t,u);return f.jsx(o("WAWebNewsletterName.react").NewsletterName,babelHelpers.extends({chat:y,selectable:v},S))}if(t.chat&&s){var R=t.breakWord,L=t.chat,E=t.className,k=t.element,I=t.ellipsify,T=t.highlightText,D=t.onClick,x=t.selectable,$=t.testid,P=t.titlify,N=t.xstyle;return f.jsx(o("WAWebErrorBoundary.react").ErrorBoundary,{name:"broadcast-name",fallback:function(){return f.jsx("span",{children:p})},children:f.jsx(o("WAWebBroadcastName.react").BroadcastName,{chat:L,breakWord:R,className:E,element:k,ellipsify:I,highlightText:T,onClick:D,selectable:x,testid:void 0,titlify:P,xstyle:N})})}var M,w;if(t.chat){var A=t.chat,F=babelHelpers.objectWithoutPropertiesLoose(t,c);M=A.contact,w=F}else{var O=t.contact,B=babelHelpers.objectWithoutPropertiesLoose(t,d);M=O,w=B}return f.jsx(C,babelHelpers.extends({contact:M},w))}v.displayName=v.name+" [from "+i.id+"]";function S(e){var t=e.chat,n=e.contact,o=e.xstyle;return f.jsxs("span",babelHelpers.extends({},(_||(_=r("stylex"))).props(o),{children:[f.jsx(v,{contact:n,useShortName:!!n.shortName,showNotifyName:!0,elevatedPushNamesEnabled:!0,useLiftMeUp:!0}),f.jsx("span",{children:"\xA0\u2022\xA0"}),t.groupMetadata&&f.jsx(b,{chat:t,groupMetadata:t.groupMetadata})]}))}S.displayName=S.name+" [from "+i.id+"]",l.ContactName=C,l.GroupName=b,l.Name=v,l.ContactAndGroupName=S}),226); __d("WAWebActions",["fbt","$InternalEnum"],(function(t,n,r,o,a,i,l,s){var e=n("$InternalEnum").Mirrored(["CONTACT_US","DECREASE_PTT_SPEED","GO_TO_NEXT_CHAT","GO_TO_PREV_CHAT","INCREASE_PTT_SPEED","LOGOUT","OPEN_NEW_CHAT","OPEN_NEW_GROUP","OPEN_PROFILE","OPEN_SETTINGS","CLOSE_CHAT","SEARCH","SEARCH_IN_CHAT","TOGGLE_ARCHIVE","TOGGLE_MUTE","TOGGLE_PIN","TOGGLE_UNREAD","OPEN_EMOJI_PANEL","OPEN_GIF_PANEL","OPEN_STICKER_PANEL","TOGGLE_STICKER_MAKER","TOGGLE_COMMAND_PALETTE","LOCK_SCREEN","LABEL_CHAT","TOGGLE_BOLD","TOGGLE_ITALIC","TOGGLE_STRIKETHROUGH","TOGGLE_CODE","TOGGLE_INLINE_CODE","TOGGLE_NUMBERED_LIST","TOGGLE_BULLETED_LIST","TOGGLE_QUOTE","TOGGLE_THEME","ZOOM_IN","ZOOM_OUT","ZOOM_RESET","OPEN_CHAT_INFO","BLOCK_CHAT","REPLY","REPLY_PRIVATE","FORWARD","STAR_MESSAGE","OPEN","OPEN_ATTACHMENT_DROPDOWN","START_PTT_RECORDING","PAUSE_PTT_RECORDING","SEND_PTT","EDIT_LAST_MESSAGE","OPEN_NTH_CHAT","TOGGLE_CALL_CAMERA","TOGGLE_CALL_MUTE","SHOW_CALL_REACTIONS","TOGGLE_RAISE_HAND","START_SCREEN_SHARE","END_CALL"]);function u(t){switch(t){case e.TOGGLE_UNREAD:return s._(/*BTDS*/"Marcar como no le\u00eddo");case e.TOGGLE_MUTE:return s._(/*BTDS*/"Silenciar");case e.TOGGLE_ARCHIVE:return s._(/*BTDS*/"Archivar chat");case e.TOGGLE_PIN:return s._(/*BTDS*/"Fijar chat");case e.SEARCH:return s._(/*BTDS*/"Buscar");case e.SEARCH_IN_CHAT:return s._(/*BTDS*/"Buscar en el chat");case e.OPEN_NEW_CHAT:return s._(/*BTDS*/"Nuevo chat");case e.GO_TO_NEXT_CHAT:return s._(/*BTDS*/"Chat siguiente");case e.GO_TO_PREV_CHAT:return s._(/*BTDS*/"Chat anterior");case e.CLOSE_CHAT:return s._(/*BTDS*/"Cerrar chat");case e.OPEN_NEW_GROUP:return s._(/*BTDS*/"Nuevo grupo");case e.OPEN_PROFILE:return s._(/*BTDS*/"Perfil e Info.");case e.INCREASE_PTT_SPEED:return s._(/*BTDS*/"Aumentar la velocidad del mensaje de voz seleccionado");case e.DECREASE_PTT_SPEED:return s._(/*BTDS*/"Reducir la velocidad del mensaje de voz seleccionado");case e.OPEN_SETTINGS:return s._(/*BTDS*/"Ajustes");case e.OPEN_EMOJI_PANEL:return s._(/*BTDS*/"Panel de emojis");case e.OPEN_GIF_PANEL:return s._(/*BTDS*/"Panel de GIF");case e.OPEN_STICKER_PANEL:return s._(/*BTDS*/"Panel de stickers");case e.LOCK_SCREEN:return s._(/*BTDS*/"Bloquear aplicaci\u00f3n");case e.LABEL_CHAT:return s._(/*BTDS*/"Etiquetar chat");case e.TOGGLE_COMMAND_PALETTE:return s._(/*BTDS*/"Ampliar b\u00fasqueda");case e.ZOOM_IN:return s._(/*BTDS*/"Ampliar imagen");case e.ZOOM_OUT:return s._(/*BTDS*/"Reducir imagen");case e.ZOOM_RESET:return s._(/*BTDS*/"Restablecer zoom");case e.OPEN_CHAT_INFO:return s._(/*BTDS*/"Abrir informaci\u00f3n del chat");case e.BLOCK_CHAT:return s._(/*BTDS*/"Bloquear chat");case e.REPLY:return s._(/*BTDS*/"Responder");case e.REPLY_PRIVATE:return s._(/*BTDS*/"Responder en privado");case e.FORWARD:return s._(/*BTDS*/"Reenviar");case e.STAR_MESSAGE:return s._(/*BTDS*/"Destacar mensaje");case e.OPEN_ATTACHMENT_DROPDOWN:return s._(/*BTDS*/"Abrir men\u00fa desplegable de archivos adjuntos");case e.START_PTT_RECORDING:return s._(/*BTDS*/"Iniciar grabaci\u00f3n PTT");case e.PAUSE_PTT_RECORDING:return s._(/*BTDS*/"Pausar grabaci\u00f3n de audio");case e.SEND_PTT:return s._(/*BTDS*/"Enviar PTT");case e.EDIT_LAST_MESSAGE:return s._(/*BTDS*/"Editar el \u00faltimo mensaje");case e.OPEN_NTH_CHAT:return s._(/*BTDS*/"Abrir chat");case e.TOGGLE_CALL_CAMERA:return s._(/*BTDS*/"Activar o desactivar c\u00e1mara");case e.TOGGLE_CALL_MUTE:return s._(/*BTDS*/"Activar o desactivar silencio");case e.SHOW_CALL_REACTIONS:return s._(/*BTDS*/"Reacciones");case e.TOGGLE_RAISE_HAND:return s._(/*BTDS*/"Levantar la mano");case e.START_SCREEN_SHARE:return s._(/*BTDS*/"Pantalla compartida");case e.END_CALL:return s._(/*BTDS*/"Finalizar llamada");default:return""}}l.Action=e,l.getLabel=u}),226); __d("WAWebKeyboardShortcuts",["$InternalEnum","WAWebActions","WAWebCallCollection","WAWebEnvironment","WAWebUA"],(function(t,n,r,o,a,i,l){var e,s=n("$InternalEnum").Mirrored(["Command","Option","Control"]),u={mac:[s.Command,s.Control],windows:[s.Control,s.Option]},c=function(){return{mac:o("WAWebUA").UA.browser==="firefox"?[s.Command,s.Control]:[s.Command],windows:[s.Option]}},d=["ArrowUp","ArrowDown","w","f","]","[","A","a","H","h","Backspace","Tab","{","}","Escape","n","N","p",",","/","F","E","M","P","U",">","<","e","g","G","s","S","k","l","b","B","Delete","DELETE","r","y","R","d","i","X","I","K","Shift+7","Shift+8","Shift+.","Shift+L","Shift+Tab","Enter"," ","7","8",".","*","&","t","+","=","-","_","0","F4","v","m"];function m(e){return d.includes(e)?e:null}function p(e){var t=r("WAWebEnvironment").isWindows;switch(e){case o("WAWebActions").Action.OPEN_NTH_CHAT:return[];case o("WAWebActions").Action.CONTACT_US:return[{key:"H"}];case o("WAWebActions").Action.GO_TO_NEXT_CHAT:{var n=[{key:"Tab",hybridKey:"]",hybridModifiers:[s.Control]},{key:"}"}];return t&&n.push({key:"}",hybridModifiers:[s.Control]},{key:"Tab",hybridModifiers:[s.Control]}),n}case o("WAWebActions").Action.GO_TO_PREV_CHAT:{var a=[{key:"Shift+Tab",hybridKey:"[",hybridModifiers:[s.Control]},{key:"{"}];return t&&a.push({key:"{",hybridModifiers:[s.Control]},{key:"Shift+Tab",hybridModifiers:[s.Control]}),a}case o("WAWebActions").Action.CLOSE_CHAT:{var i=[{key:"Escape",webModifiers:{mac:[],windows:[]}}];return t&&i.push({key:"w",hybridModifiers:[s.Control]},{key:"F4",hybridModifiers:[s.Control]}),i}case o("WAWebActions").Action.LOGOUT:return[];case o("WAWebActions").Action.OPEN_NEW_CHAT:{if(o("WAWebUA").UA.isSafari)return[{key:"N",webModifiers:{mac:[s.Control],windows:[]}}];var l=[{key:"n",hybridModifiers:[s.Control,s.Option]}];return t&&l.push({key:"n",hybridModifiers:[s.Control]}),l}case o("WAWebActions").Action.OPEN_NEW_GROUP:return[{key:"N",hybridModifiers:[s.Control]}];case o("WAWebActions").Action.OPEN_PROFILE:{var u=[{key:"p",hybridModifiers:[s.Control,s.Option]}];return t&&u.push({key:"p",hybridModifiers:[s.Control]}),u}case o("WAWebActions").Action.OPEN_SETTINGS:return[{key:",",hybridKey:"s",hybridModifiers:[s.Option]}];case o("WAWebActions").Action.SEARCH:{var d=[{webKey:"/"}];return t&&d.push({key:"f",hybridKey:"f",hybridModifiers:[s.Control]}),d}case o("WAWebActions").Action.SEARCH_IN_CHAT:return[{key:"F",webModifiers:{mac:[s.Command],windows:[s.Control]},hybridModifiers:[s.Control]}];case o("WAWebActions").Action.TOGGLE_ARCHIVE:return[{key:"E",hybridKey:"A",hybridModifiers:[s.Control]}];case o("WAWebActions").Action.TOGGLE_MUTE:return[{key:"M",hybridModifiers:[s.Control]}];case o("WAWebActions").Action.TOGGLE_PIN:return[{key:"P"}];case o("WAWebActions").Action.TOGGLE_UNREAD:return[{key:"U",hybridModifiers:[s.Control]}];case o("WAWebActions").Action.INCREASE_PTT_SPEED:return[{key:">",hybridKey:">",hybridModifiers:[]}];case o("WAWebActions").Action.DECREASE_PTT_SPEED:return[{key:"<",hybridKey:"<",hybridModifiers:[]}];case o("WAWebActions").Action.OPEN_EMOJI_PANEL:{var m=[{key:"e",hybridModifiers:[s.Control,s.Option]}];return t&&m.push({key:"E",hybridModifiers:[s.Control]}),m}case o("WAWebActions").Action.OPEN_GIF_PANEL:{var p=[{key:"g",hybridModifiers:[s.Control,s.Option]}];return t&&p.push({key:"G",hybridModifiers:[s.Control]}),p}case o("WAWebActions").Action.OPEN_STICKER_PANEL:{var _=[{key:"s",hybridModifiers:[s.Control,s.Option]}];return t&&_.push({key:"S",hybridModifiers:[s.Control]}),_}case o("WAWebActions").Action.TOGGLE_STICKER_MAKER:return[{key:"S"}];case o("WAWebActions").Action.TOGGLE_COMMAND_PALETTE:return[{key:"k",webModifiers:c(),hybridModifiers:[s.Option]}];case o("WAWebActions").Action.LABEL_CHAT:return[{key:"Shift+L",hybridModifiers:[s.Control,s.Command]}];case o("WAWebActions").Action.LOCK_SCREEN:return[{key:"l",hybridModifiers:[s.Option]}];case o("WAWebActions").Action.TOGGLE_BOLD:return[{key:"b",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.TOGGLE_ITALIC:return[{key:"i",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.TOGGLE_STRIKETHROUGH:return[{key:"X",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.TOGGLE_INLINE_CODE:return[{key:"I",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.TOGGLE_CODE:return[{key:"K",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.TOGGLE_NUMBERED_LIST:return[{key:"Shift+7",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.TOGGLE_BULLETED_LIST:return[{key:"Shift+8",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.TOGGLE_QUOTE:return[{key:"Shift+.",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.TOGGLE_THEME:return[{webKey:"t"}];case o("WAWebActions").Action.ZOOM_IN:return[{key:"+",webModifiers:{mac:[s.Command],windows:[s.Control]}},{key:"=",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.ZOOM_OUT:return[{key:"-",webModifiers:{mac:[s.Command],windows:[s.Control]}},{key:"_",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.ZOOM_RESET:return[{key:"0",webModifiers:{mac:[s.Command],windows:[s.Control]}}];case o("WAWebActions").Action.OPEN_CHAT_INFO:return[{key:"i",hybridKey:"i",webModifiers:{mac:[s.Option],windows:[s.Option]},hybridModifiers:[s.Option]}];case o("WAWebActions").Action.BLOCK_CHAT:return[{key:"B",hybridKey:"B",webModifiers:{mac:[s.Control],windows:[s.Control]},hybridModifiers:[s.Control]}];case o("WAWebActions").Action.REPLY:return[{key:"r",hybridKey:"r",webModifiers:{mac:[s.Option],windows:[s.Option]},hybridModifiers:[s.Option]}];case o("WAWebActions").Action.REPLY_PRIVATE:return[{key:"r",hybridKey:"r",webModifiers:{mac:[s.Control,s.Option],windows:[s.Control,s.Option]},hybridModifiers:[s.Control,s.Option]}];case o("WAWebActions").Action.FORWARD:return[{key:"d",hybridKey:"d",webModifiers:{mac:[s.Control,s.Option],windows:[s.Control,s.Option]},hybridModifiers:[s.Control,s.Option]}];case o("WAWebActions").Action.STAR_MESSAGE:return[{key:"8",hybridKey:"8",webModifiers:{mac:[s.Option],windows:[s.Option]},hybridModifiers:[s.Option]}];case o("WAWebActions").Action.EDIT_LAST_MESSAGE:return[{key:"ArrowUp",hybridKey:"ArrowUp",webModifiers:{mac:[s.Command],windows:[s.Command]},hybridModifiers:[s.Control]}];case o("WAWebActions").Action.OPEN:return[{key:"Enter",hybridKey:"Enter",hybridModifiers:[],webModifiers:{mac:[],windows:[]}}];case o("WAWebActions").Action.OPEN_ATTACHMENT_DROPDOWN:return[{key:"a",hybridKey:"a",webModifiers:{mac:[s.Option],windows:[s.Option]},hybridModifiers:[s.Option]}];case o("WAWebActions").Action.START_PTT_RECORDING:return[{key:"R",hybridKey:"R",webModifiers:{mac:[s.Control,s.Option],windows:[s.Control,s.Option]},hybridModifiers:[s.Control,s.Option]}];case o("WAWebActions").Action.PAUSE_PTT_RECORDING:return[{key:"p",hybridKey:"p",webModifiers:{mac:[s.Option],windows:[s.Option]},hybridModifiers:[s.Option]}];case o("WAWebActions").Action.SEND_PTT:return[{key:"Enter",hybridKey:"Enter",webModifiers:{mac:[s.Control],windows:[s.Control]},hybridModifiers:[s.Control]}];case o("WAWebActions").Action.TOGGLE_CALL_CAMERA:return[{key:"v"}];case o("WAWebActions").Action.TOGGLE_CALL_MUTE:return[{key:"m"}];case o("WAWebActions").Action.SHOW_CALL_REACTIONS:return[{key:"r"}];case o("WAWebActions").Action.TOGGLE_RAISE_HAND:return[{key:"h"}];case o("WAWebActions").Action.START_SCREEN_SHARE:return[{key:"s"}];case o("WAWebActions").Action.END_CALL:return[{key:"w"}]}}var _=C(Array.from((e=o("WAWebActions")).Action.members()),p),f=new Set([e.Action.TOGGLE_CALL_CAMERA,e.Action.TOGGLE_CALL_MUTE,e.Action.SHOW_CALL_REACTIONS,e.Action.TOGGLE_RAISE_HAND,e.Action.START_SCREEN_SHARE,e.Action.END_CALL]);function g(e){var t=e.hybridModifiers,n=e.modifiers,a=n.mac,i=n.windows,l=o("WAWebUA").UA.os===o("WAWebUA").OS_TYPE.MAC?a:i,s=r("WAWebEnvironment").isWindows;return s&&t.length!==0&&(l=t),l}function h(e,t){t===void 0&&(t=_);var n=e.altKey,o=e.ctrlKey,a=e.key,i=e.metaKey,l=e.shiftKey;if(!(a==="Control"||a==="Meta"||a==="Alt"||a==="Shift")){var u=b(a,l),c=m(u);if(c!=null){var d=t[c];if(d){var p=r("WAWebCallCollection").activeCall!=null,h=void 0,y=void 0;for(var C of d){var v=C.action,S=g(C),R=[S.includes(s.Command)===i,S.includes(s.Control)===o,S.includes(s.Option)===n].every(Boolean);R&&(p&&f.has(v)?y=v:h==null&&(h=v))}return y!=null?y:h}}}}function y(e){if(e.ctrlKey){if(e.deltaY<0)return o("WAWebActions").Action.ZOOM_IN;if(e.deltaY>0)return o("WAWebActions").Action.ZOOM_OUT}}function C(e,t){var n={};return e.forEach(function(e){t(e).forEach(function(t){var o=t.key,a=t.webKey,i=t.webModifiers,l=i===void 0?u:i,s=t.hybridModifiers,c=t.hybridKey,d=r("WAWebEnvironment").isWindows&&c?c:a!=null?a:o;d!=null&&(n[d]||(n[d]=[]),n[d].push({action:e,modifiers:l,hybridModifiers:s!=null?s:[]}))})}),Object.keys(n).forEach(function(e){n[e]=n[e].sort(function(e,t){return g(t).length-g(e).length})}),n}function b(e,t){if(t){if(e==="Tab"||e==="Enter"||e==="Backspace"||e===" "||e==="L")return"Shift+"+e;if(e>="a"&&e<="z")return e.toUpperCase();if(e==="Delete")return"DELETE";switch(e){case"7":case"&":return"Shift+7";case"8":case"*":return"Shift+8";case".":case">":return"Shift+."}}return/^[A-Z]$/.test(e)&&!t?e.toLowerCase():e}function v(e){var t=p(e);if(t.length){var n=r("WAWebEnvironment").isWindows,o=t[0],a=o.hybridKey,i=o.key,l=o.webKey;return n&&a?a:l!=null?l:i}}function S(e){var t=p(e);if(t.length){var n=t[0],a=n.webModifiers,i=a===void 0?u:a,l=n.hybridModifiers,c=o("WAWebUA").UA.os===o("WAWebUA").OS_TYPE.MAC,d=r("WAWebEnvironment").isWindows,m=c?i.mac:i.windows;return d&&l&&(m=l),m.map(function(e){switch(e){case s.Command:return"Cmd";case s.Option:return c?"Option":"Alt";case s.Control:return"Ctrl"}})}}function R(e){var t=[];for(var n of e)switch(n){case"Cmd":t.push("Super");break;case"Ctrl":t.push("Control");break;case"Alt":case"Option":t.push("Option");break}return t}var L={" ":"Space",DELETE:"Backspace",ArrowUp:"ArrowUp",ArrowDown:"ArrowDown",Tab:"Tab",Enter:"Enter",Backspace:"Backspace",Escape:"Escape","/":"/",",":",",".":".",">":">","<":"<","]":"]","[":"[","{":"{","}":"}","|":"|","*":"*","&":"&","+":"+","=":"=","-":"-",_:"_",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",A:"A",B:"B",C:"C",D:"D",E:"E",F:"F",G:"G",H:"H",I:"I",J:"J",K:"K",L:"L",M:"M",N:"N",O:"O",P:"P",Q:"Q",R:"R",S:"S",T:"T",U:"U",V:"V",W:"W",X:"X",Y:"Y",Z:"Z",a:"A",b:"B",c:"C",d:"D",e:"E",f:"F",g:"G",h:"H",i:"I",j:"J",k:"K",l:"L",m:"M",n:"N",o:"O",p:"P",q:"Q",r:"R",s:"S",t:"T",u:"U",v:"V",w:"W",x:"X",y:"Y",z:"Z"};function E(e){var t;if(e.startsWith("Shift+")){var n,r=e.substring(6);return(n=L[r])!=null?n:null}return(t=L[e])!=null?t:null}function k(e){var t=v(e);if(!t)return null;var n=E(t);if(!n)return null;var r=S(e),o=r?R(r):[];return t.startsWith("Shift+")&&!o.includes("Shift")&&o.push("Shift"),{modifiers:o.length>0?o:void 0,shortcutKeys:[n]}}l.Modifier=s,l.getAction=h,l.getActionFromMouseEvent=y,l.buildShortcutMap=C,l.getShortcutKey=v,l.getShortcutDisplayModifiers=S,l.getWDSShortcuts=k}),98); __d("WAWebNotificationTone",["Promise","WAWebNoop","bx"],(function(t,n,r,o,a,i,l){var e,s=new window.Audio(r("bx").getURL(r("bx")("9561")));function u(){s.play().catch(r("WAWebNoop"))}function c(t){return(e||(e=n("Promise"))).resolve(t)}l.playNotification=u,l.cachePath=c}),98); __d("WAWebBaseNotification",["Promise","WAAbortError","WALogger","WAWebBuildConstants","WAWebEnvironment","WAWebNotificationBanner","WAWebNotificationConstants","WAWebNotificationDeliveryWamEvent","WAWebNotificationHelpers","WAWebNotificationMuteReason","WAWebNotificationTone","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c=(function(){function t(){var t=this;this.creationAt=Date.now(),this.closeBanner=function(){t.notificationBanner!=null&&(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["WABaseNotification:_closeNotification()"]))),t.notificationBanner.close())}}var a=t.prototype;return a.shouldPlaySound=function(){return r("WAWebEnvironment").isWindows&&Number(o("WAWebBuildConstants").WINDOWS_BUILD)>=257300?!1:o("WAWebNotificationHelpers").shouldPlaySoundGranular()},a.shouldMute=function(t){return null},a.shouldShowBanner=function(){return o("WAWebNotificationHelpers").shouldEnableNotificationGranular()},a.shouldSquelch=function(){return null},a.shouldSuppressBanner=function(t){return t===r("WAWebNotificationMuteReason").GroupFlood||t===r("WAWebNotificationMuteReason").OfflineResumeInProgress},a.buildKey=function(){throw r("err")("WABaseNotification: must implement `buildKey` method")},a.getBannerOptions=function(){throw r("err")("WABaseNotification: must implement `getBannerOptions` method")},a.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){throw r("err")("WABaseNotification: must implement `getIcon` method")});function t(){return e.apply(this,arguments)}return t})(),a.matchesChat=function(t){return!1},a.beforeBannerShown=function(){return(u||(u=n("Promise"))).resolve()},a.afterBannerShown=function(t){},a.getChatKind=function(){throw r("err")("WABaseNotification: must implement `getChatKind` method")},a.getNotificationDeliveryWamEventData=function(){return null},a.performLogging=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield this.getNotificationDeliveryWamEventData();t!=null&&new(o("WAWebNotificationDeliveryWamEvent")).NotificationDeliveryWamEvent({uiNotificationType:t.uiNotificationType,isSilenced:e,triggeredByOfflineMessage:t.triggeredByOfflineMessage}).commit()});function t(t){return e.apply(this,arguments)}return t})(),a.isReplyable=function(){return!1},a.triggerNotification=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield this.shouldMute(e);t||(t=yield this.shouldSquelch()),t&&o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["WABaseNotification:triggerNotification muteReason ",""])),t);var n=!1;if(t)if(this.shouldSuppressBanner(t))n=!0;else throw new(o("WAAbortError")).AbortError("Notification mute/squelched "+t);var a;return(yield this.shouldShowBanner())&&((r("WAWebEnvironment").isWindows||!n)&&(yield this.beforeBannerShown(),a=yield this.showBanner(n),this.afterBannerShown(a)),yield this.performLogging(n)),!t&&(yield this.shouldPlaySound())&&this.playSound(),a});function t(t){return e.apply(this,arguments)}return t})(),a.showBanner=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){e===void 0&&(e=!1),this.abortController=new AbortController;var t=this.getBannerOptions(),n=yield this.getIcon();if(this.abortController.signal.aborted)throw new(o("WAAbortError")).AbortError("Aborted through abortController");if(!r("WAWebEnvironment").isWindows&&window.Notification.permission!==o("WAWebNotificationConstants").PERMISSION_ALLOWED)throw new(o("WAAbortError")).AbortError("Permission Denied");var a=new(r("WAWebNotificationBanner"))(babelHelpers.extends({},t,{icon:n,key:this.buildKey(),isReplyable:this.isReplyable(),suppressBanner:e}));return this.notificationBanner=a,a});function t(t){return e.apply(this,arguments)}return t})(),a.playSound=function(){o("WAWebNotificationTone").playNotification()},t})();l.WABaseNotification=c}),98); __d("WAWebBannerContextMenuActions",["$InternalEnum"],(function(t,n,r,o,a,i){var e=n("$InternalEnum").Mirrored(["None","MuteChatForEightHours","MuteChatForOneWeek","MuteChat","DisableNotifications"]),l=e;i.default=l}),66); __d("WAWebMuteExpirations",["fbt","WAWeb-moment","WAWebClock"],(function(t,n,r,o,a,i,l,s){var e=[{getLabel:function(){return s._(/*BTDS*/"8 horas")},duration:8,radioId:"8-hours"},{getLabel:function(){return s._(/*BTDS*/"1 semana")},duration:168,radioId:"1-week"},{getLabel:function(){return s._(/*BTDS*/"Siempre")},duration:Number.POSITIVE_INFINITY,radioId:"always"}];function u(){return e[0].duration}function c(e){return e===Number.POSITIVE_INFINITY?o("WAWebClock").MUTE_ALWAYS_EXPIRATION_SENTINEL:e*60*60+r("WAWeb-moment")().unix()}l.ALL_MUTE_DURATIONS=e,l.getDefaultMuteDuration=u,l.calculateMuteExpiration=c}),226); __d("WAWebBaseNotificationBanner",["Promise","WALogger","WATypeUtils","WAWebBannerContextMenuActions","WAWebChatCollection","WAWebChatEntryPoint","WAWebChatMessageSearch","WAWebCmd","WAWebComposeBoxActions","WAWebEnvironment","WAWebGroupType","WAWebL10N","WAWebModalManager","WAWebMsgCollection","WAWebMsgType","WAWebMuteCollection","WAWebMuteExpirations","WAWebNewsletterCollection","WAWebNoop","WAWebSendTextMsgChatAction","WAWebUserPrefsGeneral","asyncToGeneratorRuntime","cr:3133"],(function(t,n,r,o,a,i,l){var e=["contextMenuItems","footer","isReplyable","notification","renotify","suppressBanner","title"],s,u,c,d,m,p,_,f=(s=n("cr:3133"))!=null?s:{},g=f.closeMessageNotification,h=f.showMessageNotification,y=(function(){function t(e,t,a,i,l){var s=this,c;this.isReplyable=!1,this.close=function(){s.$3().then(function(){s.notification&&o("WATypeUtils").isFunction(s.notification.close)&&s.notification.close(),g==null||g(s.key,s.tag)}).catch(r("WAWebNoop"))},this.$4=function(){s.waitingPromise.resolver(),window.removeEventListener("beforeunload",s.close);var e=s.notification;e&&(e.removeEventListener("click",s.$5),e.removeEventListener("close",s.$4)),s.msg&&s.msg.off("change:type",s.$6)},this.$5=function(){s.$1==null||s.$1(),window.focus();var e=s.chat,t=s.msg,n=s.doNotOpenChat==null?!1:s.doNotOpenChat;if(e){if(!n){var a,i,l=t&&t!==e.msgs.last()?o("WAWebChatMessageSearch").getSearchContext(e,t.id):void 0;if(((a=e.groupMetadata)==null?void 0:a.groupType)===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&(i=e.groupMetadata)!=null&&i.parentGroup&&t!=null&&(t.subtype===o("WAWebGroupType").GROUP_ACTIONS.LINKED_GROUP_PROMOTE||t.subtype===o("WAWebGroupType").GROUP_ACTIONS.LINKED_GROUP_DEMOTE)){var u;o("WAWebCmd").Cmd.openCommunityHome((u=e.groupMetadata)==null?void 0:u.parentGroup)}else{var c=r("WAWebEnvironment").isWindows?o("WAWebCmd").Cmd.openChatFromUnread({chat:e,chatEntryPoint:o("WAWebChatEntryPoint").ChatEntryPoint.Notification}):o("WAWebCmd").Cmd.openChatAt({chat:e,msgContext:l,chatEntryPoint:o("WAWebChatEntryPoint").ChatEntryPoint.Notification});c.then(function(t){t&&o("WAWebComposeBoxActions").ComposeBoxActions.focus(e)})}}o("WAWebModalManager").ModalManager.closeMedia(),s.increaseNotificationEngagement({isClick:!0}),s.close()}},this.$6=function(){!s.msg||s.msg.type!==o("WAWebMsgType").MSG_TYPE.REVOKED||s.close()},this.msg=t!=null?o("WAWebMsgCollection").MsgCollection.get(t):null,this.chat=(c=o("WAWebChatCollection").ChatCollection.get(e))!=null?c:r("WAWebNewsletterCollection").get(e),this.tag=a,this.key=i,this.$1=l.onClick,this.canBlock=l.canBlock,this.doNotOpenChat=l.doNotOpenChat,this.isReplyable=l.isReplyable;var d=new(_||(_=n("Promise")))(function(e){s.waitingPromise={resolver:e}});this.waitingPromise.promise=d;try{this.$2(i,a,l)}catch(e){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Failed to create notification: ",":",""])),e.name,e.message),this.waitingPromise.resolver()}}var a=t.prototype;return a.$3=function(){return(_||(_=n("Promise"))).resolve()},a.waitForClose=function(){return this.waitingPromise.promise},a.detach=function(){this.$4()},a.click=function(){this.$5()},a.quickReply=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this.chat;t&&t.isReadOnly!==!0&&this.isReplyable&&(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["quickReply inside WAWebBaseNotificationBanner"]))),yield o("WAWebSendTextMsgChatAction").sendTextMsgToChat(t,e)),this.$4()});function t(t){return e.apply(this,arguments)}return t})(),a.$2=function(n,a,i){var t=i.contextMenuItems,l=i.footer,s=i.isReplyable,u=i.notification,c=i.renotify,p=i.suppressBanner,_=i.title,f=babelHelpers.objectWithoutPropertiesLoose(i,e);f.body&&f.body.charCodeAt(0)>=128&&(f.body=" "+f.body);var g=babelHelpers.extends({tag:a,renotify:c!=null?c:!!a,dir:"auto",lang:r("WAWebL10N").getNormalizedLocale(),silent:!0},f);if(h)h({key:n,tag:a,title:_,body:g.body,icon:g.icon,footer:l,contextMenuItems:t,isReplyable:s,suppressBanner:p,chat:this.chat});else{var y,C,b,v;this.notification=new u(_,g),(y=this.notification)==null||y.addEventListener("error",function(e){o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["native notification error"])))}),(C=this.notification)==null||C.addEventListener("close",function(e){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["native notification close"])))}),(b=this.notification)==null||b.addEventListener("click",this.$5),(v=this.notification)==null||v.addEventListener("close",this.$4)}this.msg&&this.msg.on("change:type",this.$6),window.addEventListener("beforeunload",this.close),this.increaseNotificationEngagement({isShow:!0})},a.contextMenuClick=function(t){var e=this.chat;if(e){switch(t){case r("WAWebBannerContextMenuActions").MuteChatForEightHours:this.$7(e,o("WAWebMuteExpirations").ALL_MUTE_DURATIONS[0].duration);break;case r("WAWebBannerContextMenuActions").MuteChatForOneWeek:this.$7(e,o("WAWebMuteExpirations").ALL_MUTE_DURATIONS[1].duration);break;case r("WAWebBannerContextMenuActions").MuteChat:this.$7(e,o("WAWebMuteExpirations").ALL_MUTE_DURATIONS[2].duration);break;case r("WAWebBannerContextMenuActions").DisableNotifications:o("WAWebMuteCollection").MuteCollection.setAllNotificationsAndReactions(!1);break;case r("WAWebBannerContextMenuActions").None:break}this.$4()}},a.$7=function(t,n){t.mute.mute({expiration:o("WAWebMuteExpirations").calculateMuteExpiration(n),sendDevice:!0}).catch(function(e){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["mute failed: ",""])),e)})},a.increaseNotificationEngagement=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n,r=e===void 0?{}:e,a=r.isClick,i=a===void 0?!1:a,l=r.isShow,s=l===void 0?!1:l,u=yield o("WAWebUserPrefsGeneral").getNotificationEngagement();o("WAWebUserPrefsGeneral").setNotificationContentEngagement({totalNotifShown:((t=u==null?void 0:u.totalNotifShown)!=null?t:0)+(s?1:0),totalNotifTapToOpen:((n=u==null?void 0:u.totalNotifTapToOpen)!=null?n:0)+(i?1:0)})});function t(t){return e.apply(this,arguments)}return t})(),t})();l.default=y}),98); __d("WAWebCurrencyData",[],(function(t,n,r,o,a,i){var e="USD",l=2,s={ADP:0,AFN:0,ALL:0,BHD:3,BIF:0,BYR:0,CLF:4,CLP:0,DJF:0,ESP:0,GNF:0,IQD:0,IRR:0,ISK:0,ITL:0,JOD:3,JPY:0,KMF:0,KPW:0,KRW:0,KWD:3,LAK:0,LBP:0,LUF:0,LYD:3,MGA:0,MGF:0,MMK:0,MRO:0,OMR:3,PYG:0,RSD:0,RWF:0,SLL:0,SOS:0,STD:0,SYP:0,TMM:0,TND:3,TRL:0,UGX:0,UYI:0,UYW:4,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,YER:0,ZMK:0,ZWD:0},u={AC:["SHP"],AD:["EUR"],AE:["AED"],AF:["AFN"],AG:["XCD"],AI:["XCD"],AL:["ALL"],AM:["AMD"],AO:["AOA"],AR:["ARS"],AS:["USD"],AT:["EUR"],AU:["AUD"],AW:["AWG"],AX:["EUR"],AZ:["AZN"],BA:["BAM"],BB:["BBD"],BD:["BDT"],BE:["EUR"],BF:["XOF"],BG:["BGN"],BH:["BHD"],BI:["BIF"],BJ:["XOF"],BL:["EUR"],BM:["BMD"],BN:["BND"],BO:["BOB"],BQ:["USD"],BR:["BRL"],BS:["BSD"],BT:["BTN","INR"],BV:["NOK"],BW:["BWP"],BY:["BYN"],BZ:["BZD"],CA:["CAD"],CC:["AUD"],CD:["CDF"],CF:["XAF"],CG:["XAF"],CH:["CHF"],CI:["XOF"],CK:["NZD"],CL:["CLP"],CM:["XAF"],CN:["CNY"],CO:["COP"],CR:["CRC"],CU:["CUP","CUC"],CV:["CVE"],CW:["ANG"],CX:["AUD"],CY:["EUR"],CZ:["CZK"],DE:["EUR"],DG:["USD"],DJ:["DJF"],DK:["DKK"],DM:["XCD"],DO:["DOP"],DZ:["DZD"],EA:["EUR"],EC:["USD"],EE:["EUR"],EG:["EGP"],EH:["MAD"],ER:["ERN"],ES:["EUR"],ET:["ETB"],EU:["EUR"],FI:["EUR"],FJ:["FJD"],FK:["FKP"],FM:["USD"],FO:["DKK"],FR:["EUR"],GA:["XAF"],GB:["GBP"],GD:["XCD"],GE:["GEL"],GF:["EUR"],GG:["GBP"],GH:["GHS"],GI:["GIP"],GL:["DKK"],GM:["GMD"],GN:["GNF"],GP:["EUR"],GQ:["XAF"],GR:["EUR"],GS:["GBP"],GT:["GTQ"],GU:["USD"],GW:["XOF"],GY:["GYD"],HK:["HKD"],HM:["AUD"],HN:["HNL"],HR:["HRK"],HT:["HTG","USD"],HU:["HUF"],IC:["EUR"],ID:["IDR"],IE:["EUR"],IL:["ILS"],IM:["GBP"],IN:["INR"],IO:["USD"],IQ:["IQD"],IR:["IRR"],IS:["ISK"],IT:["EUR"],JE:["GBP"],JM:["JMD"],JO:["JOD"],JP:["JPY"],KE:["KES"],KG:["KGS"],KH:["KHR"],KI:["AUD"],KM:["KMF"],KN:["XCD"],KP:["KPW"],KR:["KRW"],KW:["KWD"],KY:["KYD"],KZ:["KZT"],LA:["LAK"],LB:["LBP"],LC:["XCD"],LI:["CHF"],LK:["LKR"],LR:["LRD"],LS:["ZAR","LSL"],LT:["EUR"],LU:["EUR"],LV:["EUR"],LY:["LYD"],MA:["MAD"],MC:["EUR"],MD:["MDL"],ME:["EUR"],MF:["EUR"],MG:["MGA"],MH:["USD"],MK:["MKD"],ML:["XOF"],MM:["MMK"],MN:["MNT"],MO:["MOP"],MP:["USD"],MQ:["EUR"],MR:["MRU"],MS:["XCD"],MT:["EUR"],MU:["MUR"],MV:["MVR"],MW:["MWK"],MX:["MXN"],MY:["MYR"],MZ:["MZN"],NA:["NAD","ZAR"],NC:["XPF"],NE:["XOF"],NF:["AUD"],NG:["NGN"],NI:["NIO"],NL:["EUR"],NO:["NOK"],NP:["NPR"],NR:["AUD"],NU:["NZD"],NZ:["NZD"],OM:["OMR"],PA:["PAB","USD"],PE:["PEN"],PF:["XPF"],PG:["PGK"],PH:["PHP"],PK:["PKR"],PL:["PLN"],PM:["EUR"],PN:["NZD"],PR:["USD"],PS:["ILS","JOD"],PT:["EUR"],PW:["USD"],PY:["PYG"],QA:["QAR"],RE:["EUR"],RO:["RON"],RS:["RSD"],RU:["RUB"],RW:["RWF"],SA:["SAR"],SB:["SBD"],SC:["SCR"],SD:["SDG"],SE:["SEK"],SG:["SGD"],SH:["SHP"],SI:["EUR"],SJ:["NOK"],SK:["EUR"],SL:["SLL"],SM:["EUR"],SN:["XOF"],SO:["SOS"],SR:["SRD"],SS:["SSP"],ST:["STN"],SV:["USD"],SX:["ANG"],SY:["SYP"],SZ:["SZL"],TA:["GBP"],TC:["USD"],TD:["XAF"],TF:["EUR"],TG:["XOF"],TH:["THB"],TJ:["TJS"],TK:["NZD"],TL:["USD"],TM:["TMT"],TN:["TND"],TO:["TOP"],TR:["TRY"],TT:["TTD"],TV:["AUD"],TW:["TWD"],TZ:["TZS"],UA:["UAH"],UG:["UGX"],UM:["USD"],US:["USD"],UY:["UYU"],UZ:["UZS"],VA:["EUR"],VC:["XCD"],VE:["VES"],VG:["USD"],VI:["USD"],VN:["VND"],VU:["VUV"],WF:["XPF"],WS:["WST"],XK:["EUR"],YE:["YER"],YT:["EUR"],ZA:["ZAR"],ZM:["ZMW"],ZW:["USD"]};i.DEFAULT_CURRENCY=e,i.DEFAULT_DIGITS=l,i.CURRENCY_DIGITS=s,i.REGION_TO_CURRENCY=u}),66); __d("WAWebCurrencyUtils",["WAWebCurrencyData","WAWebL10N"],(function(t,n,r,o,a,i,l){var e={IDR:"in-ID",MXN:"es-MX",INR:"en-IN"},s=new Set(["DZD","ARS","AUD","BDT","BOB","BRL","GBP","CAD","CLP","CNY","COP","CRC","CZK","DKK","EGP","EUR","GTQ","HNL","HKD","HUF","ISK","INR","IDR","ILS","JPY","KES","KRW","MOP","MYR","MXN","NZD","NIO","NGN","NOK","PKR","PYG","PEN","PHP","PLN","QAR","RON","RUB","SAR","SGD","ZAR","SEK","CHF","TWD","THB","TRY","AED","USD","UYU","VEF","VND"]),u=["es-ES","pt-BR"],c=function(){var e;return[(e=r("WAWebL10N")).getFullLocale(),e.normalizeLocaleToBcp47Compliant(e.getNormalizedLocale()),e.normalizeLocaleToBcp47Compliant(e.getLocale())].filter(Boolean)},d=function(t,n,r,o){o===void 0&&(o=c());var e="symbol";return u.includes(Array.isArray(o)?o[0]:o)&&(e="code"),new Intl.NumberFormat(o,babelHelpers.extends({style:"currency",currency:t,currencyDisplay:e},r)).format(n)},m=function(t,n,r,o){return d(t,n/1e3,r,o)};function p(e){return new Intl.NumberFormat(e).format(1.1).substring(1,2)}function _(e){return new Intl.NumberFormat(e).format(1e4).substring(2,3)}function f(e,t){var n=m(t,0,{},e);return n.replace(/\d+([,.]\d+)?/g,"").trim()}function g(e,t){var n=c(),r=p(n),o=f(n,e),a=m(e,t),i=a.replace(o,"").trim(),l=i.indexOf(r),s=l===-1?i:i.substring(0,l),u=l===-1?"":i.substring(l);return{symbol:o,integer:s,decimal:u}}function h(t){return f(e[t],t)}function y(e,t){var n=c(),r=f(n,e),o=_(n),a=p(n);return C(t,r,a,o)}function C(e,t,n,r){var o=e.replace(t,"").trim(),a=o.split(r).join(""),i=parseFloat(a.replace(n,".")||"0");return Math.round(i*1e3)}function b(e,t){if(t==null||t.trim().length===0)return!1;var n=c(),r=_(n),o=p(n);if(t.match("/[^0-9"+r+o+"]/"))return!1;var a=f(n,e),i=y(e,t),l=m(e,i),s=l.replace(a,"").trim(),u=s.indexOf(o),d=u===-1?s:s.substring(0,u),g=s.split(r).join("");u=g.indexOf(o);var h=u===-1?g:g.substring(0,u);return t===s||t===d||t===g||t===h}function v(e,t,n,r){var a=c(),i=o("WAWebCurrencyData").CURRENCY_DIGITS[e]!==void 0?o("WAWebCurrencyData").CURRENCY_DIGITS[e]:o("WAWebCurrencyData").DEFAULT_DIGITS,l=y(e,t);if(n!=null&&lr)return!1;var s=t.replace(/\D+$/g,""),u=p(a);return!(Number.isNaN(l)||s!==t||(t.split(u)[1]||"").length>i)}function S(e){var t=o("WAWebCurrencyData").REGION_TO_CURRENCY[e.toUpperCase()];return(t==null?void 0:t.length)>0?t[0]:o("WAWebCurrencyData").DEFAULT_CURRENCY}function R(e){return s.has(e)}l.formatAmount=d,l.formatAmount1000=m,l.formatAmount1000ToParts=g,l.formatLocalSymbol=h,l.valueFromString=y,l.parseValueFromString=C,l.validateAmountString=b,l.validatePriceString=v,l.currencyForCountryShortcode=S,l.isSupportedCurrency=R}),98); __d("WAWebGetInteractiveFooterText",["fbt","WAWebInteractiveMessagesNativeFlowName","WAWebMsgType","WAWebOrderStatusButton","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l,s){"use strict";function e(e){if(e.type===o("WAWebMsgType").MSG_TYPE.INTERACTIVE&&e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS){var t=o("WAWebOrderStatusButton").getOrderStatusButton(e);if(t!=null){var n=t.order,a=n.shipping_method,i=n.tracking;if(i)return i.courier_name+" \u2022 "+i.tracking_ref;var l=r("isStringNullOrEmpty")(a)?s._(/*BTDS*/"No disponible"):a;return s._(/*BTDS*/"M\u00e9todo de env\u00edo: {shipping_method}",[s._param("shipping_method",l)]).toString()}}return e.footer}l.getInteractiveFooterText=e}),226); __d("WAWebBizFormatInteractiveMsg",["fbt","WAWebBizOrderDetailsParams","WAWebBrazilPixKeyFormattingUtils","WAWebCurrencyUtils","WAWebGetInteractiveFooterText","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebOrderDetails","WAWebOrderPaymentStatus","WAWebOrderStatus","WAWebOrderStatusButton","WAWebUserPrefsTypes"],(function(t,n,r,o,a,i,l,s){function e(e,t){var n,o,a=t===void 0?{}:t,i=a.formatAsSearchResult,l=i===void 0?!1:i;if(e.interactiveType===r("WAWebInteractiveMessageType").SHOPS_STOREFRONT){var s;return e.caption||((s=e.interactiveHeader)==null?void 0:s.title)||""}if(e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO){var u=p(e);if(u!=null)return u}if(e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS){var d=m(e);if(d!=null)return d}if(e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS){var _=c(e);if(_!=null)return _}return[(n=e.interactiveHeader)==null?void 0:n.title,l?(o=e.interactiveHeader)==null?void 0:o.subtitle:null,e.caption,e.footer].filter(Boolean).join("\n")}function u(e){switch(e){case o("WAWebOrderStatus").OrderStatus.Pending:return s._(/*BTDS*/"Pedido pendiente");case o("WAWebOrderStatus").OrderStatus.Canceled:return s._(/*BTDS*/"Pedido cancelado");case o("WAWebOrderStatus").OrderStatus.PartiallyShipped:return s._(/*BTDS*/"Pedido enviado parcialmente");case o("WAWebOrderStatus").OrderStatus.Complete:return s._(/*BTDS*/"Pedido completado \ud83c\udf89");case o("WAWebOrderStatus").OrderStatus.Shipped:return s._(/*BTDS*/"Pedido enviado");case o("WAWebOrderStatus").OrderStatus.Processing:return s._(/*BTDS*/"Pedido en proceso");case o("WAWebOrderStatus").OrderStatus.PaymentRequested:return s._(/*BTDS*/"Pago solicitado");case o("WAWebOrderStatus").OrderStatus.PreparingToShip:return s._(/*BTDS*/"Env\u00edo del pedido en preparaci\u00f3n");case o("WAWebOrderStatus").OrderStatus.Delivered:return s._(/*BTDS*/"Pedido entregado \ud83c\udf89");case o("WAWebOrderStatus").OrderStatus.Confirmed:return s._(/*BTDS*/"Pedido confirmado");case o("WAWebOrderStatus").OrderStatus.Delayed:return s._(/*BTDS*/"Pedido demorado");case o("WAWebOrderStatus").OrderStatus.OutForDelivery:return s._(/*BTDS*/"Pedido en camino");case o("WAWebOrderStatus").OrderStatus.Failed:return s._(/*BTDS*/"Error en el pedido");case o("WAWebOrderStatus").OrderStatus.Refunded:return s._(/*BTDS*/"Se reembols\u00f3 el pedido.")}}function c(e){var t=o("WAWebOrderStatus").getOrderStatusInfo(e);if(t==null)return null;var n=t.status;if(n==null)return null;var r=o("WAWebOrderStatusButton").getOrderStatusButton(e);if(r!=null){var a=u(n).toString(),i=e.caption,l=o("WAWebGetInteractiveFooterText").getInteractiveFooterText(e),c=s._(/*BTDS*/"N.\u00b0 de pedido: {order-id}",[s._param("order-id",r.reference_id)]);return[a,c,i,l].filter(Boolean).join("\n")}return d(e)}function d(e){var t=o("WAWebOrderStatus").getOrderStatusInfo(e);if(t==null)return null;var n=t.status;if(n==null)return null;if(o("WAWebOrderStatus").hasOrderStatusButton(e)){var r=u(n).toString(),a=e.caption;return["*"+r+"*",a].filter(Boolean).join("\n")}return g(e.caption,n)}function m(e){var t=o("WAWebOrderDetails").getOrderInfo(e);if(t==null)return null;var n=t.currency,r=t.items,a=t.totalAmount,i=o("WAWebCurrencyUtils").formatAmount(n,a);return r.length!==0?r[0].name+" \xB7 "+i:i}function p(e){var t,n,r,a=o("WAWebOrderDetails").getOrderInfo(e);if(a==null)return null;var i=a==null?void 0:a.paymentSettings,l=s._(/*BTDS*/"Pix"),u=i==null||(t=i.at(0))==null?void 0:t[o("WAWebBizOrderDetailsParams").PaymentSettingType.PIX_STATIC_CODE],c=(n=u==null?void 0:u.merchant_name)!=null?n:"",d=(r=u==null?void 0:u.key)!=null?r:"",m=o("WAWebUserPrefsTypes").PixKeyType.cast(u==null?void 0:u.key_type);return c+" \xB7 "+l.toString()+": "+o("WAWebBrazilPixKeyFormattingUtils").getFormattedPixKey(d,m)}function _(e){var t=o("WAWebOrderPaymentStatus").getOrderPaymentStatusInfoFromNativeFlow(e);return t==null?null:h(e.caption,t==null?void 0:t.paymentStatus).toString()}function f(e){var t=o("WAWebOrderPaymentStatus").getOrderPaymentStatusInfoFromNativeFlow(e);return t==null?null:y(t==null?void 0:t.paymentMethod)}function g(e,t){var n="";switch(t){case o("WAWebOrderStatus").OrderStatus.Pending:n=s._(/*BTDS*/"Estado: Pendiente");break;case o("WAWebOrderStatus").OrderStatus.Canceled:n=s._(/*BTDS*/"Estado: Cancelado");break;case o("WAWebOrderStatus").OrderStatus.PartiallyShipped:n=s._(/*BTDS*/"Estado: Enviado parcialmente");break;case o("WAWebOrderStatus").OrderStatus.Complete:n=s._(/*BTDS*/"Estado: Completado");break;case o("WAWebOrderStatus").OrderStatus.Shipped:n=s._(/*BTDS*/"Estado: Enviado");break;case o("WAWebOrderStatus").OrderStatus.Processing:n=s._(/*BTDS*/"Estado: En proceso");break;case o("WAWebOrderStatus").OrderStatus.PaymentRequested:n=s._(/*BTDS*/"Estado: Pago solicitado");break;case o("WAWebOrderStatus").OrderStatus.PreparingToShip:n=s._(/*BTDS*/"Estado: Env\u00edo en preparaci\u00f3n");break;case o("WAWebOrderStatus").OrderStatus.Delivered:n=s._(/*BTDS*/"Estado: Entregado");break;case o("WAWebOrderStatus").OrderStatus.Confirmed:n=s._(/*BTDS*/"Estado: Confirmado");break;case o("WAWebOrderStatus").OrderStatus.Delayed:n=s._(/*BTDS*/"Estado: Demorado");break;case o("WAWebOrderStatus").OrderStatus.OutForDelivery:n=s._(/*BTDS*/"Estado: Listo para entregar");break;case o("WAWebOrderStatus").OrderStatus.Failed:n=s._(/*BTDS*/"Estado: Error");break;case o("WAWebOrderStatus").OrderStatus.Refunded:n=s._(/*BTDS*/"Estado: Reembolsado");break}return e!=null&&e.toLowerCase().includes(n.toString().toLowerCase())?e||"":(n.toString()+"\n"+(e||"")).trim()}function h(e,t){var n="";switch(t){case o("WAWebOrderPaymentStatus").OrderPaymentStatus.Captured:n=s._(/*BTDS*/"Pago: Realizado");break;case o("WAWebOrderPaymentStatus").OrderPaymentStatus.Pending:n=s._(/*BTDS*/"Pago: Pendiente");break;case o("WAWebOrderPaymentStatus").OrderPaymentStatus.Failed:n=s._(/*BTDS*/"Pago: Error");break}return(n.toString()+"\n"+(e!=null?e:"")).trim()}function y(e){var t="";switch(e){case o("WAWebOrderPaymentStatus").OrderPaymentMethod.PaymentInstruction:t=s._(/*BTDS*/"Pago fuera de WhatsApp");break;case o("WAWebOrderPaymentStatus").OrderPaymentMethod.Confirm:t=s._(/*BTDS*/"Pedido confirmado");break}return t.toString()}l.formatInteractive=e,l.getOrderStatusButtonBodyTitle=u,l.formatOrderStatusMessagePreview=c,l.formatOrderStatusMessageBody=d,l.formatOrderDetailsMessagePreview=m,l.formatPaymentInfoMessagePreview=p,l.formatOrderPaymentStatusMessage=_,l.formatOrderPaymentMethodMessage=f,l.appendPrefilledMsg=g,l.appendPrefilledOrderPaymentMsg=h}),226); __d("WAWebFormatCallLog",["fbt","WAWebMsgGetters"],(function(t,n,r,o,a,i,l,s){function e(e){if(o("WAWebMsgGetters").getIsCallSilenced(e))return s._(/*BTDS*/"Se silenci\u00f3 la llamada de un n\u00famero desconocido.");var t=u(e.subtype);if(t!=null)return t;var n=o("WAWebMsgGetters").getCallOutcome(e),r=o("WAWebMsgGetters").getIsAdHocGroupCall(e),a=o("WAWebMsgGetters").getIsMissedCall(e),i=o("WAWebMsgGetters").getIsVideoCall(e);return n&&(t=c(r,a,i)),t!=null?t:""}function u(e){switch(e){case"miss":return s._(/*BTDS*/"Llamada perdida");case"miss_video":return s._(/*BTDS*/"Videollamada perdida");case"miss_group":case"miss_group_video":return s._(/*BTDS*/"Llamada grupal perdida")}}function c(e,t,n){return t?e?s._(/*BTDS*/"Llamada grupal perdida"):n?s._(/*BTDS*/"Videollamada perdida"):s._(/*BTDS*/"Llamada perdida"):e?s._(/*BTDS*/"Llamada grupal"):n?s._(/*BTDS*/"Videollamada"):s._(/*BTDS*/"Llamada")}l.default=e}),226); __d("WAWebFormatEventDateString",["fbt","WATimeUtils","WAWeb-moment","WAWebClock","WAWebL10N"],(function(t,n,r,o,a,i,l,s){function e(e,t){var n=o("WATimeUtils").castToUnixTime(e),a=r("WAWeb-moment").unix(n);if(t==null||t===0)return u(a,{maybeShowAmPm:!0});var i=o("WATimeUtils").castToUnixTime(t),l=r("WAWeb-moment").unix(i);if(o("WATimeUtils").sameDay(n,i)){var c=a.format("a")===l.format("a");return s._(/*BTDS*/"{start-date} - {end-time}",[s._param("start-date",u(a,{maybeShowAmPm:!c})),s._param("end-time",u(l,{maybeShowAmPm:!0,timeOnly:!0,lowercase:!0}))])}return s._(/*BTDS*/"{start-date} - {end-date}",[s._param("start-date",u(a,{maybeShowAmPm:!0})),s._param("end-date",u(l,{maybeShowAmPm:!0,lowercase:!0}))])}function u(e,t){var n=t.maybeShowAmPm&&!o("WAWebClock").Clock.getIs24Hour(),a=o("WATimeUtils").unixTime(),i=o("WATimeUtils").castToUnixTime(e.unix());if(t.timeOnly===!0)return o("WAWebClock").Clock.timestampStr(i);var l="LT";n===!1&&(l="h:mm");var u=o("WATimeUtils").sameDay(o("WATimeUtils").castToUnixTime(r("WAWeb-moment")().subtract(1,"day").unix()),i);if(u)return t.lowercase===!0?s._(/*BTDS*/"ayer, {time}",[s._param("time",e.format(l))]):s._(/*BTDS*/"Ayer a la(s) {time}",[s._param("time",e.format(l))]);var c=o("WATimeUtils").sameDay(a,i);if(c)return t.lowercase===!0?s._(/*BTDS*/"hoy, {time}",[s._param("time",e.format(l))]):s._(/*BTDS*/"Hoy a la(s) {time}",[s._param("time",e.format(l))]);var d=o("WATimeUtils").sameDay(o("WATimeUtils").castToUnixTime(r("WAWeb-moment")().add(1,"day").unix()),i);if(d)return t.lowercase===!0?s._(/*BTDS*/"ma\u00f1ana, {time}",[s._param("time",e.format(l))]):s._(/*BTDS*/"Ma\u00f1ana a la(s) {time}",[s._param("time",e.format(l))]);var m="ddd, MMM D",p="MMM D, YYYY";r("WAWebL10N").getLanguage()!=="en"&&(m="LL",p="LL");var _=e.isSame(r("WAWeb-moment")(),"year");return _?s._(/*BTDS*/"{date}, {time}",[s._param("date",e.format(m)),s._param("time",e.format(l))]):s._(/*BTDS*/"{date}, {time}",[s._param("date",e.format(p)),s._param("time",e.format(l))])}l.getEventDateStringFor=e}),226); __d("WAWebFormatNfmText",["WAWebBizFormatInteractiveMsg","WAWebInteractiveMessagesNativeFlowName"],(function(t,n,r,o,a,i,l){function e(e){if(e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS){var t=o("WAWebBizFormatInteractiveMsg").formatOrderStatusMessageBody(e);if(t!=null)return t}else if(e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").PAYMENT_STATUS){var n=o("WAWebBizFormatInteractiveMsg").formatOrderPaymentStatusMessage(e);if(n!=null)return n}else if(e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").PAYMENT_METHOD){var a=o("WAWebBizFormatInteractiveMsg").formatOrderPaymentMethodMessage(e);if(a!=null)return a}return e.caption||""}function s(t){if(t.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS){var n=o("WAWebBizFormatInteractiveMsg").formatOrderDetailsMessagePreview(t);if(n!=null)return n}else if(t.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO){var a=o("WAWebBizFormatInteractiveMsg").formatPaymentInfoMessagePreview(t);if(a!=null)return a}return e(t)}l.formatNFMText=e,l.formatNFMTextPreview=s}),98); __d("WAWebFormatOversizedMsg",["fbt"],(function(t,n,r,o,a,i,l,s){function e(e){return s._(/*BTDS*/"Este mensaje no se puede ver en WhatsApp Web. Puedes verlo en tu tel\u00e9fono.")}function u(e){return s._(/*BTDS*/"Este mensaje no se puede ver en WhatsApp Web. Puedes verlo en tu tel\u00e9fono.")}l.formatOversizedMsgText=e,l.formatOversizedMsgNotification=u}),226); __d("WAWebRichResponseStrings",["fbt"],(function(t,n,r,o,a,i,l,s){"use strict";function e(){return s._(/*BTDS*/"A\u00fan no se admite este tipo de respuesta en este dispositivo. Visualiza la respuesta en tu tel\u00e9fono.")}l.getWholeRichResponseUnsupportedText=e}),226); __d("WAWebFormatUnknownMsg",["fbt","WAWebCommonMsgUtils","WAWebMsgGetters","WAWebMsgType","WAWebRichResponseStrings"],(function(t,n,r,o,a,i,l,s){function e(){return s._(/*BTDS*/"No se pudo cargar este mensaje. Abre el mensaje en tu tel\u00e9fono para verlo.")}function u(t){var n=o("WAWebMsgGetters").getIsNewsletterMsg(t);return n?s._(/*BTDS*/"Recibiste una actualizaci\u00f3n de canal que no se pudo cargar. Abre el mensaje en tu tel\u00e9fono para verla."):e()}function c(t){var n=o("WAWebMsgGetters").getIsNewsletterMsg(t);return n?s._(/*BTDS*/"Enviaste una actualizaci\u00f3n de canal que no se pudo cargar. Abre el mensaje en tu tel\u00e9fono para verla."):e()}function d(t){var n=o("WAWebMsgGetters").getIsNewsletterMsg(t);return n?s._(/*BTDS*/"Recibiste una actualizaci\u00f3n de canal que no se pudo cargar. Abre el mensaje en tu tel\u00e9fono para verla."):e()}function m(e){return o("WAWebMsgGetters").getIsSentByMe(e)?c(e):u(e)}function p(t){if(t.futureproofType===o("WAWebMsgType").MSG_TYPE.REACTION)return o("WAWebMsgGetters").getIsSentByMe(t)?s._(/*BTDS*/"No se pudo cargar tu reacci\u00f3n Abre el mensaje en tu tel\u00e9fono para verla."):s._(/*BTDS*/"No se pudo cargar esta reacci\u00f3n Abre el mensaje en tu tel\u00e9fono para verla.");if(t.futureproofType===o("WAWebMsgType").MSG_TYPE.PROTOCOL&&t.futureproofSubtype==="message_edit")return o("WAWebMsgGetters").getIsSentByMe(t)?s._(/*BTDS*/"No se pudo cargar tu mensaje editado. Abre el mensaje en tu tel\u00e9fono para verlo."):s._(/*BTDS*/"No se pudo cargar este mensaje editado. Abre el mensaje en tu tel\u00e9fono para verlo.");if(t.futureproofType===o("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT)return o("WAWebMsgGetters").getIsSentByMe(t)?m(t):s._(/*BTDS*/"Se conserv\u00f3 un mensaje en este chat para que no sea temporal. Abre el mensaje en tu tel\u00e9fono para verlo.");if(t.futureproofType===o("WAWebMsgType").MSG_TYPE.PIN_MESSAGE)return o("WAWebMsgGetters").getIsSentByMe(t)?s._(/*BTDS*/"No se pudo cargar tu mensaje fijado. Abre el mensaje en tu tel\u00e9fono para verlo."):s._(/*BTDS*/"No se pudo cargar este mensaje fijado Abre el mensaje en tu tel\u00e9fono para verlo.");if(t.futureproofType===o("WAWebMsgType").MSG_TYPE.ALBUM)return s._(/*BTDS*/"Archivos multimedia");if(t.type===o("WAWebMsgType").MSG_TYPE.AUTOMATED_GREETING_MESSAGE)return e();if(o("WAWebCommonMsgUtils").isRichResponseMsg(t.type))return o("WAWebRichResponseStrings").getWholeRichResponseUnsupportedText();if(t.type===o("WAWebMsgType").MSG_TYPE.UNKNOWN&&t.futureproofType===o("WAWebMsgType").MSG_TYPE.CALL_LOG)return s._(/*BTDS*/"Esta llamada no se pudo cargar. Abre el mensaje en tu tel\u00e9fono para verla.");if(o("WAWebMsgGetters").getIsSentByMe(t))return m(t);switch(t.subtype){case"phone":return d(t);case"phone_only_feature":return e();default:return m(t)}}function _(e){if(e.futureproofType===o("WAWebMsgType").MSG_TYPE.REACTION)return s._(/*BTDS*/"Recibiste una reacci\u00f3n. Actualiza la versi\u00f3n de WhatsApp para ver reacciones.");switch(e.subtype){case"phone":return d(e);case"phone_only_feature":return s._(/*BTDS*/"Este mensaje no se puede abrir en WhatsApp Web, pero puedes verlo en tu tel\u00e9fono.");default:return u(e)}}l.defaultFutureproofMsgText=m,l.formatUnknownMsgText=p,l.formatUnknownMsgNotification=_}),226); __d("WAWebVcardUtils",["fbt","WATypeUtils","WAWebFbtIntlList","WAWebVcardParsingUtils","err","lodash"],(function(t,n,r,o,a,i,l,s){function e(e){var t,n,a=(t=e.ORG)==null?void 0:t[0],i=(n=e.TITLE)==null?void 0:n[0];if(a&&Array.isArray(a.value)&&a.value.length>0){var l,s=null;i!=null&&i.value&&(s=(""+i.value).trim());var u=a.value,c=u[0],d=babelHelpers.arrayLikeToArray(u).slice(1);d.push(c);var m=r("WAWebFbtIntlList")(d.map(function(e){return o("WATypeUtils").isString(e)?e.trim():""}).filter(function(e){return e.length}),r("WAWebFbtIntlList").CONJUNCTIONS.NONE,r("WAWebFbtIntlList").DELIMITERS.COMMA).toString();return(s||"")+((l=s)!=null&&l.length&&m.length?" - ":"")+m}return""}function u(e){var t,n=(t={jabber:s._(/*BTDS*/"Jabber"),"skype-username":s._(/*BTDS*/"Skype"),skype:s._(/*BTDS*/"Skype"),msn:s._(/*BTDS*/"Windows Live"),aim:s._(/*BTDS*/"AIM"),yahoo:s._(/*BTDS*/"Yahoo"),icq:s._(/*BTDS*/"ICQ"),"wa-biz-description":s._(/*BTDS*/"Descripci\u00f3n")},t[o("WAWebVcardParsingUtils").WA_BIZ_NAME]=s._(/*BTDS*/"Nombre de empresa"),t),a=e.properties["X-ABLabel"]||n[e.type.toLowerCase()];if(a!=null&&a!=="")return o("WAWebVcardParsingUtils").clean(String(a));var i={TEL:[[["cell"],s._(/*BTDS*/"Tel\u00e9fono m\u00f3vil")],[["iphone"],s._(/*BTDS*/"iPhone")],[["main"],s._(/*BTDS*/"Principal")],[["home","fax"],s._(/*BTDS*/"Fax de casa")],[["work","fax"],s._(/*BTDS*/"Fax de trabajo")],[["home"],s._(/*BTDS*/"Casa")],[["work"],s._(/*BTDS*/"Trabajo")],[["pager"],s._(/*BTDS*/"Pager")],[[],s._(/*BTDS*/"Casa")]],EMAIL:[[["home"],s._(/*BTDS*/"Casa")],[["work"],s._(/*BTDS*/"Trabajo")],[["internet"],s._(/*BTDS*/"Correo electr\u00f3nico")]],URL:[[["home"],s._(/*BTDS*/"Casa")],[["work"],s._(/*BTDS*/"Trabajo")]],ADR:[[["home"],s._(/*BTDS*/"Casa")],[["work"],s._(/*BTDS*/"Trabajo")]]};return a=e.type,r("lodash").forOwn(i,function(t){if(t){var n,r,o=t[0],i=t[1];if(Array.from(new Set(o).difference(new Set((n=(r=e.properties)==null||(r=r.type)==null?void 0:r.map(function(e){return e.toLowerCase()}))!=null?n:[]))).length===0)return a=i,!1}}),a}function c(e){return d(e.map(function(e){return e.displayName})).toString()}function d(e){var t=e.find(function(e){return!!e});return e.length?t?e.length===1?t:s._(/*BTDS*/"_j{\"*\":\"{contactName} y {count} contactos m\\u00e1s\",\"4\":\"{contactName} y {count} contacto m\\u00e1s\",\"_1\":\"{contactName} y 1 contacto m\\u00e1s\"}",[s._plural(e.length-1,"count"),s._param("contactName",t)]):s._(/*BTDS*/"_j{\"*\":\"{count} contactos\",\"4\":\"{count} contacto\",\"_1\":\"1 contacto\"}",[s._plural(e.length,"count")]):s._(/*BTDS*/"No hay contactos")}function m(e){if(e.length===0)throw r("err")("No vcards provided");return e.length===1?e[0]:{displayName:c(e),vcard:e.map(function(e){return e.vcard}).join("\n"),isMultiVcard:!0}}l.vcardGetOrganizationString=e,l.vcardGetType=u,l.getNameString=c,l.getNameStringFromNames=d,l.mergeVcards=m}),226); __d("WAWebGetNotificationStrings",["fbt","WABidi","WALogger","WAWebAlbumsFormatAlbumMessageText","WAWebBizFormatInteractiveMsg","WAWebClock","WAWebContactCollection","WAWebContactGetters","WAWebCurrencyUtils","WAWebFormatBroadcastNotification","WAWebFormatCallLog","WAWebFormatE2ENotification","WAWebFormatEventDateString","WAWebFormatGroupNotification","WAWebFormatNfmText","WAWebFormatOversizedMsg","WAWebFormatPaymentMsg","WAWebFormatRevokedMsg","WAWebFormatUnknownMsg","WAWebFrontendMsgGetters","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebL10N","WAWebMsgGetters","WAWebMsgType","WAWebPollCreationUtils","WAWebUA","WAWebUnformatMsg","WAWebVcardUtils","WAWebWidToFormattedNameOrNumber","cr:4404","fbs"],(function(t,n,r,o,a,i,l,s){var e,u,c,d,m=(e=n("cr:4404"))!=null?e:{},p=m.getNotificationBodyForPreviewOff;function _(e){var t,n,a,i,l,m=e.shouldShowNotificationPreview(),_=e.safe(),f="";if(p&&!m)return p().toString();switch(_.type){case"chat":{m&&(f=r("WAWebUnformatMsg")(e,e.body));break}case"image":{var h="";o("WAWebUA").UA.hasEmoji&&(h=_.isViewOnce?"1\uFE0F\u20E3 ":"\uD83D\uDCF7 "),f=h+(m&&r("WAWebUnformatMsg")(e,e.caption)||r("fbs")._(/*BTDS*/"Foto").toString());break}case"product":{var y=o("WAWebUA").UA.hasEmoji?"\uD83D\uDED2 ":"";f=y+(o("WAWebFrontendMsgGetters").getText(e)&&r("WAWebUnformatMsg")(e,o("WAWebFrontendMsgGetters").getText(e))||s._(/*BTDS*/"Producto").toString());break}case"interactive":{if(e.interactiveType===r("WAWebInteractiveMessageType").SHOPS_STOREFRONT){var C,b=o("WAWebUA").UA.hasEmoji?"\uD83D\uDECD\uFE0F ":"";f=b+r("WAWebUnformatMsg")(e,e.body!=null?e.body:(C=e.interactiveHeader)==null?void 0:C.title)||"";break}if(e.interactiveType===r("WAWebInteractiveMessageType").NATIVE_FLOW&&e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS){var v,S=e;f=o("WAWebBizFormatInteractiveMsg").formatOrderDetailsMessagePreview(S)||((v=e.caption)!=null?v:"");var R=o("WAWebUA").UA.hasEmoji?"\uD83D\uDCC3 ":"";f=R+f;break}if(e.interactiveType===r("WAWebInteractiveMessageType").NATIVE_FLOW&&e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO){var L,E=e;f=o("WAWebBizFormatInteractiveMsg").formatPaymentInfoMessagePreview(E)||((L=e.caption)!=null?L:"");break}if(e.interactiveType===r("WAWebInteractiveMessageType").NATIVE_FLOW&&e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").ORDER_STATUS){var k,I=e;f=o("WAWebBizFormatInteractiveMsg").formatOrderStatusMessagePreview(I)||((k=e.caption)!=null?k:"");break}return o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["getNotificationBody: Unrecognized type ",""])),e.type),""}case"native_flow":if(e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS){var T,D=e,x=o("WAWebUA").UA.hasEmoji?"\uD83D\uDCC3 ":"";f=x+(o("WAWebFormatNfmText").formatNFMTextPreview(D)||((T=e.caption)!=null?T:""));break}if(e.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO){var $,P=e;f=o("WAWebFormatNfmText").formatNFMTextPreview(P)||(($=e.caption)!=null?$:"");break}return o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["getNotificationBody: Unrecognized type ",""])),e.type),"";case"sticker":{var N=o("WAWebUA").UA.hasEmoji?"\uD83D\uDC9F":"";f=s._(/*BTDS*/"{stickerIcon} Sticker",[s._param("stickerIcon",N)]);break}case"video":{var M="",w;e.isGif?(M=o("WAWebUA").UA.hasEmoji?"\uD83D\uDC7E ":"",w=m&&r("WAWebUnformatMsg")(e,e.caption)||"GIF"):(o("WAWebUA").UA.hasEmoji&&(M=_.isViewOnce?"1\uFE0F\u20E3 ":"\uD83C\uDFA5 "),w=m&&r("WAWebUnformatMsg")(e,e.caption)||r("fbs")._(/*BTDS*/"Video").toString(),_.isViewOnce||(w=w+" ("+o("WAWebClock").Clock.durationStr(e.duration)+")")),f=""+M+w;break}case"ptv":{var A=o("WAWebUA").UA.hasEmoji?"\uD83C\uDFA5 ":"",F=m&&r("WAWebUnformatMsg")(e,e.caption)||s._(/*BTDS*/"Nota de video"),O=F.toString()+" ("+o("WAWebClock").Clock.durationStr(e.duration)+")";f=""+A+O;break}case"ptt":{var B="",W=s._(/*BTDS*/"Mensaje de voz").toString();o("WAWebUA").UA.hasEmoji&&(B=_.isViewOnce?"1\uFE0F\u20E3 ":"\uD83C\uDFA4 "),_.isViewOnce||(W=W+" ("+o("WAWebClock").Clock.durationStr(e.duration)+")"),f=""+B+W;break}case"audio":{var q=o("WAWebUA").UA.hasEmoji?"\uD83C\uDFB5 ":"";f=q+" "+r("fbs")._(/*BTDS*/"Audio").toString()+" ("+o("WAWebClock").Clock.durationStr(e.duration)+")";break}case"location":{var U=o("WAWebUA").UA.hasEmoji?"\uD83D\uDCCD ":"",V;e.isLive?V=m&&r("WAWebUnformatMsg")(e,e.comment)||s._(/*BTDS*/"Ubicaci\u00f3n en tiempo real").toString():V=m&&e.loc||r("fbs")._(/*BTDS*/"Ubicaci\u00f3n").toString(),f=U+" "+V;break}case"groups_v4_invite":f=s._(/*BTDS*/"Invitaci\u00f3n a grupo de WhatsApp");break;case"newsletter_admin_invite":f=s._(/*BTDS*/"Invitaci\u00f3n para ser admin. del canal de WhatsApp");break;case"gp2":f=r("WAWebFormatGroupNotification")(e,!0);break;case"broadcast_notification":f=o("WAWebFormatBroadcastNotification").formatBroadcastNotification(e);break;case"notification":f=(t=e.body)!=null?t:"";break;case"vcard":{var H=o("WAWebUA").UA.hasEmoji?"\uD83D\uDC64 ":"";f=H+(e.subtype||r("fbs")._(/*BTDS*/"Contacto").toString());break}case"multi_vcard":{var G=o("WAWebUA").UA.hasEmoji?"\uD83D\uDC65 ":"";f=G+o("WAWebVcardUtils").getNameString(e.vcardList).toString();break}case"document":{if(e.isVcardOverMmsDocument){var z=o("WAWebUA").UA.hasEmoji?"\uD83D\uDC64 ":"";f=z+(e.filename||s._(/*BTDS*/"_j{\"*\":\"{count} contactos\",\"4\":\"{count} contacto\",\"_1\":\"1 contacto\"}",[s._plural(e.pageCount,"count")]).toString());break}var j=o("WAWebUA").UA.hasEmoji?"\uD83D\uDCC4 ":"",K=e.caption;(e.caption==null||e.caption==="")&&(K=e.filename),f=j+(m&&r("WAWebUnformatMsg")(e,K)||r("fbs")._(/*BTDS*/"Documento").toString());break}case"e2e_notification":f=o("WAWebFormatE2ENotification").formatE2ENotification(_);break;case"call_log":f=r("WAWebFormatCallLog")(e);break;case"ciphertext":f=s._(/*BTDS*/"Esperando el mensaje. Esto puede demorar un poco.");break;case"revoked":f=o("WAWebFormatRevokedMsg").formatRevokedMsg(_);break;case"payment":f=g(e);break;case"oversized":f=o("WAWebFormatOversizedMsg").formatOversizedMsgNotification(e);break;case"unknown":f=o("WAWebFormatUnknownMsg").formatUnknownMsgNotification(e);break;case"list":f=(((n=e.list)==null?void 0:n.title)||"")+" "+(((a=e.list)==null?void 0:a.description)||"");break;case"list_response":f=(((i=e.listResponse)==null?void 0:i.title)||"")+" "+(((l=e.listResponse)==null?void 0:l.description)||"");break;case"poll_result_snapshot":case"poll_creation":{var Q=e.pollType===o("WAWebPollCreationUtils").PollType.QUIZ?"\uD83C\uDFC6 ":"\uD83D\uDCCA ",X=o("WAWebUA").UA.hasEmoji?Q:"";f=""+X+r("WAWebUnformatMsg")(e,e.pollName);break}case"event_creation":{var Y,J=o("WAWebUA").UA.hasEmoji?"\uD83D\uDCC6 ":"",Z=e.eventStartTime!=null?o("WAWebFormatEventDateString").getEventDateStringFor(e.eventStartTime,(Y=e.eventEndTime)!=null?Y:void 0):null;f=s._(/*BTDS*/"{eventIcon} Te invitaron a un evento: {eventName} {eventTime}",[s._param("eventIcon",J),s._param("eventName",e.eventName),s._param("eventTime",Z)]);break}case"album":{var ee=o("WAWebUA").UA.hasEmoji?"\uD83D\uDCF7 ":"",te=r("WAWebAlbumsFormatAlbumMessageText")({msg:e,options:{}});f=s._(/*BTDS*/"{albumIcon}{photoAndVideoCountText}",[s._param("albumIcon",ee),s._param("photoAndVideoCountText",te)]);break}case"order":{var ne=o("WAWebUA").UA.hasEmoji?"\uD83D\uDED2 ":"";f=s._(/*BTDS*/"_j{\"*\":\"{shoppingCartIcon}{count} art\\u00edculos{message}\",\"4\":\"{shoppingCartIcon}{count} art\\u00edculo{message}\",\"_1\":\"{shoppingCartIcon}1 art\\u00edculo{message}\"}",[s._plural(e.itemCount,"count"),s._param("shoppingCartIcon",ne),s._param("message",e.message!=null&&e.message!==""?"\n"+e.message:"")]);break}case"sticker-pack":{var re=o("WAWebUA").UA.hasEmoji?"\uD83D\uDC9F ":"";f=s._(/*BTDS*/"{stickerPackIcon} Paquete de stickers",[s._param("stickerPackIcon",re)]);break}case"quarantined":{var oe=o("WAWebUA").UA.hasEmoji?"\uD83D\uDCC4 ":"",ae=e.quarantineExtractedText!=null&&e.quarantineExtractedText!==""?e.quarantineExtractedText:s._(/*BTDS*/"Se bloque\u00f3 el archivo adjunto por los ajustes estrictos de la cuenta.").toString();f=""+oe+ae;break}case"notification_template":case"protocol":case"hsm":case"template_button_reply":case"debug":case"debug_placeholder":case"interactive_response":case"keep_in_chat":case"request_phone_number":case"automated_greeting_message":case"rich_response":case o("WAWebMsgType").MSG_TYPE.MESSAGE_HISTORY_BUNDLE:case"message_history_notice":case"loading_media":return"";default:return _.type,o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["getNotificationBody: Unrecognized type ",""])),e.type),""}var ie=o("WAWebUA").UA.hasEmoji&&e.isQuestion?"\u2753 ":"";return""+ie+f.toString()}function f(e){var t=e.msgDir,n=r("WAWebL10N").isRTL()?"rtl":"ltr";if(e.body&&e.author==null&&e.action==null)return e.body;var a=e.body,i=e.author,l=e.action;if(i==null&&(i=""),l==null?l="":l=n==="ltr"?r("WAWebL10N").isolateLTR(l):r("WAWebL10N").isolateRTL(l),i){var s=o("WABidi").dir(i);return n==="ltr"&&(!t||t==="ltr")&&(!s||s==="ltr")?l?i+"\u200E: "+l+"\u200E "+a+"\u200E":i+"\u200E: "+a+"\u200E":n==="ltr"&&(!t||t==="ltr")?l?"\u200E\u202B"+i+"\u202C: "+l+"\u200E "+a+"\u200E":"\u200E\u202B"+i+"\u202C: "+a+"\u200E":n==="ltr"&&(!s||s==="ltr")?l?i+"\u200E: "+l+"\u200E \u202B"+a+"\u202C\u200E":i+"\u200E: \u202B"+a+"\u202C\u200E":n==="ltr"?l?"\u202B"+i+"\u200F: "+l+" "+a+"\u200F":"\u202B"+i+"\u200F: "+a+"\u200F":(!t||t==="rtl")&&(!s||s==="rtl")?l?i+"\u200F: "+l+"\u200F "+a+"\u200F":i+"\u200F: "+a+"\u200F":!t||t==="rtl"?l?"\u200F\u202A"+i+"\u202C: "+l+"\u200F "+a+"\u200F":"\u200F\u202A"+i+"\u202C: "+a+"\u200F":!s||s==="rtl"?l?i+"\u200F: "+l+"\u200F \u202A"+a+"\u202C\u200F":i+"\u200F: \u202A"+a+"\u202C\u200F":l?"\u202A"+i+"\u200E: "+l+" "+a+"\u200E":"\u202A"+i+"\u200E: "+a+"\u200E$"}return l?l+" "+a:a}function g(e){if(e.subtype==="invite")return o("WAWebFormatPaymentMsg").formatPaymentInviteMessageText(e.id);var t=e.paymentCurrency&&e.paymentAmount1000;if(!t)return s._(/*BTDS*/"Mensaje de Pagos \u2022 Importe no disponible");if(e.subtype!=="send"&&e.subtype!=="request")return s._(/*BTDS*/"Mensaje de pago. Abre WhatsApp en tu tel\u00e9fono para ver.");var n,a=o("WAWebCurrencyUtils").formatAmount1000(e.paymentCurrency,e.paymentAmount1000),i=r("WAWebWidToFormattedNameOrNumber")(o("WAWebMsgGetters").getSender(e)),l=r("WAWebWidToFormattedNameOrNumber")(e.paymentMessageReceiverJid),u=o("WAWebContactCollection").ContactCollection.get(e.paymentMessageReceiverJid),c=u!=null&&o("WAWebContactGetters").getIsMe(u),d=e.paymentAmount1000/1e3;return e.subtype==="send"?o("WAWebMsgGetters").getIsGroupMsg(e)?n=c?s._(/*BTDS*/"_j{\"*\":\"{senderName} te envi\\u00f3 {amount}\"}",[s._param("amount",a,[0,d]),s._param("senderName",i)]):s._(/*BTDS*/"_j{\"*\":\"{senderName} envi\\u00f3 {amount} a {receiverName}\"}",[s._param("amount",a,[0,d]),s._param("senderName",i),s._param("receiverName",l)]):n=s._(/*BTDS*/"_j{\"*\":\"Te envi\\u00f3 {amount}\"}",[s._param("amount",a,[0,d])]):o("WAWebMsgGetters").getIsGroupMsg(e)?n=c?s._(/*BTDS*/"_j{\"*\":\"{senderName} te solicit\\u00f3 {amount}\"}",[s._param("amount",a,[0,d]),s._param("senderName",i)]):s._(/*BTDS*/"_j{\"*\":\"{senderName} solicit\\u00f3 {amount} a {receiverName}\"}",[s._param("amount",a,[0,d]),s._param("senderName",i),s._param("receiverName",l)]):n=s._(/*BTDS*/"_j{\"*\":\"Te solicit\\u00f3 {amount}\"}",[s._param("amount",a,[0,d])]),n}function h(e){return e===void 0&&(e=1),s._(/*BTDS*/"_j{\"*\":\"{newMessageCount} mensajes nuevos\",\"_1\":\"1 mensaje nuevo\"}",[s._plural(e,"newMessageCount")])}h.displayName=h.name+" [from "+i.id+"]",l.getNotificationMessageBody=_,l.getNotificationBody=f,l.getPluralMessageNotificationBody=h}),226); __d("WAWebNotificationBackend",["Promise","WAWebAiHandoffNotification","WAWebCommentNotification","WAWebMsgGetters","WAWebNotificationController","WAWebNotificationsDeviceSwitchNotification","WAWebNotificationsMsgNotification","WAWebNotificationsNewsletterMilestoneNotification","WAWebNotificationsReactionNotification","WAWebNotificationsStatusReactionNotification","WAWebPollsVoteNotification","WAWebStatusGatingUtils","WAWebStatusNotification"],(function(t,n,r,o,a,i,l){var e;function s(e){return o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebNotificationsMsgNotification")).WAMsgNotification({msg:e}))}function u(e){return o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebNotificationsNewsletterMilestoneNotification")).WANewsletterMilestoneNotification(e))}function c(e){return o("WAWebStatusGatingUtils").isStatusLikesReceiveEnabled()&&o("WAWebMsgGetters").getIsStatus(e)?o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebNotificationsStatusReactionNotification")).WAStatusReactionNotification({reactionMsg:e})):o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebNotificationsReactionNotification")).WAReactionNotification({reactionMsg:e}))}function d(e){return o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebCommentNotification")).WACommentNotification({commentMsg:e}))}function m(e){return o("WAWebNotificationController").WANotificationController.closeOrCancelNotification("comment:"+e.toString())}function p(t){var r=new(o("WAWebPollsVoteNotification")).PollVoteNotification({creationMsg:t}),a=o("WAWebNotificationController").WANotificationController.getNotification(r.buildKey());return a instanceof o("WAWebPollsVoteNotification").PollVoteNotification&&a.bodyText===r.bodyText?(e||(e=n("Promise"))).resolve():o("WAWebNotificationController").WANotificationController.triggerNotification(r)}function _(e){return o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebNotificationsDeviceSwitchNotification")).WADeviceSwitchNotification(e))}function f(e){return o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebAiHandoffNotification")).AiHandoffNotification({chat:e}))}function g(){o("WAWebNotificationController").WANotificationController.closeOrCancelAllNotifications()}function h(e){o("WAWebNotificationController").WANotificationController.closeOrCancelNotificationsForChat(e)}function y(e){return o("WAWebNotificationController").WANotificationController.triggerNotification(new(o("WAWebStatusNotification")).WAStatusNotification({msg:e}))}function C(e){o("WAWebNotificationController").WANotificationController.setAppContext(e)}l.showMsgNotification=s,l.showNewsletterMilestoneNotification=u,l.showReactionNotification=c,l.showCommentNotification=d,l.removeCommentNotification=m,l.showPollVoteNotification=p,l.showDeviceSwitchNotification=_,l.showAiHandoffNotification=f,l.shutdownAsNeeded=g,l.closeNotifications=h,l.showStatusNotification=y,l.setAppContext=C}),98); __d("WAWebNotificationBanner",["WAWebBaseNotificationBanner","WAWebEmoji","WAWebURLUtils"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(t){var n=t.body,a=t.contextMenuItems,i=t.doNotOpenChat,l=t.footer,s=t.icon,u=t.isReplyable,c=t.key,d=t.msgId,m=t.onClick,p=t.renotify,_=t.suppressBanner,f=t.tag,g=t.title,h=t.wid;return e.call(this,h,d,f,c,{title:o("WAWebEmoji").EmojiUtil.normalizeAllEmojis(g),notification:window.Notification,body:o("WAWebEmoji").EmojiUtil.normalizeAllEmojis(n),icon:r("WAWebURLUtils").relToAbs(s),onClick:m,renotify:p,doNotOpenChat:i,footer:l,isReplyable:u,contextMenuItems:a,suppressBanner:_})||this}return babelHelpers.inheritsLoose(t,e),t})(r("WAWebBaseNotificationBanner"));l.default=e}),98); __d("WAWebNotificationController",["WAAbortError","WALogger","WAWebCmd","WAWebEnvironment","WAWebFrontendMsgGetters","WAWebNotificationsMsgNotification","asyncToGeneratorRuntime","cr:4692"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_=(e=n("cr:4692"))!=null?e:null,f=(function(){function e(){var e=this;this.map=new Map,this.lastMsgNotifByChat=new Map,this.$1=null,this.$2=null,_&&(this.$1=new _(this)),r("WAWebEnvironment").isWindows&&o("WAWebCmd").Cmd.on("offline_delivery_end_from_bridge",n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController: show lastest unread msg due to offline delivery end"]))),e.$3()}))}var t=e.prototype;return t.notificationExists=function(t){return this.map.has(t)},t.getNotification=function(t){return this.map.get(t)},t.closeOrCancelNotification=function(t){var e=this.getNotification(t);e&&(e.notificationBanner?e.notificationBanner.close():e.abortController&&e.abortController.abort(),this.$4(t))},t.closeOrCancelAllNotifications=function(){var e=this;this.map.forEach(function(t,n){e.closeOrCancelNotification(n)})},t.closeOrCancelNotificationsForChat=function(t){var e=this;this.map.forEach(function(n,r){n.matchesChat(t)&&e.closeOrCancelNotification(r)})},t.triggerNotification=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this,n=e.buildKey();this.$5(n,e);try{var r,a=yield e.triggerNotification((r=this.$2)==null?void 0:r.call(this));if(a!=null){if(o("WAWebNotificationsMsgNotification").shouldReplaceMsgNotificationManually()&&e instanceof o("WAWebNotificationsMsgNotification").WAMsgNotification){var i=o("WAWebFrontendMsgGetters").getChat(e.msg).id.toString(),l=this.lastMsgNotifByChat.get(i);l&&self.setTimeout(function(){return l.close()},2e3),this.lastMsgNotifByChat.set(i,a),a.waitForClose().then(function(){t.lastMsgNotifByChat.get(i)===a&&t.lastMsgNotifByChat.delete(i)})}a.waitForClose().then(function(){t.$4(n)})}else o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController: notification not invoked:"]))),this.$4(n)}catch(e){o("WAAbortError").catchAbort(function(e){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController: notification aborted: ",""])),e),t.$4(n)})(e)}return e});function t(t){return e.apply(this,arguments)}return t})(),t.setAppContext=function(t){this.$2=t},t.$3=function(){var e=null;this.map.forEach(function(t,n){(e==null||t.creationAt>e.creationAt)&&(e=t)}),e?this.triggerNotification(e):o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController: showLastestUnreadMsgNotification: no unread msg notification found"])))},t.$5=function(t,n){this.map.set(t,n)},t.$4=function(t,n){var e=this.getNotification(t);if(e==null){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController:_removeNotificationFromMap cannot find notification in map with key: ",""])),t);return}if(n!=null&&e!==n){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["WANotificationController:_removeNotificationFromMap not removing due to strict equality"])));return}this.map.delete(t)},e})(),g=new f;l.WANotificationController=g}),98); __d("WAWebNotificationHelpers",["fbt","WANullthrows","WAWebABProps","WAWebChatCollection","WAWebChatGetters","WAWebCmd","WAWebEnvironment","WAWebFbtCommon","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebGroupMetadataCollection","WAWebMsgGetters","WAWebMuteCollection","WAWebMuteGetters","WAWebNotificationConstants","WAWebOfflineHandler","WAWebParticipantListUtils","WAWebQuotedMsgModelUtils","WAWebSettingsGetters","WAWebSettingsModel","WAWebUserPrefsNotifications","gkx"],(function(t,n,r,o,a,i,l,s){function e(){return document.hasFocus()}function u(){return o("WAWebOfflineHandler").OfflineMessageHandler.isResumeOnSocketDisconnectInProgress()||!o("WAWebCmd").Cmd.isOfflineDeliveryEnd}function c(e,t){if(t===void 0&&(t=!0),!o("WAWebChatGetters").getIsGroup(e)||o("WAWebChatGetters").getIsGroup(e)&&e.isReadOnly)return!1;var n=Date.now(),a=e.squelch||0;return n>a?(t&&r("WAWebGroupMetadataCollection").find(e.id).then(function(t){if(t!=null){var n=d(e.id,t);e.squelch=Date.now()+n}}),!1):!0}function d(e,t){var n=t.participants.length;return Math.min(120,30+5*n)*1e3}function m(e){var t;return!!((t=o("WAWebFrontendMsgGetters").getChat(e).groupMetadata)!=null&&t.isParentGroup)}function p(e){return r("gkx")("26258")||!o("WAWebMsgGetters").getIsGroupMsg(e)||g(e)?!1:!!o("WAWebUserPrefsNotifications").getIgnoreNondirectGroupMsg()}function _(e){var t=o("WAWebFrontendMsgGetters").getChat(e);if(t==null||!o("WAWebMuteGetters").getIsMuted(t.mute))return!1;if(!o("WAWebChatGetters").getIsGroup(t))return!0;if(g(e)||o("WAWebMsgGetters").getHasMentionAll(e)){var n=o("WAWebMsgGetters").getSender(e);if(n==null)return!1;var r=o("WAWebChatCollection").ChatCollection.get(n);return r!=null&&o("WAWebMuteGetters").getIsMuted(r.mute)===!0}return!0}function f(e){var t=o("WAWebFrontendMsgGetters").getChat(e);return t==null||!o("WAWebMuteGetters").getIsMuted(t.mute)||!o("WAWebChatGetters").getIsGroup(t)?!1:o("WAWebMsgGetters").getHasMentionAll(e)&&o("WAWebMuteGetters").getIsMentionAllMuted(t.mute)}function g(e){return e.isMeMentioned()||o("WAWebQuotedMsgModelUtils").isMyQuotedMsg(e)}function h(e){var t=o("WAWebFrontendMsgGetters").getChat(e);if(!o("WAWebSettingsGetters").getShowArchiveV2(r("WAWebSettingsModel"))||!t.archive)return!1;if(!o("WAWebChatGetters").getIsGroup(t))return!0;if(g(e)){var n=o("WAWebChatCollection").ChatCollection.get(o("WAWebMsgGetters").getSender(e));return n!=null&&o("WAWebMuteGetters").getIsMuted(n.mute)===!0}return!0}function y(e){return o("WAWebChatGetters").getIsGroup(e)?s._(/*BTDS*/"Mensaje de grupo de WhatsApp"):s._(/*BTDS*/"Mensaje de WhatsApp")}function C(e){var t;if(e.isLocked)return r("WAWebFbtCommon")("WhatsApp").toString();if((t=e.groupMetadata)!=null&&t.isUnnamed)return o("WAWebParticipantListUtils").calculateUnnamedGroupFullParticipantsList(r("WANullthrows")(e.groupMetadata),!0);var n=e.msgs.last();if((n==null?void 0:n.subtype)==="sender_invite"){var a=o("WAWebFrontendContactGetters").getFormattedName(e.contact);return n!=null&&n.templateParams&&(n==null?void 0:n.templateParams[0])==="true"?s._(/*BTDS*/"{receiver_name} acept\u00f3 tu invitaci\u00f3n.",[s._param("receiver_name",a)]).toString():s._(/*BTDS*/"{receiver_name} se uni\u00f3 a WhatsApp.",[s._param("receiver_name",a)]).toString()}return o("WAWebFrontendContactGetters").getFormattedName(e.contact)||y(e).toString()}function b(t){return r("WAWebEnvironment").isWindows?e()&&(t==null?void 0:t.isChatsSurfaceActive)===!0:e()}function v(e){var t=o("WAWebABProps").getABPropConfigValue("wa_web_enable_granular_notifications");if(!t)return o("WAWebMuteCollection").MuteCollection.getGlobalSounds();if(e&&t){var n=o("WAWebChatGetters").getIsGroup(e);return n?o("WAWebMuteCollection").MuteCollection.getGlobalGroupSoundsEnabled():o("WAWebMuteCollection").MuteCollection.getGlobalSoundsEnabled()}return!0}function S(e){var t,n=o("WAWebABProps").getABPropConfigValue("wa_web_enable_granular_notifications");if(!r("WAWebEnvironment").isWindows&&((t=window.Notification)==null?void 0:t.permission)!==o("WAWebNotificationConstants").PERMISSION_ALLOWED)return!1;if(!n)return o("WAWebMuteCollection").MuteCollection.getGlobalNotifications();if(e){var a=o("WAWebChatGetters").getIsGroup(e);return a?o("WAWebMuteCollection").MuteCollection.getGlobalGroupNotificationsEnabled():o("WAWebMuteCollection").MuteCollection.getGlobalNotificationsEnabled()}return!0}l.appIsActive=e,l.isOfflineResumeInProgress=u,l.shouldSquelch=c,l._calculateTimeoutFromGroupMetadata=d,l.isCommunityHomeAdd=m,l.shouldIgnoreGroupMsg=p,l.isMutedAndNotMentioned=_,l.isMentionAllMutedForMsg=f,l.isMeUserMentionedOrQuoted=g,l.isArchivedAndNotMentioned=h,l.getNotificationTitle=C,l.shouldMuteDueToAppState=b,l.shouldPlaySoundGranular=v,l.shouldEnableNotificationGranular=S}),226); __d("WAWebNotificationIconUtils",["WAAbortError","WACustomError","WAFilteredCatch","WALogger","WAPromiseRaceAbort","WAPromiseTimeout","WAWebChatGetters","WAWebNotificationTone","WAWebProfilePicThumbCollection","asyncToGeneratorRuntime","bx"],(function(t,n,r,o,a,i,l){var e,s,u=(s=r("bx")).getURL(s("11319")),c=s.getURL(s("9555")),d=s.getURL(s("9556")),m=s.getURL(s("11370"));function p(e){return o("WAWebChatGetters").getIsNewsletter(e)?m:o("WAWebChatGetters").getIsGroup(e)?c:d}function _(e,t,n){return f.apply(this,arguments)}function f(){return f=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){return e.isLocked?u:g(e.id,t,n!=null?n:p(e))}),f.apply(this,arguments)}function g(t,n,a){return o("WAPromiseTimeout").promiseTimeout(r("WAPromiseRaceAbort")(o("WAWebProfilePicThumbCollection").ProfilePicThumbCollection.find(t),n),1500,"showNotificationTimeout").then(function(e){var t;if(n.aborted)throw new(o("WAAbortError")).AbortError;var r=(t=e==null?void 0:e.img)!=null?t:a;return o("WAWebNotificationTone").cachePath(r)}).catch(o("WAFilteredCatch").filteredCatch(o("WACustomError").TimeoutError,function(n){return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["NotificationBackend:IconLoadTimeoutError:",""])),t.toString()),o("WAWebNotificationTone").cachePath(a)}))}l.USER_DEFAULT_ICON=d,l.getDefaultChatNotificationIcon=p,l.getChatNotificationIcon=_,l.getNotificationIconByWid=g}),98); __d("WAWebNotificationsChatAssignmentNotification",["fbt","WANullthrows","WAWebBaseNotification","WAWebChatCollection","WAWebChatGetters","WAWebConnModel","WAWebFrontendChatGetters","WAWebGetNotificationStrings","WAWebMuteGetters","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebUserPrefsMeUser","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){var e=(function(e){function t(t){var n,a,i=t.assignmentTimestamps,l=t.chats;return a=e.call(this)||this,a.$WAWebNotificationsChatAssignmentNotification$p_1=function(){},a.chats=l.map(function(e){return o("WAWebChatCollection").ChatCollection.get(e)}).filter(function(e){return e!=null}),a.primaryChat=r("WANullthrows")(a.chats[0]),a.assignmentTimestamps=i,a.businessName=(n=o("WAWebConnModel").Conn.pushname)!=null?n:s._(/*BTDS*/"Admin.").toString(),a}babelHelpers.inheritsLoose(t,e);var a=t.prototype;return a.shouldPlaySound=function(){return e.prototype.shouldPlaySound.call(this)?o("WAWebNotificationHelpers").shouldPlaySoundGranular(this.primaryChat):!1},a.shouldShowBanner=function(){return e.prototype.shouldShowBanner.call(this)?o("WAWebNotificationHelpers").shouldEnableNotificationGranular(this.primaryChat):!1},a.shouldMute=function(t){return o("WAWebNotificationHelpers").shouldMuteDueToAppState(t)?r("WAWebNotificationMuteReason").AppState:this.chats.every(function(e){return e&&o("WAWebMuteGetters").getIsMuted(e.mute)})?r("WAWebNotificationMuteReason").MutedChat:this.chats.every(function(e){return e==null?void 0:e.archive})?r("WAWebNotificationMuteReason").ArchivedChat:o("WAWebNotificationHelpers").isOfflineResumeInProgress()?r("WAWebNotificationMuteReason").OfflineResumeInProgress:null},a.buildKey=function(){return"chat_assignment:"+this.chats.map(function(e){return e==null?void 0:e.id.toString()}).join("-")+this.assignmentTimestamps},a.matchesChat=function(t){return this.chats.length>1?!1:this.primaryChat.equals(t)},a.getChatKind=function(){return o("WAWebFrontendChatGetters").getKind(this.primaryChat)},a.performLogging=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){});function t(){return e.apply(this,arguments)}return t})(),a.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebNotificationIconUtils").getNotificationIconByWid(o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),this.abortController.signal,o("WAWebNotificationIconUtils").USER_DEFAULT_ICON)});function t(){return e.apply(this,arguments)}return t})(),a.getBannerOptions=function(){var e=o("WAWebGetNotificationStrings").getNotificationBody(babelHelpers.extends({},u(this.primaryChat,this.businessName,this.chats.length)));return{wid:this.primaryChat.id,title:this.businessName,body:e,onClick:this.$WAWebNotificationsChatAssignmentNotification$p_1}},t})(o("WAWebBaseNotification").WABaseNotification);function u(e,t,n){var r;return n===1?o("WAWebChatGetters").getIsGroup(e)?r=s._(/*BTDS*/"{businessName} te asign\u00f3 el chat con el grupo {chatName}.",[s._param("businessName",t),s._param("chatName",e.formattedTitle)]):r=s._(/*BTDS*/"{businessName} te asign\u00f3 un chat con {chatName}.",[s._param("businessName",t),s._param("chatName",e.formattedTitle)]):r=s._(/*BTDS*/"{businessNme} te asign\u00f3 {numberOfChats}.",[s._param("businessNme",t),s._param("numberOfChats",n)]),{body:r.toString()}}l.WAWebNotificationsChatAssignmentNotification=e}),226); __d("WAWebNotificationsDeviceSwitchNotification",["fbt","WAWebBaseNotification","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){var e=(function(e){function t(t){var n,r=t.otpCode,o=t.wid;return n=e.call(this)||this,n.wid=o,n.otpCode=r,n}babelHelpers.inheritsLoose(t,e);var a=t.prototype;return a.shouldMute=function(t){return o("WAWebNotificationHelpers").appIsActive()?r("WAWebNotificationMuteReason").AppState:null},a.buildKey=function(){return"registration:"+this.wid.toString()},a.getChatKind=function(){return null},a.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebNotificationIconUtils").getNotificationIconByWid(this.wid,this.abortController.signal,o("WAWebNotificationIconUtils").USER_DEFAULT_ICON)});function t(){return e.apply(this,arguments)}return t})(),a.getBannerOptions=function(){var e=s._(/*BTDS*/"No lo compartas con nadie. Tu c\u00f3digo es {otpCode}.",[s._param("otpCode",this.otpCode)]).toString(),t=s._(/*BTDS*/"C\u00f3digo para el tel\u00e9fono nuevo").toString();return{wid:this.wid,title:t,body:e,doNotOpenChat:!0}},t})(o("WAWebBaseNotification").WABaseNotification);l.WADeviceSwitchNotification=e}),226); __d("WAWebMediaUtils",["WABinary"],(function(t,n,r,o,a,i,l){function e(e){return btoa(String.fromCharCode.apply(null,o("WABinary").Binary.build(e).readByteArrayView()))}function s(t){return"data:image/jpeg;base64,"+e(t)}l.convertToBase64=e,l.convertToDataURI=s}),98); __d("WAWebUIRefreshGatingUtils",["WAWebABProps","WAWebGetSpecialAbProps"],(function(t,n,r,o,a,i,l){function e(){return o("WAWebABProps").getABPropConfigValue("web_new_chat_flow_refresh_variant")}function s(){var e;return(e=o("WAWebGetSpecialAbProps").getSpecialAbpropValue("wa_web_favicons_update_m1"))!=null?e:!1}l.newChatFlowRefreshVariant=e,l.isFaviconsUpdateEnabled=s}),98); __d("WAWebNotificationIcon",["WAAbortError","WALogger","WAWebABProps","WAWebAssetLoader","WAWebAssetLoaderSingleton","WAWebFbtCommon","WAWebL10N","WAWebMobilePlatforms","WAWebPwaDocumentMetadataUtils","WAWebUA","WAWebUIRefreshGatingUtils"],(function(t,n,r,o,a,i,l){var e,s,u,c,d="v4",m=!1,p=!1,_=0,f=!1;function g(){f||(f=!0,m=document.hidden,document.addEventListener("visibilitychange",function(){var e=m;m=document.hidden,e===!0&&m===!1&&(p=!1,b(_))}))}function h(){m===!0&&(p=!0,b(_))}function y(e){_=e,g();var t=[];e>0&&t.push("("+r("WAWebL10N").n(e)+")"),o("WAWebMobilePlatforms").isSMB()?t.push(r("WAWebFbtCommon")("WhatsApp Business").toString()):t.push(r("WAWebFbtCommon")("WhatsApp").toString());var n=t.join(" ");o("WAWebPwaDocumentMetadataUtils").setDocumentTitle(n),o("WAWebPwaDocumentMetadataUtils").isCurrentWebSessionInsidePwa()&&o("WAWebPwaDocumentMetadataUtils").setAppBadge(e),b(e)}var C;function b(t){var n;if(!o("WAWebUA").UA.isSafari){var r;t===-1?r="favicon-error2":t===0?r="favicon":t<10?r="f0"+t:t<100?r="f"+t:r="f00",m===!0&&p&&t>=0&&t<=99&&o("WAWebABProps").getABPropConfigValue("wa_web_favicon_badging_enabled")&&(r+="-badged"),C=r,(n=document.getElementById("favicon"))==null||n.remove();var a=o("WAWebUIRefreshGatingUtils").isFaviconsUpdateEnabled(),i=a?"/"+d+"/":"/",l=a?r+"-"+d:r,_={id:l,low:{default:"/favicon/1x/"+r+i},high:{default:"/favicon/2x/"+r+i}};o("WAWebAssetLoaderSingleton").AssetLoader.loadAsset(_,o("WAWebAssetLoader").LOAD_PRIORITY.NOTIFICATION_ICON,!1).then(function(t){if(C!==r){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[favicon] skipped: "," because of newer favicon: ",""])),r,C);return}var n=document.createElement("link");n.setAttribute("id","favicon"),n.setAttribute("rel","icon"),n.setAttribute("type","image/png"),n.setAttribute("href",t);var a=document.getElementsByTagName("head");a!=null&&a[0]&&a[0].appendChild(n),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[favicon] updated: ",""])),r)}).catch(o("WAAbortError").catchAbort(function(){o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[favicon] update aborted: ",""])),r)})).catch(function(e){o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Error updating favicon: ",""])),e).sendLogs("favicon-fetch-error")})}}l.notifyBackgroundActivity=h,l.setTitleAndIcon=y}),98); __d("WAWebNotificationsMsgNotification",["fbt","WAWebBaseNotification","WAWebBizAiAgentStatusUtils","WAWebBotGating","WAWebBotTypes","WAWebChatThreadLogging","WAWebElevatedPushNamesFlag","WAWebEnvironment","WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebGroupSafetyCheckUtils","WAWebMediaUtils","WAWebMsgGetters","WAWebMsgType","WAWebNotificationController","WAWebNotificationEngagementWamEvent","WAWebNotificationHelpers","WAWebNotificationIcon","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebUA","WAWebViewMode.flow","WAWebViewModeUtils","WAWebVoipGatingUtils","WAWebWamEnumNotificationTypeEnum","asyncToGeneratorRuntime","cr:3133","cr:4404","gkx"],(function(t,n,r,o,a,i,l,s){var e,u,c=(e=n("cr:3133"))!=null?e:{},d=c.getContextMenuItems,m=c.isReplyable,p=c.shouldIgnoreSquelchForGroupMention,_=(u=n("cr:4404"))!=null?u:{},f=_.getMessageNotificationFooter,g=_.getNotificationBodyForPreviewOff,h=new Set([o("WAWebMsgType").MSG_TYPE.ALBUM]),y=(function(e){function t(t){var n,r=t.msg;return n=e.call(this)||this,n.msg=r,n}babelHelpers.inheritsLoose(t,e);var a=t.prototype;return a.shouldPlaySound=function(){if(!e.prototype.shouldPlaySound.call(this))return!1;var t=o("WAWebFrontendMsgGetters").getChat(this.msg);return o("WAWebNotificationHelpers").shouldPlaySoundGranular(t)&&!o("WAWebMsgGetters").getIsEdited(this.msg)},a.shouldShowBanner=function(){if(!e.prototype.shouldShowBanner.call(this))return!1;var t=o("WAWebFrontendMsgGetters").getChat(this.msg);return o("WAWebNotificationHelpers").shouldEnableNotificationGranular(t)},a.shouldMute=function(t){if(r("WAWebEnvironment").isWindows&&this.msg.viewed)return r("WAWebNotificationMuteReason").IgnoreViewedMsgs;if(this.msg.read===!0)return r("WAWebNotificationMuteReason").ReadByPeer;var e=o("WAWebFrontendMsgGetters").getChat(this.msg);return o("WAWebNotificationHelpers").shouldMuteDueToAppState(t)?r("WAWebNotificationMuteReason").AppState:o("WAWebGroupSafetyCheckUtils").shouldMuteMentionWhileGroupSafetyChecked(this.msg)?r("WAWebNotificationMuteReason").GroupSafetyCheck:o("WAWebNotificationHelpers").isMutedAndNotMentioned(this.msg)?r("WAWebNotificationMuteReason").MutedChat:o("WAWebNotificationHelpers").isMentionAllMutedForMsg(this.msg)?r("WAWebNotificationMuteReason").MentionAllMuted:o("WAWebNotificationHelpers").isArchivedAndNotMentioned(this.msg)?r("WAWebNotificationMuteReason").ArchivedChat:o("WAWebNotificationHelpers").isCommunityHomeAdd(this.msg)?r("WAWebNotificationMuteReason").IgnoreAddedToCommunityHome:!r("gkx")("26258")&&o("WAWebNotificationHelpers").shouldIgnoreGroupMsg(this.msg)?r("WAWebNotificationMuteReason").IgnoreGroupMsg:o("WAWebMsgGetters").getIsFutureproof(this.msg)?r("WAWebNotificationMuteReason").IgnoreFutureProof:o("WAWebNotificationHelpers").isOfflineResumeInProgress()?r("WAWebNotificationMuteReason").OfflineResumeInProgress:o("WAWebMsgGetters").getIsBizContentPlaceholder(this.msg)?r("WAWebNotificationMuteReason").IgnoreBizContentPlaceholder:o("WAWebMsgGetters").getIsCallSilenced(this.msg)||o("WAWebVoipGatingUtils").isCallingEnabled()&&this.msg.type===o("WAWebMsgType").MSG_TYPE.CALL_LOG&&this.msg.subtype==null?r("WAWebNotificationMuteReason").IgnoreCallMsgs:e.id.isBot()&&(!o("WAWebBotGating").isBotEnabled()||this.msg.botMsgBodyType===o("WAWebBotTypes").BotMsgBodyType.VOICE)?r("WAWebNotificationMuteReason").IgnoreBotMsgs:b(this.msg)?r("WAWebNotificationMuteReason").IgnoreInternalSilentTag:o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.NOTIFICATION,this.msg.viewMode)?o("WAWebBizAiAgentStatusUtils").shouldMuteNotification(e)?r("WAWebNotificationMuteReason").AIRepliesOn:null:r("WAWebNotificationMuteReason").IgnoreHiddenViewModeMsgs},a.shouldSquelch=function(){var e=o("WAWebNotificationController").WANotificationController.notificationExists(this.buildKey());return e&&(o("WAWebMsgGetters").getIsEdited(this.msg)||h.has(this.msg.type))||p!=null&&p(this.msg)?null:o("WAWebNotificationHelpers").shouldSquelch(o("WAWebFrontendMsgGetters").getChat(this.msg))?r("WAWebNotificationMuteReason").GroupFlood:null},a.buildKey=function(){var e,t;return"msg:"+((e=(t=this.msg.latestEditMsgKey)==null?void 0:t.toString())!=null?e:this.msg.id.toString())},a.matchesChat=function(t){return t.equals(o("WAWebFrontendMsgGetters").getMaybeChat(this.msg))},a.getChatKind=function(){return o("WAWebFrontendChatGetters").getKind(o("WAWebFrontendMsgGetters").getChat(this.msg))},a.getDefaultIcon=function(){return o("WAWebMsgGetters").getIsProductListMessage(this.msg)?o("WAWebMediaUtils").convertToDataURI(o("WAWebMsgGetters").getProductListHeaderImage(this.msg)):o("WAWebNotificationIconUtils").getDefaultChatNotificationIcon(o("WAWebFrontendMsgGetters").getChat(this.msg))},a.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebNotificationIconUtils").getChatNotificationIcon(o("WAWebFrontendMsgGetters").getChat(this.msg),this.abortController.signal,this.getDefaultIcon())});function t(){return e.apply(this,arguments)}return t})(),a.getBannerOptions=function(){var e=this.msg,t=v(e),a=o("WAWebGetNotificationStrings").getNotificationBody(babelHelpers.extends({},t,{msgDir:o("WAWebFrontendMsgGetters").getDir(e)})),i=o("WAWebFrontendMsgGetters").getChat(this.msg),l=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield o("WAWebChatThreadLogging").getChatThreadID(i.id.toJid());new(o("WAWebNotificationEngagementWamEvent")).NotificationEngagementWamEvent({threadId:e}).commit()});return function(){return e.apply(this,arguments)}})();return{wid:i.id,msgId:this.msg.id.toString(),tag:S()?this.msg.id.toString():i.id.toString(),title:o("WAWebNotificationHelpers").getNotificationTitle(i),body:a,onClick:function(){r("gkx")("26258")||l()},renotify:!o("WAWebMsgGetters").getIsEdited(this.msg),footer:t.footer,contextMenuItems:this.getContextMenuItems()}},a.isReplyable=function(){var e;return(e=m==null?void 0:m(this.msg))!=null?e:!1},a.getContextMenuItems=function(){var e;return(e=d==null?void 0:d(this.msg))!=null?e:[]},a.beforeBannerShown=function(){return o("WAWebNotificationIcon").notifyBackgroundActivity(),e.prototype.beforeBannerShown.call(this)},a.playSound=function(){o("WAWebNotificationIcon").notifyBackgroundActivity(),e.prototype.playSound.call(this)},a.getNotificationDeliveryWamEventData=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return{uiNotificationType:C(this.msg),triggeredByOfflineMessage:this.msg.isOffline===!0}});function t(){return e.apply(this,arguments)}return t})(),t})(o("WAWebBaseNotification").WABaseNotification);function C(e){switch(e.type){case o("WAWebMsgType").MSG_TYPE.CHAT:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.TEXT_MESSAGE;case o("WAWebMsgType").MSG_TYPE.IMAGE:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.PHOTO_MESSAGE;case o("WAWebMsgType").MSG_TYPE.VIDEO:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.VIDEO_MESSAGE;case o("WAWebMsgType").MSG_TYPE.PTT:case o("WAWebMsgType").MSG_TYPE.AUDIO:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.VOICE_MESSAGE;case o("WAWebMsgType").MSG_TYPE.DOCUMENT:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.FILE_MESSAGE;case o("WAWebMsgType").MSG_TYPE.STICKER:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.STICKER_MESSAGE;case o("WAWebMsgType").MSG_TYPE.LOCATION:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.LOCATION_MESSAGE;case o("WAWebMsgType").MSG_TYPE.VCARD:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.CONTACT_MESSAGE;case o("WAWebMsgType").MSG_TYPE.POLL_CREATION:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.POLL_MESSAGE;case o("WAWebMsgType").MSG_TYPE.CALL_LOG:return e.subtype==="miss"||e.subtype==="miss_group"?o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.MISSED_VOICE_CALL:e.subtype==="miss_video"||e.subtype==="miss_group_video"?o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.MISSED_VIDEO_CALL:o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.OTHER;default:return o("WAWebWamEnumNotificationTypeEnum").NOTIFICATION_TYPE_ENUM.OTHER}}function b(e){var t;return!r("gkx")("26258")&&((t=e.body)==null||(t=t.toLowerCase())==null?void 0:t.includes("@silent"))===!0}function v(e){var t,n=null,r=o("WAWebFrontendMsgGetters").getChat(e),a=o("WAWebElevatedPushNamesFlag").elevatedPushNamesM2Enabled(r),i=o("WAWebMsgGetters").getIsGroupMsg(e)||o("WAWebMsgGetters").getIsMetaBotInvokeResponse(e)?e.displayName({withPushName:a,withPushNameOnly:a,newPushNameFormatting:a,showVerifiedName:a}):void 0;if(r.isLocked)return{body:o("WAWebGetNotificationStrings").getPluralMessageNotificationBody(r.unreadCount).toString()};if(e.type===o("WAWebMsgType").MSG_TYPE.CHAT&&!e.shouldShowNotificationPreview()){var l,u=(l=g==null?void 0:g())!=null?l:null;u!=null?n=u:o("WAWebMsgGetters").getIsGroupMsg(e)?i!=null?(n=s._(/*BTDS*/"Mensaje de {name}",[s._param("name",i)]),i=void 0):n=s._(/*BTDS*/"Mensaje nuevo"):n=o("WAWebGetNotificationStrings").getPluralMessageNotificationBody(r.unreadCount)}else e.type===o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE&&e.subtype==="sender_invite"?e.templateParams&&e.templateParams[0]==="true"?n=s._(/*BTDS*/"Saluda por WhatsApp."):n=s._(/*BTDS*/"Env\u00eda un saludo."):n=o("WAWebGetNotificationStrings").getNotificationMessageBody(e);var c=(t=f==null?void 0:f(r.unreadCount))!=null?t:null;return babelHelpers.extends({body:n.toString(),author:i},c!=null&&{footer:c.toString()})}function S(){return o("WAWebUA").UA.isBlink&&o("WAWebUA").UA.os===o("WAWebUA").OS_TYPE.MAC}l.eligibleMessagesForNotificationRetriggering=h,l.WAMsgNotification=y,l.getNotificationParts=v,l.shouldReplaceMsgNotificationManually=S}),226); __d("WAWebNotificationsNewsletterMilestoneNotification",["fbt","WALogger","WAWebBaseNotification","WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebGetNotificationStrings","WAWebL10N","WAWebNewsletterGatingUtils","WAWebNewsletterModelUtils","WAWebNoop","WAWebNotificationHelpers","WAWebNotificationIconUtils","WAWebNotificationMuteReason","WAWebPollCreationUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l,s){var e,u,c=(function(t){function a(e){var n,r=e.milestoneType,o=e.msg,a=e.reactionCode,i=e.value;return n=t.call(this)||this,n.msg=o,n.milestoneType=r,n.value=i,n.reactionCode=a,n}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.buildKey=function(){var e;return"newsletter-milestone:"+this.msg.id.toString()+":"+this.milestoneType+":"+this.value+":"+((e=this.reactionCode)!=null?e:"")},i.getIcon=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){return o("WAWebNotificationIconUtils").getChatNotificationIcon(o("WAWebFrontendMsgGetters").getChat(this.msg),this.abortController.signal)});function t(){return e.apply(this,arguments)}return t})(),i.shouldMute=function(n){var e=t.prototype.shouldMute.call(this,n);if(e!=null)return e;var a=o("WAWebFrontendMsgGetters").getChat(this.msg).newsletterMetadata;return o("WAWebNewsletterGatingUtils").isNewsletterAdminNotificationsEnabled(a)?o("WAWebNewsletterModelUtils").isMuted(a.followerActivityMuteExpiration)?r("WAWebNotificationMuteReason").NewsletterFollowerActivityMuted:null:r("WAWebNotificationMuteReason").NewsletterFollowerActivityDisabled},i.shouldPlaySound=function(){if(!t.prototype.shouldPlaySound.call(this))return!1;var e=o("WAWebFrontendMsgGetters").getChat(this.msg);return o("WAWebNotificationHelpers").shouldPlaySoundGranular(e)},i.getBody=function(){e:{var t=this.milestoneType;if(t==="FOLLOWS")return s._(/*BTDS*/"_j{\"*\":\"\\ud83c\\udf89 Tu canal tiene {channel_followers_count} seguidores.\",\"_1\":\"\\ud83c\\udf89 Tu canal tiene {channel_followers_count} nuevo seguidor.\"}",[s._plural(this.value),s._param("channel_followers_count",r("WAWebL10N").d(this.value))]).toString();if(t==="MESSAGE_REACTIONS"||t==="MESSAGE_RESPONSES"||t==="MESSAGE_VOTES")return o("WAWebGetNotificationStrings").getNotificationMessageBody(this.msg);{return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter] unsupported milestone type: ",""])),this.milestoneType),"";break e}}},i.getAction=function(){e:{var e=this.milestoneType;if(e==="FOLLOWS")return"";if(e==="MESSAGE_REACTIONS")return this.value<=1?s._(/*BTDS*/"{channel_reaction} reacci\u00f3n a:",[s._param("channel_reaction",this.reactionCode)]).toString():s._(/*BTDS*/"{channel_reaction} reacciones a:",[s._param("channel_reaction",r("WAWebL10N").d(this.value))]).toString();if(e==="MESSAGE_RESPONSES")return s._(/*BTDS*/"_j{\"*\":\"{channel_followers_count} respuestas a:\",\"_1\":\"{channel_followers_count} respuesta a:\"}",[s._plural(this.value),s._param("channel_followers_count",r("WAWebL10N").d(this.value))]).toString();if(e==="MESSAGE_VOTES")return this.msg.pollType===o("WAWebPollCreationUtils").PollType.QUIZ?s._(/*BTDS*/"_j{\"*\":\"{channel_followers_count} respuestas a:\",\"_1\":\"{channel_followers_count} respuesta a:\"}",[s._plural(this.value),s._param("channel_followers_count",r("WAWebL10N").d(this.value))]).toString():s._(/*BTDS*/"_j{\"*\":\"{channel_followers_count} votos en:\",\"_1\":\"{channel_followers_count} voto en:\"}",[s._plural(this.value),s._param("channel_followers_count",r("WAWebL10N").d(this.value))]).toString();{return o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["[mex][newsletter] unsupported milestone type: ",""])),this.milestoneType),"";break e}}},i.getBannerOptions=function(){var e=o("WAWebFrontendMsgGetters").getChat(this.msg),t=o("WAWebGetNotificationStrings").getNotificationBody({action:this.getAction(),body:this.getBody(),msgDir:o("WAWebFrontendMsgGetters").getDir(this.msg)});return{wid:e.id,msgId:this.msg.id.toString(),onClick:r("WAWebNoop"),tag:this.msg.id.toString(),doNotOpenChat:!1,title:o("WAWebNotificationHelpers").getNotificationTitle(e),body:t}},i.matchesChat=function(t){return t.equals(o("WAWebFrontendMsgGetters").getMaybeChat(this.msg))},i.getChatKind=function(){return o("WAWebFrontendChatGetters").getKind(o("WAWebFrontendMsgGetters").getChat(this.msg))},a})(o("WAWebBaseNotification").WABaseNotification);l.WANewsletterMilestoneNotification=c}),226); __d("WAWebStateConcern",["WALogger","WAWebBaseMirror","WAWebBaseModel","WAWebCollections","WAWebProxyStateFactory","WAWebStreamModel"],(function(t,n,r,o,a,i,l){var e,s,u,c;n("WAWebCollections");function d(e){return typeof e=="string"?e:e.toString?e.toString():"Invalid Object"}function m(t,n,r,a){var i={$ProxyState$ComponentName:{value:t},proxyBitMask:{value:o("WAWebBaseMirror").genBitMask(n.prototype.mirrorMask,r)}},l=function(r){var n={};n.enumerable=!0,n.get=function(){return this.$ProxyState$state.get(r)},n.set=function(){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(['READ ONLY: Cannot write to proxied property "','", created in <'," />, it is not writable."])),r,t)},a||(n.set=function(e){this.$ProxyState$state.set(r,e)}),i[r]=n};for(var s of r)l(s);function u(e){n.call(this,e)}return u.prototype=Object.create(n.prototype,i),u.prototype.constructor=u,u}var p=(function(){function e(e,t,n,r,a){a===void 0&&(a=!1),this.componentName=e,this.name=t,this.$1=r,this.keys=n;var i=o("WAWebProxyStateFactory").ProxyStates[t];i||o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(['Unknown StateHOC concern type "','"'])),t).sendLogs("state-hoc-error"),this.$2=i,this.$3=m(e,i,n,a)}var t=e.prototype;return t.getModel=function(t){return t instanceof this.$2?t.$ProxyState$state:t},t.getModelAndValidate=function(t){var e=t instanceof this.$2?t.$ProxyState$state:t;return e?e instanceof o("WAWebBaseModel").BaseModel?e:(o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose([""," given invalid object for ",": ",""])),this.componentName,this.name,d(e)).sendLogs("state-hoc-error"),null):(o("WAWebStreamModel").Stream.mode===o("WAWebStreamModel").StreamMode.MAIN&&o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose([""," was not supplied the "," model with keys ","."])),this.componentName,this.name,String(this.keys)).sendLogs("state-hoc-error"),null)},t.createProxy=function(t){return new this.$3(t)},t.attachConcern=function(t,n,r){t.incObservers(!this.$1),t.mirror.addListener(r,n,this)},t.detachConcern=function(t,n){t.decObservers(),t.mirror.removeListener(n)},e})();l.default=p}),98); __d("WAWebHostedGroupUtils",["fbt","WAWebABProps","WAWebFrontendContactGetters"],(function(t,n,r,o,a,i,l,s){var e=function(){return o("WAWebABProps").getABPropConfigValue("is_capi_groups_alpha_enabled")},u=function(t,n){return n===void 0&&(n=!1),n?s._(/*BTDS*/"{ownerName} usa un servicio seguro de Meta para administrar este chat.",[s._param("ownerName",o("WAWebFrontendContactGetters").getFormattedName(t))]):s._(/*BTDS*/"{ownerName} usa un servicio seguro de Meta para administrar este chat. Toca para obtener m\u00e1s informaci\u00f3n.",[s._param("ownerName",o("WAWebFrontendContactGetters").getFormattedName(t))])};l.isWAHostedGroupEnabled=e,l.getSecureServicesBannerText=u}),226); __d("WAWebParticipantListUtils",["fbt","WAWebABProps","WAWebAlphaRegex","WAWebBotGroupGatingUtils","WAWebBotUtils","WAWebContactCollection","WAWebContactGetters","WAWebFbtIntlList","WAWebFrontendContactGetters","WAWebHostedGroupUtils","WAWebMiscGatingUtils","compactMap","fbs","partitionArray"],(function(t,n,r,o,a,i,l,s){function e(e){if(e.participants.length===0)return s._(/*BTDS*/"Grupo").toString();if(e.participants.length===1){var t,n=(t=e.participants.head())==null?void 0:t.contact;if(n!=null&&o("WAWebContactGetters").getIsMe(n))return s._(/*BTDS*/"T\u00fa").toString()}var a=c(e,!0);if(a.length===1)return a[0];if(a.length<=3)return r("WAWebFbtIntlList")(a,r("WAWebFbtIntlList").CONJUNCTIONS.AND,r("WAWebFbtIntlList").DELIMITERS.COMMA).toString();if(a.length>=4){var i=a[0],l=s._(/*BTDS*/"_j{\"*\":\"{other_participants} m\\u00e1s\",\"_1\":\"1 m\\u00e1s\"}",[s._plural(a.length-1,"other_participants")]).toString();return r("WAWebFbtIntlList")([i,l],r("WAWebFbtIntlList").CONJUNCTIONS.AND).toString()}return a.join()}function u(e,t,n){if(t===void 0&&(t=!1),n===void 0&&(n=!1),e.participants.length===0)return n?r("fbs")._(/*BTDS*/"Esperando a que otras personas se unan\u2026").toString():r("fbs")._(/*BTDS*/"Grupo").toString();if(e.participants.length===1){var a,i=(a=e.participants.head())==null?void 0:a.contact;if(i!=null&&o("WAWebContactGetters").getIsMe(i))return s._(/*BTDS*/"T\u00fa").toString()}var l=c(e,t);if(l.length===1)return l.pop();var u=r("WAWebFbtIntlList")(l,r("WAWebFbtIntlList").CONJUNCTIONS.AND,r("WAWebFbtIntlList").DELIMITERS.COMMA);return u.toString()}function c(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0);var a,i=e.participants.length;t?a=e.participants.filter(function(e){return!o("WAWebContactGetters").getIsMe(e.contact)}):a=e.participants;var l=a.filter(function(e){return o("WAWebFrontendContactGetters").getIsMyContact(e.contact)}),s=a.filter(function(e){return!o("WAWebFrontendContactGetters").getIsMyContact(e.contact)}),u=[];o("WAWebABProps").getABPropConfigValue("elevated_push_names_v2_m2_enabled")&&i>=3&&(u=s.filter(function(e){return o("WAWebContactGetters").getNotifyName(e.contact)!=null}));var c=s.filter(function(e){return!u.includes(e)}),d=c,m=[];o("WAWebMiscGatingUtils").isDropLastNameEnabled()?m=l.map(function(t){var n=t.contact;return e.hasUniqueShortNameMention(n)?o("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(n):o("WAWebFrontendContactGetters").getFormattedName(n).replace(/\s/g," ")}):m=l.map(function(e){var t=n?o("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(e.contact):o("WAWebFrontendContactGetters").getFormattedName(e.contact);return t===""&&e.contact.name?e.contact.name:t});var p=[];o("WAWebMiscGatingUtils").isDropLastNameEnabled()?p=u.map(function(e){var t=e.contact,n=o("WAWebContactGetters").getNotifyName(t),r=n!=null?n:o("WAWebFrontendContactGetters").getFormattedName(t);return"~"+r.replace(/\s/g," ")}):p=u.map(function(e){var t=o("WAWebContactGetters").getNotifyName(e.contact),a;t!=null?a=t:n?a=o("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(e.contact):a=o("WAWebFrontendContactGetters").getFormattedName(e.contact);var i=a.split(/\s/),l=i[0];return"~"+(r("WAWebAlphaRegex").exec(l)?l:a)});var _=d.map(function(e){return o("WAWebFrontendContactGetters").getFormattedName(e.contact)});return m.sort().concat(p.sort().concat(_.sort()))}function d(e){var t=o("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(e);if(o("WAWebBotGroupGatingUtils").isOpenGroupBotParticipantAddEnabled()&&e.id.isBot())return t;var n=t.split(/\s/),a=n[0];return r("WAWebAlphaRegex").exec(a)?a:t}function m(e,t){var n=e,a=r("partitionArray")(n,function(e){return o("WAWebContactGetters").getIsMe(e.contact)}),i=a[0],l=a[1];if(n=l.concat(i),o("WAWebMiscGatingUtils").isDropLastNameEnabled()&&t.isOpenBotGroup!==!0)return r("compactMap")(n,function(e){var n=e.contact;return t.hasUniqueShortNameMention(n)?o("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(n):o("WAWebFrontendContactGetters").getFormattedName(n).replace(/\s/g," ")});if(o("WAWebHostedGroupUtils").isWAHostedGroupEnabled()&&t.hasCapi===!0){var s=r("partitionArray")(n,function(e){return e.id.equals(t.owner)}),u=s[0],c=s[1];n=u.concat(c)}if(o("WAWebBotGroupGatingUtils").isOpenGroupBotParticipantAddEnabled()&&t.isOpenBotGroup===!0){var m=r("partitionArray")(n,function(e){return e.id.equals(o("WAWebBotUtils").META_BOT_FBID_WID)}),p=m[0],_=m[1];n=p.concat(_)}return r("compactMap")(n,function(e){return d(e.contact)})}function p(e){return m(e.participants.toArray(),e)}function _(e){return m(e.participants.getAdmins(),e)}function f(e,t){t===void 0&&(t=!0);var n=e.participants.length;if(n===0)return s._(/*BTDS*/"Llamada grupal").toString();var o=c(e,!1,t);if(n===1)return o[0];if(n===2)return r("WAWebFbtIntlList")(o.slice(0,2),r("WAWebFbtIntlList").CONJUNCTIONS.AND).toString();var a=o[0],i=n-1,l=s._(/*BTDS*/"_j{\"*\":\"{other_participants} m\\u00e1s\",\"_1\":\"1 m\\u00e1s\"}",[s._plural(i,"other_participants")]).toString();return r("WAWebFbtIntlList")([a,l],r("WAWebFbtIntlList").CONJUNCTIONS.AND).toString()}function g(e,t){t===void 0&&(t=!0);var n=e.length;if(n===0)return s._(/*BTDS*/"Llamada grupal").toString();var a=e.map(function(e){var n=o("WAWebContactCollection").ContactCollection.get(e);return n==null?e.toString():o("WAWebContactGetters").getIsMe(n)?s._(/*BTDS*/"T\u00fa").toString():t?o("WAWebFrontendContactGetters").getFormattedShortNameWithNonBreakingSpaces(n):o("WAWebFrontendContactGetters").getFormattedName(n)});if(n===1)return a[0];if(n===2)return r("WAWebFbtIntlList")(a.slice(0,2),r("WAWebFbtIntlList").CONJUNCTIONS.AND).toString();var i=a[0],l=n-1,u=s._(/*BTDS*/"_j{\"*\":\"{other_participants} m\\u00e1s\",\"_1\":\"1 m\\u00e1s\"}",[s._plural(l,"other_participants")]).toString();return r("WAWebFbtIntlList")([i,u],r("WAWebFbtIntlList").CONJUNCTIONS.AND).toString()}l.calculateUnnamedGroupParticipantsList=e,l.calculateUnnamedGroupFullParticipantsList=u,l.getFirstNameForContact=d,l.calculateParticipantsList=p,l.calculateAdminsList=_,l.formatParticipantNames=f,l.formatParticipantWidsPreserveOrder=g}),226); __d("WAWebCxtUrl",["WAWebL10N"],(function(t,n,r,o,a,i,l){var e="https://faq.whatsapp.com";function s(t){return e+"/cxt/?entrypointid="+t+"&platform=web&lang="+r("WAWebL10N").getNormalizedLocale()}function u(){return s("invite-via-link-unavailable")}function c(){return s("community-no-longer-available")}l.getGroupInviteGrowthLockedFaqUrl=u,l.getCommunityNotAvailableFaqUrl=c}),98); __d("WAWebSuspendedCommunityModalLoadable",["fbt","JSResourceForInteraction","WAWebLazyLoadedRetriable","WAWebLoadingConfirmPopup.react","asyncToGeneratorRuntime","react","react-loadable"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react")),c=r("WAWebLazyLoadedRetriable")(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=yield r("JSResourceForInteraction")("WAWebSuspendedCommunityModal.react").__setRef("WAWebSuspendedCommunityModalLoadable").load();return e.SuspendedCommunityModal}),"SuspendedCommunityModal"),d=r("react-loadable")({loader:c,loading:function(t){return u.jsx(r("WAWebLoadingConfirmPopup.react"),{title:s._(/*BTDS*/"Comunidad no disponible"),error:!!t.error})}});l.SuspendedCommunityModalLoadable=d}),226); __d("WAWebSuspendedCommunityUtils",["fbt","WAWebChatCollection","WAWebConfirmPopup.react","WAWebCxtUrl","WAWebExternalLink.react","WAWebModalManager","WAWebSuspendedCommunityModalLoadable","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react")),c="community-suspend-appeal";function d(){o("WAWebModalManager").ModalManager.open(u.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{onOK:function(){o("WAWebModalManager").ModalManager.close()},onCancel:function(){o("WAWebModalManager").ModalManager.close(),o("WAWebExternalLink.react").openExternalLink(o("WAWebCxtUrl").getCommunityNotAvailableFaqUrl())},okText:s._(/*BTDS*/"Descartar"),cancelText:s._(/*BTDS*/"M\u00e1s informaci\u00f3n"),title:s._(/*BTDS*/"Esta comunidad ya no est\u00e1 disponible.")}),{transition:"modal-flow"})}function m(e){var t,n=(t=e.groupMetadata)==null?void 0:t.parentGroup;if(n!=null){var r=o("WAWebChatCollection").ChatCollection.get(n);r!=null&&o("WAWebModalManager").ModalManager.open(u.jsx(o("WAWebSuspendedCommunityModalLoadable").SuspendedCommunityModalLoadable,{community:r}),{transition:"modal-flow"})}}l.SUSPENDED_COMMUNITY_SUPPORT_TAG=c,l.openTerminatedCommunityModal=d,l.openSuspendedCommunityModal=m}),226); __d("WAWebGetThreadType",["WAWebChatGetters","WAWebGroupType","WAWebWamEnumThreadType"],(function(t,n,r,o,a,i,l){function e(e){if(o("WAWebChatGetters").getIsBroadcast(e))return o("WAWebWamEnumThreadType").THREAD_TYPE.BROADCAST;if(o("WAWebChatGetters").getIsNewsletter(e))return o("WAWebWamEnumThreadType").THREAD_TYPE.CHANNEL;var t=e==null?void 0:e.groupMetadata;if(!t)return o("WAWebWamEnumThreadType").THREAD_TYPE.INDIVIDUAL;switch(t.groupType){case o("WAWebGroupType").GroupType.COMMUNITY:return o("WAWebWamEnumThreadType").THREAD_TYPE.PARENT_GROUP;case o("WAWebGroupType").GroupType.DEFAULT:return o("WAWebWamEnumThreadType").THREAD_TYPE.GROUP;case o("WAWebGroupType").GroupType.LINKED_SUBGROUP:return o("WAWebWamEnumThreadType").THREAD_TYPE.SUB_GROUP;case o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP:return o("WAWebWamEnumThreadType").THREAD_TYPE.DEFAULT_SUB_GROUP;case o("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP:return o("WAWebWamEnumThreadType").THREAD_TYPE.SUB_GROUP}}l.getThreadType=e}),98); __d("WAWebWamEnumUserRoleType",[],(function(t,n,r,o,a,i){var e=Object.freeze({MEMBER:0,ADMIN:1,CADMIN:2});i.USER_ROLE_TYPE=e}),66); __d("WAWebGetUserRole",["WAWebWamEnumUserRoleType"],(function(t,n,r,o,a,i,l){function e(e){var t=e==null?void 0:e.groupMetadata;if(t==null)return null;var n=t.participants.iAmAdmin(),r=n&&t.isParentGroup;return r===!0?o("WAWebWamEnumUserRoleType").USER_ROLE_TYPE.CADMIN:n===!0?o("WAWebWamEnumUserRoleType").USER_ROLE_TYPE.ADMIN:o("WAWebWamEnumUserRoleType").USER_ROLE_TYPE.MEMBER}l.getUserRole=e}),98); __d("WAWebGroupJourneyWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumChatFilterActionTypes","WAWebWamEnumSurfaceType","WAWebWamEnumThreadType","WAWebWamEnumTsSurface","WAWebWamEnumUserRoleType"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({GroupJourney:[4512,{actionType:[1,o("WAWebWamEnumChatFilterActionTypes").CHAT_FILTER_ACTION_TYPES],appSessionId:[2,o("WAWebWamCodegenUtils").TYPES.STRING],groupSize:[3,o("WAWebWamCodegenUtils").TYPES.INTEGER],surface:[4,o("WAWebWamEnumSurfaceType").SURFACE_TYPE],threadType:[5,o("WAWebWamEnumThreadType").THREAD_TYPE],uiSurface:[7,o("WAWebWamEnumTsSurface").TS_SURFACE],userRole:[6,o("WAWebWamEnumUserRoleType").USER_ROLE_TYPE]},[1,1,1],"regular"]},{GroupJourney:[]});l.GroupJourneyWamEvent=e}),98); __d("WAWebCommunityGroupJourneyEventImpl",["WALogger","WAWebGetSharedSessionId","WAWebGetThreadType","WAWebGetUserRole","WAWebGroupJourneyWamEvent","WAWebWamEnumSurfaceType"],(function(t,n,r,o,a,i,l){var e,s=(function(){function t(e){var t=e.action,n=e.chat,r=e.surface;this.action=t,this.surface=r,this.chat=n,this.sessionId=o("WAWebGetSharedSessionId").getSharedSessionId()}t.inviteModalSourceToSurface=function(n){var t;e:{if(n==="community_home"){t=o("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_HOME;break e}if(n==="community_nav"){t=o("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_NAV;break e}if(n==="subgroup_switcher"){t=o("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_NAV_SHEET;break e}if(n==="invite_link"||n==="group_mention"){t=o("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT;break e}if(n==="other"){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["No relevant communtiy journey log for this invite modal"]))),t=null;break e}throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+n)}return t};var n=t.prototype;return n.shouldLogThreadType=function(){switch(this.surface){case o("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT:case o("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHATLIST:case o("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_HOME:case o("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_TAB:case o("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_NAV:case o("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_NAV_SHEET:case o("WAWebWamEnumSurfaceType").SURFACE_TYPE.COMMUNITY_SETTINGS:case o("WAWebWamEnumSurfaceType").SURFACE_TYPE.GROUP_INFO:return!0;default:return!1}},n.getThreadType=function(){var e;return!this.shouldLogThreadType()||((e=this.chat)==null?void 0:e.groupMetadata)==null?null:o("WAWebGetThreadType").getThreadType(this.chat)},n.getGroupSize=function(){var e,t,n=(e=this.chat)==null?void 0:e.groupMetadata;return n==null?0:(t=n.participants.length)!=null?t:0},n.getUserRole=function(){return o("WAWebGetUserRole").getUserRole(this.chat)},n.commit=function(){var e=new(o("WAWebGroupJourneyWamEvent")).GroupJourneyWamEvent({actionType:this.action,appSessionId:this.sessionId,surface:this.surface,groupSize:this.getGroupSize()}),t=this.getThreadType();t!=null&&(e.threadType=t);var n=this.getUserRole();n!=null&&(e.userRole=n),e.commit()},t})();l.CommunityGroupJourneyEvent=s}),98); __d("WAWebCommunitySquircleIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","innerStyles","name","viewBox","width"],s,u,c=s||(s=r("react")),d="community-squircle";function m(t){var n=t.height,a=t.iconXstyle,i=t.innerStyles,l=t.name,s=t.viewBox,m=t.width,p=babelHelpers.objectWithoutPropertiesLoose(t,e),_;if(s){var f=s.height,g=f===void 0?0:f,h=s.width,y=h===void 0?0:h,C=s.x,b=C===void 0?0:C,v=s.y,S=v===void 0?0:v;_=[b,S,y,g].join(" ")}var R=180,L=180;return(n!=null||m!=null)&&(R=n,L=m),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:l!=null?l:d},p,{children:c.jsxs("svg",{viewBox:_!=null?_:"0 0 180 180",height:R,width:L,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),fill:"none",children:[c.jsx("title",{children:l!=null?l:d}),c.jsx("path",{d:"M90 0C1.43051e-05 0 0 0 0 90C0 180 1.43051e-05 180 90 180C180 180 180 180 180 90C180 0 180 0 90 0Z",fill:"currentColor",className:u(i==null?void 0:i.background)}),c.jsx("path",{transform:"translate(30, 52)",fillRule:"evenodd",clipRule:"evenodd",d:"M86.0728 25.3655C86.1287 25.7634 86.2023 26.1501 86.2934 26.5313C86.3389 26.7247 86.3886 26.9126 86.4426 27.0949C86.5491 27.4658 86.6736 27.831 86.8156 28.1888C87.0246 28.7152 87.2706 29.2248 87.5516 29.7138C87.7381 30.0342 87.939 30.3491 88.1538 30.6475C88.7962 31.5513 89.5655 32.3502 90.4362 33.0177C91.0223 33.4638 91.6483 33.8505 92.3056 34.1725C92.8094 34.4169 93.3294 34.6237 93.8617 34.7913C94.2205 34.9018 94.5877 34.9957 94.9632 35.0731C95.7326 35.2269 96.5143 35.3046 97.2978 35.3051C103.567 35.3051 108.649 30.0362 108.649 23.5368C108.649 17.0373 103.567 11.7684 97.2978 11.7684C96.5142 11.7662 95.7322 11.8439 94.9632 12.0005C94.5915 12.0741 94.2238 12.1682 93.8617 12.2822C93.3296 12.448 92.8095 12.6529 92.3056 12.8955C90.663 13.6984 89.2368 14.9092 88.1538 16.4205C87.9406 16.7244 87.7381 17.0338 87.5516 17.3598C87.2695 17.8481 87.0235 18.3579 86.8156 18.8847C86.6755 19.2383 86.5492 19.6029 86.4426 19.9731C86.3883 20.161 86.3385 20.3488 86.2934 20.5367C86.2023 20.9179 86.1287 21.3046 86.0728 21.7024C85.9037 22.9172 85.9037 24.1508 86.0728 25.3655ZM33.9272 25.3655C33.8739 25.7634 33.7977 26.1501 33.7071 26.5313C33.6617 26.7247 33.6119 26.9126 33.5579 27.0949C33.4514 27.4658 33.3269 27.8309 33.1849 28.1888C32.9755 28.7151 32.7294 29.2247 32.4484 29.7138C32.2624 30.0342 32.0615 30.3491 31.8467 30.6475C31.204 31.551 30.4347 32.3499 29.5642 33.0177C28.9782 33.4638 28.3521 33.8505 27.6948 34.1725C27.191 34.4169 26.6709 34.6237 26.1387 34.7913C25.7795 34.9018 25.4123 34.9957 25.0371 35.0731C24.2677 35.2268 23.486 35.3045 22.7024 35.3051C16.4334 35.3051 11.3514 30.0362 11.3514 23.5368C11.3514 17.0373 16.4334 11.7684 22.7024 11.7684C23.4861 11.7663 24.2681 11.844 25.0371 12.0005C25.4089 12.0742 25.7765 12.1682 26.1387 12.2822C26.6708 12.448 27.1908 12.6529 27.6948 12.8955C29.3375 13.6984 30.7636 14.9092 31.8467 16.4205C32.0599 16.7244 32.2624 17.0338 32.4484 17.3598C32.7304 17.8482 32.9766 18.3579 33.1849 18.8847C33.325 19.2383 33.4513 19.6029 33.5579 19.9731C33.6116 20.161 33.6613 20.3488 33.7071 20.5367C33.7977 20.9179 33.8718 21.3046 33.9272 21.7024C34.0963 22.9172 34.0963 24.1508 33.9272 25.3655ZM119.343 54.0764C119.204 53.836 119.05 53.5733 118.862 53.2826C118.66 52.9695 118.432 52.6341 118.171 52.2764C117.909 51.9186 117.62 51.5385 117.295 51.1472C116.97 50.7559 116.615 50.3534 116.224 49.9398C114.625 48.2625 112.798 46.8262 110.799 45.6746C110.168 45.3056 109.497 44.9591 108.788 44.6292C108.767 44.6181 108.748 44.6125 108.728 44.6013C100.676 41.1728 91.6054 41.1728 83.5538 44.6013C83.4404 44.6516 83.3336 44.7075 83.2235 44.7634C83.0429 44.8472 82.8778 44.9423 82.7027 45.0317C82.8007 45.0876 82.9003 45.1379 82.9978 45.1938C84.9925 46.3455 86.8856 47.6696 88.6562 49.1516C89.8126 50.1167 90.913 51.1488 91.952 52.2428C92.5945 52.9136 93.1818 53.5788 93.7185 54.2273C94.269 54.8925 94.7513 55.513 95.1817 56.1055C95.6249 56.7148 96.0075 57.2794 96.3488 57.7993C96.6719 58.3024 96.9455 58.7496 97.1817 59.1633C97.6294 59.9211 97.9634 60.7426 98.1726 61.6005L98.2601 62.2042H116.6C118.478 62.2042 120 60.682 120 58.8042V55.3676C119.81 54.9225 119.591 54.491 119.343 54.0764ZM77.6389 15.6162C77.5508 14.9906 77.435 14.382 77.292 13.7846C77.2208 13.4859 77.1425 13.1873 77.0577 12.8942C76.8886 12.3081 76.6929 11.7389 76.4727 11.181C76.1444 10.3541 75.7576 9.55357 75.3153 8.78587C75.0228 8.27866 74.7075 7.78837 74.3694 7.31498C72.6729 4.93631 70.4305 3.03412 67.8456 1.78084C67.0544 1.39541 66.2367 1.07141 65.3992 0.811523C64.8349 0.63682 64.2576 0.48466 63.6683 0.366313C62.4595 0.123014 61.231 0 59.9997 0C49.8923 0 42.1622 8.01379 42.1622 18.496C42.1622 28.9781 49.8923 36.9863 59.9997 36.9863C61.231 36.9863 62.4595 36.8633 63.6683 36.62C64.2576 36.5016 64.8349 36.3495 65.3992 36.1748C66.2367 35.9149 67.0544 35.5909 67.8456 35.2055C70.4305 33.9522 72.6729 32.05 74.3694 29.6713C74.7072 29.1979 75.0225 28.7076 75.3153 28.2004C75.7576 27.4327 76.1444 26.6322 76.4727 25.8053C76.6902 25.2474 76.8886 24.6726 77.0577 24.0921C77.1425 23.799 77.2208 23.5004 77.292 23.2017C77.435 22.6043 77.5508 21.9957 77.6389 21.3701C77.9042 19.462 77.9042 17.5243 77.6389 15.6162ZM93.0965 61.4246C92.8978 61.0703 92.6696 60.6818 92.4021 60.2532C92.1144 59.7961 91.7847 59.299 91.4118 58.7733C91.039 58.2476 90.623 57.6876 90.1612 57.1162C89.6993 56.5448 89.1905 55.9448 88.6326 55.3448C87.7365 54.3736 86.7887 53.456 85.7938 52.5964C84.2613 51.2774 82.6237 50.0979 80.8992 49.0708C79.999 48.5337 79.0431 48.0195 78.0315 47.5395C78.0039 47.522 77.9751 47.5067 77.9453 47.4938C73.2477 45.2653 67.3414 43.7111 59.9989 43.7111C52.6564 43.7111 46.7496 45.2653 42.0526 47.4938C41.8888 47.5681 41.7398 47.6538 41.5803 47.7338C40.8941 48.0709 40.2347 48.4252 39.6009 48.7851C39.2573 48.9851 38.9214 49.1851 38.5931 49.3851C37.0554 50.3392 35.5882 51.4126 34.204 52.5964C33.209 53.4558 32.2612 54.3734 31.3652 55.3448C30.8084 55.9448 30.3001 56.5391 29.8367 57.1162C29.3732 57.6933 28.9583 58.2419 28.5854 58.7733C28.2126 59.3047 27.8834 59.7961 27.5957 60.2532C27.3282 60.6818 27.1 61.0703 26.9018 61.4246C26.8833 61.4521 26.8664 61.4807 26.8511 61.5103C26.6425 61.8817 26.4728 62.2074 26.3385 62.476C26.0699 63.0131 25.9459 63.3159 25.9459 63.3159V70.5726C25.9459 72.4504 27.4682 73.9726 29.3459 73.9726H90.6541C92.5318 73.9726 94.0541 72.4504 94.0541 70.5726V63.3159C93.7702 62.6666 93.4505 62.035 93.0965 61.4246ZM21.7773 61.6062C21.8277 61.1833 21.9651 60.7758 22.1807 60.4102C22.3487 60.086 22.4749 59.6948 22.7367 59.2421C23.0271 58.7447 23.2558 58.3032 23.5732 57.8057C23.9132 57.2804 24.2785 56.7159 24.7161 56.1179C25.1536 55.5199 25.6319 54.8883 26.1698 54.24C26.7076 53.5917 27.2983 52.921 27.9447 52.2392C30.4236 49.6351 33.2397 47.3846 36.3159 45.5492C36.6355 45.3592 36.965 45.1692 37.2973 44.9847C37.1535 44.9121 37.0218 44.8339 36.8724 44.7668C36.7622 44.7109 36.652 44.655 36.5418 44.6047C32.5724 42.8404 28.2751 41.9636 23.9418 42.0338C19.6088 41.9636 15.3116 42.8405 11.3424 44.6047C11.3215 44.6159 11.3028 44.6215 11.2818 44.6326C10.5721 44.9624 9.90032 45.3089 9.26825 45.6778C8.05739 46.376 6.90772 47.1782 5.83185 48.0754C5.1338 48.66 4.46803 49.2832 3.83757 49.9421C3.44632 50.3557 3.08887 50.7581 2.76521 51.1493C2.44064 51.5406 2.14858 51.9206 1.88682 52.2783C1.62507 52.636 1.39363 52.9713 1.19139 53.2843C1.00403 53.5749 0.826588 53.8376 0.68717 54.0779C0.224832 54.8716 0 55.369 0 55.369V58.8042C0 60.682 1.52223 62.2042 3.4 62.2042H21.7371L21.7773 61.6062Z",fill:"#fff",className:u(i==null?void 0:i.primary)})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.CommunitySquircleIcon=m}),98); __d("WAWebDrawerContext",["react"],(function(t,n,r,o,a,i,l){var e,s=(e||(e=o("react"))).createContext,u={type:null},c=s(u);l.undefinedDrawerContext=u,l.DrawerContext=c}),98); __d("WAWebKeyboardRotateFocus.react",["WAWebFocusTracer","WAWebKeyboardConstants","WAWebKeyboardTabUtils","WAWebUseIsKeyboardUser","react","useMergeRefs"],(function(t,n,r,o,a,i,l){var e=["ref"],s,u,c=u||(u=r("react")),d=(s||(s=o("react"))).useRef;function m(t){var n=t.ref,a=babelHelpers.objectWithoutPropertiesLoose(t,e),i=a.focusType,l=d(null),s=r("useMergeRefs")(n,l),u=r("WAWebUseIsKeyboardUser")(),m=u.setIsKeyboardUser,p=function(t){if(!(t.metaKey||t.ctrlKey)){var e=l.current,n;t.key===o("WAWebKeyboardConstants").KEYBOARD_EVENT_KEY_VALUE.TAB?(t.stopPropagation(),t.preventDefault(),m(!0),e!=null&&(n=o("WAWebKeyboardTabUtils").getNextTabbableElement(e,t.shiftKey?o("WAWebKeyboardTabUtils").TabDirection.BACKWARD:o("WAWebKeyboardTabUtils").TabDirection.FORWARD,i))):e!=null&&e===document.activeElement&&(n=o("WAWebKeyboardTabUtils").getNextTabbableElement(e,o("WAWebKeyboardTabUtils").TabDirection.FORWARD,i,function(e){return e.nodeName.toLowerCase()==="input"})),n!=null&&_(n)}};return c.jsx("div",{ref:s,style:a.style,className:"x10l6tqk x13vifvy xtijo5x x1ey2m1c x1o0tod",onKeyDown:p,tabIndex:-1,children:a.children})}m.displayName=m.name+" [from "+i.id+"]";var p=m;function _(e){r("WAWebFocusTracer").focus(e)}l.RotateFocus=p}),98); __d("WAWebDrawerManager.react",["WATypeUtils","WAUpperFirst","WAWebDrawerContext","WAWebDrawerManagerContext","WAWebErrorBoundary.react","WAWebFocusTracer","WAWebKeyboardRotateFocus.react","WAWebUimContext","WAWebUimUie.react","WAWebVelocityTransitionGroup","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u={container:{position:"x10l6tqk",top:"x13vifvy",insetInlineEnd:"xtijo5x",bottom:"x1ey2m1c",insetInlineStart:"x1o0tod",left:null,right:null,$$css:!0},rightContainer:{backgroundColor:"x1280gxy",$$css:!0}},c={LEFT:"drawer-left",MID:"slide-up",NONE:"none",RIGHT:"slide-left"},d={LEFT:"left",MID:"mid",RIGHT:"right",FULLSCREEN:"fullscreen"};function m(e){var t=e.animationDisabled,n=e.direction,a=e.onDrawerAnimationComplete,i=o("WAWebDrawerManagerContext").useDrawerManagerContext(n),l=i.blockTransitionRef,c=i.disableRotateFocus,m=i.drawer,p=i.drawerContext,_=i.drawerId,f=i.focusType,g=i.handleRequestDismiss,h=i.noFocus,y=i.onEnterAnimationComplete,C=i.transition,b=i.uieRef,v=i.uim,S=function(){if(b.current){var e=b.current.getElement();!e||e.contains(document.activeElement)||r("WAWebFocusTracer").focus(e)}},R=function(t){var e=a;e&&e(),!(y===void 0&&h===void 0)&&m&&t===_&&o("WATypeUtils").isFunction(y)&&y()},L=function(){return t===!0?"none":l.current||C},E;if(m){var k=c===!0?"div":o("WAWebKeyboardRotateFocus.react").RotateFocus,I=c===!0?{}:{focusType:f};E=s.jsx(o("WAWebUimUie.react").UIE,{displayName:"Drawer"+r("WAUpperFirst")(n),escapable:!0,ref:b,requestFocus:h===!0?null:S,requestDismiss:g,children:s.jsx(k,babelHelpers.extends({style:{height:"100%"}},I,{children:s.jsx(o("WAWebDrawerContext").DrawerContext.Provider,{value:p,children:s.jsx(o("WAWebErrorBoundary.react").ErrorBoundary,{name:"drawer-manager-"+n,type:"fatal",children:m})})}))},_)}var T=E!=null&&n===d.RIGHT;return s.jsx(r("WAWebUimContext").Consumer,{children:function(t){return s.jsx(r("WAWebUimContext").Provider,{value:v||t,children:s.jsx(r("WAWebVelocityTransitionGroup"),{xstyle:[u.container,T&&u.rightContainer],transitionName:L(),onAnimationComplete:function(){return R(_)},displayName:"DrawerManager",children:E})})}})}m.displayName=m.name+" [from "+i.id+"]",l.Transition=c,l.Dir=d,l.DrawerManagerComponent=m}),98); __d("WAWebDrawerManagerContext",["WALogger","WAWebDrawerManagerGlobalContext","err","react","useWAWebDrawerManagerEvents"],(function(t,n,r,o,a,i,l){var e,s,u=s||(s=o("react")),c=s,d=c.createContext,m=c.useCallback,p=c.useContext,_=c.useEffect,f=d(null);function g(e){var t=e.children,n=e.onDrawerStateChange,r=o("useWAWebDrawerManagerEvents").useDrawerManagerEvents("left",n);return _(function(){return o("WAWebDrawerManagerGlobalContext").setGlobalDrawerManager("left",r),function(){o("WAWebDrawerManagerGlobalContext").setGlobalDrawerManager("left",null)}},[r]),u.jsx(f.Provider,{value:r,children:t})}g.displayName=g.name+" [from "+i.id+"]";var h=d(null);function y(e){var t=e.children,n=e.onDrawerStateChange,r=o("useWAWebDrawerManagerEvents").useDrawerManagerEvents("right",n);return _(function(){return o("WAWebDrawerManagerGlobalContext").setGlobalDrawerManager("right",r),function(){o("WAWebDrawerManagerGlobalContext").setGlobalDrawerManager("right",null)}},[r]),u.jsx(h.Provider,{value:r,children:t})}y.displayName=y.name+" [from "+i.id+"]";var C=d(null);function b(e){var t=e.children,n=e.onDrawerStateChange,r=o("useWAWebDrawerManagerEvents").useDrawerManagerEvents("mid",n);return _(function(){return o("WAWebDrawerManagerGlobalContext").setGlobalDrawerManager("mid",r),function(){o("WAWebDrawerManagerGlobalContext").setGlobalDrawerManager("mid",null)}},[r]),u.jsx(C.Provider,{value:r,children:t})}b.displayName=b.name+" [from "+i.id+"]";var v=d(null);function S(e){var t=e.children,n=e.onDrawerStateChange,r=o("useWAWebDrawerManagerEvents").useDrawerManagerEvents("fullscreen",n);return _(function(){return o("WAWebDrawerManagerGlobalContext").setGlobalDrawerManager("fullscreen",r),function(){o("WAWebDrawerManagerGlobalContext").setGlobalDrawerManager("fullscreen",null)}},[r]),u.jsx(v.Provider,{value:r,children:t})}S.displayName=S.name+" [from "+i.id+"]";function R(e){var t=e.children,n=e.onDrawerStateChange,r=m(function(e){n==null||n("left",e)},[n]),o=m(function(e){n==null||n("right",e)},[n]),a=m(function(e){n==null||n("mid",e)},[n]),i=m(function(e){n==null||n("fullscreen",e)},[n]);return u.jsx(g,{onDrawerStateChange:r,children:u.jsx(y,{onDrawerStateChange:o,children:u.jsx(b,{onDrawerStateChange:a,children:u.jsx(S,{onDrawerStateChange:i,children:t})})})})}R.displayName=R.name+" [from "+i.id+"]";function L(){return p(C)}function E(t){var n=t==="left"?f:t==="right"?h:t==="mid"?C:t==="fullscreen"?v:(function(){throw Error("Match: No case succesfully matched. Make exhaustive or add a wildcard case using '_'. Argument: "+t)})(),a=p(n);if(a==null){var i=o("WAWebDrawerManagerGlobalContext").getGlobalDrawerManager(t);if(i!=null)return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["useDrawerManagerContext: "," drawer manager context is not available. Using global context instead"])),t),i;throw r("err")("useDrawerManagerContext: "+t+" drawer manager context is not available. Make sure the component is wrapped with the appropriate DrawerManagerContextProvider.")}return a}l.LeftDrawerManagerContextProvider=g,l.DrawerManagerContextProvider=R,l.useMiddleDrawerManagerContext=L,l.useDrawerManagerContext=E}),98); __d("useWAWebUiIdle",["WAAbortError","WAWebDocumentFlushed","WAWebNoop","WAWebUiIdleEventBus","react","useWAWebListener","useWAWebUnmountSignal"],(function(t,n,r,o,a,i,l){var e,s=(e||(e=o("react"))).useCallback;function u(){var e=o("useWAWebListener").useAddListenerOnce(),t=e[0],n=r("useWAWebUnmountSignal")(),a=s(function(e){if(o("WAWebUiIdleEventBus").UiIdleEventBus.uiBusy){t(o("WAWebUiIdleEventBus").UiIdleEventBus,"ui_idle",e);return}o("WAWebDocumentFlushed").documentFlushed({signal:n}).then(function(){e()}).catch(o("WAAbortError").catchAbort(r("WAWebNoop")))},[t,n]);return a}l.default=u}),98); __d("useWAWebDrawerManagerEvents",["WAWebDrawerContext","WAWebDrawerManager.react","WAWebFocusTracer","WAWebKeyboardTabUtils","WAWebNonEmptyString","lodash","react","uniqueID","useWAWebUiIdle"],(function(t,n,r,o,a,i,l){var e,s=e||(e=o("react")),u=s.useCallback,c=s.useMemo,d=s.useRef,m=s.useState,p=function(t){switch(t){case o("WAWebDrawerManager.react").Dir.LEFT:case o("WAWebDrawerManager.react").Dir.FULLSCREEN:return o("WAWebDrawerManager.react").Transition.LEFT;case o("WAWebDrawerManager.react").Dir.MID:return o("WAWebDrawerManager.react").Transition.MID;default:return o("WAWebDrawerManager.react").Transition.RIGHT}};function _(e,t){var n=r("useWAWebUiIdle")(),a=d(null),i=d(null),l=d(null),s=d(!1),_=m(void 0),f=_[0],g=_[1],h=m(!1),y=h[0],C=h[1],b=m(null),v=b[0],S=b[1],R=m(function(){return p(e)}),L=R[0],E=R[1],k=m(void 0),I=k[0],T=k[1],D=m(void 0),x=D[0],$=D[1],P=m(!1),N=P[0],M=P[1],w=m(void 0),A=w[0],F=w[1],O=m(o("WAWebDrawerContext").undefinedDrawerContext),B=O[0],W=O[1],q=m(o("WAWebKeyboardTabUtils").FocusType.CUSTOM),U=q[0],V=q[1],H=u(function(a,u){var c=u===void 0?{}:u,d=c.transition,m=d===void 0?p(e):d,_=c.uim,h=c.noFocus,y=c.onEnterAnimationComplete,b=c.newDrawerContext,v=b===void 0?o("WAWebDrawerContext").undefinedDrawerContext:b,R=c.focusType,L=c.disableRotateFocus,k=c.focusOnUnMount,I=k===void 0?!1:k,D=o("WAWebNonEmptyString").asMaybeNonEmptyString(r("uniqueID")("DrawerManager"+e)),x=null;if(I&&(x=document.activeElement),i.current=x,!s.current&&f){if(f.key!=null&&r("lodash").isEqual(f.key,a.key))return;t&&t("updated"),l.current=o("WAWebDrawerManager.react").Transition.NONE,g(a),S(D),E(m),T(_),$(h),F(y),W(v),V(R),M(L),n(function(){l.current=m}),C(I)}else t&&t("opened"),g(a),S(D),E(m),T(_),$(h),F(y),W(v),V(R),M(L),C(I)},[e,f,t,n]),G=u(function(e,a){if(!(e!=null&&v!==e)&&f){if(t){var l=a!=null&&a.isConflictingDrawerOpening?"replaced":"closed";t(l)}if(s.current=!0,g(void 0),W(o("WAWebDrawerContext").undefinedDrawerContext),n(function(){s.current=!1}),y){var u=i==null?void 0:i.current;u&&r("WAWebFocusTracer").focus(u)}}},[f,v,t,y,n]),z=u(function(){var e,t=(e=a.current)==null?void 0:e.getElement();if(t){var n=o("WAWebKeyboardTabUtils").getNextTabbableElement(t);n&&r("WAWebFocusTracer").focus(n)}},[]),j=u(function(){G(v)},[G,v]),K=u(function(){return s.current===!0?!1:!!f},[f]);return c(function(){return{drawer:f,drawerId:v,transition:L,uim:I,noFocus:x,onEnterAnimationComplete:A,drawerContext:B,focusType:U,disableRotateFocus:N,uieRef:a,blockTransitionRef:l,handleRequestDismiss:j,openDrawer:H,closeDrawer:G,existsDrawer:K,focusDrawer:z,updateContext:W}},[N,f,B,v,U,j,x,A,L,I,H,G,K,z,W])}l.useDrawerManagerEvents=_}),98); __d("WAWebMessageCommunityCard.react",["fbt","WAWebArrowForwardIcon.react","WAWebChatCollection","WAWebChatGroupUtils","WAWebCmd","WAWebCommunityGeneralChatImage.react","WAWebCommunityGroupJourneyEventImpl","WAWebCommunitySquircleIcon.react","WAWebDetailImage.react","WAWebDrawerManagerContext","WAWebFlex.react","WAWebGroupMetadataCollection","WAWebText_DONOTUSE.react","WAWebToast.react","WAWebToastManager","WAWebUISpacing","WAWebUnstyledButton.react","WAWebWamEnumChatFilterActionTypes","WAWebWamEnumSurfaceType","WAWebWid","WAWebWidFactory","react","stylex"],(function(t,n,r,o,a,i,l,s){var e,u,c=e||(e=r("react")),d={communitySquircle:{color:"x17k9de1",$$css:!0},footerButton:{color:"xo1mcw5",display:"x78zum5",justifyContent:"xl56j7k",borderTopWidth:"x178xt8z",borderTopStyle:"x13fuv20",borderTopColor:"xx42vgk",width:"xh8yej3",$$css:!0},list:{textAlign:"x1yc453h",position:"x1n2onr6",$$css:!0}};function m(e){var t,n=e.body,a=e.footer,i=e.onFooterClick,l=e.openNavigation,m=l===void 0?!1:l,p=e.subgroupId,_=e.subtitle,f=e.title,g=o("WAWebDrawerManagerContext").useDrawerManagerContext("right"),h=null;e.communityId&&(h=e.communityId instanceof r("WAWebWid")?e.communityId:o("WAWebWidFactory").createWid(e.communityId));var y=p?o("WAWebChatCollection").ChatCollection.get(p):null,C=y?!!(o("WAWebChatGroupUtils").isCommunityAnnouncementGroup(y)||(t=y.groupMetadata)!=null&&t.isParentGroup):!1,b=y?o("WAWebChatGroupUtils").isCommunityGeneralGroup(y):!1,v=function(t){var e;if(!h||!((e=r("WAWebGroupMetadataCollection").get(h))!=null&&e.hasJoined())){var n=s._(/*BTDS*/"Esta comunidad ya no existe.");o("WAWebToastManager").ToastManager.open(c.jsx(o("WAWebToast.react").Toast,{msg:n}));return}if(y&&new(o("WAWebCommunityGroupJourneyEventImpl")).CommunityGroupJourneyEvent({action:o("WAWebWamEnumChatFilterActionTypes").CHAT_FILTER_ACTION_TYPES.COMMUNITY_RICH_SYSTEM_MESSAGE_CLICK,surface:o("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT,chat:y}).commit(),t&&(t.preventDefault(),t.stopPropagation()),i)return i();if(!m){var a,l=(a=g.existsDrawer())!=null?a:!1;!l&&h&&o("WAWebCmd").Cmd.openCommunityTabbedInfo(h);return}o("WAWebCmd").Cmd.openCommunityHome(h)},S;b||(h?S=c.jsx(o("WAWebDetailImage.react").DetailImage,{id:h,shape:o("WAWebDetailImage.react").DetailImageShape.Squircle}):S=c.jsx(o("WAWebCommunitySquircleIcon.react").CommunitySquircleIcon,{width:49,height:49,iconXstyle:d.communitySquircle}));var R;b?R=c.jsx("div",{className:"x1c9tyrk xeusxvb x1pahc9y x1ertn4p xpyat2d x1exxlbk x1n2onr6",children:c.jsx(o("WAWebCommunityGeneralChatImage.react").CommunityGeneralChatImage,{})}):p&&!C&&(R=c.jsxs(c.Fragment,{children:[c.jsx(o("WAWebDetailImage.react").DetailImage,{id:p,xstyle:o("WAWebUISpacing").uiMargin.end8}),c.jsx(o("WAWebArrowForwardIcon.react").ArrowForwardIcon,{directional:!0,xstyle:o("WAWebUISpacing").uiMargin.end8})]}));var L=c.jsxs(o("WAWebFlex.react").FlexRow,{justify:"center",align:"center",children:[R,S]}),E=c.jsxs("div",babelHelpers.extends({},(u||(u=r("stylex"))).props(o("WAWebUISpacing").uiMargin.top8,o("WAWebUISpacing").uiMargin.bottom12),{children:[c.jsx(o("WAWebText_DONOTUSE.react").TextHeader,{color:"primary",weight:"medium",level:"3",children:f}),_!=null?c.jsx(o("WAWebText_DONOTUSE.react").Text,{as:"p",size:"13",children:_}):null]})),k=a!=null?c.jsx(r("WAWebUnstyledButton.react"),{xstyle:[d.footerButton,o("WAWebUISpacing").uiPadding.all12],onClick:v,children:c.jsx(o("WAWebText_DONOTUSE.react").Text,{as:"span",size:"14",weight:"medium",children:a})}):null;return c.jsxs(c.Fragment,{children:[c.jsxs("div",babelHelpers.extends({},u.props(o("WAWebUISpacing").uiPadding.horiz24,o("WAWebUISpacing").uiPadding.top12,n&&o("WAWebUISpacing").uiPadding.bottom16),{children:[L,E,n]})),k]})}m.displayName=m.name+" [from "+i.id+"]";function p(e){var t=e.items;return c.jsx("ul",babelHelpers.extends({},(u||(u=r("stylex"))).props(d.list,o("WAWebUISpacing").uiMargin.start24),{children:t.map(function(e,t){return c.jsx("li",{className:"xo7wnuk x1a8jhtq x1hmns74",children:e},t)})}))}p.displayName=p.name+" [from "+i.id+"]",l.MessageCommunityCard=m,l.BulletedList=p}),226); __d("WAWebMessageCommunityLinkGroup.react",["fbt","WAWebFormatParticipantNames","WAWebGroupMetadataCollection","WAWebMessageCommunityCard.react","WAWebUserPrefsMeUser","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react"));function c(e){var t,n,a=e.author,i=e.chat,l=e.clickable,c=e.templateParams,m=c[0],p=r("WAWebGroupMetadataCollection").get(m),_=p==null?void 0:p.participants.iAmAdmin(),f=(t=i.groupMetadata)==null?void 0:t.membershipApprovalMode,g=(n=i.groupMetadata)==null?void 0:n.hiddenSubgroup,h;g===!0?h=s._(/*BTDS*/"Solo las personas de la comunidad que hayan recibido una invitaci\u00f3n podr\u00e1n ver este grupo y unirse a \u00e9l."):f===!0?h=s._(/*BTDS*/"Cualquier miembro de la comunidad puede solicitar unirse a este grupo."):h=s._(/*BTDS*/"Cualquier miembro de la comunidad puede unirse a este grupo.");var y=[s._(/*BTDS*/"Como miembro, puedes unirte a los grupos de esta comunidad y recibir avisos de los administradores."),h,s._(/*BTDS*/"Quienes administran la comunidad pueden ver tu perfil.")],C=[s._(/*BTDS*/"Los miembros de este grupo ahora forman parte de la comunidad."),h],b=_===!0?s._(/*BTDS*/"Administrar la comunidad"):s._(/*BTDS*/"Explorar la comunidad");return u.jsx(o("WAWebMessageCommunityCard.react").MessageCommunityCard,{communityId:m,subgroupId:i.id,title:d({templateParams:c,clickable:l,author:a}),body:u.jsx(o("WAWebMessageCommunityCard.react").BulletedList,{items:_===!0?C:y}),footer:b,openNavigation:!_})}c.displayName=c.name+" [from "+i.id+"]";function d(e){var t=e.author,n=e.clickable,r=e.templateParams,a=t?o("WAWebFormatParticipantNames").getFormattedName(t,n):null,i=o("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:r[0],asString:!n,alternativeStringName:r[1]}),l=!i,u=o("WAWebUserPrefsMeUser").isMeAccount(t);return l?u?s._(/*BTDS*/"A\u00f1adiste este grupo a una comunidad"):a!=null?s._(/*BTDS*/"{author} a\u00f1adi\u00f3 este grupo a una comunidad",[s._param("author",a)]):s._(/*BTDS*/"Se a\u00f1adi\u00f3 este grupo a una comunidad"):u?s._(/*BTDS*/"A\u00f1adiste este grupo a la comunidad {community}",[s._param("community",i)]):a!=null?s._(/*BTDS*/"{author} a\u00f1adi\u00f3 este grupo a la comunidad {community}",[s._param("author",a),s._param("community",i)]):s._(/*BTDS*/"Se a\u00f1adi\u00f3 este grupo a la comunidad {community}.",[s._param("community",i)])}l.MessageCommunityLinkGroup=c,l.communityLinkGroupTitle=d}),226); __d("WAWebMessageCommunitySubgroupWelcome.react",["fbt","WAWebFormatParticipantNames","WAWebMessageCommunityCard.react","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react"));function c(e){var t=e.author,n=e.chat,r=e.clickable,a=e.templateParams,i=a[0],l=[s._(/*BTDS*/"Como miembro, puedes unirte a los grupos de esta comunidad y recibir avisos de los administradores."),s._(/*BTDS*/"Quienes administran la comunidad pueden ver tu perfil.")],c=s._(/*BTDS*/"Explorar la comunidad");return u.jsx(o("WAWebMessageCommunityCard.react").MessageCommunityCard,{communityId:i,subgroupId:n.id,title:d({templateParams:a,clickable:r,author:t}),body:u.jsx(o("WAWebMessageCommunityCard.react").BulletedList,{items:l}),footer:c,openNavigation:!0})}c.displayName=c.name+" [from "+i.id+"]";function d(e){var t=e.author,n=e.clickable,r=e.templateParams,a=t?o("WAWebFormatParticipantNames").getFormattedName(t,n):null,i=o("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:r[0],asString:!n,alternativeStringName:r[1]}),l=!i;return l?a!=null?s._(/*BTDS*/"{user_name} te a\u00f1adi\u00f3 a un grupo en una comunidad",[s._param("user_name",a)]):s._(/*BTDS*/"Te uniste a un grupo en una comunidad mediante una invitaci\u00f3n."):a!=null?s._(/*BTDS*/"{user_name} te a\u00f1adi\u00f3 a un grupo en la comunidad {community}",[s._param("user_name",a),s._param("community",i)]):s._(/*BTDS*/"Te uniste a un grupo en la comunidad {community} mediante una invitaci\u00f3n",[s._param("community",i)])}l.MessageCommunitySubgroupWelcome=c,l.communitySubgroupWelcomeTitle=d}),226); __d("WAWebMessageCommunityWelcomeAdmin.react",["fbt","WANullthrows","WAWebFormatLinkNotification","WAWebGroupMetadataCollection","WAWebMessageCommunityCard.react","WAWebUISpacing","WAWebUserPrefsMeUser","WAWebWid","WAWebWidFactory","isStringNullOrEmpty","react","stylex"],(function(t,n,r,o,a,i,l,s){var e,u,c=e||(e=r("react"));function d(e){var t,n=e.author,a=e.chat,i=e.templateParams,l=i.length>0?i[0]:null,d;l instanceof r("WAWebWid")?d=l:r("isStringNullOrEmpty")(l)||(d=o("WAWebWidFactory").createWid(l));var p=d!=null?r("WAWebGroupMetadataCollection").get(d):null;p!=null&&p.parentGroup&&(d=p.parentGroup);var _=o("WAWebUserPrefsMeUser").isMeAccount((t=a.groupMetadata)==null?void 0:t.owner);if(!_)return c.jsx("div",babelHelpers.extends({},(u||(u=r("stylex"))).props(o("WAWebUISpacing").uiPadding.horiz12,o("WAWebUISpacing").uiPadding.top5,o("WAWebUISpacing").uiPadding.bottom6),{children:o("WAWebFormatLinkNotification").formatLinkNotification("community_create",n,null,i,!0)}));if(d==null)return null;var f=c.jsx("div",babelHelpers.extends({},(u||(u=r("stylex"))).props(o("WAWebUISpacing").uiPadding.horiz10),{children:s._(/*BTDS*/"Env\u00eda actualizaciones importantes de los administradores a todos los miembros a la vez.")})),g=s._(/*BTDS*/"Administrar comunidad");return c.jsx(o("WAWebMessageCommunityCard.react").MessageCommunityCard,{communityId:d,subgroupId:a.id,title:m({templateParams:i,chat:a,author:n}),subtitle:f,footer:g})}d.displayName=d.name+" [from "+i.id+"]";function m(e){var t,n=e.author,a=e.chat,i=e.templateParams,l=o("WAWebUserPrefsMeUser").isMeAccount((t=a.groupMetadata)==null?void 0:t.owner);return l?s._(/*BTDS*/"\u00a1Te damos la bienvenida a tu comunidad!"):r("WANullthrows")(o("WAWebFormatLinkNotification").formatLinkNotifAsFbt("community_create",n,null,i))}m.displayName=m.name+" [from "+i.id+"]",l.MessageCommunityWelcomeAdmin=d,l.communityWelcomeAdminTitle=m}),226); __d("WAWebMessageCommunityWelcomeMember.react",["fbt","WAWebFormatParticipantNames","WAWebMessageCommunityCard.react","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react"));function c(e){var t=e.author,n=e.chat,r=e.clickable,a=e.templateParams,i=a[0],l=t?o("WAWebFormatParticipantNames").getFormattedName(t,r):null,c=[u.jsx(u.Fragment,{children:l==null||l===""?s._(/*BTDS*/"Te uniste a esta comunidad."):s._(/*BTDS*/"{author} te a\u00f1adi\u00f3.",[s._param("author",l)])}),s._(/*BTDS*/"Aqu\u00ed, quienes administran la comunidad enviar\u00e1n avisos importantes a los miembros.")],m=s._(/*BTDS*/"Ver informaci\u00f3n de la comunidad");return u.jsx(o("WAWebMessageCommunityCard.react").MessageCommunityCard,{communityId:i,subgroupId:n.id,title:d(),body:u.jsx(o("WAWebMessageCommunityCard.react").BulletedList,{items:c}),footer:m})}c.displayName=c.name+" [from "+i.id+"]";function d(){return s._(/*BTDS*/"\u00a1Te damos la bienvenida a la comunidad!")}d.displayName=d.name+" [from "+i.id+"]",l.MessageCommunityWelcomeMember=c,l.communityWelcomeMemberTitle=d}),226); __d("WAWebBizGetCustomUrlUserGraphqlQuery.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"data"}],t=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"data"}],concreteType:"WAWebBizGetCustomUrlUserGraphqlQueryResponse",kind:"LinkedField",name:"xwa_custom_url_get_user",plural:!1,selections:[{alias:null,args:null,concreteType:"boolean",kind:"ScalarField",name:"success",plural:!1,storageKey:null},{alias:null,args:null,concreteType:"WAWebBizGetCustomUrlUser",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,concreteType:"string",name:"jid",kind:"ScalarField",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"number",kind:"ScalarField",name:"error_code",plural:!1,storageKey:null},{alias:null,args:null,concreteType:"string",kind:"ScalarField",name:"error_text",plural:!1,storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"WAWebBizGetCustomUrlUserGraphqlQuery",selections:t,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"WAWebBizGetCustomUrlUserGraphqlQuery",selections:t},params:{id:"WAWebBizGetCustomUrlUserGraphqlQuery",metadata:{},name:"WAWebBizGetCustomUrlUserGraphqlQuery",operationKind:"query",text:null}}})(),l=e;i.default=l}),66); __d("WAWebBizGetCustomUrlUserGraphql",["WAWebBizGetCustomUrlUserGraphqlQuery.graphql","WAWebGraphQLServerError","WAWebRelayClient","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){return o("WAWebRelayClient").fetchQuery(e!==void 0?e:e=n("WAWebBizGetCustomUrlUserGraphqlQuery.graphql"),{data:{custom_url:{path:t}}}).then(u).catch(function(e){if(e instanceof o("WAWebGraphQLServerError").GraphQLServerError){var t,n,r,a;return{type:"graphql-error",errorCode:(t=(n=e.source)==null?void 0:n.errors[0].code)!=null?t:0,errorText:(r=(a=e.source)==null?void 0:a.errors[0].message)!=null?r:""}}return{type:"graphql-error",errorCode:0,errorText:"unknown error"}})});return function(n){return t.apply(this,arguments)}})();function u(e){var t,n;if(!(e!=null&&(t=e.xwa_custom_url_get_user)!=null&&t.success)){var r,o,a=e==null||(r=e.xwa_custom_url_get_user)==null?void 0:r.error_code,i=e==null||(o=e.xwa_custom_url_get_user)==null?void 0:o.error_text;return{type:"error",errorCode:c(a),errorText:i!=null?i:""}}var l=e==null||(n=e.xwa_custom_url_get_user)==null||(n=n.user)==null?void 0:n.jid;return l==null||l===""?{type:"error",errorCode:500,errorText:"null or missing userJid"}:{type:"success",user:{jid:l}}}function c(e){return e==="CODE_404"?404:e==="CODE_400"?400:e==="CODE_403"?403:e==="CODE_500"?500:0}l.queryCustomUrlUser=s,l.parseResponse=u}),98); __d("WAWebBizGetCustomUserJob",["WADeprecatedSendIq","WADeprecatedWapParser","WAWap","WAWapDeprecatedSmaxID","WAWebBackendErrors","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=new(r("WADeprecatedWapParser"))("customURLResponse",function(e){e.assertTag("iq"),e.assertFromServer();var t=e.child("user"),n=t.attrUserJid("jid");return{user:{jid:n}}});function s(e){return u.apply(this,arguments)}function u(){return u=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n,a=(n=o("WAWap")).wap("iq",{smax_id:n.SMAX_ID(r("WAWapDeprecatedSmaxID").BtmCustomUrlGetUser),xmlns:"fb:thrift_iq",type:"get",to:n.S_WHATSAPP_NET,id:n.generateId()},n.wap("custom_url",null,n.wap("path",null,t))),i=yield o("WADeprecatedSendIq").deprecatedSendIq(a,e);if(!i.success)throw new(o("WAWebBackendErrors")).ServerStatusCodeError(i.errorCode,i.errorText);return i.result}),u.apply(this,arguments)}l.getUserByCustomURL=s}),98); __d("WAWebBizGetWidFromPathCustomUrlAction",["WALogger","WAWebBackendErrors","WAWebBizGatingUtils","WAWebBizGetCustomUrlUserGraphql","WAWebBizGetCustomUserJob","WAWebWidFactory","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s;function u(e){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n;if(o("WAWebBizGatingUtils").isGetCustomUrlUserGraphqlMigrationEnabled()){var r=yield d(t);r!=null&&(n=o("WAWebWidFactory").createUserWidOrThrow(r))}else try{var a=yield o("WAWebBizGetCustomUserJob").getUserByCustomURL(t);n=o("WAWebWidFactory").createUserWidOrThrow(a.user.jid)}catch(t){if(t instanceof o("WAWebBackendErrors").ServerStatusCodeError)return t.statusCode!==404&&o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[custom-url] Error fetching user by custom url ",""])),t.message).sendLogs("get-user-by-custom-url-error"),null;throw t}return n}),c.apply(this,arguments)}function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=yield o("WAWebBizGetCustomUrlUserGraphql").queryCustomUrlUser(e);return n.type==="error"?(n.errorCode!==404&&o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[custom-url] Error fetching user by custom url "," ",""])),n.errorCode,n.errorText).sendLogs("get-user-by-custom-url-graphql-error"),null):(t=n.user)==null?void 0:t.jid}),m.apply(this,arguments)}l.getWidfromPath=u}),98); __d("useWAWebFlow",["$InternalEnum","WANullthrows","WAWebUimUie.react","WAWebVelocityTransitionGroup","react","useWAWebStableCallback","useWAWebUIM"],(function(t,n,r,o,a,i,l){var e=["ref"],s,u,c=u||(u=o("react")),d=s||(s=r("react")),m=c.useCallback,p=c.useEffect,_=c.useMemo,f=c.useReducer,g=c.useRef,h={container:{height:"x5yr21d",insetInlineStart:"x1o0tod",left:null,right:null,overflowX:"x6ikm8r",overflowY:"x10wlt62",position:"x10l6tqk",top:"x13vifvy",width:"xh8yej3",$$css:!0}};function y(){function t(t){var n=t.ref,a=babelHelpers.objectWithoutPropertiesLoose(t,e),i=a.children,l=a.displayName,s=l===void 0?"FlowDrawer":l,u=a.flow,c=u.activeKey,m=u.pop,p=u.transition;if(i==null)return null;var _=function(){a.requestFocus&&a.requestFocus()},f=function(t){a.requestDismiss?a.requestDismiss(t):m()};return d.jsx(r("WAWebVelocityTransitionGroup"),{ref:n,transitionName:p,xstyle:h.container,displayName:s+"-"+c,children:d.jsx(o("WAWebUimUie.react").UIE,{displayName:s+"-"+c,escapable:!0,requestFocus:_,requestDismiss:f,children:i},c)})}return t.displayName=t.name+" [from "+i.id+"]",t}var C=n("$InternalEnum").Mirrored(["DrawerLeft","DrawerRight","Modal","None"]);function b(e){var t=e.initialStep,n=e.initialTransition;return{stack:t!=null?[t]:[],previousStep:null,transition:n,activeKey:1,ended:!1,isPushed:!0}}function v(e,t){var n,r,o;switch(t.type){case"transition":return babelHelpers.extends({},e,{transition:(n=(r=t.payload)==null?void 0:r.transition)!=null?n:e.transition});case"push":return((o=t.payload)==null?void 0:o.step)==null?e:babelHelpers.extends({},e,{previousStep:e.stack[e.stack.length-1],stack:e.stack.concat(t.payload.step),activeKey:e.activeKey+1,ended:!1,isPushed:!0});case"pop":{var a,i,l=(a=(i=t.payload)==null?void 0:i.count)!=null?a:1,s=e.stack.slice(0,-l);return s.length>=1?babelHelpers.extends({},e,{previousStep:e.stack[e.stack.length-1],stack:s,activeKey:e.activeKey-l,isPushed:!1}):e.ended?e:babelHelpers.extends({},e,{ended:!0})}default:return e}}function S(e,t){var n=r("useWAWebUIM")(),o=t||{},a=o.transitions,i=a===void 0?C.None:a,l=o.onEnd,s=R(i),u=s.popTransition,c=s.pushTransition,d=f(v,{initialStep:e,initialTransition:c},b),h=d[0],S=d[1],L=g(null),E=m(function(e){S({type:"transition",payload:{transition:e}})},[]),k=m(function(e,t){t===void 0&&(t=c),E(t);var n=L.current;L.current=function(){n==null||n(),S({type:"push",payload:{step:e}})}},[c,E]),I=m(function(e,t){e===void 0&&(e=u),t===void 0&&(t=1),E(e),L.current=function(){return S({type:"pop",payload:{count:t}})}},[u,E]);p(function(){L.current!=null&&(L.current(),L.current=null)},void 0);var T=r("useWAWebStableCallback")(function(e){l?l(e):r("WANullthrows")(n).requestDismiss(e)}),D=r("useWAWebStableCallback")(function(){return h.stack.length});p(function(){h.ended&&T()},[T,h.ended]);var x=_(function(){return y()},[]),$={push:k,pop:I,end:T,stackSize:D,step:h.stack[h.stack.length-1],previousStep:h.previousStep,transition:h.transition,activeKey:h.activeKey,isPushed:h.isPushed};return[x,$]}function R(e){switch(e){case C.DrawerLeft:return{pushTransition:"flow-transition-drawer-pop",popTransition:"flow-transition-drawer-push"};case C.DrawerRight:return{pushTransition:"flow-transition-drawer-push",popTransition:"flow-transition-drawer-pop"};case C.Modal:return{pushTransition:"flow-transition-modal-push",popTransition:"flow-transition-modal-pop"};case C.None:return{pushTransition:"none",popTransition:"none"}}}l.FlowTransitions=C,l.useFlow=S}),98); __d("WAWebOpenChatFlow.react",["fbt","$InternalEnum","WAAbortError","WALogger","WAPromiseDelays","WATimeUtils","WAWebBizGetWidFromPathCustomUrlAction","WAWebBotProfileCollection","WAWebCmd","WAWebComposeBoxActions","WAWebConfirmPopup.react","WAWebExternalLink.react","WAWebFbtCommon","WAWebFindChatAction","WAWebFlex.react","WAWebLinkify","WAWebNoop","WAWebQueryExistsJob","WAWebSpinner.react","WAWebUserPrefsMeUser","WAWebUsernameGatingUtils","WAWebUsernameKeyVerificationFlow","WAWebWidFormat","asyncToGeneratorRuntime","err","react","useWAWebFlow"],(function(t,n,r,o,a,i,l,s){var e,u,c,d,m=d||(d=o("react")),p=c||(c=r("react")),_=m.useEffect,f=m.useRef,g=250,h=500,y=new Map;function C(){y.clear()}function b(e){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(!e.isUser())return e;var t=y.get(e.user);if(t)return t;var n=yield o("WAWebQueryExistsJob").queryWidExists(e),r=n==null?e:n.wid;return y.set(e.user,r),r}),v.apply(this,arguments)}var S=n("$InternalEnum").Mirrored(["Confirm","Error","UsernameNotFoundError"]);function R(t){var a=o("useWAWebFlow").useFlow(),i=a[0],l=a[1],c=f(),d=(function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var n=t.target,r=n.customUrl,a=n.username,i=n.usernameKey,l=n.wid;if(l!=null)return{wid:l,widLookupMethod:"directWid"};if(r!=null){var s=yield o("WAWebBizGetWidFromPathCustomUrlAction").getWidfromPath(r);if(s)return{wid:s,widLookupMethod:"customUrl"}}if(a!=null&&o("WAWebUsernameGatingUtils").username1on1ChatCreationEnabled()){var u=yield o("WAWebQueryExistsJob").queryUsernameExists(a,i),c;if((u==null?void 0:u.keyRequired)===!0?(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["OpenChatFlow: username query returned keyRequired"]))),c=yield o("WAWebUsernameKeyVerificationFlow").usernameKeyVerificationFlow({username:a,initWithError:i!=null})):c=u==null?void 0:u.wid,c!=null)return{wid:c,widLookupMethod:"username"}}});return function(){return r.apply(this,arguments)}})(),m=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var n=t.ctwaContextLinkData,r=t.msgText,a=t.clearPreviousText,i=a===void 0?!1:a;if(n){var l=o("WAWebLinkify").findLink(n.sourceUrl||"",!1,o("WAWebUserPrefsMeUser").getMaybeMePnUser()),s=(l==null?void 0:l.suspiciousCharacters)!=null&&l.suspiciousCharacters.size>0;s&&(n=void 0)}n&&(r=n.icebreaker),e.active&&r!=null&&r!==""?(i&&o("WAWebComposeBoxActions").ComposeBoxActions.setTextContent(e,""),o("WAWebComposeBoxActions").ComposeBoxActions.paste(e,r),n&&o("WAWebComposeBoxActions").ComposeBoxActions.setCtwaContextLinkData(e,n)):(i&&e.setComposeContents({text:""}),r!=null&&r!==""&&e.setComposeContents({text:r,timestamp:o("WATimeUtils").unixTime()}),yield o("WAWebCmd").Cmd.openChatFromUnread({chat:e}).then(function(t){t&&(o("WAWebComposeBoxActions").ComposeBoxActions.focus(e),n&&o("WAWebComposeBoxActions").ComposeBoxActions.setCtwaContextLinkData(e,n))})),t.sendLogAttributes!=null&&o("WAWebComposeBoxActions").ComposeBoxActions.addMsgSendingLogAttributes(e,t.sendLogAttributes)});return function(n){return e.apply(this,arguments)}})(),y=function(){l.push(S.Error)},C=function(){var e;(e=c.current)==null||e.controller.abort(),c.current=void 0,l.end()};if(_(function(){var e=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=!1,a=new AbortController;o("WAPromiseDelays").delayMs(g).then(function(){if(a.signal.aborted)throw new(o("WAAbortError")).AbortError;e=!0,l.push(S.Confirm)}).catch(o("WAAbortError").catchAbort(r("WAWebNoop")));var i=Date.now(),s=new AbortController,p=s.signal,_=yield d();if(_==null){var f=t.target,C=f.fallbackUrl,v=f.username;if(v!=null&&o("WAWebUsernameGatingUtils").username1on1ChatCreationEnabled()){a.abort(),l.push(S.UsernameNotFoundError);return}if(C!=null){o("WAWebExternalLink.react").openExternalLink(C),l.end();return}o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["OpenChatFlow chat open was no-op from provided props."]))),l.end();return}var R=b(_.wid).then(function(e){var t,n=(t=o("WAWebBotProfileCollection").BotProfileCollection.getDefaultBot())==null?void 0:t.id;if(e.isBot()&&(n==null||!n.equals(e)))throw r("err")("invalid bot chat");return o("WAWebFindChatAction").findOrCreateLatestChat(e,"debugOpenChatFlow",{forceUsync:!0})}).then((function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n){if(p.aborted)throw new(o("WAAbortError")).AbortError;e||a.abort();var r=Date.now()-i,s=e?Math.max(h+g-r,0):0;yield m(n.chat),yield o("WAPromiseDelays").delayMs(s),l.end(),t.onSuccess(babelHelpers.extends({},n,{widLookupMethod:_.widLookupMethod}))});return function(e){return r.apply(this,arguments)}})()).catch(o("WAAbortError").catchAbort(r("WAWebNoop"))).catch(function(e){a.abort(),t.onError==null||t.onError(e),y()});c.current={controller:s,promise:R}});return function(){return e.apply(this,arguments)}})();e().catch(r("WAWebNoop"))},[]),l.step==null)return null;var v=null;switch(l.step){case S.Confirm:v=p.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{title:s._(/*BTDS*/"Iniciando chat"),onCancel:C,cancelText:s._(/*BTDS*/"Cancelar"),children:p.jsx(o("WAWebFlex.react").FlexRow,{justify:"center",align:"center",children:p.jsx(o("WAWebSpinner.react").Spinner,{stroke:6,size:24})})});break;case S.Error:if(t.customError!=null)v=t.customError;else{var R=t.target.wid,L=o("WAWebWidFormat").widToFormattedUser(R);v=p.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{onOK:function(){return l.end()},okText:r("WAWebFbtCommon")("OK"),children:s._(/*BTDS*/"El n\u00famero {formattedNumber} no est\u00e1 en WhatsApp.",[s._param("formattedNumber",L)])})}break;case S.UsernameNotFoundError:{var E=t.target.username;v=p.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{onOK:function(){return l.end()},okText:r("WAWebFbtCommon")("OK"),children:s._(/*BTDS*/"El nombre de usuario \u0040{username} no est\u00e1 en WhatsApp.",[s._param("username",E)])});break}}return p.jsx(i,{flow:l,children:v})}R.displayName=R.name+" [from "+i.id+"]",l.clearChatIdCorrectionCache=C,l.OpenChatFlow=R}),226); __d("WAWebBlockQuoteFormatMutator",["WAWebBlockQuoteMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=/(?:^)\>(\s(?! +)[^\n]+(?:$)(?:\n|$))/gm,c=/(?:^)\>(\s(?! +)[^\n]*(?:$)(?:\n|$))/gm,d=r("WAWebCreateRegexMutator")(u,1),m=r("WAWebCreateRegexMutator")(c,1),p=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){var e=o.inline,a=e===void 0?!1:e,i=o.quoted,l=i===void 0?!1:i,u=o.selectable,c=u===void 0?!1:u,d=n[1];return s.jsx(r("WAWebBlockQuoteMutatorComponent.react"),{selectable:c,inline:a,text:d,quoted:l,children:t})},t})(d);p.unformatDecorations={pre:">"};var _=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t})(m);l.BlockQuote=p,l.BlockQuoteWithEmpty=_}),98); __d("WAWebAdjustDelimitedRange",[],(function(t,n,r,o,a,i){function e(e){return function(t,n){var r=2*e.length+t[1].length,o=t[0].length-r;return o>0&&(t.index+=o,t[0]=t[0].slice(o)),n.lastIndex--,t}}i.default=e}),66); __d("WAWebBoldFormatRegex",[],(function(t,n,r,o,a,i){var e=/(?:^|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))\*(?![\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]|\u20E3|\uFE0F\u20E3)((?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))\*(?=$|(?!\u20E3|\uFE0F\u20E3))(?=$|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))/g,l=e;i.default=l}),66); __d("WAWebBoldMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react"));function u(e){var t=e.children,n=t===void 0?"":t,r=e.selectable;return s.jsx(o("WAWebCopyPasteSelectable.react").SelectableStrong,{selectable:r,appTextTemplate:"*${appText}*",children:n})}u.displayName=u.name+" [from "+i.id+"]",l.default=u}),98); __d("WAWebBoldFormatMutator",["WAWebAdjustDelimitedRange","WAWebBoldFormatRegex","WAWebBoldMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=r("WAWebAdjustDelimitedRange")("*"),c=r("WAWebCreateRegexMutator")(r("WAWebBoldFormatRegex"),1,u),d=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){var e=o.selectable,a=e===void 0?!1:e;return s.jsx(r("WAWebBoldMutatorComponent.react"),{selectable:a,children:t})},t})(c);l.default=d}),98); __d("WAWebClickable.react",["$InternalEnum","WAWebClassnames","WAWebKeyboardIsKeyActivation","WAWebUseIsKeyboardUser","WDSFocusStateStyles","react","stylex","useMergeRefs"],(function(t,n,r,o,a,i,l){var e=["ref"],s,u,c,d=c||(c=r("react")),m=(s||(s=o("react"))).useRef,p=n("$InternalEnum").Mirrored(["Default","Image"]),_={imageFocus:{":focus_filter":"x1cm50aa",$$css:!0}};function f(t){var n=t.ref,a=babelHelpers.objectWithoutPropertiesLoose(t,e),i=a.as,l=i===void 0?"div":i,s=a.children,c=a.className,f=a.dataTestId,g=a.inlineStyle,h=a.onClick,y=a.preventDefaultKeyboard,C=y===void 0?!1:y,b=a.xstyle,v=l,S=r("WAWebUseIsKeyboardUser")(),R=S.isKeyboardUser,L=m(null),E=r("useMergeRefs")(n,L),k=function(t){if(r("WAWebKeyboardIsKeyActivation")(t)&&h){var e;(e=L.current)==null||e.click(),C&&t.preventDefault()}},I,T,D,x,$,P;if(h){var N,M,w;I=(N=a.role)!=null?N:"button",T=a.ariaLabel,D=(M=a.tabIndex)!=null?M:0,x=(w=a.focusTheme)!=null?w:p.Default,$=a.title,P=a["data-tab"]}return d.jsx(v,{onClick:h,role:I,tabIndex:D,"data-testid":void 0,"aria-label":T,title:$,"data-tab":P,ref:E,className:o("WAWebClassnames").classnamesConvertMeToStylexPlease(c,(u||(u=r("stylex")))(b,R&&p.Default===x&&o("WDSFocusStateStyles").WDSFocusStateStyles.genericFocus,R&&p.Image===x&&_.imageFocus)),onKeyDown:k,style:g,children:s})}f.displayName=f.name+" [from "+i.id+"]";var g=f;l.FocusTheme=p,l.Clickable=g}),98); __d("WAWebBotCommandMutatorComponent.react",["WAWebClickable.react","WAWebComposeBoxActions","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u={link:{color:"x1ph7ams",$$css:!0}};function c(e){var t=e.children,n=t===void 0?"":t,r=function(){o("WAWebComposeBoxActions").ComposeBoxActions.paste(null,String(n)+" ",{insertLeadingSpace:!0})};return s.jsx(o("WAWebClickable.react").Clickable,{as:"span",xstyle:u.link,onClick:r,children:n})}c.displayName=c.name+" [from "+i.id+"]",l.default=c}),98); __d("WAWebBotCommandFormatMutator",["WAWebBotCommandMutatorComponent.react","WAWebExtractRangesUsingRegex","WAWebFormatMutator","escapeRegex","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.match=function(t,n){var e=n!=null?n:{},o=e.commands;if(!o||o.length===0)return[];var a=o.map(function(e){return r("escapeRegex")("/"+e.name)}),i=new RegExp("("+a.join("|")+")(?=$|\\s)","gmi"),l=!1;return r("WAWebExtractRangesUsingRegex")(t,i,0,function(e){return l?null:(l=!0,e)})},t})(r("WAWebFormatMutator"));u.format=!1,u.jsx=function(e,t){return s.jsx(r("WAWebBotCommandMutatorComponent.react"),{children:e})},l.BotCommand=u}),98); __d("WAWebBulletedListFormatMutator",["WAWebBoolFunc","WAWebBulletedListMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=/((?:^)(?:[\*\-\•] (?! +)(?:[^\n]+)(?:\n(?:[\*\-\•] (?! +)[^\n]+)){0,})(?:\n|$))/gm,c=r("WAWebCreateRegexMutator")(u,0),d=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){return s.jsx(r("WAWebBulletedListMutatorComponent.react"),babelHelpers.extends({},o,{children:t}))},t})(c);d.nestable=o("WAWebBoolFunc").returnFalse,l.default=d}),98); __d("WAWebBulletedListItemFormatMutator",["WAWebBulletedListFormatMutator","WAWebBulletedListItemMutatorComponent.react","WAWebCreateRegexMutator","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=/(?:^)[\*\•]( (?! +)[^\n]+(?:$))/gm,c=/(?:^)\-( (?! +)[^\n]+(?:$))/gm,d=/(?:^)\*( (?! +)[^\n]*(?:$))/gm,m=/(?:^)\-( (?! +)[^\n]*(?:$))/gm,p=new Set([r("WAWebBulletedListFormatMutator")]);function _(e,t){var n,o=r("WAWebCreateRegexMutator")(e,1),a=(n=(function(e){function n(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(n,e),n.jsx=function(n,o,a){var e=a.inline,i=a.selectable,l=i===void 0?!1:i,u=o[1];return s.jsx(r("WAWebBulletedListItemMutatorComponent.react"),{inline:e,selectable:l,text:u,symbol:t,children:n})},n})(o),n.displayName="BulletedListItem",n.nestable=function(e){return p.has(e)},n.unformatDecorations={pre:t},n);return a}var f=_(u,"*"),g=_(c,"-"),h=_(d,"*"),y=_(m,"-");l.BulletedListItem=f,l.HyphenListItem=g,l.BulletedListItemWithEmpty=h,l.HyphenListItemWithEmpty=y}),98); __d("WAWebEmojiMutatorComponent.react",["WAWebEmoji.react","WAWebMessageLargeEmoji.react","react","useWAWebABPropConfigValue"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react"));function u(e){var t=e.emoji,n=e.selectable,a=e.size,i=e.xstyle;return o("useWAWebABPropConfigValue").useABPropConfigValue("custom_racing_emoji"),o("useWAWebABPropConfigValue").useABPropConfigValue("custom_racing_emoji_feb2025"),a==="xlarge"?s.jsx(o("WAWebMessageLargeEmoji.react").LargeEmoji,{emoji:t,xstyle:i,size:o("WAWebMessageLargeEmoji.react").SIZE.XLARGE,element:"span",selectable:n}):s.jsx(r("WAWebEmoji.react"),{emoji:t,xstyle:i,selectable:n,size:a})}u.displayName=u.name+" [from "+i.id+"]",l.default=u}),98); __d("WAWebEmojiFormatMutator",["WAUnicodeUtils","WAWebEmoji","WAWebEmojiMutatorComponent.react","WAWebExtractRangesUsingRegex","WAWebFormatMutator","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){var e=n[0],a=o.emojiXstyle,i=o.selectable,l=i===void 0?!1:i,u=o.size;return s.jsx(r("WAWebEmojiMutatorComponent.react"),{emoji:e,size:u,selectable:l,xstyle:a})},t.match=function(t,n,a){var e=a!=null&&a!==0?a:t.length,i=o("WAUnicodeUtils").firstNCodepoints(t,e);return r("WAWebExtractRangesUsingRegex")(i,o("WAWebEmoji").EmojiUtil.emojiRegex(),0,c)},t})(r("WAWebFormatMutator"));u.compatibility=!0;function c(e,t){return o("WAWebEmoji").EmojiUtil.getGlyphId(e[0])?e:null}l.default=u}),98); __d("WAWebHeadingFormatMutator",["$InternalEnum","WAWebCreateRegexMutator","WAWebRichTextHeading.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=n("$InternalEnum")({LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4}),c=/^(#{1,4})\s([^\n]+)(?:$)(?:\n|$)/gm,d=r("WAWebCreateRegexMutator")(c,2);function m(e){switch(e){case"#":return u.LEVEL_1;case"##":return u.LEVEL_2;case"###":return u.LEVEL_3;case"####":return u.LEVEL_4;default:return u.LEVEL_4}}var p=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n){var e=n[2],o=n[1];return s.jsx(r("WAWebRichTextHeading.react"),{level:m(o),text:e})},t})(d),_=new Set([u.LEVEL_1,u.LEVEL_2]),f=new Set([u.LEVEL_3,u.LEVEL_4]),g=function(t){return _.has(t)},h=function(t){return f.has(t)},y=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n){var e=n[2],o=m(n[1]);return g(o)?s.jsx(r("WAWebRichTextHeading.react"),{level:o,text:e}):h(o)?s.jsx(r("WAWebRichTextHeading.react"),{level:o,text:e}):s.jsx("span",{children:n[0]})},t})(d),C=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n){var e=n[2];return s.jsx("span",{children:e})},t})(d);C.unformatDecorations={post:" "},l.HeadingLevel=u,l.RegexMutator=d,l.Heading=p,l.AIRichResponseHeading=y,l.HeadlessHeading=C}),98); __d("WAWebRichTextHeading.react",["WAWebHeadingFormatMutator","react","stylex"],(function(t,n,r,o,a,i,l){var e,s,u=e||(e=r("react")),c={base:{display:"x1rg5ohu",width:"xh8yej3",$$css:!0},LEVEL_1:{fontSize:"x1q74xe4",lineHeight:"x1slxwg",marginBottom:"x12nagc",$$css:!0},LEVEL_2:{fontSize:"x1aueamr",lineHeight:"xgif2c7",marginBottom:"x12nagc",$$css:!0},LEVEL_3:{fontSize:"x1603h9y",lineHeight:"x101yacv",marginBottom:"x12nagc",$$css:!0},LEVEL_4:{fontSize:"x1lkfr7t",lineHeight:"x19v9tvf",marginBottom:"x12nagc",$$css:!0}};function d(e){switch(e){case o("WAWebHeadingFormatMutator").HeadingLevel.LEVEL_1:return[c.base,c.LEVEL_1];case o("WAWebHeadingFormatMutator").HeadingLevel.LEVEL_2:return[c.base,c.LEVEL_2];case o("WAWebHeadingFormatMutator").HeadingLevel.LEVEL_3:return[c.base,c.LEVEL_3];case o("WAWebHeadingFormatMutator").HeadingLevel.LEVEL_4:return[c.base,c.LEVEL_4]}}function m(e){var t=e.level,n=e.text;return u.jsx("span",babelHelpers.extends({},(s||(s=r("stylex"))).props(d(t)),{children:n}))}m.displayName=m.name+" [from "+i.id+"]",l.default=m}),98); __d("WAWebHighlightMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react"));function u(e){var t=e.children,n=t===void 0?"":t,r=e.selectable;return s.jsx(o("WAWebCopyPasteSelectable.react").SelectableSpan,{className:"matched-text",selectable:r,children:n})}u.displayName=u.name+" [from "+i.id+"]",l.default=u}),98); __d("WAWebL10NIsLatinAlphabetLanguage",["WAWebL10NRemoveAccents","latenize"],(function(t,n,r,o,a,i,l){function e(e){return r("latenize").isLatin(o("WAWebL10NRemoveAccents").removeAccents(e))}l.isLatinAlphabetLanguage=e}),98); __d("WAWebHighlightFormatMutator",["WAWebExtractRangesUsingRegex","WAWebFormatMutator","WAWebHighlightMutatorComponent.react","WAWebL10N","WAWebL10NIsLatinAlphabetLanguage","WAWebL10NRemoveAccents","escapeRegex","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.match=function(t,n){if(!n)return[];var e=n.boundary,a=e===void 0?!1:e,i=n.ignoreDiacritics,l=i===void 0?!1:i,s=n.terms;if(!s.length||s.every(function(e){return e.length===0}))return[];var u=l&&o("WAWebL10NIsLatinAlphabetLanguage").isLatinAlphabetLanguage(t)&&s.every(function(e){return o("WAWebL10NIsLatinAlphabetLanguage").isLatinAlphabetLanguage(e)})&&!r("WAWebL10N").isRTL(),d=u?o("WAWebL10NRemoveAccents").removeAccents(t):t,m=r("WAWebExtractRangesUsingRegex")(d,c(s,a,u));return m},t})(r("WAWebFormatMutator"));u.jsx=function(e,t,n){var o=n.selectable;return s.jsx(r("WAWebHighlightMutatorComponent.react"),{selectable:o,children:e})};function c(e,t,n){var a=n?e.map(function(e){return o("WAWebL10NRemoveAccents").removeAccents(e)}):e,i=a.filter(function(e){return e.trim().length>0}),l=i.map(r("escapeRegex")).join("|");return r("WAWebL10N").isRTL()?new RegExp((t?"(?:^|\\b)":"")+"(\\S+)?("+l+")(\\S+)?","ig"):new RegExp((t?"(?:^|\\b)":"")+"("+l+")","ig")}l.default=u}),98); __d("WAWebInlineCodeFormatRegex",[],(function(t,n,r,o,a,i){var e=/(?:^|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))`(?![\t-\r `\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])((?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))`(?=$|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))/g,l=e;i.default=l}),66); __d("WAWebInlineCodeMutatorComponent.react",["WAWebCopyPasteSelectable.react","WAWebUISpacing","react","stylex"],(function(t,n,r,o,a,i,l){var e,s,u=e||(e=r("react")),c={code:{borderStartStartRadius:"xbrszos",borderStartEndRadius:"xea3l6g",borderEndEndRadius:"x18isctg",borderEndStartRadius:"x2q3nzr",backgroundColor:"x1bu39yj",color:"x1bvqhpb",$$css:!0},quotedColor:{color:"x15rks2t",$$css:!0}};function d(e){var t=e.children,n=t===void 0?"":t,a=e.quoted,i=e.selectable;return u.jsx(o("WAWebCopyPasteSelectable.react").SelectableCode,{selectable:i,appTextTemplate:"`${appText}`",className:(s||(s=r("stylex")))(c.code,a&&c.quotedColor,o("WAWebUISpacing").uiPadding.horiz4,o("WAWebUISpacing").uiPadding.vert2),children:n})}d.displayName=d.name+" [from "+i.id+"]",l.default=d}),98); __d("WAWebInlineCodeFormatMutator",["WAWebAdjustDelimitedRange","WAWebCreateRegexMutator","WAWebInlineCodeFormatRegex","WAWebInlineCodeMutatorComponent.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=r("WAWebAdjustDelimitedRange")("`"),c=r("WAWebCreateRegexMutator")(r("WAWebInlineCodeFormatRegex"),1,u),d=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){var e=o.quoted,a=e===void 0?!1:e,i=o.selectable,l=i===void 0?!1:i;return s.jsx(r("WAWebInlineCodeMutatorComponent.react"),{selectable:l,quoted:a,children:t})},t})(c);d.format=!1,l.default=d}),98); __d("WAWebItalicFormatRegex",[],(function(t,n,r,o,a,i){var e=/(?:^|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))_((?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))_(?=$|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))/g,l=e;i.default=l}),66); __d("WAWebItalicMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react"));function u(e){var t=e.children,n=t===void 0?"":t,r=e.selectable;return s.jsx(o("WAWebCopyPasteSelectable.react").SelectableEm,{selectable:r,appTextTemplate:"_${appText}_",children:n})}u.displayName=u.name+" [from "+i.id+"]",l.default=u}),98); __d("WAWebItalicFormatMutator",["WAWebAdjustDelimitedRange","WAWebCreateRegexMutator","WAWebItalicFormatRegex","WAWebItalicMutatorComponent.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=r("WAWebAdjustDelimitedRange")("_"),c=r("WAWebCreateRegexMutator")(r("WAWebItalicFormatRegex"),1,u),d=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){var e=o.selectable,a=e===void 0?!1:e;return s.jsx(r("WAWebItalicMutatorComponent.react"),{selectable:a,children:t})},t})(c);l.default=d}),98); __d("WAWebLinkMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u={link:{textDecoration:"x1bvjpef x1lku1pv x11iimpl xbvygy2 x1wp9yj1 x1e2wovf",color:"x1ph7ams x17f7hit",backgroundColor:"xn69kzl",textUnderlineOffset:"xrys4gj xhmieyt",$$css:!0}};function c(e){var t=e.children,n=t===void 0?"":t,r=e.className,a=e.dataTab,i=e.href,l=e.onClick,c=e.selectable;return s.jsx(o("WAWebCopyPasteSelectable.react").SelectableLink,{onClick:function(t){l==null||l()},onContextMenu:function(t){l==null||l()},className:r,xstyle:u.link,href:i,title:i,target:"_blank",rel:"noopener noreferrer",selectable:c,dataTab:a,children:n})}c.displayName=c.name+" [from "+i.id+"]",l.default=c}),98); __d("WAWebStrikethroughFormatRegex",[],(function(t,n,r,o,a,i){var e=/(?:^|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))~((?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?:[\0-\t\x0B-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))~(?=$|(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0600-\u060F\u061B\u061C\u061E\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u070F\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u08E2\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u180E\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B6A\u1B74-\u1B7C\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u2066-\u206F\u207A-\u207E\u208A-\u208E\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2B95\u2B98-\u2BC8\u2BCA-\u2BFE\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uABEB\uFB29\uFBB2-\uFBC1\uFD3E\uFD3F\uFDFC\uFDFD\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB-\uDCC1\uDCCD\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3F]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDE97-\uDE9A]|\uD82F[\uDC9C\uDC9F-\uDCA3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD6B\uDD70-\uDDAC\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED4\uDEE0-\uDEEC\uDEF0-\uDEF9\uDF00-\uDF73\uDF80-\uDFD8]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD00-\uDD0B\uDD10-\uDD3E\uDD40-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF\uDE60-\uDE6D]|\uDB40[\uDC01\uDC20-\uDC7F]))/g,l=e;i.default=l}),66); __d("WAWebStrikethroughMutatorComponent.react",["WAWebCopyPasteSelectable.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react"));function u(e){var t=e.children,n=t===void 0?"":t,r=e.selectable;return s.jsx(o("WAWebCopyPasteSelectable.react").SelectableDel,{selectable:r,appTextTemplate:"~${appText}~",children:n})}u.displayName=u.name+" [from "+i.id+"]",l.default=u}),98); __d("WAWebStrikethroughFormatMutator",["WAWebAdjustDelimitedRange","WAWebCreateRegexMutator","WAWebStrikethroughFormatRegex","WAWebStrikethroughMutatorComponent.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=r("WAWebAdjustDelimitedRange")("_"),c=r("WAWebCreateRegexMutator")(r("WAWebStrikethroughFormatRegex"),1,u),d=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){var e=o.selectable;return s.jsx(r("WAWebStrikethroughMutatorComponent.react"),{selectable:e,children:t})},t})(c);l.default=d}),98); __d("WAWebSuspiciousLinkPopup.react",["fbt","WAWebCmd","WAWebConfirmPopup.react","WAWebExternalLink.react","WAWebFaqUrl","WAWebModal.react","WAWebModalManager","react"],(function(t,n,r,o,a,i,l,s){var e,u,c=u||(u=r("react")),d=(e||(e=o("react"))).Fragment,m=".",p=function(){o("WAWebModalManager").ModalManager.close(),o("WAWebCmd").Cmd.closeLongLinkModal(!0)};function _(e){var t=e.link,n=function(){var e=t.href;o("WAWebExternalLink.react").openExternalLink(e),o("WAWebModalManager").ModalManager.close(),o("WAWebCmd").Cmd.closeLongLinkModal(!0)},r=t.domain,a=t.href,i=t.suspiciousCharacters,l=r.split(m),u=l.map(function(e,t){var n=!1,r=e.split("").map(function(e,r){var o=i!=null&&i.has(e);n=o||n;var a=o?"x117nqv4":void 0;return c.jsx("span",{className:a,children:e},t+"-"+r+"-"+e)}),o=n?"xghrzdh":void 0;return c.jsxs(d,{children:[c.jsx("span",{className:o,children:r}),t+1!==l.length?c.jsx("span",{children:m}):null]},t+"-"+e)}),_=a.split(r),f=_[0],g=_[1];return c.jsxs(o("WAWebConfirmPopup.react").ConfirmPopup,{title:s._(/*BTDS*/"Enlace sospechoso"),okText:s._(/*BTDS*/"Cancelar"),cancelText:s._(/*BTDS*/"Abrir enlace"),onOK:p,onCancel:n,type:o("WAWebModal.react").ModalTheme.LinkPopup,children:[c.jsxs("div",{className:"xyorhqc",children:[s._(/*BTDS*/"Este enlace contiene caracteres inusuales. Es posible que no sea el sitio web que aparenta ser.")," ",c.jsx(o("WAWebExternalLink.react").ExternalLink,{href:o("WAWebFaqUrl").getSuspiciousLinkFaqUrl(),children:s._(/*BTDS*/"M\u00e1s informaci\u00f3n")})]}),c.jsxs("div",{className:"x104kibb x1jquxbb x1anpbxc x6ikm8r x10wlt62 x1fc57z9 xlyipyv x1mzt3pk x1gzmk7r x1ua5tub",children:[f,u,g]})]})}_.displayName=_.name+" [from "+i.id+"]",l.default=_}),226); __d("WAWebSuspiciousLinkMutatorComponent.react",["WAWebCmd","WAWebCopyPasteSelectable.react","WAWebModalManager","WAWebSuspiciousLinkPopup.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react"));function u(e){var t=e.children,n=t===void 0?"":t,a=e.className,i=e.dataTab,l=e.link,u=e.onClick,c=e.selectable;return s.jsx(o("WAWebCopyPasteSelectable.react").SelectableLink,{className:a,onClick:function(){o("WAWebModalManager").ModalManager.open(s.jsx(r("WAWebSuspiciousLinkPopup.react"),{link:l})),o("WAWebCmd").Cmd.openLongLinkModal(),u==null||u()},onContextMenu:function(t){u==null||u()},selectable:c,style:{cursor:"pointer"},dataTab:i,children:n})}u.displayName=u.name+" [from "+i.id+"]",l.default=u}),98); __d("WAWebLinkFormatMutator",["WAWebBoldFormatMutator","WAWebCodeFormatMutator","WAWebFormatMutator","WAWebInlineCodeFormatMutator","WAWebItalicFormatMutator","WAWebLinkMutatorComponent.react","WAWebStrikethroughFormatMutator","WAWebSuspiciousLinkMutatorComponent.react","react","stylex"],(function(t,n,r,o,a,i,l){var e,s,u=e||(e=r("react")),c=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){var e=o.dataTab,a=o.linkXstyle,i=o.onLinkClick,l=o.selectable,c=l===void 0?!1:l,d=n.href,m=n.suspiciousCharacters;return m!=null&&m.size?u.jsx(r("WAWebSuspiciousLinkMutatorComponent.react"),{onClick:i,className:(s||(s=r("stylex")))(a),link:n,selectable:c,dataTab:e,children:t}):u.jsx(r("WAWebLinkMutatorComponent.react"),{className:(s||(s=r("stylex")))(a),onClick:i,href:d,selectable:c,dataTab:e,children:t})},t})(r("WAWebFormatMutator"));c.format=!1,c.compatibility=!0,c.match=function(e,t,n){if(!t)return[];var r=t.links,o=r===void 0?[]:r;return o.map(d)},c.conflictResolvers=new Map([[r("WAWebBoldFormatMutator"),m],[r("WAWebItalicFormatMutator"),m],[r("WAWebStrikethroughFormatMutator"),m],[r("WAWebInlineCodeFormatMutator"),m],[o("WAWebCodeFormatMutator").Code,m]]);function d(e){var t=e.index,n=e.url,r=t+n.length-1;return[t,t,r,r,e]}function m(e,t){for(var n=0,r=0;n0)n++;else if(o<0)r++;else{var a=t[r][3]-t[r][2];e[n][2]-=a,e[n][3]-=a;var i=e[n][5];i.href=i.href.slice(0,-a),i.path=i.path&&i.path.slice(0,-a),i.url=i.url.slice(0,-a),r++,n++}}}l.default=c}),98); __d("WAWebNumberedListFormatMutator",["WAWebBoolFunc","WAWebCreateRegexMutator","WAWebNumberedListMutatorComponent.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=/((?:^)(?:(\d{1,2})\. (?! +)(?:[^\n]+)(?:\n(?:(\d{1,2})\. [^\n]+)){0,})(?:\n|$))/gm,c=r("WAWebCreateRegexMutator")(u,0),d=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){return s.jsx(r("WAWebNumberedListMutatorComponent.react"),babelHelpers.extends({},o,{children:t}))},t})(c);d.nestable=o("WAWebBoolFunc").returnFalse,l.default=d}),98); __d("WAWebNumberedListItemFormatMutator",["WAWebCreateRegexMutator","WAWebNumberedListFormatMutator","WAWebNumberedListItemMutatorComponent.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=/(?:^)(\d{1,2}\.)( (?! +)[^\n]+(?:$))/gm,c=/(?:^)(\d{1,2}\.)( (?! +)[^\n]*(?:$))/gm,d=new Set([r("WAWebNumberedListFormatMutator")]);function m(e){var t,n=r("WAWebCreateRegexMutator")(e,2),o=(t=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(t,n,o){var e=o.inline,a=o.selectable,i=a===void 0?!1:a,l=n[1],u=n[2];return s.jsx(r("WAWebNumberedListItemMutatorComponent.react"),{inline:e,selectable:i,text:u,numbering:l,children:t})},t})(n),t.displayName="NumberedListItem",t.nestable=function(e){return d.has(e)},t.unformatDecorations={pre:function(t){return t[1]}},t);return o}var p=m(u),_=m(c);l.NumberedListItem=p,l.NumberedListItemWithEmpty=_}),98); __d("WAWebWamEnumUrlStatusClicked",[],(function(t,n,r,o,a,i){var e=Object.freeze({ONE_CLICK:1,TWO_CLICKS:2,NO_CLICK:3});i.URL_STATUS_CLICKED=e}),66); __d("WAWebLongLinkPop.react",["fbt","WAWebCmd","WAWebConfirmPopup.react","WAWebExternalLink.react","WAWebModal.react","WAWebModalManager","WAWebWamEnumUrlStatusClicked","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react")),c=function(){o("WAWebModalManager").ModalManager.close(),o("WAWebCmd").Cmd.closeLongLinkModal(!0)};function d(e){var t=e.link,n=function(){var n;((n=e.statusItemViewEventRef)==null?void 0:n.current)!=null&&(e.statusItemViewEventRef.current.urlStatusClicked=o("WAWebWamEnumUrlStatusClicked").URL_STATUS_CLICKED.TWO_CLICKS),o("WAWebModalManager").ModalManager.close(),o("WAWebExternalLink.react").openExternalLink(t.href)};return u.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{title:s._(/*BTDS*/"Abrir en el navegador"),okText:s._(/*BTDS*/"Abrir enlace"),cancelText:s._(/*BTDS*/"Cancelar"),onOK:n,onCancel:c,type:o("WAWebModal.react").ModalTheme.LinkPopup,children:u.jsx("div",{children:t.href})})}d.displayName=d.name+" [from "+i.id+"]",l.default=d}),226); __d("WAWebStatusContext",["react"],(function(t,n,r,o,a,i,l){var e,s=(e||(e=o("react"))).createContext,u=s({statusItemViewEventRef:null});l.StatusContext=u}),98); __d("WAWebLongLinkMutatorComponent.react",["WAWebCmd","WAWebCopyPasteSelectable.react","WAWebLongLinkPop.react","WAWebModalManager","WAWebStatusContext","WAWebSuspiciousLinkMutatorComponent.react","react","stylex"],(function(t,n,r,o,a,i,l){var e,s,u,c=u||(u=r("react")),d=(e||(e=o("react"))).useContext,m={link:{cursor:"x1ypdohk",$$css:!0}};function p(e){var t,n=e.children,a=n===void 0?"":n,i=e.dataTab,l=e.link,u=e.selectable,p=e.xstyle,_=d(o("WAWebStatusContext").StatusContext),f=_.statusItemViewEventRef;return(t=l.suspiciousCharacters)!=null&&t.size?c.jsx(r("WAWebSuspiciousLinkMutatorComponent.react"),{className:(s||(s=r("stylex")))(p),link:l,selectable:u,children:a}):c.jsx(o("WAWebCopyPasteSelectable.react").SelectableLink,{dataTab:i,onClick:function(t){t.preventDefault(),o("WAWebModalManager").ModalManager.open(c.jsx(r("WAWebLongLinkPop.react"),{link:l,statusItemViewEventRef:f})),o("WAWebCmd").Cmd.openLongLinkModal()},selectable:u,className:(s||(s=r("stylex")))(m.link,p),children:a})}p.displayName=p.name+" [from "+i.id+"]",l.default=p}),98); __d("WAWebStatusLinkFormatMutator",["WAWebLinkFormatMutator","WAWebLongLinkMutatorComponent.react","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=34,c=12,d="...";function m(e,t){var n=Math.min(t.length,Math.max(t.length-c,t.length+e.length-u));return t.length-n}function p(e,t){var n=t.length>c||t.length+e.length>u?t.slice(0,m(e,t)):t;return n}function _(e){var t=e.domain,n=e.path;return[t.replace(/^www\./,""),n==null||n.length===1?"":n]}function f(e,t){var n=p(e,t),r=e+(n.length===1?"":n),o=r.length>u?""+d+r.slice(r.length-u):r,a=t!==n?d:"";return o+a}var g=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.jsx=function(n,o,a){var t=_(o),i=t[0],l=t[1],u=f(i,l);if(u!==i+l){var c;return s.jsx(r("WAWebLongLinkMutatorComponent.react"),{xstyle:a.linkXstyle,selectable:(c=a.selectable)!=null?c:!1,link:o,dataTab:a.dataTab,children:u})}return e.jsx.call(this,[i+l],o,a)},t})(r("WAWebLinkFormatMutator"));l.cleanUrl=_,l.redactUrl=f,l.StatusLink=g}),98); __d("WAWebFormatConfiguration",["WAWebABProps","WAWebBlockQuoteFormatMutator","WAWebBoldFormatMutator","WAWebBotCommandFormatMutator","WAWebBotGating","WAWebBulletedListFormatMutator","WAWebBulletedListItemFormatMutator","WAWebCodeFormatMutator","WAWebEmojiFormatMutator","WAWebGroupMentionFormatMutator","WAWebHeadingFormatMutator","WAWebHighlightFormatMutator","WAWebInlineCodeFormatMutator","WAWebItalicFormatMutator","WAWebLinkFormatMutator","WAWebMentionAllFormatMutator","WAWebMentionFormatMutator","WAWebNoop","WAWebNumberedListFormatMutator","WAWebNumberedListItemFormatMutator","WAWebPhoneNumberFormatMutator","WAWebRawGroupMentionFormatMutator","WAWebRawMentionMutator","WAWebRawShortNameMentionFormatMutator","WAWebStatusLinkFormatMutator","WAWebStrikethroughFormatMutator","WAWebTextMentionFormatMutator","cr:6000","gkx"],(function(t,n,r,o,a,i,l){var e=function(t){var e=t===void 0?{}:t,n=e.emojiXstyle,o=e.selectable;return[[[r("WAWebEmojiFormatMutator"),{selectable:o,emojiXstyle:n}]]]},s=function(t){var e=t===void 0?{}:t,n=e.selectable;return[[[r("WAWebEmojiFormatMutator"),{selectable:n,size:"large"}]]]},u=function(t){var e=t===void 0?{}:t,n=e.dataTab,a=e.emojiXstyle,i=e.links,l=e.linkXstyle,s=e.selectable;return[[[o("WAWebCodeFormatMutator").Code,{selectable:s}]],[[o("WAWebStatusLinkFormatMutator").StatusLink,{links:i,selectable:s,linkXstyle:l,dataTab:n}]],[[r("WAWebBoldFormatMutator"),{selectable:s}],[r("WAWebItalicFormatMutator"),{selectable:s}],[r("WAWebStrikethroughFormatMutator"),{selectable:s}]],[[r("WAWebEmojiFormatMutator"),{selectable:s,size:"xlarge",emojiXstyle:a}]]]},c=function(t){var e=t===void 0?{}:t,n=e.links,a=e.linkXstyle,i=e.selectable;return[[[o("WAWebCodeFormatMutator").Code,{selectable:i}]],[[o("WAWebStatusLinkFormatMutator").StatusLink,{links:n,selectable:i,linkXstyle:a}]],[[r("WAWebBoldFormatMutator"),{selectable:i}],[r("WAWebItalicFormatMutator"),{selectable:i}],[r("WAWebStrikethroughFormatMutator"),{selectable:i}]],[[r("WAWebEmojiFormatMutator"),{selectable:i}]]]},d=function(t){var e=t===void 0?{}:t,n=e.selectable;return[[[r("WAWebEmojiFormatMutator"),{selectable:n}]]]},m=function(t){var e=t===void 0?{}:t,a=e.mentions,i=e.groupMentions,l=e.hasMentionAll,s=e.links,u=e.phoneNumbers,c=e.selectable,d=e.trusted,m=e.fromMe,p=e.fromChatWid,_=e.commands,f=e.parseInlineCode,g=f===void 0?!1:f,h=e.parseLists,y=h===void 0?!1:h,C=e.parseQuotes,b=C===void 0?!1:C,v=e.parseHeadings,S=v===void 0?!1:v,R=e.onLinkClick,L=R===void 0?r("WAWebNoop"):R,E=e.terms,k=E===void 0?null:E,I=d&&u!=null&&u.length>0?[[r("WAWebPhoneNumberFormatMutator"),{phoneNumbers:u,selectable:c,fromMe:m}]]:null,T;return(o("WAWebBotGating").isBizBot3pEnabled()||o("WAWebBotGating").isMetaBotCommandsEnabled())&&_&&_.length>0&&(T=[[o("WAWebBotCommandFormatMutator").BotCommand,{commands:_,selectable:c}]]),[[[o("WAWebCodeFormatMutator").Code,{selectable:c}]],g?[[r("WAWebInlineCodeFormatMutator"),{selectable:c}]]:null,y?[[o("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:c}]]:null,y?[[o("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:c}]]:null,y?[[r("WAWebBulletedListFormatMutator"),{selectable:c}]]:null,y?[[o("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:c}]]:null,y?[[r("WAWebNumberedListFormatMutator"),{selectable:c}]]:null,d?[[r("WAWebLinkFormatMutator"),{links:s,selectable:c,onLinkClick:L}]]:null,a?[[r("WAWebMentionFormatMutator"),{mentions:a,selectable:c}]]:null,[[r("WAWebMentionAllFormatMutator"),{hasMentionAll:l,selectable:c}]],S?[[o("WAWebHeadingFormatMutator").Heading,{selectable:c}]]:null,i?[[o("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:i,selectable:c,fromChatWid:p}]]:null,!r("gkx")("26258")&&n("cr:6000")?n("cr:6000")(c):null,I,[[r("WAWebBoldFormatMutator"),{selectable:c}],[r("WAWebItalicFormatMutator"),{selectable:c}],[r("WAWebStrikethroughFormatMutator"),{selectable:c}]],[[r("WAWebEmojiFormatMutator"),{selectable:c}]],b?[[o("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:c}]]:null,T,k!=null?[[r("WAWebHighlightFormatMutator"),{terms:k,ignoreDiacritics:!0}]]:null].filter(Boolean)},p=function(t){var e=t.boundary,n=t.groupMentions,a=t.mentions,i=t.selectable,l=t.terms;return[[[r("WAWebTextMentionFormatMutator"),{mentions:a,selectable:i}]],[[o("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:n,selectable:i,clickable:!1}]],[[r("WAWebBoldFormatMutator"),{selectable:i}],[r("WAWebItalicFormatMutator"),{selectable:i}],[r("WAWebStrikethroughFormatMutator"),{selectable:i}]],[[r("WAWebHighlightFormatMutator"),{terms:l,boundary:e,selectable:i,ignoreDiacritics:!0}]],[[r("WAWebEmojiFormatMutator"),{selectable:i}]]]},_=function(t){var e=t.emojiXstyle,n=t.terms;return[[[r("WAWebHighlightFormatMutator"),{terms:n,ignoreDiacritics:!0}]],[[r("WAWebEmojiFormatMutator"),{emojiXstyle:e,selectable:!1}]]]},f=function(t){t===void 0&&(t={});var e=o("WAWebABProps").getABPropConfigValue("enable_clear_formatted_preview"),n=t,a=n.groupMentions,i=n.isDraftMessage,l=n.mentions,s=n.selectable;return[e?null:[[o("WAWebCodeFormatMutator").Code,{selectable:s}]],l?[[r("WAWebTextMentionFormatMutator"),{mentions:l,selectable:s,lastMessage:!0,isDraftMessage:i}]]:null,a?[[o("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:a,selectable:s,clickable:!1,lastMessage:!0,isDraftMessage:i}]]:null,e?null:[[r("WAWebBoldFormatMutator"),{selectable:s}],[r("WAWebItalicFormatMutator"),{selectable:s}],[r("WAWebStrikethroughFormatMutator"),{selectable:s}]],[[r("WAWebEmojiFormatMutator"),{selectable:s}]]].filter(Boolean)},g=function(t){var e=t.boundary,n=t.groupMentions,a=t.mentions,i=t.selectable,l=t.terms;return[[[o("WAWebCodeFormatMutator").Code,{selectable:i}]],[[r("WAWebTextMentionFormatMutator"),{mentions:a,selectable:i}]],[[o("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:n,selectable:i,clickable:!1}]],[[r("WAWebBoldFormatMutator"),{selectable:i}],[r("WAWebItalicFormatMutator"),{selectable:i}],[r("WAWebStrikethroughFormatMutator"),{selectable:i}]],[[r("WAWebHighlightFormatMutator"),{terms:l,boundary:e,selectable:i}]],[[r("WAWebEmojiFormatMutator"),{selectable:i}]]]},h=function(t){var e=t===void 0?{}:t,n=e.selectable;return[[[o("WAWebCodeFormatMutator").Code,{selectable:n}]],[[r("WAWebBoldFormatMutator"),{selectable:n}],[r("WAWebItalicFormatMutator"),{selectable:n}],[r("WAWebStrikethroughFormatMutator"),{selectable:n}]],[[r("WAWebEmojiFormatMutator"),{selectable:n}]]]},y=function(t){var e=t.groupMentions,n=t.mentions,a=t.selectable;return[[[o("WAWebCodeFormatMutator").Code,{selectable:a}]],[[r("WAWebInlineCodeFormatMutator"),{selectable:a}]],[[r("WAWebTextMentionFormatMutator"),{mentions:n,selectable:a}]],[[o("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:e,selectable:a,clickable:!1}]],[[r("WAWebBoldFormatMutator"),{selectable:a}],[r("WAWebItalicFormatMutator"),{selectable:a}],[r("WAWebStrikethroughFormatMutator"),{selectable:a}]],[[r("WAWebEmojiFormatMutator"),{selectable:a}]],[[o("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:a}]]].filter(Boolean)},C=function(t){var e=t.groupMentions,n=t.mentions,a=t.selectable;return[[[o("WAWebCodeFormatMutator").Code,{selectable:a}]],[[r("WAWebInlineCodeFormatMutator"),{selectable:a,quoted:!0}]],[[o("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:a}]],[[o("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:a}]],[[r("WAWebBulletedListFormatMutator"),{selectable:a,quoted:!0}]],[[o("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:a}]],[[r("WAWebNumberedListFormatMutator"),{selectable:a,quoted:!0}]],[[r("WAWebTextMentionFormatMutator"),{mentions:n,selectable:a,theme:{quoted:!0}}]],[[o("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:e,selectable:a,theme:{quoted:!0},clickable:!1}]],[[r("WAWebBoldFormatMutator"),{selectable:a}],[r("WAWebItalicFormatMutator"),{selectable:a}],[r("WAWebStrikethroughFormatMutator"),{selectable:a}]],[[r("WAWebEmojiFormatMutator"),{selectable:a}]],[[o("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:a,quoted:!0}]]].filter(Boolean)},b=function(t){var e=t.groupMentions,n=t.mentions,a=t.selectable;return[[[o("WAWebCodeFormatMutator").Code,{selectable:a}]],[[r("WAWebRawMentionMutator"),{mentions:n,selectable:a}]],[[o("WAWebRawGroupMentionFormatMutator").RawGroupMention,{groupMentions:e}]],[[r("WAWebBoldFormatMutator"),{selectable:a}],[r("WAWebItalicFormatMutator"),{selectable:a}],[r("WAWebStrikethroughFormatMutator"),{selectable:a}]]].filter(Boolean)},v=function(t){var e=t.groupMentions,n=t.groupMetadata,a=t.mentions,i=t.selectable;return[[[o("WAWebCodeFormatMutator").Code,{selectable:i}]],[[r("WAWebInlineCodeFormatMutator"),{selectable:i}]],[[r("WAWebRawShortNameMentionFormatMutator"),{mentions:a,selectable:i,groupMetadata:n}]],[[o("WAWebRawGroupMentionFormatMutator").RawGroupMention,{groupMentions:e}]],[[r("WAWebBoldFormatMutator"),{selectable:i}],[r("WAWebItalicFormatMutator"),{selectable:i}],[r("WAWebStrikethroughFormatMutator"),{selectable:i}]],[[o("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:i}]]].filter(Boolean)},S=function(t){var e,a=t.links,i=!!t.expandedFormattingEnabled,l=!!((e=t.bulletPointsEnabled)!=null?e:i),s=!0;return[[[o("WAWebCodeFormatMutator").Code,{selectable:s}]],i?[[r("WAWebInlineCodeFormatMutator"),{selectable:s}]]:null,l?[[o("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:s}]]:null,l?[[o("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:s}]]:null,l?[[r("WAWebBulletedListFormatMutator"),{selectable:s}]]:null,i?[[o("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:s}]]:null,i?[[r("WAWebNumberedListFormatMutator"),{selectable:s}]]:null,[[r("WAWebLinkFormatMutator"),{links:a,selectable:s}]],[[r("WAWebBoldFormatMutator"),{selectable:s}],[r("WAWebItalicFormatMutator"),{selectable:s}],[r("WAWebStrikethroughFormatMutator"),{selectable:s}]],!r("gkx")("26258")&&n("cr:6000")?n("cr:6000")(s):null,[[r("WAWebEmojiFormatMutator"),{selectable:s}]],i?[[o("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:s}]]:null].filter(Boolean)},R=function(t){var e,a=!!(t!=null&&t.expandedFormattingEnabled),i=!!((e=t==null?void 0:t.bulletPointsEnabled)!=null?e:a),l=!0;return[[[o("WAWebCodeFormatMutator").Code,{selectable:l}]],a?[[r("WAWebInlineCodeFormatMutator"),{selectable:l}]]:null,i?[[o("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:l}]]:null,i?[[o("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:l}]]:null,i?[[r("WAWebBulletedListFormatMutator"),{selectable:l}]]:null,a?[[o("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:l}]]:null,a?[[r("WAWebNumberedListFormatMutator"),{selectable:l}]]:null,[[r("WAWebBoldFormatMutator"),{selectable:l}],[r("WAWebItalicFormatMutator"),{selectable:l}],[r("WAWebStrikethroughFormatMutator"),{selectable:l}]],!r("gkx")("26258")&&n("cr:6000")?n("cr:6000")(l):null,[[r("WAWebEmojiFormatMutator"),{selectable:l}]],a?[[o("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:l}]]:null].filter(Boolean)},L=function(t){var e=t===void 0?{}:t,n=e.links,o=e.selectable,a=e.trusted;return[a===!0?[[r("WAWebLinkFormatMutator"),{links:n,selectable:o}]]:null,[[r("WAWebEmojiFormatMutator"),{selectable:o}]]].filter(Boolean)},E=function(t){t===void 0&&(t={});var e=t,n=e.groupMentions,a=e.isDraftMessage,i=e.mentions,l=e.selectable;return[[[o("WAWebCodeFormatMutator").Code,{selectable:l}]],[[r("WAWebInlineCodeFormatMutator"),{selectable:l}]],[[o("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:l,inline:!0}]],[[o("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:l,inline:!0}]],[[r("WAWebBulletedListFormatMutator"),{selectable:l,inline:!0}]],[[o("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:l,inline:!0}]],[[r("WAWebNumberedListFormatMutator"),{selectable:l,inline:!0}]],i?[[r("WAWebTextMentionFormatMutator"),{mentions:i,selectable:l,lastMessage:!0,isDraftMessage:a}]]:null,n?[[o("WAWebGroupMentionFormatMutator").GroupMention,{groupMentions:n,selectable:l,clickable:!1,lastMessage:!0,isDraftMessage:a}]]:null,[[r("WAWebBoldFormatMutator"),{selectable:l}],[r("WAWebItalicFormatMutator"),{selectable:l}],[r("WAWebStrikethroughFormatMutator"),{selectable:l}]],[[r("WAWebEmojiFormatMutator"),{selectable:l}]],[[o("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:l,inline:!0}]]].filter(Boolean)},k=function(t){var e=t.selectable,n=t.parseHeadings,a=n===void 0?!0:n,i=t.parseHeadlessHeadings,l=i===void 0?!1:i,s=t.parseLists,u=s===void 0?!0:s,c=t.parseQuotes,d=c===void 0?!0:c,m=t.parseInlineCode,p=m===void 0?!0:m,_=t.showLinks,f=_===void 0?!0:_,g=t.links,h=t.onLinkClick,y=h===void 0?r("WAWebNoop"):h;return[[[o("WAWebCodeFormatMutator").Code,{selectable:e}]],p?[[r("WAWebInlineCodeFormatMutator"),{selectable:e}]]:null,[[r("WAWebBoldFormatMutator"),{selectable:e}],[r("WAWebItalicFormatMutator"),{selectable:e}],[r("WAWebStrikethroughFormatMutator"),{selectable:e}]],[[r("WAWebEmojiFormatMutator"),{selectable:e}]],d?[[o("WAWebBlockQuoteFormatMutator").BlockQuote,{selectable:e}]]:null,u?[[o("WAWebBulletedListItemFormatMutator").BulletedListItem,{selectable:e}]]:null,u?[[o("WAWebBulletedListItemFormatMutator").HyphenListItem,{selectable:e}]]:null,u?[[r("WAWebBulletedListFormatMutator"),{selectable:e}]]:null,u?[[o("WAWebNumberedListItemFormatMutator").NumberedListItem,{selectable:e}]]:null,u?[[r("WAWebNumberedListFormatMutator"),{selectable:e}]]:null,f?[[r("WAWebLinkFormatMutator"),{links:g,selectable:e,onLinkClick:y}]]:null,a?[[o("WAWebHeadingFormatMutator").AIRichResponseHeading,{selectable:e}]]:null,l?[[o("WAWebHeadingFormatMutator").HeadlessHeading,{selectable:e}]]:null].filter(Boolean)};l.EmojiOnly=e,l.LargeEmojiOnly=s,l.StatusText=u,l.StatusCaption=c,l.Compatibility=d,l.Conversation=m,l.Search=p,l.SearchName=_,l.LastMessage=f,l.FTSMessage=g,l.QuickReply=h,l.Unformat=y,l.QuotedMention=C,l.FormattedNotification=b,l.FormattedGroupNotification=v,l.TrustedGroupDesc=S,l.UntrustedGroupDesc=R,l.HeaderAndFooter=L,l.InlineMessage=E,l.RichResponse=k}),98); __d("WAWebFormatRevokedMsg",["fbt","WAWebContactCollection","WAWebFrontendContactGetters","WAWebMsgGetters","WAWebWidFormat"],(function(t,n,r,o,a,i,l,s){var e=function(t){var e=o("WAWebContactCollection").ContactCollection.get(t);return e?e.shortName||e.name||o("WAWebFrontendContactGetters").getDisplayName(e):o("WAWebWidFormat").widToFormattedUser(t)};function u(t){return o("WAWebMsgGetters").getIsRevokedByMe(t)?s._(/*BTDS*/"Eliminaste este mensaje como admin."):t.revokeSender==null?s._(/*BTDS*/"Un admin. elimin\u00f3 este mensaje"):s._(/*BTDS*/"Un admin., {admin}, elimin\u00f3 este mensaje.",[s._param("admin",e(t.revokeSender))])}function c(e){return o("WAWebMsgGetters").getIsSentByMe(e)?s._(/*BTDS*/"Eliminaste este mensaje."):s._(/*BTDS*/"Se elimin\u00f3 este mensaje.")}function d(e){var t,n=(t=e.subtype)!=null?t:"sender";switch(n){case"sender":return c(e);case"admin":return u(e)}}function m(e){var t,n=(t=e.subtype)!=null?t:"sender";switch(n){case"sender":return c(e);case"admin":return o("WAWebMsgGetters").getIsNewsletterMsg(e)?p(e):u(e)}}function p(e){return o("WAWebMsgGetters").getIsRevokedByMe(e)?s._(/*BTDS*/"Eliminaste esta actualizaci\u00f3n."):s._(/*BTDS*/"Se elimin\u00f3 esta actualizaci\u00f3n.")}l.formatRevokedComment=d,l.formatRevokedMsg=m}),226); __d("WAWebGroupMentionFormatMutator",["WAWebExtractRangesUsingRegex","WAWebFormatMutator","WAWebGroupMetadataCollection","WAWebRichTextInputConst","WAWebTextGroupMentionWrapperMutatorComponent.react","WAWebUnjoinedSubgroupMetadataCollection","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react")),u=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t.match=function(t,n){if(!n)return[];var e=n.fromChatWid,a=n.groupMentions,i=n.isDraftMessage;if(this.fromChatWid=e,i===!0){for(var l=r("WAWebExtractRangesUsingRegex")(t,new RegExp(o("WAWebRichTextInputConst").groupJidRegexStr,"g")),s=0;s3?s._(/*BTDS*/"A\u00f1adiste a {names} y {participants_count} m\u00e1s.",[s._param("names",r),s._param("participants_count",a-2)]):s._(/*BTDS*/"A\u00f1adiste a {names}.",[s._param("names",r)]):o("WAWebSystemMessagesUtils").isMe(i)?n!=null?s._(/*BTDS*/"{user_name} te a\u00f1adi\u00f3.",[s._param("user_name",n)]):s._(/*BTDS*/"Un miembro te agreg\u00f3."):n!=null?u&&a!=null&&a>3?s._(/*BTDS*/"{user_name} a\u00f1adi\u00f3 a {names} y {participants_count} m\u00e1s.",[s._param("user_name",n),s._param("names",r),s._param("participants_count",a-2)]):s._(/*BTDS*/"{user_name} a\u00f1adi\u00f3 a {names}.",[s._param("user_name",n),s._param("names",r)]):u&&a!=null&&a>3?s._(/*BTDS*/"Un miembro a\u00f1adi\u00f3 a {names} y {participants_count} m\u00e1s.",[s._param("names",r),s._param("participants_count",a-2)]):s._(/*BTDS*/"Un miembro a\u00f1adi\u00f3 a {names}.",[s._param("names",r)]):o("WAWebSystemMessagesUtils").isMe(i)?s._(/*BTDS*/"Se te a\u00f1adi\u00f3 al grupo."):s._(/*BTDS*/"Se a\u00f1adi\u00f3 a {user_name}.",[s._param("user_name",l)])}l.formatAddNotification=e}),226); __d("WAWebFormatAnnounceNotification",["fbt","WAWebSystemMessagesUtils"],(function(t,n,r,o,a,i,l,s){function e(e){var t=e.author,n=e.authorClickable,r=e.body;return r==="on"?o("WAWebSystemMessagesUtils").isMe(t)?s._(/*BTDS*/"Permitiste que solo los administradores puedan enviar mensajes a este grupo."):s._(/*BTDS*/"{user_name} cambi\u00f3 los ajustes de este grupo para permitir que solo los administradores puedan enviar mensajes al grupo.",[s._param("user_name",n)]):o("WAWebSystemMessagesUtils").isMe(t)?s._(/*BTDS*/"Cambiaste los ajustes de este grupo para permitir que todos los miembros puedan enviar mensajes al grupo."):s._(/*BTDS*/"{user_name} cambi\u00f3 los ajustes de este grupo para permitir que todos los miembros puedan enviar mensajes al grupo.",[s._param("user_name",n)])}l.formatAnnounceNotification=e}),226); __d("WAWebFormatBroadcastNotification",["fbt","WAWebFormatParticipantNames"],(function(t,n,r,o,a,i,l,s){function e(e){return s._(/*BTDS*/"You created a business broadcast.")}function u(e){var t=e.length;return s._(/*BTDS*/"_j{\"*\":\"Se a\\u00f1adieron {name} a la lista.\",\"_1\":\"Se a\\u00f1adi\\u00f3 a {name} a la lista.\"}",[s._plural(t),s._param("name",o("WAWebFormatParticipantNames").getFormattedNames(e,!1))])}function c(e){var t=e.length;return s._(/*BTDS*/"_j{\"*\":\"Se quit\\u00f3 a {name} de la lista.\"}",[s._plural(t),s._param("name",o("WAWebFormatParticipantNames").getFormattedNames(e,!1))])}function d(t){var n=t.body,r=t.recipients,o=t.subtype;return o==="create"?e(n).toString():o==="add"?u(r).toString():o==="remove"?c(r).toString():""}l.getBroadcastCreateMessage=e,l.getBroadcastAddMessage=u,l.getBroadcastRemoveMessage=c,l.formatBroadcastNotification=d}),226); __d("WAWebFormatCommunityOwnerUpdateNotification",["fbt","WAWebChatCommunityUtils","WAWebFormatParticipantNames","WAWebSystemMessagesUtils"],(function(t,n,r,o,a,i,l,s){function e(e){var t=e.author,n=e.clickable,r=e.templateParams,a=t?o("WAWebFormatParticipantNames").getFormattedName(t,n):null,i=o("WAWebChatCommunityUtils").getNewCommunityOwnerFromTemplateParams(r),l=i!=null?o("WAWebFormatParticipantNames").getFormattedName(i,n):null;return t!=null?o("WAWebSystemMessagesUtils").isMe(t)?s._(/*BTDS*/"Asignaste a {user_name} como el nuevo propietario.",[s._param("user_name",l)]):o("WAWebSystemMessagesUtils").isMe(i)?s._(/*BTDS*/"{user_name} te asign\u00f3 como el nuevo propietario. M\u00e1s info.",[s._param("user_name",a)]):s._(/*BTDS*/"{author_name} asign\u00f3 a {user_name} como el nuevo propietario.",[s._param("author_name",a),s._param("user_name",l)]):o("WAWebSystemMessagesUtils").isMe(i)?s._(/*BTDS*/"Eres el nuevo propietario. M\u00e1s informaci\u00f3n"):s._(/*BTDS*/"{user_name} es el nuevo propietario.",[s._param("user_name",l)])}l.formatCommunityOwnerUpdateNotification=e}),226); __d("WAWebFormatCreateNotification",["fbt","WAWebSystemMessagesUtils","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react"));function c(e){var t=e.author,n=e.authorClickable,r=e.chat,a=e.groupSubject,i=e.groupSubjectAsString,l=i?a:u.jsx(o("WAWebSystemMessagesUtils").FormattedText,{text:a});if(o("WAWebSystemMessagesUtils").isMe(t))return a?s._(/*BTDS*/"Creaste el grupo \"{group_subject}\".",[s._param("group_subject",l)]):s._(/*BTDS*/"Creaste este grupo.");if(a)return n!=null?s._(/*BTDS*/"{user_name} cre\u00f3 el grupo \"{group_subject}\".",[s._param("user_name",n),s._param("group_subject",l)]):s._(/*BTDS*/"Un admin. cre\u00f3 el grupo \"{group_subject}\".",[s._param("group_subject",l)]);if(n!=null){var c=r?r.title():"";return c.trim()===""?s._(/*BTDS*/"{user_name} cre\u00f3 este grupo.",[s._param("user_name",n)]):s._(/*BTDS*/"{user_name} cre\u00f3 el grupo \"{group_subject}\".",[s._param("user_name",n),s._param("group_subject",c)])}return s._(/*BTDS*/"Un admin. cre\u00f3 este grupo")}c.displayName=c.name+" [from "+i.id+"]",l.formatCreateNotification=c}),226); __d("WAWebFormatCreatedSubgroupSuggestionNotification",["fbt","WAWebFormatParticipantNames","WAWebSystemMessageGatingUtils"],(function(t,n,r,o,a,i,l,s){function e(e,t,n){var r=o("WAWebFormatParticipantNames").getFormattedName(e,n),a=t[0],i=o("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled();return i?s._(/*BTDS*/"{suggestion-owner} sugiri\u00f3 el grupo \"{suggested-group-name}\".",[s._param("suggestion-owner",r),s._param("suggested-group-name",a)]):s._(/*BTDS*/"{suggestion-owner} sugiri\u00f3 el grupo \"{suggested-group-name}\". Haz clic para aprobar o rechazar.",[s._param("suggestion-owner",r),s._param("suggested-group-name",a)])}l.default=e}),226); __d("WAWebFormatDeleteNotification",["fbt","WAWebChatGroupUtils"],(function(t,n,r,o,a,i,l,s){function e(e){var t=e.chat;return o("WAWebChatGroupUtils").isCommunityAnnouncementGroup(t)?s._(/*BTDS*/"Esta comunidad ya no est\u00e1 disponible."):o("WAWebChatGroupUtils").isSupportGroup(t)?s._(/*BTDS*/"Se cerr\u00f3 este chat."):s._(/*BTDS*/"Se cerr\u00f3 este grupo")}l.formatDeleteNotification=e}),226); __d("WAWebWamEnumSystemMessageTypeType",[],(function(t,n,r,o,a,i){var e=Object.freeze({E2E_ENCRYPTED_MESSAGES_CALLS:1,E2E_ENCRYPTED_MESSAGES:2,E2E_ENCRYPTED_BROADCAST_LIST:3,E2E_ENCRYPTED_MESSAGE_YOURSELF:4,OFFICIAL_ACCOUNT_INFO:8,GROUP_ADD:9,GROUP_RESET_INVITE:10,COMMUNITY_DESCRIPTION_CHANGED:11,GROUP_DESCRIPTION_CHANGED:12,GROUP_PARTICIPANTS_CHANGED:13,COMMUNITY_MEMBERS_CHANGED:14,GROUP_INVITE_LINK_UNAVAILABLE:15,GROUP_INVITE_LINK_AVAILABLE:16,GROUP_JOIN_REQUEST:17,GROUP_SUGGEST:18});i.SYSTEM_MESSAGE_TYPE_TYPE=e}),66); __d("WAWebFormatDescriptionNotification",["fbt","WAWebSystemMessageGatingUtils","WAWebSystemMessagesUtils","WAWebWamEnumSystemMessageTypeType"],(function(t,n,r,o,a,i,l,s){var e=o("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled();function u(t){var n=t.author,r=t.authorClickable,a=t.isParentGroup,i=a===void 0?!1:a,l=t.shouldFormatAsLastMsg,u=l===void 0?!1:l;return u?o("WAWebSystemMessagesUtils").isMe(n)?i===!0?{text:s._(/*BTDS*/"Cambiaste la descripci\u00f3n de la comunidad."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:s._(/*BTDS*/"Cambiaste la descripci\u00f3n del grupo."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED}:r!=null?i===!0?{text:s._(/*BTDS*/"{user_name} cambi\u00f3 la descripci\u00f3n de la comunidad.",[s._param("user_name",r)]),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:s._(/*BTDS*/"{user_name} cambi\u00f3 la descripci\u00f3n del grupo.",[s._param("user_name",r)]),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED}:i===!0?{text:s._(/*BTDS*/"Un miembro cambi\u00f3 la descripci\u00f3n de la comunidad."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:s._(/*BTDS*/"Un miembro cambi\u00f3 la descripci\u00f3n del grupo."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED}:o("WAWebSystemMessagesUtils").isMe(n)?i===!0?{text:e?s._(/*BTDS*/"Cambiaste la descripci\u00f3n de la comunidad."):s._(/*BTDS*/"Cambiaste la descripci\u00f3n de la comunidad. Haz clic para verla."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:e?s._(/*BTDS*/"Cambiaste la descripci\u00f3n del grupo."):s._(/*BTDS*/"Cambiaste la descripci\u00f3n del grupo. Haz clic para verla."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED}:r!=null?i===!0?{text:e?s._(/*BTDS*/"{user_name} cambi\u00f3 la descripci\u00f3n de la comunidad.",[s._param("user_name",r)]):s._(/*BTDS*/"{user_name} cambi\u00f3 la descripci\u00f3n de la comunidad. Haz clic para verla.",[s._param("user_name",r)]),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:e?s._(/*BTDS*/"{user_name} cambi\u00f3 la descripci\u00f3n del grupo.",[s._param("user_name",r)]):s._(/*BTDS*/"{user_name} cambi\u00f3 la descripci\u00f3n del grupo. Haz clic para verla.",[s._param("user_name",r)]),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_DESCRIPTION_CHANGED}:i===!0?{text:e?s._(/*BTDS*/"Un miembro cambi\u00f3 la descripci\u00f3n de la comunidad."):s._(/*BTDS*/"Un miembro cambi\u00f3 la descripci\u00f3n de la comunidad. Haz clic para verla."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}:{text:e?s._(/*BTDS*/"Un miembro cambi\u00f3 la descripci\u00f3n del grupo."):s._(/*BTDS*/"Un miembro cambi\u00f3 la descripci\u00f3n del grupo. Haz clic para verla."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.COMMUNITY_DESCRIPTION_CHANGED}}function c(e){var t=e.author,n=e.authorClickable,r=e.isParentGroup,o=r===void 0?!1:r,a=e.shouldFormatAsLastMsg,i=a===void 0?!1:a;return u({author:t,authorClickable:n,isParentGroup:o,shouldFormatAsLastMsg:i}).text}l.formatDescriptionNotification=c}),226); __d("WAWebLimitSharingGatingUtils",["WAWebABProps"],(function(t,n,r,o,a,i,l){"use strict";function e(){return o("WAWebABProps").getABPropConfigValue("render_updated_disclosure")}function s(){return o("WAWebABProps").getABPropConfigValue("limit_sharing_enabled_for_group_chat")}function u(){return o("WAWebABProps").getABPropConfigValue("limit_sharing_enabled_for_1on1_chat")}function c(){return o("WAWebABProps").getABPropConfigValue("limit_sharing_update_enabled_web")}function d(){return o("WAWebABProps").getABPropConfigValue("limit_sharing_protocol_message_receiver_enabled")}function m(){return o("WAWebABProps").getABPropConfigValue("advanced_chat_privacy_content_update_july_25")}l.isRenderUpdatedDisclosureGatingEnabled=e,l.isLimitSharingSetterGatingEnabledForGroupChat=s,l.isLimitSharingSetterGatingEnabledFor1on1Chat=u,l.isLimitSharingSetterUpdateGatingEnabledForWeb=c,l.isLimitSharingReceiverGatingEnabledForChat=d,l.isLimitSharingContentUpdateJuly25Enabled=m}),98); __d("WAWebFormatE2ENotification",["fbt","WALogger","WAWebChatGetters","WAWebChatGroupUtils","WAWebContactCollection","WAWebContactGetters","WAWebFormatE2ENotificationForDeviceChange","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebLimitSharingGatingUtils","WAWebMsgGetters","WAWebSupportChatStrings","WAWebSystemMessageGatingUtils","WAWebUserPrefsMeUser","WAWebWamEnumSystemMessageTypeType","WAWebWid","WAWebWidFormat"],(function(t,n,r,o,a,i,l,s){var e;function u(t){var n=o("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled();switch(t.subtype){case"identity":{var a=t.body==null?null:o("WAWebContactCollection").ContactCollection.get(t.body);if(a!=null&&o("WAWebContactGetters").getIsMe(a)){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["generateE2ENotification: receive identity notification of self"]))).sendLogs("SelfIdentityNotificationError");var i=o("WAWebFrontendMsgGetters").getChat(t.unsafe());if(o("WAWebChatGetters").getIsUser(i)){var l=i.contact?o("WAWebFrontendContactGetters").getFormattedName(i.contact):o("WAWebWidFormat").widToFormattedUser(i.id);return{text:n?s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName}.",[s._param("contactName",l)]):s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName}. Haz clic para obtener m\u00e1s informaci\u00f3n.",[s._param("contactName",l)])}}else{if(o("WAWebChatGetters").getIsGroup(i))return{text:n?s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los miembros."):s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los miembros. Haz clic para obtener m\u00e1s informaci\u00f3n.")};if(o("WAWebChatGetters").getIsBroadcast(i))return{text:n?s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los destinatarios."):s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los destinatarios. Haz clic para obtener m\u00e1s informaci\u00f3n.")}}}var u=a?o("WAWebFrontendContactGetters").getFormattedName(a):o("WAWebWidFormat").widToFormattedUser(t.body);return{text:n?s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName}.",[s._param("contactName",u)]):s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName}. Haz clic para obtener m\u00e1s informaci\u00f3n.",[s._param("contactName",u)])}}case"device":return{text:o("WAWebFormatE2ENotificationForDeviceChange").formatE2ENotificationForDeviceChange(t),enumType:o("WAWebFormatE2ENotificationForDeviceChange").getE2ENotificationForDeviceChangeEnum(t)};case"encrypt":{var c=t.id.remote;return r("WAWebWid").isGroup(c)?o("WAWebChatGroupUtils").isSupportGroup(o("WAWebFrontendMsgGetters").getMaybeChat(t.unsafe()))?{text:o("WAWebSupportChatStrings").SupportChatSystemMessage()}:o("WAWebLimitSharingGatingUtils").isRenderUpdatedDisclosureGatingEnabled()?{text:n?s._(/*BTDS*/"Los mensajes y las llamadas est\u00e1n cifrados de extremo a extremo. Solo las personas en este chat pueden leerlos, escucharlos o compartirlos"):s._(/*BTDS*/"Los mensajes y las llamadas est\u00e1n cifrados de extremo a extremo. Solo las personas en este chat pueden leerlos, escucharlos o compartirlos. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES}:{text:n?s._(/*BTDS*/"Los mensajes est\u00e1n cifrados de extremo a extremo. Nadie fuera de este chat, ni siquiera WhatsApp, puede leerlos ni escucharlos"):s._(/*BTDS*/"Los mensajes est\u00e1n cifrados de extremo a extremo. Nadie fuera de este chat, ni siquiera WhatsApp, puede leerlos ni escucharlos. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES}:o("WAWebMsgGetters").getIsCAPISupport(t)?{text:o("WAWebSupportChatStrings").SupportChatSystemMessage()}:r("WAWebWid").isBroadcast(c)?{text:n?s._(/*BTDS*/"Los mensajes que env\u00edas a esta lista de difusi\u00f3n est\u00e1n protegidos con cifrado de extremo a extremo."):s._(/*BTDS*/"Los mensajes que env\u00edas a esta lista de difusi\u00f3n est\u00e1n protegidos con cifrado de extremo a extremo. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_BROADCAST_LIST}:o("WAWebUserPrefsMeUser").isMeAccount(c)?o("WAWebLimitSharingGatingUtils").isRenderUpdatedDisclosureGatingEnabled()?{text:n?s._(/*BTDS*/"Los mensajes que env\u00edas a tu propio n\u00famero est\u00e1n cifrados de extremo a extremo. Nadie m\u00e1s, ni siquiera WhatsApp, puede leerlos, escucharlos o compartirlos."):s._(/*BTDS*/"Los mensajes que env\u00edas a tu propio n\u00famero est\u00e1n cifrados de extremo a extremo. Nadie m\u00e1s, ni siquiera WhatsApp, puede leerlos, escucharlos o compartirlos. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGE_YOURSELF}:{text:n?s._(/*BTDS*/"Los mensajes enviados a este mismo n\u00famero est\u00e1n cifrados de extremo a extremo. Nadie fuera de este chat, ni siquiera WhatsApp, puede leerlos ni escucharlos."):s._(/*BTDS*/"Los mensajes enviados a este mismo n\u00famero est\u00e1n cifrados de extremo a extremo. Nadie fuera de este chat, ni siquiera WhatsApp, puede leerlos ni escucharlos. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGE_YOURSELF}:o("WAWebLimitSharingGatingUtils").isRenderUpdatedDisclosureGatingEnabled()?{text:n?s._(/*BTDS*/"Los mensajes y las llamadas est\u00e1n cifrados de extremo a extremo. Solo las personas en este chat pueden leerlos, escucharlos o compartirlos"):s._(/*BTDS*/"Los mensajes y las llamadas est\u00e1n cifrados de extremo a extremo. Solo las personas en este chat pueden leerlos, escucharlos o compartirlos. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES}:{text:n?s._(/*BTDS*/"Los mensajes est\u00e1n cifrados de extremo a extremo. Nadie fuera de este chat, ni siquiera WhatsApp, puede leerlos ni escucharlos"):s._(/*BTDS*/"Los mensajes est\u00e1n cifrados de extremo a extremo. Nadie fuera de este chat, ni siquiera WhatsApp, puede leerlos ni escucharlos. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES}}case"encrypt_now":return o("WAWebLimitSharingGatingUtils").isRenderUpdatedDisclosureGatingEnabled()?{text:n?s._(/*BTDS*/"Las llamadas y los mensajes ahora est\u00e1n cifrados de extremo a extremo. Solo las personas en este chat pueden leerlos, escucharlos o compartirlos."):s._(/*BTDS*/"Los mensajes y las llamadas ahora est\u00e1n cifrados de extremo a extremo. Solo las personas en este chat pueden leerlos, escucharlos o compartirlos. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES_CALLS}:{text:n?s._(/*BTDS*/"Los mensajes y las llamadas ahora est\u00e1n cifrados de extremo a extremo. Nadie fuera de este chat, ni siquiera WhatsApp, puede leerlos o escucharlos."):s._(/*BTDS*/"Los mensajes y las llamadas ahora est\u00e1n cifrados de extremo a extremo. Nadie fuera de este chat, ni siquiera WhatsApp, puede leerlos ni escucharlos. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.E2E_ENCRYPTED_MESSAGES_CALLS};case"e2e_identity_unavailable":return{text:s._(/*BTDS*/"Ya no est\u00e1n disponibles para este chat las notificaciones relacionadas con el c\u00f3digo de seguridad.")};case"chat_psa":return{text:n?s._(/*BTDS*/"Esta es una cuenta oficial de WhatsApp."):s._(/*BTDS*/"Esta es una cuenta oficial de WhatsApp. Haz clic para obtener m\u00e1s informaci\u00f3n."),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.OFFICIAL_ACCOUNT_INFO};default:return{text:""}}}function c(e){return u(e).text}function d(e){return u(e).enumType}l.formatE2ENotification=c,l.getE2ENotificationEnum=d}),226); __d("WAWebFormatE2ENotificationForDeviceChange",["fbt","invariant","WAWebChatGetters","WAWebContactCollection","WAWebContactGetters","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebSystemMessageGatingUtils","WAWebWidFormat"],(function(t,n,r,o,a,i,l,s,u){function e(e,t){t===void 0&&(t=!1),e.subtype==="device"||u(0,56347);var n=o("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled(),r=e.body?o("WAWebContactCollection").ContactCollection.get(e.body):null,a,i=e.devicesAdded===1&&e.devicesRemoved===0,l=e.devicesAdded===0&&e.devicesRemoved===1,c=!i&&!l;if(r!=null&&o("WAWebContactGetters").getIsMe(r)){var d=o("WAWebFrontendMsgGetters").getChat(e.unsafe());if(o("WAWebChatGetters").getIsUser(d)){var m=o("WAWebFrontendContactGetters").getFormattedName(d.contact);t?i?e.isThisDeviceAdded?a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName} porque se inici\u00f3 sesi\u00f3n en este dispositivo.",[s._param("contactName",m)]):a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName} porque se inici\u00f3 sesi\u00f3n en un nuevo dispositivo tuyo.",[s._param("contactName",m)]):l?a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName} porque se cerr\u00f3 la sesi\u00f3n de uno de tus dispositivos.",[s._param("contactName",m)]):c&&(a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName} porque se inici\u00f3 o cerro sesi\u00f3n en uno o m\u00e1s de tus dispositivos.",[s._param("contactName",m)])):a=n?s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName}.",[s._param("contactName",m)]):s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName}. Haz clic para obtener m\u00e1s informaci\u00f3n.",[s._param("contactName",m)])}else o("WAWebChatGetters").getIsGroup(d)?t?i?e.isThisDeviceAdded?a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los miembros porque se inici\u00f3 sesi\u00f3n en este dispositivo. Para verificar el c\u00f3digo de seguridad de un contacto, abre su p\u00e1gina de informaci\u00f3n y haz clic en Cifrado."):a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los miembros porque se inici\u00f3 sesi\u00f3n en un nuevo dispositivo tuyo. Para verificar el c\u00f3digo de seguridad de un contacto, abre su p\u00e1gina de informaci\u00f3n y haz clic en Cifrado."):l?a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los miembros porque se cerr\u00f3 la sesi\u00f3n de uno de tus dispositivos. Para verificar el c\u00f3digo de seguridad de un contacto, abre su p\u00e1gina de informaci\u00f3n y haz clic en Cifrado."):c&&(a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los miembros porque se inici\u00f3 o cerr\u00f3 sesi\u00f3n en uno o m\u00e1s de tus dispositivos. Para verificar el c\u00f3digo de seguridad de un contacto, abre su p\u00e1gina de informaci\u00f3n y haz clic en Cifrado.")):a=n?s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los miembros."):s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los miembros. Haz clic para obtener m\u00e1s informaci\u00f3n."):o("WAWebChatGetters").getIsBroadcast(d)&&(t?i?e.isThisDeviceAdded?a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los destinatarios porque se inici\u00f3 sesi\u00f3n en este dispositivo. Para verificar el c\u00f3digo de seguridad de un contacto, abre su p\u00e1gina de info. y haz clic en \"Cifrado\"."):a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los destinatarios porque se inici\u00f3 sesi\u00f3n en un nuevo dispositivo tuyo. Para verificar el c\u00f3digo de seguridad de un contacto, abre su p\u00e1gina de info. y haz clic en \"Cifrado\"."):l?a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los destinatarios porque se cerr\u00f3 la sesi\u00f3n de uno de tus dispositivos. Para verificar el c\u00f3digo de seguridad de un contacto, abre su p\u00e1gina de info. y haz clic en \"Cifrado\"."):c&&(a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los destinatarios porque se inici\u00f3 o cerr\u00f3 sesi\u00f3n en uno o m\u00e1s de tus dispositivos. Para verificar el c\u00f3digo de seguridad de un contacto, abre su p\u00e1gina de info. y haz clic en \"Cifrado\".")):a=n?s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los destinatarios."):s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con todos los destinatarios. Haz clic para obtener m\u00e1s informaci\u00f3n."))}else{var p=e.body;r=p==null?null:o("WAWebContactCollection").ContactCollection.get(p);var _=r?o("WAWebFrontendContactGetters").getFormattedName(r):o("WAWebWidFormat").widToFormattedUser(p);t?i?a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName} porque este contacto volvi\u00f3 a registrar WhatsApp en su tel\u00e9fono.",[s._param("contactName",_)]):l?a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName} porque se cerr\u00f3 la sesi\u00f3n de uno de sus dispositivos.",[s._param("contactName",_)]):c&&(a=s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName} porque se inici\u00f3 o cerr\u00f3 sesi\u00f3n en uno o m\u00e1s de sus dispositivos.",[s._param("contactName",_)])):a=n?s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName}.",[s._param("contactName",_)]):s._(/*BTDS*/"Cambi\u00f3 tu c\u00f3digo de seguridad con {contactName}. Haz clic para obtener m\u00e1s informaci\u00f3n.",[s._param("contactName",_)])}return a!=null||u(0,56348),{text:a}}function c(t,n){return n===void 0&&(n=!1),e(t,n).text}function d(t,n){return n===void 0&&(n=!1),e(t,n).enumType}l.formatE2ENotificationForDeviceChange=c,l.getE2ENotificationForDeviceChangeEnum=d}),226); __d("WAWebFormatEphemeralSetting",["fbt","WALogger","WANullthrows","WAWebABProps","WAWebBizCoexGatingUtils","WAWebChatEphemerality","WAWebContactCollection","WAWebEphemeralConstants","WAWebEphemeralFbtKic","WAWebEphemeralityTypes","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebStateUtils","WAWebUserPrefsMeUser","WAWebWid","err"],(function(t,n,r,o,a,i,l,s){var e,u;function c(e){var t,n=_(e),a=n.initiatingUser,i=n.newDuration,l=o("WAWebUserPrefsMeUser").isMeAccount(r("WANullthrows")(a));if(l)t=o("WAWebEphemeralFbtKic").getDisappearingModeYouStringKic(i);else{var s=o("WAWebContactCollection").ContactCollection.gadd(r("WANullthrows")(a));t=o("WAWebEphemeralFbtKic").getDisappearingModeOtherStringKic(i,o("WAWebFrontendContactGetters").getFormattedName(s))}return t}function d(e){return C(o("WAWebStateUtils").unproxy(e.unsafe()))}function m(e){if(o("WAWebFrontendMsgGetters").getChat(e)!=null)for(var t=o("WAWebFrontendMsgGetters").getChat(e).msgs,n=t.indexOf(e),r=n-1;r>=0;r--){var a=t.at(r);if(a!=null&&a.type!=="debug"&&(a.type!=="gp2"||a.subtype==="ephemeral"))return a}}function p(e){var t=m(e);return t!=null&&(t.ephemeralDuration!=null&&t.ephemeralDuration>0||(t.subtype==="ephemeral"||t.subtype==="disappearing_mode")&&t.templateParams[0]!=null&&t.templateParams[0]!=="0")}function _(e){var t,n;if(e.templateParams.length?(n=parseInt(e.templateParams[0],10),e.templateParams[1]instanceof r("WAWebWid")&&(t=e.templateParams[1])):(t=e.ephemeralSettingUser,n=e.ephemeralDuration),n==null)throw r("err")("Duration cannot be null for DM notification");return{newDuration:n!=null?n:0,disappearingModeTrigger:null,initiatingUser:t}}function f(e){var t,n;return e.ephemeralSettingUser!==void 0?n=e.ephemeralSettingUser:n=e.from,{newDuration:(t=e.ephemeralDuration)!=null?t:0,disappearingModeTrigger:e.disappearingModeTrigger,initiatingUser:n}}function g(e){var t=e.initiatorIsMe,n=e.initiatorUsername,r=e.state;return t?r==="update"?s._(/*BTDS*/"Actualizaste la duraci\u00f3n de los mensajes."):r==="on"?s._(/*BTDS*/"Activaste los mensajes temporales."):s._(/*BTDS*/"Desactivaste los mensajes temporales."):n!=null?r==="update"?s._(/*BTDS*/"{name} actualiz\u00f3 la duraci\u00f3n de los mensajes.",[s._param("name",n)]):r==="on"?s._(/*BTDS*/"{name} activ\u00f3 los mensajes temporales.",[s._param("name",n)]):s._(/*BTDS*/"{name} desactiv\u00f3 los mensajes temporales.",[s._param("name",n)]):r==="update"?s._(/*BTDS*/"Se actualiz\u00f3 la duraci\u00f3n de los mensajes."):r==="on"?s._(/*BTDS*/"Se activaron los mensajes temporales."):s._(/*BTDS*/"Se desactivaron los mensajes temporales.")}function h(t){var n=o("WAWebEphemeralConstants").getDurationForString(t),r=n.duration,a=n.unit;switch(a){case o("WAWebEphemeralConstants").DurationUnit.Seconds:return s._(/*BTDS*/"_j{\"*\":\"{duration} seconds\",\"_1\":\"1 second\"}",[s._plural(r,"duration")]);case o("WAWebEphemeralConstants").DurationUnit.Minutes:return s._(/*BTDS*/"_j{\"*\":\"{duration} minutes\",\"_1\":\"1 minute\"}",[s._plural(r,"duration")]);case o("WAWebEphemeralConstants").DurationUnit.Hours:return s._(/*BTDS*/"_j{\"*\":\"{duration} horas\",\"4\":\"{duration} hora\",\"_1\":\"1 hora\"}",[s._plural(r,"duration")]);case o("WAWebEphemeralConstants").DurationUnit.Days:return s._(/*BTDS*/"_j{\"*\":\"{duration} d\\u00edas\",\"4\":\"{duration} d\\u00eda\",\"_1\":\"1 d\\u00eda\"}",[s._plural(r,"duration")]);case o("WAWebEphemeralConstants").DurationUnit.Weeks:return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["getDisappearingMessageDurationString: Weeks are not an option for DM system messages"]))),s._(/*BTDS*/"_j{\"*\":\"{duration} weeks\",\"_1\":\"1 week\"}",[s._plural(r,"duration")])}}function y(e){var t=h(e);return s._(/*BTDS*/"Los mensajes nuevos desaparecer\u00e1n de este chat despu\u00e9s de {dm-duration} de haber sido enviados, a menos que se use la opci\u00f3n para conservarlos.",[s._param("dm-duration",t)])}function C(e){var t,n=null;switch(e.type){case"gp2":case"notification_template":n=_(e);break;case"protocol":n=f(e);break;default:break}if(n==null)throw o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Cannot parse msg to build DM system message"]))).tags("DM","DDM"),r("err")("Cannot parse msg to build DM system message");var a=null,i=o("WAWebUserPrefsMeUser").isMePrimary(n.initiatingUser);if(o("WAWebBizCoexGatingUtils").bizHostedDevicesEnabled()&&n.disappearingModeTrigger===o("WAWebEphemeralityTypes").DisappearingModeTrigger.BizSupportFbHosting)return b(i);var l=null;if(n.newDuration?p(e)?l="update":l="on":l="off",l==="update"&&!o("WAWebABProps").getABPropConfigValue("dm_updated_system_message")&&(l="on"),n.initiatingUser!=null&&!i){var s=o("WAWebContactCollection").ContactCollection.gadd(n.initiatingUser);a=o("WAWebFrontendContactGetters").getIsMyContact(s)?o("WAWebFrontendContactGetters").getFormattedName(s):o("WAWebFrontendContactGetters").getFormattedUsernameOrPhone(s)}var c=o("WAWebFrontendMsgGetters").getMaybeChat(e),d=c&&o("WAWebChatEphemerality").shouldShowEphemeralSetting(c)&&(r("WAWebWid").isUser(c.id)||((t=c.groupMetadata)==null?void 0:t.canSetEphemeralSetting()));return v({newDuration:n.newDuration,state:l,initiatorUsername:a,initiatorIsMe:i,userCanChange:d===!0})}function b(e){var t=s._(/*BTDS*/"Los mensajes temporales ya no son compatibles con esta empresa."),n=s._(/*BTDS*/"Los mensajes temporales ya no son compatibles con tu empresa.");return e?n:t}function v(e){var t=e.initiatorIsMe,n=e.initiatorUsername,r=e.newDuration,o=e.state,a=e.userCanChange,i=g({initiatorUsername:n,initiatorIsMe:t,state:o}),l=s._(/*BTDS*/"Haz clic para cambiar esto.");if(!r)return a!==!0?i:s._(/*BTDS*/"{dm-sm-event} {dm-sm-action}",[s._param("dm-sm-event",i),s._param("dm-sm-action",l)]);var u=y(r);return a!==!0?s._(/*BTDS*/"{dm-sm-event} {dm-sm-explanation}",[s._param("dm-sm-event",i),s._param("dm-sm-explanation",u)]):s._(/*BTDS*/"{dm-sm-event} {dm-sm-explanation} {dm-sm-action}",[s._param("dm-sm-event",i),s._param("dm-sm-explanation",u),s._param("dm-sm-action",l)])}function S(){return s._(/*BTDS*/"Los mensajes temporales no son compatibles con este chat, por lo que tus mensajes no desaparecer\u00e1n.")}l.getDefaultDisappearingModeSystemMessageText=c,l.getDisappearingModeUpdateSystemMessageText=d,l.getDisappearingMessageDurationString=h,l.formatEphemeralSetting=C,l.buildEphemeralSystemMessage=v,l.getDMUnsupportedSystemMessageText=S}),226); __d("WAWebFormatAllowNonAdminSubGroupCreationNotification",["fbt","WAWebGroupType"],(function(t,n,r,o,a,i,l,s){function e(e,t){var n,r=t[0]&&o("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.cast(t[0].toString())===o("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On,a=!!((n=e.groupMetadata)!=null&&n.participants.iAmAdmin());return r?a?s._(/*BTDS*/"Ahora, cualquier miembro de esta comunidad puede a\u00f1adir grupos. Haz clic para cambiar esto."):s._(/*BTDS*/"Cualquier miembro de esta comunidad puede a\u00f1adir grupos."):a?s._(/*BTDS*/"Solo quienes administran la comunidad pueden a\u00f1adir grupos. Los miembros pueden sugerirles grupos para que los aprueben. Haz clic para cambiar esto."):s._(/*BTDS*/"Solo quienes administran la comunidad pueden a\u00f1adir grupos. Los miembros pueden sugerirles grupos para que los aprueben.")}l.default=e}),226); __d("WAWebMessageCommunityEmptySubgroupWelcomeTitle.react",["fbt"],(function(t,n,r,o,a,i,l,s){function e(e){return s._(/*BTDS*/"Creaste el grupo {subgroup_name}.",[s._param("subgroup_name",e)])}l.communityEmptySubgroupWelcomeTitle=e}),226); __d("WAWebMessageCommunityGeneralChatAutoAddDisabledNotification.react",["fbt","WAWebCommunityGatingUtils","WAWebGroupType"],(function(t,n,r,o,a,i,l,s){function e(e,t){var n,r,a=(n=o("WAWebGroupType").GeneralChatAutoAddDisabledReasonEnum.cast((r=t[0])==null?void 0:r.toString()))!=null?n:o("WAWebGroupType").GeneralChatAutoAddDisabledReasonEnum.Full;return a===o("WAWebGroupType").GeneralChatAutoAddDisabledReasonEnum.Server?s._(/*BTDS*/"Ya no se a\u00f1adir\u00e1 autom\u00e1ticamente a los nuevos miembros de la comunidad."):o("WAWebCommunityGatingUtils").communityGeneralChatV2Enabled()?s._(/*BTDS*/"\"{subgroup_name}\" ahora est\u00e1 completo.",[s._param("subgroup_name",e)]):s._(/*BTDS*/"\"{subgroup_name}\" est\u00e1 lleno. Los nuevos miembros de la comunidad ya no se a\u00f1adir\u00e1n autom\u00e1ticamente a \u00e9l.",[s._param("subgroup_name",e)])}l.communityGeneralChatAutoAddDisabledNotification=e}),226); __d("WAWebMessageCommunityGeneralChatWelcomeTitle.react",["fbt"],(function(t,n,r,o,a,i,l,s){function e(e){return s._(/*BTDS*/"Les damos la bienvenida al grupo: {subgroup_name}",[s._param("subgroup_name",e)])}l.communityGeneralChatWelcomeTitle=e}),226); __d("WAWebFormatGroupNotification",["fbt","WALogger","WAWebChatGroupUtils","WAWebContactCollection","WAWebFormatAddNotification","WAWebFormatAllowNonAdminSubGroupCreationNotification","WAWebFormatAnnounceNotification","WAWebFormatCommunityOwnerUpdateNotification","WAWebFormatCreateNotification","WAWebFormatCreatedSubgroupSuggestionNotification","WAWebFormatDeleteNotification","WAWebFormatDescriptionNotification","WAWebFormatEphemeralSetting","WAWebFormatLeaveNotification","WAWebFormatLinkNotification","WAWebFormatMembershipApprovalNotification","WAWebFormatParticipantNames","WAWebFormatPictureNotification","WAWebFormatPromoteDemoteNotification","WAWebFormatRemoveNotification","WAWebFormatReportToAdminNotification","WAWebFormatRestrictNotification","WAWebFormatSubjectNotification","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebL10N","WAWebMessageCommunityEmptySubgroupWelcomeTitle.react","WAWebMessageCommunityGeneralChatAutoAddDisabledNotification.react","WAWebMessageCommunityGeneralChatWelcomeTitle.react","WAWebMessageCommunityLinkGroup.react","WAWebMessageCommunitySubgroupWelcome.react","WAWebMessageCommunityWelcomeAdmin.react","WAWebMessageCommunityWelcomeMember.react","WAWebUserPrefsMeUser","WAWebWidFormat"],(function(t,n,r,o,a,i,l,s){var e;function u(t,n){var a="",i=t.get("type");if(i!=="gp2")return a;var l=t.get("subtype"),u=t.displayName(),c=t.get("author"),d=t.get("body"),m,p,_=!!n,f=t.recipients||[],g=o("WAWebFormatParticipantNames").getFormattedNames(f,!1),h=f[0],y=h?o("WAWebContactCollection").ContactCollection.get(h):void 0,C=y?o("WAWebFrontendContactGetters").getFormattedName(y):h?o("WAWebWidFormat").widToFormattedUser(h):"";switch(l){case"add":a=o("WAWebFormatAddNotification").formatAddNotification({author:c,authorClickable:u,subject:h,subjectClickable:C,participantsClickable:g});break;case"remove":a=o("WAWebFormatRemoveNotification").formatRemoveNotification({author:c,authorClickable:u,subject:h,subjectClickable:C,participantsClickable:g});break;case"leave":a=o("WAWebFormatLeaveNotification").formatLeaveNotification({body:d,subject:h,participantsClickable:g});break;case"picture":a=o("WAWebFormatPictureNotification").formatPictureNotification({author:c,authorClickable:u,body:d});break;case"subject":a=o("WAWebFormatSubjectNotification").formatSubjectNotification(o("WAWebFrontendMsgGetters").getChat(t),c,u,d);break;case"modify":m=o("WAWebWidFormat").widToFormattedUser(c),p=o("WAWebWidFormat").widToFormattedUser(h),a=m===u?s._(/*BTDS*/"{name} cambi\u00f3 a {new_number}",[s._param("name",u),s._param("new_number",p)]):s._(/*BTDS*/"{name} cambi\u00f3 su n\u00famero de tel\u00e9fono.",[s._param("name",u)]);break;case"create":a=o("WAWebFormatCreateNotification").formatCreateNotification({author:c,authorClickable:u,groupSubject:d,groupSubjectAsString:!0});break;case"delete":a=o("WAWebFormatDeleteNotification").formatDeleteNotification({chat:o("WAWebFrontendMsgGetters").getChat(t)});break;case"promote":case"demote":case"linked_group_promote":case"linked_group_demote":a=o("WAWebFormatPromoteDemoteNotification").formatPromoteDemoteNotification({subtype:l,subject:h,subjectClickable:C,participantsClickable:g,participantsCount:f.length});break;case"invite":a=o("WAWebUserPrefsMeUser").isMeAccount(h)?s._(/*BTDS*/"Te uniste a trav\u00e9s de un enlace de invitaci\u00f3n"):s._(/*BTDS*/"{name} se uni\u00f3 a trav\u00e9s de un enlace de invitaci\u00f3n",[s._param("name",C)]);break;case"revoke_invite":a=o("WAWebUserPrefsMeUser").isMeAccount(c)?s._(/*BTDS*/"Restableciste el enlace de invitaci\u00f3n de este grupo. Haz clic para ver el nuevo enlace de invitaci\u00f3n."):s._(/*BTDS*/"{name} restableci\u00f3 el enlace de invitaci\u00f3n de este grupo. Haz clic para ver el nuevo enlace de invitaci\u00f3n.",[s._param("name",u)]);break;case"description":a=o("WAWebFormatDescriptionNotification").formatDescriptionNotification({author:c,authorClickable:u,shouldFormatAsLastMsg:_});break;case"parent_group_description":a=o("WAWebFormatDescriptionNotification").formatDescriptionNotification({author:c,authorClickable:u,isParentGroup:!0,shouldFormatAsLastMsg:_});break;case"announce":a=o("WAWebFormatAnnounceNotification").formatAnnounceNotification({author:c,authorClickable:u,body:d});break;case"restrict":a=o("WAWebFormatRestrictNotification").formatRestrictNotification({author:c,authorClickable:u,templateParams:t.templateParams});break;case"no_frequently_forwarded":d==="on"?a=o("WAWebUserPrefsMeUser").isMeAccount(c)?s._(/*BTDS*/"Cambiaste los ajustes de este grupo para no permitir los mensajes reenviados muchas veces."):s._(/*BTDS*/"{name} cambi\u00f3 los ajustes de este grupo para no permitir los mensajes reenviados muchas veces.",[s._param("name",u)]):a=o("WAWebUserPrefsMeUser").isMeAccount(c)?s._(/*BTDS*/"Cambiaste los ajustes de este grupo para permitir mensajes reenviados muchas veces."):s._(/*BTDS*/"{name} cambi\u00f3 los ajustes de este grupo para permitir mensajes reenviados muchas veces.",[s._param("name",u)]);break;case"announce_msg_bounce":a=s._(/*BTDS*/"Solo los administradores pueden enviar mensajes a este grupo.");break;case"v4_add_invite_sent":a=s._(/*BTDS*/"Invitaste a {participants}.",[s._param("participants",g)]).toString();break;case"v4_add_invite_join":a=s._(/*BTDS*/"Se unieron {participants} con tu invitaci\u00f3n.",[s._param("participants",g)]).toString();break;case"ephemeral":return o("WAWebFormatEphemeralSetting").formatEphemeralSetting(t);case"growth_locked":a=s._(/*BTDS*/"El enlace de invitaci\u00f3n ya no est\u00e1 disponible. Haz clic para obtener m\u00e1s informaci\u00f3n.");break;case"growth_unlocked":a=s._(/*BTDS*/"El enlace de invitaci\u00f3n est\u00e1 disponible otra vez. Haz clic para ver el nuevo enlace de invitaci\u00f3n.");break;case"linked_group_join":case"parent_group_link":case"sibling_group_link":case"sub_group_link":case"parent_group_unlink":case"sibling_group_unlink":case"sub_group_unlink":case"integrity_parent_group_unlink":case"delete_parent_group":case"delete_parent_group_unlink":case"auto_add":case"default_sub_group_admin_add":case"invite_auto_add":{var b=o("WAWebFormatLinkNotification").formatLinkNotifAsFbt(l,c,h,t.templateParams);b!=null&&(a=b);break}case"community_participant_add_rich":case"community_invite_rich":case"community_invite_auto_add_rich":case"subgroup_admin_triggered_auto_add":case"subgroup_admin_triggered_invite_auto_add":a=o("WAWebMessageCommunityWelcomeMember.react").communityWelcomeMemberTitle();break;case"sub_group_participant_add_rich":case"sub_group_invite_rich":a=o("WAWebMessageCommunitySubgroupWelcome.react").communitySubgroupWelcomeTitle({templateParams:t.templateParams,clickable:!1,author:c});break;case"community_link_parent_group_rich":a=o("WAWebMessageCommunityLinkGroup.react").communityLinkGroupTitle({templateParams:t.templateParams,clickable:!1,author:c});break;case"community_create":a=o("WAWebMessageCommunityWelcomeAdmin.react").communityWelcomeAdminTitle({templateParams:t.templateParams,author:c,chat:o("WAWebFrontendMsgGetters").getChat(t)});break;case"membership_approval_mode":case"membership_approval_request":case"created_membership_requests":a=o("WAWebFormatMembershipApprovalNotification").formatMembershipApprovalNotification(l,c,t.templateParams);break;case"ephemeral_keep_in_chat":a=s._(/*BTDS*/"Ahora est\u00e1 disponible la opci\u00f3n de conservar mensajes temporales en el chat. Haz clic para obtener m\u00e1s informaci\u00f3n.");break;case"initial_pHash_mismatch":case"default_sub_group_promote":case"default_sub_group_demote":o("WAWebChatGroupUtils").isCommunityAnnouncementGroup(o("WAWebFrontendMsgGetters").getChat(t))?a=s._(/*BTDS*/"Se produjo un cambio en los miembros de la comunidad. Haz clic para verlo."):a=s._(/*BTDS*/"Se produjo un cambio en los miembros del grupo. Haz clic para verlo.");break;case"allow_admin_reports":a=o("WAWebFormatReportToAdminNotification").formatReportToAdminNotification(c,t.templateParams);break;case"allow_non_admin_sub_group_creation":a=r("WAWebFormatAllowNonAdminSubGroupCreationNotification")(o("WAWebFrontendMsgGetters").getChat(t),t.templateParams);break;case"empty_subgroup_create":{var v=t.templateParams[2];a=o("WAWebMessageCommunityEmptySubgroupWelcomeTitle.react").communityEmptySubgroupWelcomeTitle(v);break}case"created_subgroup_suggestion":{a=r("WAWebFormatCreatedSubgroupSuggestionNotification")(c,t.templateParams,!1);break}case"general_chat_add":{var S=t.templateParams[1];a=o("WAWebMessageCommunityGeneralChatWelcomeTitle.react").communityGeneralChatWelcomeTitle(S);break}case"general_group_auto_add_disabled":{a=o("WAWebMessageCommunityGeneralChatAutoAddDisabledNotification.react").communityGeneralChatAutoAddDisabledNotification(o("WAWebFrontendMsgGetters").getChat(t).formattedTitle,t.templateParams);break}case"community_owner_update":{a=o("WAWebFormatCommunityOwnerUpdateNotification").formatCommunityOwnerUpdateNotification({author:c,templateParams:t.templateParams,clickable:!1});break}default:o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["wa:formatGroupNotification:unknown message subtype: ",""])),l);break}return r("WAWebL10N").isRTL()&&(a=r("WAWebL10N").forceRTL(String(a))),a}l.default=u}),226); __d("WAWebFormatLeaveNotification",["fbt","WAWebGroupType","WAWebSystemMessagesUtils"],(function(t,n,r,o,a,i,l,s){function e(e){var t=e.body,n=e.participantsClickable,r=e.subject;return r?o("WAWebSystemMessagesUtils").isMe(r)?s._(/*BTDS*/"Saliste del grupo"):s._(/*BTDS*/"{user_name} sali\u00f3 del grupo.",[s._param("user_name",n)]):t===o("WAWebGroupType").DELETE_REASON.INTEGRITY_DELETE_PARENT?s._(/*BTDS*/"Esta comunidad ya no est\u00e1 disponible."):s._(/*BTDS*/"Se cerr\u00f3 este grupo.")}l.formatLeaveNotification=e}),226); __d("WAWebStringsWithMultiplePluralParts",["fbt"],(function(t,n,r,o,a,i,l,s){function e(e,t){return s._(/*BTDS*/"_j{\"*\":{\"*\":\"No se pudieron reenviar {count} mensajes porque {contact} tiene una versi\\u00f3n de WhatsApp que no es compatible.\"},\"_1\":{\"_1\":\"No se pudo reenviar 1 mensaje porque {contact} tiene una versi\\u00f3n de WhatsApp que no es compatible.\"}}",[s._plural(e,"count"),s._plural(e),s._param("contact",t)]).toString()}function u(e,t){return s._(/*BTDS*/"_j{\"*\":{\"*\":\"No se pudieron reenviar {count} mensajes porque el archivo no existe o {contact} tiene una versi\\u00f3n de WhatsApp que no es compatible.\"},\"_1\":{\"_1\":\"No se pudo reenviar 1 mensaje porque el archivo no existe o {contact} tiene una versi\\u00f3n de WhatsApp que no es compatible.\"}}",[s._plural(e,"count"),s._plural(e),s._param("contact",t)]).toString()}function c(e,t){return d(e,t).toString()}function d(e,t){return s._(/*BTDS*/"_j{\"*\":{\"*\":\"Se a\\u00f1adieron los grupos {group-names}.\"},\"_1\":{\"_1\":\"Se a\\u00f1adi\\u00f3 el grupo {group-names}.\"}}",[s._plural(t),s._plural(t),s._param("group-names",e.formattedNames)])}function m(e,t){return p(e,t).toString()}function p(e,t){return s._(/*BTDS*/"_j{\"*\":{\"*\":\"Se quitaron los grupos {group-names}.\"},\"_1\":{\"_1\":\"Se quit\\u00f3 el grupo {group-names}.\"}}",[s._plural(t),s._plural(t),s._param("group-names",e.formattedNames)])}l.getCannotForwardCapabilityContactString=e,l.getCannotForwardFileMissingAndCapabilityContactString=u,l.getCommunityGroupsAddedString=c,l.getCommunityGroupsAddedStringComponent=d,l.getCommunityGroupsRemovedString=m,l.getCommunityGroupsRemovedStringComponent=p}),226); __d("WAWebFormatLinkNotification",["fbt","WALogger","WAWebFormatParticipantNames","WAWebPairList","WAWebStringsWithMultiplePluralParts","WAWebUserPrefsMeUser","WAWebWid"],(function(t,n,r,o,a,i,l,s){var e,u,c,d,m,p,_,f,g,h,y,C,b,v=function(t){return t instanceof r("WAWebWid")&&o("WAWebUserPrefsMeUser").isMeAccount(t)};function S(e){return!e}function R(e,t,n,r){return L(e,t,n,r,!1)}function L(t,n,r,a,i){var l=n?o("WAWebFormatParticipantNames").getFormattedName(n,i,t):null,s=r?o("WAWebFormatParticipantNames").getFormattedName(r,i):null;switch(t){case"parent_group_link":return M(a,i,n,l);case"sibling_group_link":return w(a,i,n,l,t);case"sub_group_link":break;case"parent_group_unlink":return N(a,i,n,l);case"integrity_parent_group_unlink":return P(a,i);case"delete_parent_group_unlink":case"delete_parent_group":return $(a,l,n,i);case"sibling_group_unlink":return A(a,i,n,l);case"sub_group_unlink":break;case"community_create":return F(a,i,n,l);case"linked_group_join":return O(r,s);case"auto_add":case"default_sub_group_admin_add":return B(a,i,l);case"invite_auto_add":return W(a,i,r,s);default:o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["wa:formatLinkNotification:unknown message subtype: ",""])),t);break}}function E(e){return s._(/*BTDS*/"Creaste la comunidad \"{community_name}\".",[s._param("community_name",e)])}function k(){return s._(/*BTDS*/"Creaste la comunidad.")}function I(e,t){return s._(/*BTDS*/"{author} cre\u00f3 la comunidad \"{community_name}\".",[s._param("author",e),s._param("community_name",t)])}function T(e){return s._(/*BTDS*/"{author} cre\u00f3 la comunidad.",[s._param("author",e)])}function D(e){return s._(/*BTDS*/"Se cre\u00f3 la comunidad \"{community_name}\".",[s._param("community_name",e)])}function x(){return s._(/*BTDS*/"Se cre\u00f3 la comunidad.")}function $(e,t,n,r){var a;return e[0]!=null&&typeof e[0]=="string"&&!S(e[0])&&(a=o("WAWebFormatParticipantNames").getClickableDeactivatedCommunityName(e[0],r)),a!=null&&t!=null?v(n)?(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["generateDeleteParentGroupNotification: render community deactivate, I am author"]))),s._(/*BTDS*/"Desactivaste la comunidad {community}.",[s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!r))])):(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["generateDeleteParentGroupNotification: render community deactivate, I am not author"]))),s._(/*BTDS*/"{author} desactiv\u00f3 la comunidad {community}.",[s._param("author",t),s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!r))])):v(n)?s._(/*BTDS*/"Desactivaste una comunidad."):t!=null?s._(/*BTDS*/"{author} desactiv\u00f3 una comunidad.",[s._param("author",t)]):s._(/*BTDS*/"Se desactiv\u00f3 una comunidad.")}function P(e,t){var n=o("WAWebFormatParticipantNames").getClickableIntegrityDeactivateCommunityName(e[0],e[1],t,!0);return n!=null?(o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["generateIntegrityParentGroupUnlinkNotification"]))),s._(/*BTDS*/"Este grupo ya no forma parte de la comunidad {community}.",[s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(n,!t))])):s._(/*BTDS*/"Este grupo ya no forma parte de una comunidad.")}function N(e,t,n,r){var a=babelHelpers.arrayLikeToArray(e).slice(0),i=o("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:a[0],asString:!t,alternativeStringName:a[1]});return i!=null&&v(n)?(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupUnlinkNotification, I am author"]))),s._(/*BTDS*/"Quitaste este grupo de la comunidad {community}.",[s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(i,!t))])):i==null&&v(n)?s._(/*BTDS*/"Quitaste este grupo de una comunidad."):i!=null&&n!=null?(o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupUnlinkNotification, I am not author"]))),s._(/*BTDS*/"{author} quit\u00f3 este grupo de la comunidad {community}.",[s._param("author",r),s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(i,!t))])):i!=null&&n==null?(o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupUnlinkNotification, no author"]))),s._(/*BTDS*/"Se quit\u00f3 este grupo de la comunidad {community}.",[s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(i,!t))])):i==null&&n!=null?s._(/*BTDS*/"{author} quit\u00f3 este grupo de una comunidad.",[s._param("author",r)]):s._(/*BTDS*/"Se quit\u00f3 este grupo de una comunidad.")}function M(e,t,n,r){var a=o("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:e[0],asString:!t,alternativeStringName:e[1]});return!S(a)&&v(n)?(o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupLinkNotification, I am author"]))),s._(/*BTDS*/"A\u00f1adiste este grupo y a sus miembros a la comunidad {community}.",[s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!t))])):S(a)&&v(n)?s._(/*BTDS*/"A\u00f1adiste este grupo y a sus miembros a una comunidad."):!S(a)&&n!=null?(o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupLinkNotification, I am not author"]))),s._(/*BTDS*/"{author} a\u00f1adi\u00f3 este grupo y a sus miembros a la comunidad {community}.",[s._param("author",r),s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!t))])):!S(a)&&n==null?(o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["generateParentGroupLinkNotification, no author"]))),s._(/*BTDS*/"Se a\u00f1adi\u00f3 este grupo y a sus miembros a la comunidad {community}.",[s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!t))])):S(a)&&n!=null?s._(/*BTDS*/"{author} a\u00f1adi\u00f3 este grupo y a sus miembros a una comunidad.",[s._param("author",r)]):s._(/*BTDS*/"Se a\u00f1adi\u00f3 este grupo y a sus miembros a una comunidad.")}function w(e,t,n,r,a){var i=babelHelpers.arrayLikeToArray(e).slice(0),l=o("WAWebFormatParticipantNames").getFormattedGroupListForCommunity(i,!t,a),u=o("WAWebPairList").unFlattenPairList(i).length;return n!=null&&!v(n)?l==null?s._(/*BTDS*/"_j{\"*\":\"{author} a\\u00f1adi\\u00f3 {count} grupos.\",\"4\":\"{author} a\\u00f1adi\\u00f3 {count} grupo.\",\"_1\":\"{author} a\\u00f1adi\\u00f3 1 grupo.\"}",[s._plural(u,"count"),s._param("author",r)]):s._(/*BTDS*/"_j{\"*\":\"{author} a\\u00f1adi\\u00f3 los grupos {groups}.\",\"_1\":\"{author} a\\u00f1adi\\u00f3 el grupo {groups}.\"}",[s._plural(u),s._param("author",r),s._param("groups",l)]):l==null?s._(/*BTDS*/"_j{\"*\":\"Se a\\u00f1adieron {count} grupos.\",\"4\":\"Se a\\u00f1adi\\u00f3 {count} grupo.\",\"_1\":\"Se a\\u00f1adi\\u00f3 1 grupo.\"}",[s._plural(u,"count")]):t?o("WAWebStringsWithMultiplePluralParts").getCommunityGroupsAddedStringComponent({formattedNames:l,count:u},u):o("WAWebStringsWithMultiplePluralParts").getCommunityGroupsAddedString({formattedNames:l},u)}function A(e,t,n,r){var a=babelHelpers.arrayLikeToArray(e).slice(0),i=o("WAWebFormatParticipantNames").getFormattedGroupListForCommunity(a,!t),l=o("WAWebPairList").unFlattenPairList(a).length;return n!=null&&!v(n)?i==null?s._(/*BTDS*/"_j{\"*\":\"{author} quit\\u00f3 {count} grupos.\",\"4\":\"{author} quit\\u00f3 {count} grupo.\",\"_1\":\"{author} quit\\u00f3 1 grupo.\"}",[s._plural(l,"count"),s._param("author",r)]):s._(/*BTDS*/"_j{\"*\":\"{author} quit\\u00f3 los grupos {groups}.\",\"_1\":\"{author} quit\\u00f3 el grupo {groups}.\"}",[s._plural(l),s._param("author",r),s._param("groups",i)]):i==null?s._(/*BTDS*/"_j{\"*\":\"Se quitaron {count} grupos.\",\"4\":\"Se quit\\u00f3 {count} grupo.\",\"_1\":\"Se quit\\u00f3 1 grupo.\"}",[s._plural(l,"count")]):t?o("WAWebStringsWithMultiplePluralParts").getCommunityGroupsRemovedStringComponent({formattedNames:i,count:l},l):o("WAWebStringsWithMultiplePluralParts").getCommunityGroupsRemovedString({formattedNames:i},l)}function F(e,t,n,r){var a=o("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:e[0],asString:!t,alternativeStringName:e[1]});return S(a)?r!=null?T(r):v(n)?k():x():v(n)?E(a):r!=null?I(r,a):D(a)}function O(e,t){return v(e)?s._(/*BTDS*/"Te uniste desde la comunidad."):s._(/*BTDS*/"{author} se uni\u00f3 desde la comunidad.",[s._param("author",t)])}function B(e,t,n){if(e&&e.length>=2){var r=o("WAWebFormatParticipantNames").getFormattedCommunityNameWithAlternative({jid:e[0],asString:!t,alternativeStringName:e[1]});return S(r)?s._(/*BTDS*/"{author} te a\u00f1adi\u00f3 a este grupo y a la comunidad.",[s._param("author",n)]):(o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["generateAddNotification"]))),s._(/*BTDS*/"{author} te a\u00f1adi\u00f3 a este grupo y a la comunidad {community}.",[s._param("author",n),s._param("community",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(r,!t))]))}return s._(/*BTDS*/"{author} te a\u00f1adi\u00f3.",[s._param("author",n)])}function W(e,t,n,r){var a,i=!1;return e&&e.length>=3&&(a=o("WAWebFormatParticipantNames").getFormattedNameIfExists(e[0]),a==null&&(a=e[1]),e[2]==="true"&&(i=!0)),i?v(n)?S(a)?s._(/*BTDS*/"Se te a\u00f1adi\u00f3 al grupo."):(o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["generateInviteAutoAddNotification, I am subject, has subgroup name"]))),s._(/*BTDS*/"Se te a\u00f1adi\u00f3 porque te uniste al grupo {group-name}.",[s._param("group-name",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!t))])):s._(/*BTDS*/"{user_name} se uni\u00f3.",[s._param("user_name",r)]):v(n)?S(a)?s._(/*BTDS*/"Se te a\u00f1adi\u00f3 a esta comunidad."):(o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["generateInviteAutoAddNotification, I am subject, not part of community"]))),s._(/*BTDS*/"Se te a\u00f1adi\u00f3 a esta comunidad porque te uniste al grupo {group-name}.",[s._param("group-name",o("WAWebFormatParticipantNames").getCommunityNameInQuotationMarks(a,!t))])):s._(/*BTDS*/"{user_name} se uni\u00f3.",[s._param("user_name",r)])}l.formatLinkNotifAsFbt=R,l.formatLinkNotification=L}),226); __d("WAWebFormatMembershipApprovalNotification",["fbt","WALogger","WAWebFbtIntlList","WAWebFormatParticipantNames","WAWebGroupType","WAWebSystemMessageGatingUtils","WAWebUserPrefsMeUser","WAWebWamEnumSystemMessageTypeType","WAWebWidFactory"],(function(t,n,r,o,a,i,l,s){var e;function u(t,n,a){var i=o("WAWebSystemMessageGatingUtils").systemMessageActionTextStylingEnabled(),l;switch(n&&(l=o("WAWebFormatParticipantNames").getFormattedName(n,!1)),t){case"membership_approval_mode":{var u=a[0]&&o("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.cast(a[0].toString())===o("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On,c=a[1]&&o("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.cast(a[1].toString())===o("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.Admin;return u?l==null?{text:c?s._(/*BTDS*/"Los nuevos miembros necesitan la aprobaci\u00f3n de un administrador para unirse a este grupo. Haz clic para cambiar esto."):s._(/*BTDS*/"Los nuevos miembros necesitan la aprobaci\u00f3n de un administrador para unirse a este grupo.")}:o("WAWebUserPrefsMeUser").isMeAccount(n)?{text:s._(/*BTDS*/"Activaste la aprobaci\u00f3n de los admin. para unirse a este grupo. Haz clic para cambiar esto.")}:{text:c?s._(/*BTDS*/"{author} activ\u00f3 la aprobaci\u00f3n de los admin. para unirse a este grupo. Haz clic para cambiar esto.",[s._param("author",l)]):s._(/*BTDS*/"{author} activ\u00f3 la aprobaci\u00f3n de los admin. para unirse a este grupo.",[s._param("author",l)])}:l==null?{text:s._(/*BTDS*/"Se desactiv\u00f3 la aprobaci\u00f3n de los administradores para unirse a este grupo.")}:o("WAWebUserPrefsMeUser").isMeAccount(n)?{text:s._(/*BTDS*/"Desactivaste la aprobaci\u00f3n de los admin. para unirse a este grupo. Haz clic para cambiar esto.")}:{text:c?s._(/*BTDS*/"{author} desactiv\u00f3 la aprobaci\u00f3n de los admin. para unirse a este grupo. Haz clic para cambiar esto.",[s._param("author",l)]):s._(/*BTDS*/"{author} desactiv\u00f3 la aprobaci\u00f3n de los admin. para unirse a este grupo.",[s._param("author",l)])}}case"membership_approval_request":return{text:i?s._(/*BTDS*/"{author} solicit\u00f3 unirse.",[s._param("author",l)]):s._(/*BTDS*/"{author} solicit\u00f3 unirse. Haz clic para revisar esto.",[s._param("author",l)]),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_JOIN_REQUEST};case"created_membership_requests":{var d=a.map(function(e){return o("WAWebFormatParticipantNames").getFormattedName(o("WAWebWidFactory").createWid(e.toString()),!1)}),m=d[0],p=babelHelpers.arrayLikeToArray(d).slice(1),_=r("WAWebFbtIntlList")(p,r("WAWebFbtIntlList").CONJUNCTIONS.NONE,r("WAWebFbtIntlList").DELIMITERS.COMMA);return{text:i?s._(/*BTDS*/"{author} solicit\u00f3 a\u00f1adir a {authors}.",[s._param("author",m),s._param("authors",_)]):s._(/*BTDS*/"{author} solicit\u00f3 a\u00f1adir a {authors}. Haz clic para revisar esto.",[s._param("author",m),s._param("authors",_)]),enumType:o("WAWebWamEnumSystemMessageTypeType").SYSTEM_MESSAGE_TYPE_TYPE.GROUP_JOIN_REQUEST}}default:o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["wa:formatMembershipApprovalNotification:unknown message subtype: ",""])),t);break}return{text:""}}function c(e,t,n){return u(e,t,n).text}l.formatMembershipApprovalNotification=c}),226); __d("WAWebL10NEnumeration.react",["fbt"],(function(t,n,r,o,a,i,l,s){function e(e,t){if(t===void 0&&(t=!1),e.length===0)return"";var n=e[0];if(e.length===1){var r=s._(/*BTDS*/"\"{A}\"",[s._param("A",n)]);return t?r.toString():r}var o=e[e.length-1];if(e.length===2)return u(n,o,t);var a=e.slice(0,e.length-2),i=e[e.length-2];return c(a,i,o,t)}function u(e,t,n){n===void 0&&(n=!1);var r=s._(/*BTDS*/"\"{A}\" y \"{B}\"",[s._param("A",e),s._param("B",t)]);return n?r.toString():r}function c(e,t,n,r){r===void 0&&(r=!1);var o=function(t,n){return s._(/*BTDS*/"\"{A}\", {B}",[s._param("A",n),s._param("B",t)])},a=e.reverse(),i=r?a.reduce(function(e,t){return o(e,t).toString()},""):a.reduce(function(e,t){return o(e,t)},null),l=s._(/*BTDS*/"{A}\"{B}\" y \"{C}\"",[s._param("A",i),s._param("B",t),s._param("C",n)]);return r?l.toString():l}l.default=e}),226); __d("WAWebFormatParticipantNames",["fbt","WAWebClickableLink.react","WAWebCmd","WAWebCommunityGroupJourneyEventImpl","WAWebComposeBoxActions","WAWebConfirmPopup.react","WAWebContactCollection","WAWebEmojiText.react","WAWebFbtIntlList","WAWebFindChatAction","WAWebGroupMetadataCollection","WAWebL10NEnumeration.react","WAWebModalManager","WAWebName.react","WAWebPairList","WAWebReachoutTimelockRestrictedModalLoadable","WAWebReachoutTimelockUtils","WAWebSuspendedCommunityUtils","WAWebToast.react","WAWebToastManager","WAWebUnjoinedSubgroupMetadataCollection","WAWebWamEnumChatFilterActionTypes","WAWebWamEnumSurfaceType","fbs","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react")),c={linkColor:{color:"x1bvqhpb",$$css:!0}};function d(e,t){return function(n){n&&(n.preventDefault(),n.stopPropagation()),o("WAWebFindChatAction").findOrCreateLatestChat(e,"formatParticipantNames").then(function(e){var n=e.chat;if(o("WAWebReachoutTimelockUtils").isUserReachoutTimelocked()&&!o("WAWebReachoutTimelockUtils").canSendMsgWhileTimelocked({chat:n,contact:n.contact})){o("WAWebModalManager").ModalManager.open(u.jsx(o("WAWebReachoutTimelockRestrictedModalLoadable").ReachoutTimelockRestrictedModalLoadable,{}));return}t==="sibling_group_link"&&new(o("WAWebCommunityGroupJourneyEventImpl")).CommunityGroupJourneyEvent({action:o("WAWebWamEnumChatFilterActionTypes").CHAT_FILTER_ACTION_TYPES.GROUP_SYSTEM_MESSAGE_CLICK,surface:o("WAWebWamEnumSurfaceType").SURFACE_TYPE.CHAT,chat:n}).commit(),o("WAWebCmd").Cmd.openChatFromUnread({chat:n}).then(function(e){e&&o("WAWebComposeBoxActions").ComposeBoxActions.focus(n)})})}}function m(e){return function(t){t&&(t.preventDefault(),t.stopPropagation()),o("WAWebCmd").Cmd.openCommunityHome(e,void 0)}}function p(e){return function(t){t&&(t.preventDefault(),t.stopPropagation()),o("WAWebCmd").Cmd.openCommunityTabbedInfo(e,void 0,!1,!0)}}function _(e){return function(t){t&&(t.preventDefault(),t.stopPropagation()),o("WAWebModalManager").ModalManager.open(u.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{onOK:function(){return o("WAWebModalManager").ModalManager.close()},children:s._(/*BTDS*/"Ya no eres miembro de la comunidad \"{community}\".",[s._param("community",u.jsx(o("WAWebName.react").Name,{contact:e}))])}))}}function f(){o("WAWebToastManager").ToastManager.open(u.jsx(o("WAWebToast.react").Toast,{msg:s._(/*BTDS*/"Esta comunidad ya no existe.")}))}function g(e,t){return t?u.jsx(r("WAWebClickableLink.react"),{onClick:f,xstyle:c.linkColor,children:u.jsx(o("WAWebEmojiText.react").EmojiText,{text:e})}):e}function h(e,t,n,r){var a=o("WAWebContactCollection").ContactCollection.get(e.toString());return r===!1&&a!=null?L(e,n?m(e):null):t==null||t===""?null:r===!1&&n?u.jsx(o("WAWebEmojiText.react").EmojiText,{text:t,onClick:o("WAWebSuspendedCommunityUtils").openTerminatedCommunityModal}):t}function y(e,t){t===void 0&&(t=!1);var n=o("WAWebContactCollection").ContactCollection.get(e.toString());if(!n)return null;if(t)return n.name;var a=r("WAWebGroupMetadataCollection").get(e),i=m(e);return a!=null&&a.joinedSubgroups.length||(i=_(n)),L(e,i)}function C(e,t){return t?r("fbs")._(/*BTDS*/"\"{community-name}\"",[r("fbs")._param("community-name",e)]):u.jsx("span",{className:"xuxw1ft",children:s._(/*BTDS*/"\"{community-name}\"",[s._param("community-name",e)])})}function b(e){var t=e.alternativeStringName,n=e.asString,r=n===void 0?!1:n,a=e.jid,i=y(a,r);return i==null&&t?g(t,!r):typeof i=="string"&&!r?u.jsx(o("WAWebEmojiText.react").EmojiText,{text:i}):i}function v(e,t,n){if(t===void 0&&(t=!1),o("WAWebContactCollection").ContactCollection.get(e.toString())!=null&&!t)return L(e,d(e,n));var a=r("WAWebUnjoinedSubgroupMetadataCollection").get(e.toString());return a!=null&&a.subject?a.subject:null}function S(e,t,n){t===void 0&&(t=!1);var a=o("WAWebPairList").unFlattenPairList(e).map(function(e){var r=e[0],o=e[1],a=v(r,t,n);return a!==""&&a!=null?a:o});return r("WAWebL10NEnumeration.react")(a,t)}function R(e,t,n,r){if(t===void 0&&(t=!0),!e.isUser())return L(e,t?d(e,n):null,r);var o=t?d(e,n):null;return L(e,o,r)}function L(e,t,n){var r=o("WAWebContactCollection").ContactCollection.gadd(e,{silent:!0});return u.jsx(o("WAWebName.react").Name,{contact:r,showNotifyName:!0,elevatedPushNamesEnabled:!0,onClick:t,tabIndex:n})}L.displayName=L.name+" [from "+i.id+"]";function E(e,t,n,o){if(t===void 0&&(t=!0),n===void 0&&(n=!1),!Array.isArray(e))return R(e,t,void 0,o);var a=e.map(function(e){return R(e,t,void 0,o)});return r("WAWebFbtIntlList")(a,n?r("WAWebFbtIntlList").CONJUNCTIONS.NONE:r("WAWebFbtIntlList").CONJUNCTIONS.AND,r("WAWebFbtIntlList").DELIMITERS.COMMA)}l.openCommunity=m,l.openCommunityInfo=p,l.getClickableDeactivatedCommunityName=g,l.getClickableIntegrityDeactivateCommunityName=h,l.getCommunityNameInQuotationMarks=C,l.getFormattedCommunityNameWithAlternative=b,l.getFormattedNameIfExists=v,l.getFormattedGroupListForCommunity=S,l.getFormattedName=R,l.getFormattedNames=E}),226); __d("WAWebFormatPictureNotification",["fbt","WAWebSystemMessagesUtils"],(function(t,n,r,o,a,i,l,s){function e(e){var t=e.author,n=e.authorClickable,r=e.body;return r==="remove"?o("WAWebSystemMessagesUtils").isMe(t)?s._(/*BTDS*/"Eliminaste la imagen de este grupo."):n!=null?s._(/*BTDS*/"{user_name} elimin\u00f3 la imagen de este grupo.",[s._param("user_name",n)]):s._(/*BTDS*/"Un miembro elimin\u00f3 la imagen de este grupo."):o("WAWebSystemMessagesUtils").isMe(t)?s._(/*BTDS*/"Cambiaste la imagen de este grupo."):n!=null?s._(/*BTDS*/"{user_name} cambi\u00f3 la imagen de este grupo.",[s._param("user_name",n)]):s._(/*BTDS*/"Un miembro cambi\u00f3 la imagen de este grupo.")}l.formatPictureNotification=e}),226); __d("WAWebFormatPromoteDemoteNotification",["fbt","WALogger","WAWebSystemMessagesUtils"],(function(t,n,r,o,a,i,l,s){var e;function u(t){var n=t.participantsClickable,r=t.participantsCount,a=t.subject,i=t.subjectClickable,l=t.subtype;switch(l){case"promote":return r===1&&o("WAWebSystemMessagesUtils").isMe(a)?s._(/*BTDS*/"Ahora eres admin. del grupo."):s._(/*BTDS*/"_j{\"*\":\"{participant_names} ahora son administradores.\",\"_1\":\"{participant_names} ahora es admin.\"}",[s._plural(r),s._param("participant_names",n)]);case"demote":return r===1&&o("WAWebSystemMessagesUtils").isMe(a)?s._(/*BTDS*/"Ya no eres admin. del grupo"):s._(/*BTDS*/"_j{\"*\":\"{participant_names} ya no son administradores\",\"_1\":\"{participant_names} ya no es admin.\"}",[s._plural(r),s._param("participant_names",n)]);case"linked_group_promote":return o("WAWebSystemMessagesUtils").isMe(a)?s._(/*BTDS*/"Ahora eres admin. de la comunidad."):s._(/*BTDS*/"{name} ahora es admin. de la comunidad.",[s._param("name",i)]);case"linked_group_demote":return o("WAWebSystemMessagesUtils").isMe(a)?s._(/*BTDS*/"Ya no eres admin. de la comunidad."):s._(/*BTDS*/"{name} ya no es admin. de la comunidad.",[s._param("name",i)]);default:return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["wa:formatPromoteDemoteNotification:unknown message subtype: ",""])),l),""}}l.formatPromoteDemoteNotification=u}),226); __d("WAWebFormatRemoveNotification",["fbt","WAWebLidMigrationUtils","WAWebSystemMessagesUtils","WAWebWid"],(function(t,n,r,o,a,i,l,s){function e(e){var t=e.author,n=e.authorClickable,a=e.participantsClickable,i=e.subject,l=e.subjectClickable;return t?r("WAWebWid").equals.apply(r("WAWebWid"),o("WAWebLidMigrationUtils").toCommonAddressingMode(t,i))?s._(/*BTDS*/"Se te quit\u00f3 del grupo"):o("WAWebSystemMessagesUtils").isMe(t)?s._(/*BTDS*/"Quitaste a {names}.",[s._param("names",a)]):o("WAWebSystemMessagesUtils").isMe(i)?n!=null?s._(/*BTDS*/"{user_name} te quit\u00f3.",[s._param("user_name",n)]):s._(/*BTDS*/"Un miembro te quit\u00f3."):n!=null?s._(/*BTDS*/"{user_name} quit\u00f3 a {names}.",[s._param("user_name",n),s._param("names",a)]):s._(/*BTDS*/"Un miembro quit\u00f3 a {names}.",[s._param("names",a)]):o("WAWebSystemMessagesUtils").isMe(i)?s._(/*BTDS*/"Se te quit\u00f3 del grupo"):s._(/*BTDS*/"Se quit\u00f3 a {user_name}.",[s._param("user_name",l)])}l.formatRemoveNotification=e}),226); __d("WAWebFormatReportToAdminNotification",["fbt","WAWebFormatParticipantNames","WAWebGroupType","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l,s){function e(e,t){var n=t[0]&&o("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.cast(t[0].toString())===o("WAWebGroupType").GroupSettingChangeSystemMessageToggleEnabled.On,r=t[1]&&o("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.cast(t[1].toString())===o("WAWebGroupType").GroupSettingChangeSystemMessageIsAdmin.Admin,a=o("WAWebUserPrefsMeUser").isMeAccount(e);if(a){var i=s._(/*BTDS*/"Activaste la opci\u00f3n \"Enviar para revisi\u00f3n de admin.\" en este grupo. Haz clic para cambiar esto."),l=s._(/*BTDS*/"Desactivaste la opci\u00f3n \"Enviar para revisi\u00f3n de un administrador\" en este grupo. Haz clic para cambiar esto.");return n?i:l}if(e){var u=o("WAWebFormatParticipantNames").getFormattedName(e,!1),c=s._(/*BTDS*/"{author} activ\u00f3 la opci\u00f3n \"Enviar para revisi\u00f3n de admin.\" en este grupo. Haz clic para cambiar esto.",[s._param("author",u)]),d=s._(/*BTDS*/"{author} desactiv\u00f3 la opci\u00f3n \"Enviar para revisi\u00f3n de un administrador\" en este grupo. Haz clic para cambiar esto.",[s._param("author",u)]),m=s._(/*BTDS*/"{author} activ\u00f3 la opci\u00f3n \"Enviar para revisi\u00f3n de admin.\" en este grupo. Haz clic para obtener m\u00e1s informaci\u00f3n.",[s._param("author",u)]),p=s._(/*BTDS*/"{author} desactiv\u00f3 la opci\u00f3n \"Enviar para revisi\u00f3n de admin.\" en este grupo. Haz clic para obtener m\u00e1s informaci\u00f3n.",[s._param("author",u)]);return r?n?c:d:n?m:p}var _=s._(/*BTDS*/"En este grupo, la opci\u00f3n \"Enviar para revisi\u00f3n de admin.\" est\u00e1 activada. Haz clic para cambiar esto."),f=s._(/*BTDS*/"En este grupo, la opci\u00f3n \"Enviar para revisi\u00f3n de admin.\" est\u00e1 desactivada. Haz clic para cambiar esto."),g=s._(/*BTDS*/"La opci\u00f3n \"Enviar para revisi\u00f3n de admin.\" est\u00e1 activada en este grupo. Haz clic para obtener m\u00e1s informaci\u00f3n."),h=s._(/*BTDS*/"La opci\u00f3n \"Enviar para revisi\u00f3n de admin.\" est\u00e1 desactivada en este grupo. Haz clic para obtener m\u00e1s informaci\u00f3n.");return r?n?_:f:n?g:h}l.formatReportToAdminNotification=e}),226); __d("WAWebFormatRestrictNotification",["fbt","WAWebSystemMessagesUtils"],(function(t,n,r,o,a,i,l,s){var e=256;function u(t){var n=t.author,r=t.authorClickable,a=t.templateParams,i=a[0];if(i==="on"){if(a[1]!=null){var l=parseInt(a[1],10)||e;return s._(/*BTDS*/"_j{\"*\":\"Este grupo tiene m\\u00e1s de {threshold} miembros, por eso solo quienes lo administran pueden editar los ajustes.\",\"_1\":\"Este grupo tiene m\\u00e1s de 1 miembro, por eso solo quienes lo administran pueden editar los ajustes.\"}",[s._plural(l,"threshold")])}return o("WAWebSystemMessagesUtils").isMe(n)?s._(/*BTDS*/"Cambiaste los ajustes para que solo los administradores puedan editar las opciones del grupo."):r!=null?s._(/*BTDS*/"{user_name} cambi\u00f3 los ajustes para que solo los administradores puedan editar las opciones del grupo.",[s._param("user_name",r)]):s._(/*BTDS*/"Un miembro cambi\u00f3 los ajustes para que solo los administradores puedan editar las opciones del grupo.")}else if(o("WAWebSystemMessagesUtils").isMe(n))return s._(/*BTDS*/"Cambiaste los ajustes para que todos los miembros puedan editar las opciones del grupo.");return r!=null?s._(/*BTDS*/"{user_name} cambi\u00f3 los ajustes para que todos los miembros puedan editar las opciones del grupo.",[s._param("user_name",r)]):s._(/*BTDS*/"Un miembro cambi\u00f3 los ajustes para que todos los miembros puedan editar las opciones del grupo.")}l.formatRestrictNotification=u}),226); __d("WAWebFormatSubjectNotification",["fbt","WAWebChatGroupUtils","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l,s){function e(e,t,n,r){return o("WAWebChatGroupUtils").isCommunityAnnouncementGroup(e)?o("WAWebUserPrefsMeUser").isMeAccount(t)?s._(/*BTDS*/"Cambiaste el nombre de la comunidad a \"{community_name}\".",[s._param("community_name",r)]):n!=null?s._(/*BTDS*/"{user} cambi\u00f3 el nombre de la comunidad a \"{community_name}\".",[s._param("user",n),s._param("community_name",r)]):s._(/*BTDS*/"Un miembro cambi\u00f3 el nombre de la comunidad a \"{community_name}\".",[s._param("community_name",r)]):o("WAWebUserPrefsMeUser").isMeAccount(t)?s._(/*BTDS*/"Cambiaste el nombre del grupo a \"{group_name}\".",[s._param("group_name",r)]):n!=null?s._(/*BTDS*/"{user} cambi\u00f3 el nombre del grupo a \"{group_name}\".",[s._param("user",n),s._param("group_name",r)]):s._(/*BTDS*/"Un miembro cambi\u00f3 el nombre del grupo a \"{group_name}\".",[s._param("group_name",r)])}l.formatSubjectNotification=e}),226); __d("WAWebSystemMessagesUtils",["WAWebEmojiText.react","WAWebUserPrefsMeUser","WAWebWid","react"],(function(t,n,r,o,a,i,l){var e,s=e||(e=r("react"));function u(e){return e instanceof r("WAWebWid")&&o("WAWebUserPrefsMeUser").isMeAccount(e)}function c(e){var t=e.text;return s.jsx(o("WAWebEmojiText.react").EmojiText,{direction:"auto",text:t})}c.displayName=c.name+" [from "+i.id+"]",l.isMe=u,l.FormattedText=c}),98); __d("WAWebUnformatSerializer",["WAWebFormatSerializer"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t})(r("WAWebFormatSerializer"));e.onDelimiter=function(){},e.onMutator=function(e,t,n){if(e.unformatDecorations!=null){var r=e.unformatDecorations,o=r.post,a=r.pre;return s([typeof a=="function"?a(n):a].concat(t,[o]))}return s(t)},e.onRoot=function(e){return s(e)},e.onText=function(e){return e};function s(e){return e.filter(Boolean).join("")}l.default=e}),98); __d("WAWebUnformatMsg",["WAWebCommonMsgUtils","WAWebFormat","WAWebFormatConfiguration","WAWebFrontendMsgGetters","WAWebMiscGatingUtils","WAWebUnformatSerializer"],(function(t,n,r,o,a,i,l){var e;function s(){return e||(e=o("WAWebFormatConfiguration").Unformat({mentions:{}})),e}function u(e,t){var n=t!=null?t:"";if(o("WAWebCommonMsgUtils").isRichResponseMsg(e.type)){var a=o("WAWebFormatConfiguration").RichResponse({links:[],parseHeadlessHeadings:!0,parseHeadings:!1});return r("WAWebFormat")(n,a,r("WAWebUnformatSerializer"))}var i=e.mentionMap(),l=e.groupMentionMap();if(!i&&!l)return c(n);if(o("WAWebMiscGatingUtils").isDropLastNameEnabled()){var s=o("WAWebFrontendMsgGetters").getChat(e).groupMetadata;if(s){var u=o("WAWebFormatConfiguration").FormattedGroupNotification({mentions:i,groupMentions:l,groupMetadata:s});return r("WAWebFormat")(n,u,r("WAWebUnformatSerializer"))}}var d=o("WAWebFormatConfiguration").FormattedNotification({mentions:i,groupMentions:l});return r("WAWebFormat")(n,d,r("WAWebUnformatSerializer"))}function c(e){return r("WAWebFormat")(e,s(),r("WAWebUnformatSerializer"))}l.default=u}),98); __d("WAWebWidToFormattedNameOrNumber",["WAWebContactCollection","WAWebFrontendContactGetters","WAWebWidFormat"],(function(t,n,r,o,a,i,l){function e(e){var t=o("WAWebContactCollection").ContactCollection.get(e);return t?o("WAWebFrontendContactGetters").getFormattedName(t):o("WAWebWidFormat").widToFormattedUser(e)}l.default=e}),98); __d("WAWebFrontendChatGetters",["WALogger","WAWebABProps","WAWebBizGatingUtils","WAWebBotGating","WAWebChatConstants","WAWebChatFlowTypes","WAWebChatGetters","WAWebChatModelDerivedMethods","WAWebConstantsDeprecated","WAWebContactCollection","WAWebFrontendContactGetters","WAWebGetters","WAWebGettersCaches","WAWebGroupType","WAWebHostedGroupUtils","WAWebLastAddOnDBSerialization","WAWebMsgGetters","WAWebMsgType","WAWebPrivacyModeSystemMsg","WAWebWid"],(function(t,n,r,o,a,i,l){var e,s,u=o("WAWebGetters").createGetterFactories({root:(s=o("WAWebChatGetters")).getChatUnsafe,createCache:o("WAWebGettersCaches").createFrontendChatCache}),c=u.clearCacheFor,d=u.computed,m=u.field,p=c,_=m("groupMetadata"),f=m("contact"),g=m("pendingSeenCount",{default:0}),h=m("unreadMsgAnchor"),y=m("composeQuotedMsg"),C=m("composeQuotedMsgRemoteJid"),b=m("quotedMsgAdminGroupJid"),v=m("quotedMsgAdminGroupSubject"),S=m("quotedMsgAdminParentGroupJid"),R=m("msgs"),L=m("msgsLength"),E=m("msgsChanged"),k=m("isParentGroup"),I=m("groupType"),T=m("hasCapi"),D=m("createdLocally"),x=m("pendingDeleteForMeCount"),$=m("attachMediaContents"),P=m("formattedTitle"),N=m("assignedAgent"),M=m("isAssignedToMe",{default:!1}),w=m("mute"),A=m("presence"),F=m("newsletterMetadata"),O=m("promises",{getDefault:function(){return{reportSpamAndBlockSender:void 0,reportSpamBlockClear:void 0,reportSpamExitClear:void 0,sendNotSpam:void 0,sendUnstarAll:void 0,updateSortTime:void 0,setPin:void 0,setArchive:void 0,updateDraftMessage:void 0}}}),B=m("isFavorite",{default:!1}),W=m("trusted"),q=m("active"),U=m("pendingAction"),V=m("pttRecordingSession"),H=m("unopenedByAssignedAgent",{default:!1}),G=m("mmSignalSharingExpirationWindow"),z=d(function(t){var n=t[0],r=t[1],a=t[2],i=t[3],l=t[4],s=t[5];if(r)return s===o("WAWebGroupType").GroupType.COMMUNITY?o("WAWebChatFlowTypes").ChatKindType.Community:o("WAWebChatFlowTypes").ChatKindType.Group;if(a)return o("WAWebChatFlowTypes").ChatKindType.Broadcast;if(i)return o("WAWebChatFlowTypes").ChatKindType.Chat;if(l)return o("WAWebChatFlowTypes").ChatKindType.Newsletter;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["chat:unknown kind id:",""])),n.toLogString())},[s.getId,s.getIsGroup,s.getIsBroadcast,s.getIsUser,s.getIsNewsletter,I]),j=d(function(e){var t=e[0],n=e[1];return t&&n===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP},[s.getIsGroup,I]),K=d(function(e){var t=e[0];return o("WAWebHostedGroupUtils").isWAHostedGroupEnabled()&&t===!0},[T]),Q=d(function(e){var t=e[0],n=e[1];if(!n)return!1;if(t===o("WAWebChatFlowTypes").ChatKindType.Chat){var r=o("WAWebPrivacyModeSystemMsg").getReducedPrivacyMode(n.privacyMode);if(r===o("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.FB||r===o("WAWebPrivacyModeSystemMsg").ReducedPrivacyMode.BSP)return!1}return n.isHosted!==!0},[z,f]),X=d(function(e){var t=e[0],n=e[1];return t===r("WAWebConstantsDeprecated").MARKED_AS_UNREAD?t:Math.max(0,t-n)},[s.getUnreadCount,g]),Y=d(function(e){var t=e[0],n=e[1],r=e[2];if(t===0)return!1;if(n){var a=n.msgChunk,i=a?a.getModelsArray():[];return n!==i.find(function(e){return o("WAWebMsgGetters").getIsUnreadType(e)})}var l=r.last(),s=l!=null&&o("WAWebMsgGetters").getIsSentByMe(l);if(s)return!1;if(r.msgLoadState.noEarlierMsgs){var u=r.filter(function(e){return o("WAWebMsgGetters").getIsUnreadType(e)});return u.length!==t}return!0},[s.getUnreadCount,h,R]),J=d(function(e){var t,n=e[0],r=e[1],o=n==null||(t=n.text)==null?void 0:t.trim();return!!(o!=null&&o!==""||r)},[s.getDraftMessage,$]),Z=d(function(e){var t=e[0],n=e[1],a=e[2],i=e[3],l=e[4],s=e[5],u=e[6],c=e[7],d=e[8],m=e[9];if(n||t.isBot()&&!o("WAWebBotGating").isBotEnabled())return!1;if(a)return t.user==="chat"?!0:o("WAWebBizGatingUtils").isBizBroadcastSendWebEnabled();if(r("WAWebWid").isStatus(t)||i===o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.NOT_INCLUDED_IN_HIST_SYNC&&u.length===0||l&&s===!0||!l&&c===!0&&o("WAWebBizGatingUtils").isBizBroadcastSendWebEnabled()&&u.every(function(e){return e.broadcast&&o("WAWebMsgGetters").getIsSentByMe(e)}))return!1;var p=u.some(function(e){return e.isRealMessage()}),_=o("WAWebABProps").getABPropConfigValue("chatlist_show_draft_for_empty_chat");return c!==!0||p||_&&m},[s.getId,s.getIsLocked,s.getIsBroadcast,s.getEndOfHistoryTransferType,s.getIsGroup,k,R,D,L,J]),ee=d(function(e){for(var t=e[0],n=e[1],r=e[2],a=t.length-1;a>=0;a--){var i=t.at(a);if(i&&o("WAWebChatModelDerivedMethods").isPreviewMessage(i))return i}if(t.length>0)return t.last()},[R,E,x]),te=d(function(e){var t=e[0],n=e[1],r=e[2],a=e[3];if(!n||!r&&!a)return!1;var i=o("WAWebContactCollection").ContactCollection.get(a||t);return!(i!=null&&o("WAWebFrontendContactGetters").getIsMyContact(i))},[s.getId,s.getIsUser,s.getChangeNumberOldJid,s.getChangeNumberNewJid]),ne=d(function(e){var t=e[0],n=e[1];if(t)return t;if(n)return o("WAWebLastAddOnDBSerialization").lastAddOnPreviewFromDeprecatedLastReactionPreview(n)},[s.getChatlistPreview,s.getLastReactionPreview]);l.clearFrontendChatGetterCacheFor=p,l.getGroupMetadata=_,l.getContact=f,l.getComposeQuotedMsg=y,l.getComposeQuotedMsgRemoteJid=C,l.getQuotedMsgAdminGroupJid=b,l.getQuotedMsgAdminGroupSubject=v,l.getQuotedMsgAdminParentGroupJid=S,l.getMsgs=R,l.getIsParentGroup=k,l.getAttachMediaContents=$,l.getFormattedTitle=P,l.getAssignedAgent=N,l.getIsAssignedToMe=M,l.getMute=w,l.getPresence=A,l.getNewsletterMetadata=F,l.getPromises=O,l.getIsFavorite=B,l.getTrusted=W,l.getActive=q,l.getPendingAction=U,l.getPttRecordingSession=V,l.getUnopenedByAssignedAgent=H,l.getMmSignalSharingExpirationWindow=G,l.getKind=z,l.getIsCAG=j,l.getIsCapiHostedGroup=K,l.getIsE2ee=Q,l.getOptimisticUnreadCount=X,l.getShouldShowUnreadDivider=Y,l.getHasDraftMessage=J,l.getShouldAppearInList=Z,l.getPreviewMessage=ee,l.getShowChangeNumberNotification=te,l.getDerivedLastAddOnPreview=ne}),98); __d("WAWebAnimatedEmojiAssetLoader",["WAConcurrentPriorityPromiseQueue","WALogger","WAWebEmojiConst","WAWebMediaHostsUtil","WAWebPonyfillsFetch","WAWebURLUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u="/wa/static/network_resource",c="nw_media";function d(e){return m.apply(this,arguments)}function m(){return m=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){s=s!=null?s:new Map;var a=new(r("WAConcurrentPriorityPromiseQueue"))(5,{emojis:5}),i=yield o("WAWebMediaHostsUtil").getStaticMediaHostName(),l=""+i+u;o("WAWebEmojiConst").getSupportedAnimatedEmojisAssetIdsMapping(t).forEach((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var n=t[0],i=t[1];try{var u,d=r("WAWebURLUtils").build(l,{cat:c,id:i,_nc_cat:1}),m=yield a.enqueue(function(){return r("WAWebPonyfillsFetch")(d)},{group:"emojis",priority:1}),p=yield m.json();(u=s)==null||u.set(n,p)}catch(t){o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["initAnimatedEmojiAssets: fetch failed"])))}});return function(e){return t.apply(this,arguments)}})())}),m.apply(this,arguments)}function p(e){var t;return(t=s)==null?void 0:t.get(e)}l.initAnimatedEmojiAssets=d,l.getAnimatedEmojiAsset=p}),98); __d("WAWebProductCatalogCatalogConstants",[],(function(t,n,r,o,a,i){var e=96,l=120,s=40,u=95;i.PRODUCT_LIST_ITEM_HEIGHT=e,i.CART_PRODUCT_LIST_ITEM_HEIGHT=l,i.MAX_REPLY_PRODUCT_TITLE_LENGTH=s,i.MAX_REPLY_PRODUCT_DESC_LENGTH=u}),66); __d("WAWebTemplateButtonSubtype",[],(function(t,n,r,o,a,i){var e={QUICK_REPLY:"quick_reply",CALL:"call",URL:"url"};i.TEMPLATE_BUTTON_SUBTYPE=e}),66); __d("WAWebFrontendMsgGetters",["WABidi","WALogger","WANullthrows","WAWebAck","WAWebAnimatedEmojiAssetLoader","WAWebAnimatedEmojiGatingUtils","WAWebBizSystemMsgSubtypes","WAWebChatCollection","WAWebChatGroupUtils","WAWebCommonMsgUtils","WAWebEmoji","WAWebFormatNfmText","WAWebGetters","WAWebGettersCaches","WAWebL10N","WAWebMessageAssociation.flow","WAWebMsgDataUtils","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModelUtils","WAWebMsgType","WAWebNewsletterCollection","WAWebNewsletterGatingUtils","WAWebNewsletterMembershipUtil","WAWebOrderStatus","WAWebProductCatalogCatalogConstants","WAWebProtobufsAICommon.pb","WAWebPtvGatingUtils","WAWebTemplateButtonSubtype","WAWebUserPrefsMeUser","lodash"],(function(t,n,r,o,a,i,l){var e,s,u,c=o("WAWebGetters").createGetterFactories({root:(u=o("WAWebMsgGetters")).getMsgUnsafe,createCache:o("WAWebGettersCaches").createFrontendMessagesCache}),d=c.clearCacheFor,m=c.computed,p=c.field,_=d,f=m(function(e){var t=e[0],n=e[1],r=e[2],a=e[3];return o("WAWebMsgModelUtils").typeIsMms({type:t,subtype:n,headerType:r,interactiveHeader:a})},[u.getType,u.getSubtype,u.getHeaderType,u.getInteractiveHeader]),g=m(function(e){var t=e[0],n=e[1],r=e[2];return t!=null&&t0},[u.getIsFromTemplate,$]),N=m(function(e){var t=e[0],n=e[1];if(!t||n==null)return!1;var r=n.at(0);return r==null?!1:r.subtype===o("WAWebTemplateButtonSubtype").TEMPLATE_BUTTON_SUBTYPE.QUICK_REPLY},[P,$]),M=m(function(e){var t=e[0];return t},[u.getMsgUnsafe]),w=m(function(e){var t=e[0];return t.type===o("WAWebMsgType").MSG_TYPE.PRODUCT&&t.id&&t.id.id.startsWith(o("WAWebBizSystemMsgSubtypes").PRODUCT_INQUIRY_TYPE)?t:null},[M,u.getType,u.getId]),A=m(function(e){var t=e[0];switch(t.type){case o("WAWebMsgType").MSG_TYPE.GP2:return t;default:return null}},[M,u.getType]),F=m(function(e){var t=e[0];return t.type===o("WAWebMsgType").MSG_TYPE.BROADCAST_NOTIFICATION?t:null},[M,u.getType]),O=m(function(e){var t=e[0];return t.type==="product"?t:null},[M,u.getType]),B=m(function(e){var t=e[0];return t.type===o("WAWebMsgType").MSG_TYPE.REVOKED?t:null},[M,u.getType]),W=p("associationType"),q=m(function(e){var t=e[0],n=e[1],r=e[2],a=e[3],i=e[4],l=e[5],s=e[6],u=e[7],c=e[8],d=e[9],m=e[10],p=e[11],_=e[12];return(t.type===o("WAWebMsgType").MSG_TYPE.IMAGE||t.type===o("WAWebMsgType").MSG_TYPE.VIDEO&&t.isGif!==!0)&&!r&&!l&&!p&&!_&&!(c!==o("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_ALBUM&&c!==o("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL&&(a!=null||u))&&!d&&!m?t:null},[M,u.getType,u.getIsNotification,u.getCaption,u.getIsForwarded,B,u.getIsGif,u.getQuotedMsg,W,u.getCtwaContext,u.getIsViewOnce,u.getIsQuestion,u.getQuestionReplyQuotedMessage]),U=m(function(e){var t=e[0],n=e[1];return o("WAWebMsgModelUtils").notRefiningTypeIsUrl({type:t,subtype:n})},[u.getType,u.getSubtype]),V=m(function(e){var t=e[0],n=e[1],r=e[2],a=e[3];if(r)return null;switch(t.type){case o("WAWebMsgType").MSG_TYPE.IMAGE:case o("WAWebMsgType").MSG_TYPE.STICKER:case o("WAWebMsgType").MSG_TYPE.AUDIO:case o("WAWebMsgType").MSG_TYPE.PTT:case o("WAWebMsgType").MSG_TYPE.VIDEO:case o("WAWebMsgType").MSG_TYPE.PTV:case o("WAWebMsgType").MSG_TYPE.DOCUMENT:return t}return a?t:null},[M,u.getType,u.getIsViewOnce,U]),H=m(function(e){var t=e[0],n=e[1],r=e[2],a=e[3],i=e[4],l=e[5],s=e[6],u=e[7],c=e[8],d=I(t.unsafe());return t.type===o("WAWebMsgType").MSG_TYPE.STICKER&&!r&&!a&&!i&&!l&&!s&&(!(c&&o("WAWebNewsletterGatingUtils").isStickerForwardedAttributionEnabled())||!u)&&!o("WAWebChatGroupUtils").isCommunityAnnouncementGroup(d)?t:null},[M,u.getType,u.getIsNotification,B,u.getQuotedMsg,u.getCtwaContext,u.getIsNewsletterMsg,u.getIsForwarded,u.getHasOriginatedFromNewsletter]),G=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.DOCUMENT?t:null},[M,u.getType]),z=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.IMAGE?t:null},[M,u.getType]),j=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.VIDEO?t:null},[M,u.getType]),K=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.AUDIO?t:null},[M,u.getType]),Q=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.PTT?t:null},[M,u.getType]),X=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.PTV?t:null},[M,u.getType]),Y=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.POLL_CREATION?t:null},[M,u.getType]),J=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.POLL_CREATION||t.type===o("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT?t:null},[M,u.getType]),Z=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT?t:null},[M,u.getType]),ee=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.EVENT_CREATION?t:null},[M,u.getType]),te=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.ALBUM?t:null},[M,u.getType]),ne=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.CALL_LOG?t:null},[M,u.getType]),re=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.POLL_UPDATE?t:null},[M,u.getType]),oe=m(function(e){var t=e[0],n=e[1];return o("WAWebMsgModelUtils").typeIsMms(t)?t:null},[M,u.getType]),ae=m(function(e){var t=e[0],n=e[1],r=e[2];return o("WAWebMsgModelUtils").typeIsUrl(t)?t:null},[M,u.getType,u.getSubtype]),ie=m(function(e){var t=e[0],n=e[1];return t.type===o("WAWebMsgType").MSG_TYPE.IMAGE||t.type===o("WAWebMsgType").MSG_TYPE.VIDEO?t:null},[M,u.getType]),le=m(function(e){var t=e[0],n=e[1],r=e[2],o=e[3];return(n!=null||r!=null)&&o?n!=null?n:r:null},[u.getType,ie,Q,u.getIsViewOnce]),se=m(function(e){var t=e[0],n=e[1],r=e[2],a=e[3];return t.type===o("WAWebMsgType").MSG_TYPE.PTT||t.type===o("WAWebMsgType").MSG_TYPE.AUDIO&&a&&r!=null?t:null},[M,u.getType,u.getWaveform,u.getIsOpus]),ue=p("senderObj"),ce=p("mediaData"),de=p("replyButtons"),me=p("pendingDeleteForMe",{default:!1}),pe=p("botPluginType"),_e=m(function(e){var t,n=e[0],r=e[1],a=e[2];return a!=null&&(t=a.id)!=null&&t.isBot()&&(r===o("WAWebProtobufsAICommon.pb").BotPluginMetadata$PluginType.SEARCH||r===o("WAWebProtobufsAICommon.pb").BotPluginMetadata$PluginType.REELS)?n:null},[M,pe,ue]),fe=m(function(e){var t=e[0],n=e[1],r=e[2];return t.type===o("WAWebMsgType").MSG_TYPE.RICH_RESPONSE&&r!=null?t:null},[M,u.getType,u.getRichResponse]),ge=m(function(e){var t=e[0];return o("WAWebMsgModelUtils").getCelebrationAnimationType(t)},[C]),he=m(function(e){var t=e[0],n=e[1];return o("WAWebMsgModelUtils").isAnimatedEmoji(t,n)},[u.getBody,u.getType]),ye=m(function(e){var t=e[0],n=e[1];return o("WAWebMsgModelUtils").isSingleEmojiMessageText(t,n)},[u.getBody,u.getType]),Ce=m(function(e){var t=e[0],n=e[1],r=e[2],a=o("WAWebAnimatedEmojiGatingUtils").isStaticSingleEmojiUIEnabled()&&r!=null;return t===o("WAWebMsgType").MSG_TYPE.CHAT&&(n||a)},[u.getType,he,ye]),be=m(function(e){var t=e[0],n=e[1],r=e[2],a=e[3],i=e[4],l=e[5],s=e[6],u=e[7],c=r!=null||u!=null;return t===o("WAWebMsgType").MSG_TYPE.STICKER?!c&&!n&&!(l&&i&&o("WAWebNewsletterGatingUtils").isStickerForwardedAttributionEnabled())&&!s:t===o("WAWebMsgType").MSG_TYPE.CHAT?!c&&a&&!s:t===o("WAWebMsgType").MSG_TYPE.PTV?o("WAWebPtvGatingUtils").isPtvReceivingEnabled():!1},[u.getType,u.getCtwaContext,u.getQuotedMsg,Ce,u.getHasOriginatedFromNewsletter,u.getIsForwarded,u.getIsQuestion,u.getQuestionReplyQuotedMessage]),ve=m(function(e){var t=e[0];if(t!=null){var n=o("WAWebEmoji").EmojiUtil.normalizeEmojiFromString(t);if(n!=null)return o("WAWebAnimatedEmojiAssetLoader").getAnimatedEmojiAsset(n)}},[u.getBody]),Se=m(function(e){var t=e[0],n=e[1],r=e[2],o=e[3],a;if(t){var i;a=(i=n==null?void 0:n.newsletterId)!=null?i:r.remote}return a!=null?a:o.id},[u.getHasOriginatedFromNewsletter,u.getForwardedNewsletterMessageInfo,u.getId,ue]),Re=m(function(e){var t=e[0],n=e[1];return!t&&o("WAWebUserPrefsMeUser").isMeAccount(n)},[u.getIsNewsletterMsg,u.getSender]),Le=m(function(e){var t=e[0],n=e[1],r=e[2],o=T(t.unsafe()),a;return n&&(a=o==null?void 0:o.contact),a!=null?a:r},[M,u.getIsNewsletterMsg,ue]);l.clearFrontendMsgGetterCacheFor=_,l.getIsMms=f,l.getIsUnsentMedia=g,l.getEventType=h,l.getText=C,l.getIsNewsletterInviteAccepted=b,l.getDir=v,l.getIsRTL=S,l.getRtl=R,l.getHasBodyOrFooter=L,l.getChatCollection=E,l.getCurrentChat=k,l.getChat=I,l.getMaybeChat=T,l.getCarouselCardsCollection=D,l.getCarouselCards=x,l.getButtons=$,l.getHasTemplateButtons=P,l.getIsQuickReply=N,l.getSafeMsg=M,l.getAsProductInquiry=w,l.getAsGroupNotification=A,l.getAsBroadcastNotification=F,l.getAsProduct=O,l.getAsRevoked=B,l.getAssociationType=W,l.getAsAlbumAsset=q,l.getIsUrlMessage=U,l.getAsAutoDownloadableMedia=V,l.getAsGroupedSticker=H,l.getAsDoc=G,l.getAsImage=z,l.getAsVideo=j,l.getAsAudio=K,l.getAsPtt=Q,l.getAsPtv=X,l.getAsPollCreation=Y,l.getAsPoll=J,l.getAsPollResultSnapshot=Z,l.getAsEventCreation=ee,l.getAsAlbum=te,l.getAsCallLog=ne,l.getAsPollUpdate=re,l.getAsMms=oe,l.getAsUrl=ae,l.getAsVisualMedia=ie,l.getAsViewOnce=le,l.getAsPttLike=se,l.getSenderObj=ue,l.getMediaData=ce,l.getReplyButtons=de,l.getPendingDeleteForMe=me,l.getBotPluginType=pe,l.getAsBotPluginCarouselMsg=_e,l.getAsRichResponse=fe,l.getCelebrationAnimationCandidate=ge,l.getIsAnimatedEmoji=he,l.getIsSingleEmoji=ye,l.getIsTransparentMsgEmoji=Ce,l.getIsTransparentMsg=be,l.getJSONAssetForAnimatedEmoji=ve,l.getMsgSenderId=Se,l.getShouldDisplaySelf=Re,l.getSenderForReplyMsg=Le}),98); __d("WAWebFrontendPollVoteGetters",["WANullthrows","WAWebAck","WAWebContactCollection","WAWebFrontendMsgGetters","WAWebGetters","WAWebGettersCaches","WAWebMsgCollection","WAWebPollVoteGetters","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l){var e,s=o("WAWebGetters").createGetterFactories({root:(e=o("WAWebPollVoteGetters")).getPollVoteUnsafe,createCache:o("WAWebGettersCaches").createFrontendPollVotesCache}),u=s.clearCacheFor,c=s.computed,d=s.field,m=u,p=d("isSendFailure",{default:!1}),_=c(function(e){var t=e[0],n=r("WANullthrows")(o("WAWebMsgCollection").MsgCollection.get(t));return r("WANullthrows")(o("WAWebFrontendMsgGetters").getAsPollCreation(n))},[e.getParentMsgKey]),f=c(function(e){var t=e[0];return o("WAWebContactCollection").ContactCollection.gadd(t)},[e.getSender]),g=c(function(e){var t=e[0],n=e[1],r=e[2],a=o("WAWebUserPrefsMeUser").isMeAccount(t)&&n!=null&&n0}),a=r.map(function(t){var n=t.conversionData,r=babelHelpers.objectWithoutPropertiesLoose(t,e);if(n==null)return r;var a=o("WAWebApiParse").parseConversionData(n);return a?babelHelpers.extends({},r,{conversionData:a}):r});this.add(a),this.saveToCache()}},n})(o("WAWebBaseCollection").BaseCollection);s.model=o("WAWebConversionTupleModel").ConversionTuple,s.cachePolicy={id:o("WAWebUserPrefsKeys").COLLECTIONS_KEYS.CONVERSION_TUPLE_COLLECTION,policy:o("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:1e3};var u=new s;l.default=u}),98); __d("WAWebConversionTupleModel",["WABinary","WALogger","WATimeUtils","WAWebAlarm","WAWebBaseModel","WAWebConversionTupleCollection","WAWebWid"],(function(t,n,r,o,a,i,l){var e=["conversionData"],s,u=604800,c=(function(t){function n(){for(var e,n=arguments.length,r=new Array(n),a=0;aDate.now())},s=function(n){return e(n)?n.salePriceAmount1000:n.priceAmount1000},u=function(n){var t,r;return e(n)?Math.max(0,((t=n.priceAmount1000)!=null?t:0)-((r=n.salePriceAmount1000)!=null?r:0)):0},c=function(t){var e=t.currency,n=t.priceAmount1000,o=s(t);return r("isStringNullOrEmpty")(e)||n==null||o==null};l.isSalePriceActive=e,l.getActivePrice=s,l.getSavings=u,l.isEmptyPrice=c}),98); __d("WAWebBizCreateProductInquiry",["WATimeUtils","WAWebAck","WAWebMediaOpaqueData","WAWebMsgKey","WAWebMsgModel","WAWebMsgType","WAWebProductSelectors","WAWebUserPrefsMeUser","WAWebViewMode.flow"],(function(t,n,r,o,a,i,l){function e(e,t,n,a,i){var l={ack:o("WAWebAck").ACK.CLOCK,id:new(r("WAWebMsgKey"))({id:"product_inquiry_"+r("WAWebMsgKey").newId_DEPRECATED(),remote:t,fromMe:!0}),from:t,to:o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),t:o("WATimeUtils").unixTime(),type:o("WAWebMsgType").MSG_TYPE.PRODUCT,kind:o("WAWebMsgType").MsgKind.Product,viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE,title:e.name,description:e.description,businessOwnerJid:n.toString({legacy:!0}),productId:e.id.toString(),url:e.url,productImageCount:e.getProductImageCollectionCount(),body:a.preview instanceof r("WAWebMediaOpaqueData")?a.preview.getBase64():null,currencyCode:e.currency,priceAmount1000:e.priceAmount1000,salePriceAmount1000:o("WAWebProductSelectors").isSalePriceActive(e)?e.salePriceAmount1000:null,sessionId:i,retailerId:e.retailerId},s=new(o("WAWebMsgModel")).Msg(l);return s.mediaData.set(a),s}l.createProductInquiry=e}),98); __d("WAWebBusinessCategoriesResultCollection",["WAWebBaseCollection","WAWebBizBusinessProfileAction","WAWebBusinessCategoriesResultModel","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,r=arguments.length,a=new Array(r),i=0;i0?(a=u[0].subject.typesAndValues.find(function(e){return e.type==="2.5.4.3"}))==null?void 0:a.value.valueBlock.value:null,d=r("WANullthrows")(yield o("WAWebDirectConnectionX509").genRootIssuers(u,s));return{certificateString:o("WAWebDirectConnectionX509").encodeToString([].concat(u,d)),leaftCertificateCommonName:c}}),h.apply(this,arguments)}function y(e){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t;return!!(o("WAWebDirectConnectionGatingUtils").supportsDirectConnection()&&o("WAWebChatCollection").ChatCollection.get(e)!=null&&((t=yield o("WAWebBusinessProfileCollection").BusinessProfileCollection.find(e))!=null&&t.isBusinessDirectConnection()))}),C.apply(this,arguments)}function b(e){var t=o("WAWebChatCollection").ChatCollection.get(e);return!!t&&t.hasMaybeSentMsgToChat()}function v(e){var t,n;return((t=e.directConnection)==null?void 0:t.enabled)===!0&&typeof((n=e.directConnection.defaultPostcode)==null?void 0:n.code)=="string"}function S(e){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=yield o("WAWebBusinessProfileCollection").BusinessProfileCollection.find(e);if((t=n.directConnection)!=null&&t.enabled&&n.directConnection.defaultPostcode)return{postcode:n.directConnection.defaultPostcode.code,postcodeLocationName:n.directConnection.defaultPostcode.locationName}}),R.apply(this,arguments)}var L=421;function E(e){return e instanceof o("WAWebBackendErrors").ServerStatusCodeError&&e.statusCode===L}var k=function(t,n){if(t===o("WAWebServerPropConstants").UNINITIALIZED_VALUE_WEB_BIZ_PROFILE_OPTIONS)return!1;var e=(o("WAWebBusinessProfileVersioningBridge").getBusinessProfileQueryVersionWithCustomBizProfileOptions(t)&o("WAWebBusinessProfileVersioningBridge").DIRECT_CONNECTION_FLAG)>0,r=(o("WAWebBusinessProfileVersioningBridge").getBusinessProfileQueryVersionWithCustomBizProfileOptions(n)&o("WAWebBusinessProfileVersioningBridge").DIRECT_CONNECTION_FLAG)>0;return e!==r},I=function(t,n){return t!=null&&!r("WAArraysShallowEqual")(t,n)};l.timestampFormat=s,l.DCCertificateDomainMismatchError=u,l.isCypherExpired=c,l.isCypherFromLaunch1=d,l.getValidCertificate=m,l.getCypher=f,l.fetchCertificateFullChain=g,l.isCypherNeeded=y,l.userHasSentMessageToBusiness=b,l.businessSupportsPostcode=v,l.fetchDefaultPostcode=S,l.errorIsDirectConnectionCypherError421=E,l.isDirectConnectionFlagChanged=k,l.isDirectConnectionNumbersAbPropChanged=I}),98); __d("WAWebBusinessProfileCollection",["Promise","WALogger","WAWebABPropsLocalStorage","WAWebApiBusinessProfile","WAWebBaseCollection","WAWebBizBusinessProfileAction","WAWebBizGatingUtils","WAWebBusinessDirectUtils","WAWebBusinessProfileModel","WAWebBusinessProfileUtils","WAWebCmd","WAWebContactCollection","WAWebDirectConnectionGatingUtils","WAWebHandleBizBotAutomatedTypeAction","WAWebHandleBizBotWelcomeMsgProtocolModeAction","WAWebLidMigrationUtils","WAWebServerPropConstants","WAWebWid","WAWebWidFactory","asyncToGeneratorRuntime","getErrorSafe"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p="catalog_exists",_=(function(t){function a(){var n;n=t.call(this)||this,n._inflightDbQueryMap=new Map;var a=o("WAWebABPropsLocalStorage").isABPropsAfterFirstSync()?o("WAWebDirectConnectionGatingUtils").directConnectionBusinessNumbersFromAbprop():null,i=o("WAWebABPropsLocalStorage").isABPropsAfterFirstSync()?o("WAWebBizGatingUtils").webBizProfileOptions():o("WAWebServerPropConstants").UNINITIALIZED_VALUE_WEB_BIZ_PROFILE_OPTIONS;return n.listenTo(o("WAWebCmd").Cmd,"on_ab_props_update_from_bridge",function(){var t=o("WAWebBizGatingUtils").webBizProfileOptions();o("WAWebBusinessDirectUtils").isDirectConnectionFlagChanged(i,t)&&(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] change in direct connection bit detected. marking relevant biz profiles from abprop numbers as stale"]))),n._markBizProfilesAsStale(o("WAWebDirectConnectionGatingUtils").directConnectionBusinessNumbersFromAbprop())),i=t;try{var l=o("WAWebDirectConnectionGatingUtils").directConnectionBusinessNumbersFromAbprop();o("WAWebBusinessDirectUtils").isDirectConnectionNumbersAbPropChanged(a,l)&&n._markBizProfilesAsStale(Array.from(new Set((a!=null?a:[]).concat(l)))),a=l}catch(e){var u=r("getErrorSafe")(e);o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] Failed to force update biz profiles on abprop biz numbers change"]))).verbose().sendLogs("direct-connection-biz-number-abprop-sync-fail"+String(u))}}),n}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.findImpl=function(t){return this._findAndParse(t,{queryCatalog:!0})},i._update=function(t,n){return this._findAndParse(t,{queryCatalog:!1,getMerchantCompliance:n==null?void 0:n.getMerchantCompliance})},i._findAndParse=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var r=t.getMerchantCompliance,a=t.queryCatalog,i=this.gadd(e);if(!i.id.isUserNotPSA()||i.id.isFbidBot())return(m||(m=n("Promise"))).resolve({id:e});var l=o("WAWebBizBusinessProfileAction").queryBusinessProfile([{wid:i.id,tag:i.tag}],r),s=yield l;if(!Array.isArray(s))return o("WALogger").WARN(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Received invalid business profile response"]))),null;if(s.length===0)return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Store:BusinessProfile:_findAndParse No businessProfile found for ",""])),String(e)),{id:e};var d=s[0],p=d.tag,_=d.wid,f={id:_,tag:p,dataSource:"server"},g=d.profile;if(g){var h=o("WAWebContactCollection").ContactCollection.get(e);h&&!h.isContactSyncCompleted&&(h.set("isBusiness",!0),h.set("forcedBusinessUpdateFromServer",!0));var y=o("WAWebBusinessProfileUtils").parseBusinessProfile({id:d.wid,profile:g,queryCatalog:a}),C=i.dataSource==="placeholder"?null:i.automatedType,b=y.automatedType;yield o("WAWebHandleBizBotAutomatedTypeAction").handleBizBotAutomatedTypeTransition(i.id,C,b);var v=i.dataSource==="placeholder"?null:i.welcomeMsgProtocolMode,S=y.welcomeMsgProtocolMode;return yield o("WAWebHandleBizBotWelcomeMsgProtocolModeAction").handleBizBotWelcomeMsgProtocolModeTransition(i.id,v,S),yield o("WAWebApiBusinessProfile").createOrMergeBusinessProfileRecordLidAware({id:f.id,automatedType:y.automatedType,welcomeMsgProtocolMode:y.welcomeMsgProtocolMode,prompts:y.prompts,commands:y.commands,commandsDescription:y.commandsDescription}),babelHelpers.extends({},y,f)}return f});function t(t,n){return e.apply(this,arguments)}return t})(),i.fetchBizProfile=function(t){var e=this.get(t);return e&&e.markStale(),this.find(t)},i.getValid=function(t){var e=this.get(t);if(e!=null&&e.isValid())return e},i.markProfileAsStale=function(t){var e;(e=this.get(t))==null||e.markStale()},i.hasBusinessProfileInCache=function(t){return!!this.get(t)},i.convertBusinessProfileIdForLidMigration=function(t){var e=t instanceof r("WAWebWid")?t:o("WAWebWidFactory").createWid(t.toString());if(e.isLid()){var n=o("WAWebLidMigrationUtils").toPn(e);if(n!=null)return n}return e},i._markBizProfilesAsStale=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this,r=e.map(function(e){return o("WAWebWidFactory").createUserWidOrThrow(e)}).filter(function(e){return t.hasBusinessProfileInCache(e)});yield(m||(m=n("Promise"))).all(r.map(function(e){t.markProfileAsStale(e)})),r.length>0&&o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[direct-connection] forcefully marked "," biz profiles as stale"])),r.length)});function t(t){return e.apply(this,arguments)}return t})(),a})(o("WAWebBaseCollection").BaseCollection);_.model=o("WAWebBusinessProfileModel").BusinessProfile,_.staleCollection=!0;var f=new _;l.CATALOG_EXISTS=p,l.BusinessProfileCollection=f}),98); __d("WAWebBusinessProfileModel",["WAWebBaseModel","WAWebBotGating","WAWebBotTypes","WAWebBusinessProfileCollection","WAWebBusinessProfileTypes","WAWebChatCollection","WAWebChatGroupUtils","WAWebContactCollection","WAWebOrderRequestMsg.flow","WAWebProductCatalogMetaLinkingGatingUtils","WAWebWid"],(function(t,n,r,o,a,i,l){var e="wa.me/",s=3,u=(function(t){function n(){for(var n,r=arguments.length,a=new Array(r),i=0;i=d&&c<=m?{status:I.OPEN,openUntil:D(a+m)}:c<=d?{status:I.CLOSED,opensAt:D(a+d)}:{status:I.CLOSED}}else if(((u=i.hours)==null?void 0:u.length)===2){var p=i.hours[0][0],_=i.hours[0][1],f=i.hours[1][0],g=i.hours[1][1];return c>=p&&c<=_?{status:I.OPEN,openUntil:D(a+_),additionalOpen:D(a+f),additionalClose:D(a+g)}:c=f&&c<=g?{status:I.OPEN,openUntil:D(a+g)}:ct.id?1:0},l.TemplateButtonCollection=e}),98); __d("WAWebTemplateButtonReplyMsgCollection",["WAWebBaseCollection","WAWebMsgModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t})(o("WAWebBaseCollection").BaseCollection);e.model=o("WAWebMsgModel").Msg,e.comparator=function(e,t){return t.t-e.t},l.default=e}),98); __d("WAWebAgentCollection",["WAWebAgentModel","WAWebAgentModelUtils","WAWebBaseCollection","WAWebConnModel","WAWebSyncdOrphan","promiseDone"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){var t;return t=e.call(this)||this,t.$AgentCollectionImpl$p_1=new Map,t.triggerDeviceIdMapUpdate=function(){t.$AgentCollectionImpl$p_1=new Map,t.getModelsArray().forEach(function(e){t.$AgentCollectionImpl$p_1.set(e.deviceId,e)})},t.on("remove reset",t.triggerDeviceIdMapUpdate),o("WAWebConnModel").Conn.on("change:pushname",function(){var e=t.getModelsArray().filter(function(e){return e.deviceId===o("WAWebAgentModelUtils").PRIMARY_DEVICE_ID})[0];e!=null&&e.set("name",o("WAWebAgentModelUtils").getFormattedAgentNameForAgent(e))}),t}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.add=function(n,a){var t=e.prototype.add.call(this,n,a);return this.triggerDeviceIdMapUpdate(),r("promiseDone")(o("WAWebSyncdOrphan").checkOrphanAgents(t.map(function(e){var t;return(t=e==null?void 0:e.id)!=null?t:""}))),t},n.getByDeviceId=function(t){return this.$AgentCollectionImpl$p_1.get(t)},n.initializeFromCache=function(t){this.add(t,{merge:!0})},t})(o("WAWebBaseCollection").BaseCollection);e.model=o("WAWebAgentModel").Agent;var s=new e;l.AgentCollection=s}),98); __d("WAWebAgentModel",["WAWebAgentCollection","WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;ar?-1:1:t.id.toString()a?-1:1:t.id.toString()1&&o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["ChatCollection:getActive more than one active chat"]))).sendLogs("more-than-one-active-chat-in-chat-collection"),t[0]},a.getChatByAccountLid=function(t){var e=this.get(t);if(e)return e;var n=o("WAWebLidMigrationUtils").toPn(t),r=n?this.get(n):null;return t.equals(r==null?void 0:r.accountLid)?r:null},a.getLatestChatForWid=function(t){var e=o("WAWebLidMigrationUtils").shouldHaveAccountLid(t)?o("WAWebLidMigrationUtils").toLid(t):null;return e!=null?c.getChatByAccountLid(e):c.get(t)},a.unstarAllMessages=function(t,n){return o("WAWebSendUnstarAllChatAction").unstarAllMessages(t,n)},a.hasAnyUnreadSinceGivenTimestamp=function(t){return this.length===0?!1:this.some(function(e){var n,r=(n=e.t)!=null?n:0;return o("WAWebChatGetters").getHasUnread(e)&&r>t})},a.delete=function(){t.prototype.delete.call(this),this.listenToOnce(this,"sort",r("lodash").debounce(this.setIndexes,100))},n})(o("WAWebBaseCollection").BaseCollection);u.model=o("WAWebChatModel").Chat,u.comparator=r("WAWebChatComparator");var c=new u;l.ChatCollectionImpl=u,l.ChatCollection=c}),98); __d("WAWebChatCommunityUtils",["WAWebChatCollection","WAWebChatGroupUtils","WAWebCommunityGatingUtils","WAWebFrontendContactGetters","WAWebGroupMetadataCollection","WAWebGroupType","WAWebLidMigrationUtils","WAWebUnjoinedSubgroupMetadataCollection","WAWebUserPrefsMeUser","WAWebWidFactory","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e=91,s=new Set(["add","remove","demote","linked_group_demote"]);function u(e){var t;return e?(e==null||(t=e.groupMetadata)==null?void 0:t.groupType)===o("WAWebGroupType").GroupType.COMMUNITY&&o("WAWebChatGroupUtils").isSuspendedGroup(e)&&o("WAWebCommunityGatingUtils").isCommunitySuspendAppealEnabled():!1}function c(e){var t;return e?(e==null||(t=e.groupMetadata)==null?void 0:t.groupType)===o("WAWebGroupType").GroupType.COMMUNITY&&o("WAWebChatGroupUtils").isSuspendedGroup(e)&&o("WAWebChatGroupUtils").isTerminatedGroup(e):!1}function d(e){if(!(e!=null&&e.groupMetadata))return!1;var t=e.groupMetadata,n=t.participants;return n.iAmSuperAdmin()}function m(e){return!(!(e!=null&&e.groupMetadata)||c(e)||u(e))}function p(e){return r("WAWebGroupMetadataCollection").filter(function(t){return t.parentGroup===e&&t.defaultSubgroup===!0}).map(function(e){return e.id})}function _(e,t){return e.map(function(e){var n,a,i=t?(n=o("WAWebChatCollection").ChatCollection.get(e))==null?void 0:n.formattedTitle:(a=r("WAWebUnjoinedSubgroupMetadataCollection").get(e))==null?void 0:a.subject;return{id:e,subject:i!=null?i:""}})}function f(e){if(!e||!e.contact.name)return!1;var t=o("WAWebChatCollection").ChatCollection.findFirst(function(t){var n,r;return((n=t.groupMetadata)==null?void 0:n.parentGroup)===e.id&&((r=t.groupMetadata)==null?void 0:r.defaultSubgroup)});return!t||!t.contact.name?!1:t.contact.name!==e.contact.name}function g(e){if(!e)return!1;var t=r("WAWebGroupMetadataCollection").get(e);if(!t)return!1;var n=t.participants.iAmAdmin();return t.allowNonAdminSubGroupCreation!==!0&&!n}function h(e,t,n){if(t==null)return!0;var r;if(n==null){var a,i,l=(a=o("WAWebLidMigrationUtils").toPn(t.id))!=null?a:t.id,s=e==null||(i=e.groupMetadata)==null||(i=i.getParentGroupChat())==null||(i=i.groupMetadata)==null?void 0:i.participants;r=!!(s!=null&&s.iAmAdmin())||l.isUser()&&!!(s!=null&&s.userIsAdmin(l))}else r=n.iAmCommunityAdmin||n.isSenderAdmin;return!e||o("WAWebUserPrefsMeUser").isMeAccount(t.id)||o("WAWebFrontendContactGetters").getIsMyContact(t)||!o("WAWebChatGroupUtils").isCommunityAnnouncementGroup(e)||r?!1:t.id.isLid()?!0:o("WAWebChatGroupUtils").isCommunityAnnouncementGroup(e)}function y(e){var t=e.length!==0?e[0].toString():null;return!r("isStringNullOrEmpty")(t)&&o("WAWebWidFactory").isWidlike(t)?o("WAWebWidFactory").createWidFromWidLike(t):null}function C(e,t){var n=t.groupMetadata;return!!(n!=null&&n.isCag)&&s.has(e.subtype)&&!(n!=null&&n.participants.iAmAdmin())}l.SUBGROUP_V2_CHAT_CELL_HEIGHT=e,l.isSuspendedCommunity=u,l.isIntegrityDeactivatedCommunity=c,l.isCommunitySuperAdmin=d,l.canAddGroupToCommunity=m,l.getCagIdFromCommunity=p,l.formatSubgroupUpdateTypes=_,l.cagAndCommunitySubjectDiffer=f,l.isSubgroupSuggestionCreation=g,l.shouldMaskPhoneNumberForChat=h,l.getNewCommunityOwnerFromTemplateParams=y,l.isInvalidCommunitySystemMsg=C}),98); __d("WAWebChatDocMsgsCollection",["Promise","WAFilteredCatch","WALogger","WAWebBackendErrors","WAWebBaseCollection","WAWebFrontendMsgGetters","WAWebMsgCollection","WAWebMsgModel","WAWebNoop","WAWebThreadMsgUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u=(function(t){function a(){for(var r,a=arguments.length,i=new Array(a),l=0;l0&&i.length>0?1:0;return r.$ChatDocMsgsCollection$p_1=m+i.length-p,r.$ChatDocMsgsCollection$p_1}catch(n){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Failed to count docs for chat ",""])),t.id).verbose().sendLogs("md-failed-docs-count: "+n.message),null}});return function(e,n){return t.apply(this,arguments)}})(),babelHelpers.assertThisInitialized(r)||babelHelpers.assertThisInitialized(r)}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.delete=function(){t.prototype.delete.call(this),this.stopListening(),this.reset()},i.add=function(n,r){return this.$ChatDocMsgsCollection$p_1=null,t.prototype.add.call(this,n,r)},i.remove=function(n,r){return this.$ChatDocMsgsCollection$p_1=null,t.prototype.remove.call(this,n,r)},i.queryDocs=function(t,a){var e=this;if(a){if(this.queryDocBefore)return this.queryDocBefore;var i=this.queryDocBefore=o("WAWebMsgCollection").MsgCollection.queryMedia(a.id.remote,o("WAWebMsgCollection").MEDIA_QUERY_LIMIT,"before",a.id,"document").then(function(t){(!t||t.lengtho("WATimeUtils").unixTime()}function C(e){var t;if(!e)return!1;var n=o("WAWebStateUtils").unproxy(e),r=p(n),a=g(n)&&!((t=n.groupMetadata)!=null&&t.participants.iAmMember());return(r||a)&&!_(n)}function b(e){var t,n=o("WAWebStateUtils").unproxy(e);return((t=n.groupMetadata)==null?void 0:t.groupType)===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&g(n)&&o("WAWebCommunityGatingUtils").isCommunitySuspendAppealEnabled()}function v(e){var t,n=o("WAWebStateUtils").unproxy(e);return((t=n.groupMetadata)==null?void 0:t.groupType)===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&g(n)&&p(n)}function S(){return o("WAWebABProps").getABPropConfigValue("group_suspend_appeal_include_entity_id_enabled")}function R(e){var t,n=o("WAWebStateUtils").unproxy(e);return((t=n.groupMetadata)==null?void 0:t.groupType)===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&p(n)}function L(e){return g(e)||p(e)}function E(t){var a,i=o("WAWebStateUtils").unproxy(t);if(!(d(i)&&i.isReadOnly)){var l=(c||(c=n("Promise"))).resolve();if(o("WAWebChatGetters").getIsNewsletter(i)){var s=!o("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(i.newsletterMetadata)||i.isSuspendedOrTerminated();i.isReadOnly!==s&&o("WAWebDBUpdateChatTable").updateChatTable(i.id,{isReadOnly:s}).then(function(){i.isReadOnly=s,$(i)}).catch(r("WAWebNoop"));return}if(o("WAWebChatGetters").getIsGroup(i)&&!((a=i.groupMetadata)!=null&&a.stale)){var u,m,_=((u=i.groupMetadata)==null?void 0:u.groupType)!==o("WAWebGroupType").GroupType.COMMUNITY&&(!((m=i.groupMetadata)!=null&&m.participants.iAmMember())||p(i));i.isReadOnly!==_&&(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["chat:updateReadOnly:old ",", new ",""])),i.isReadOnly,_),l=o("WAWebDBUpdateChatTable").updateChatTable(i.id,{isReadOnly:_}).then(function(){i.isReadOnly=_,$(i)}))}l.then(function(){o("WAWebChatGetters").getIsBroadcast(i)&&x(i)})}}function k(e){var t,n=o("WAWebStateUtils").unproxy(e);return((t=n.groupMetadata)==null?void 0:t.participants.length)||1}function I(e,t,n){var r=o("WAWebUserPrefsMeUser").getMeLidUserOrThrow();if(r.equals(e))return o("WAWebUserPrefsMeUser").getMePnUserOrThrow();if(o("WAWebLid1X1MigrationGating").Lid1X1MigrationUtils.isLidMigrated()||!e.isLid())return e;var a=o("WAWebApiContact").getPhoneNumber(e);return a==null?(o("WAWebCurrentUser").isEmployee()&&o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["getOneToOneContactFromGroupContact: could not find PN for Lid ",""])),e.toString()),o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["getOneToOneContactFromGroupContact: Participant LID does not have PN mapping. context: ",". more context: ",""])),t,n).sendLogs("lid-group-get-one-to-one-contact"),null):a}function T(e){var t,n=e.participants,r=(t=e.size)!=null?t:0,o=n.iAmAdmin()?r:n.length;return o}function D(e){var t,n,r=e.contact.name;return r!=null&&r.trim().length>0?r:((t=(n=e.broadcastMetadata)==null?void 0:n.recipients)!=null?t:[]).map(function(e){return o("WAWebFrontendContactGetters").getFormattedShortName(e.contact)}).join(", ")}function x(e){if(o("WAWebChatGetters").getIsBroadcast(e))e.formattedTitle=D(e);else if(o("WAWebChatGetters").getIsUser(e)){var t;e.formattedTitle=(t=o("WAWebFrontendContactGetters").getFormattedUser(e.contact))!=null?t:""}else if(o("WAWebChatGetters").getIsGroup(e)){var n,r;e.formattedTitle=(n=e.contact.name)!=null?n:(r=e.groupMetadata)==null?void 0:r.subject}else if(o("WAWebChatGetters").getIsNewsletter(e)){var a,i;e.formattedTitle=(a=e.contact.name)!=null?a:(i=e.newsletterMetadata)==null?void 0:i.name}}function $(e,t){var n;return e.isReadOnly||e.isAnnounceGrpRestrict===!0||o("WAWebTosGating").shouldBlockByTos(e.contact)||o("WAWebTosGating").shouldBlockByBotTos(e.contact)||o("WAWebTosCountryGating").shouldBlockByCountry(e.contact)||!o("WAWebBotGating").isBotEnabled()&&e.id.isBot()||!o("WAWebBotGating").isFbidBotEnabled()&&e.id.isFbidBot()||o("WAWebBizAiAgentGating").isAiAgentAutoReplyEnabled()&&(o("WAWebBizAiAgentStatusUtils").shouldShowAiAgentBlockBar(e)||o("WAWebBizAiAgentStatusUtils").tryToEnableAiAgent(e))||(n=t!=null?t:e.contact.businessProfile)!=null&&n.isBizBot3p&&(!o("WAWebBotGating").isBizBot3pAvailable()||!o("WAWebBotTos").hasAcceptedBizBotTos())?(e.canSend=!1,!1):o("WAWebChatGetters").getIsUser(e)?e.canSend=!(e.contact.isContactBlocked||o("WAWebChatGetters").getIsPSA(e)||o("WAWebChatGetters").getIsIAS(e)||o("WAWebReachoutTimelockUtils").isUserReachoutTimelocked()&&!o("WAWebReachoutTimelockUtils").canSendMsgWhileTimelocked({chat:e,contact:e.contact})||o("WAWebIndividualNewChatMessageCappingLimitUtils").isUserCapped()&&!o("WAWebIndividualNewChatMessageCappingLimitUtils").canSendMsgWhileCapped({chat:e,contact:e.contact})):o("WAWebChatGetters").getIsNewsletter(e)?e.canSend=o("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(e.newsletterMetadata):(e.canSend=!0,!0)}function P(e){return o("WAWebChatGetters").getIsGroup(e)&&o("WAWebGroupGatingUtils").isGroupExitExperienceEnabled()&&!_(e)&&!e.isReadOnly}l.isSupportGroup=d,l.isAIGroupOpen=m,l.isTerminatedGroup=p,l.isCommunityAnnouncementGroup=_,l.isCommunityGeneralGroup=f,l.isSuspendedGroup=g,l.canSendToGroup=h,l.isInviteGrowthLockedGroup=y,l.isTerminatedGroupOrNotMember=C,l.isSuspendedCommunityAnnouncementGroup=b,l.isIntegrityDeactivatedCommunityAnnouncementGroup=v,l.shouldIncludeEntityIdInAppealRequest=S,l.isDeactivatedCommunityAnnouncementGroup=R,l.shouldBlockCall=L,l.updateReadOnly=E,l.getParticipantCount=k,l.getOneToOneContactFromGroupContact=I,l.getGroupParticipantsCount=T,l.getBroadcastChatTitle=D,l.updateTitle=x,l.updateCanSend=$,l.isGroupExitExperienceEnabledForChat=P}),98); __d("WAWebChatLinkMsgsCollection",["Promise","WAFilteredCatch","WALogger","WAPromiseLoop","WAWebBackendErrors","WAWebBaseCollection","WAWebMsgCollection","WAWebMsgLinks","WAWebMsgModel","WAWebNoop","WAWebThreadMsgUtils","asyncToGeneratorRuntime"],(function(t,n,r,o,a,i,l){var e,s,u=(function(t){function a(){for(var r,a=arguments.length,i=new Array(a),l=0;l0&&o("WAWebThreadMsgUtils").isMsgInThread(e,n)}):t.msgs.filter(function(e){return o("WAWebMsgLinks").getLinksFromMsg(e).length>0}),l=(a=i[0])!=null?a:t.msgs.head();if(l==null)return 0;try{var s,u=yield o("WAWebMsgCollection").MsgCollection.queryMedia(l.id.remote,1/0,"before",l.id,"url"),c=n!=null?u.filter(function(e){return o("WAWebThreadMsgUtils").isMsgInThread(e,n)}):u,d=(s=c.length)!=null?s:0,m=d>0&&i.length>0?1:0;return r.$ChatLinkMsgsCollection$p_1=d+i.length-m,r.$ChatLinkMsgsCollection$p_1}catch(n){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Failed to count medias for chat ",""])),t.id).verbose().sendLogs("md-failed-medias-count: "+n.message),null}});return function(e,n){return t.apply(this,arguments)}})(),babelHelpers.assertThisInitialized(r)||babelHelpers.assertThisInitialized(r)}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.delete=function(){t.prototype.delete.call(this),this.stopListening(),this.reset()},i.add=function(n,r){return this.$ChatLinkMsgsCollection$p_1=null,t.prototype.add.call(this,n,r)},i.remove=function(n,r){return this.$ChatLinkMsgsCollection$p_1=null,t.prototype.remove.call(this,n,r)},i.queryLinks=function(t,a){var e=this;if(a){if(this.queryLinkBefore)return this.queryLinkBefore;var i=this.queryLinkBefore=o("WAWebMsgCollection").MsgCollection.queryMedia(a.id.remote,o("WAWebMsgCollection").MEDIA_QUERY_LIMIT,"before",a.id,"url").then(function(t){(!t||t.length0}),{at:0}),this.createLinksAndAddMsgs(l)}if(t.msgs.msgLoadState.noEarlierMsgs)return this.hasLinkBefore=!1,(s||(s=n("Promise"))).resolve();if(this.length<=2*o("WAWebMsgCollection").MEDIA_QUERY_LIMIT){var u=this.length===0?t.msgs.head():this.head();return this.queryLinks(t,u)}return(s||(s=n("Promise"))).resolve()},i.createLinksAndAddMsgs=function(t){var e=this,n=[];o("WAPromiseLoop").promiseLoop(function(e,r,a){if(t.length===a){e();return}var i=t[a];if(i!=null){var l=o("WAWebMsgLinks").getLinksFromMsg(i);l.length&&n.push(i)}}).then(function(){e.add(n),e.trigger("query_link_before")})},a})(o("WAWebBaseCollection").BaseCollection);u.model=o("WAWebMsgModel").Msg,u.comparator=function(e,t){return e.t-t.t},l.default=u}),98); __d("WAWebGetNewsletterCursor",["WAWebNewsletterSystemMessages"],(function(t,n,r,o,a,i,l){function e(e,t,n){var r,o,a,i=n.length>0?n:e.toArray(),l=t==="before"?(r=i[0])==null?void 0:r.serverId:(o=i[i.length-1])==null?void 0:o.serverId;return l==null?null:(a={},a[t]=s(l),a)}function s(e){return Math.min(Math.max(e,o("WAWebNewsletterSystemMessages").EARLIEST_AVAILABLE_MESSAGE_ID-1),o("WAWebNewsletterSystemMessages").LATEST_AVAILABLE_MESSAGE_ID)}l.getNewsletterCursor=e}),98); __d("WAWebWamEnumWebcMessageQueryDirection",[],(function(t,n,r,o,a,i){var e=Object.freeze({LOAD_PREV:0,LOAD_NEXT:1,LOAD_AROUND:2});i.WEBC_MESSAGE_QUERY_DIRECTION=e}),66); __d("WAWebWebcMessageQueryWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumWebcChatType","WAWebWamEnumWebcMessageQueryDirection","WAWebWamEnumWebcQueryTriggerType"],(function(t,n,r,o,a,i,l){var e,s=(e=o("WAWebWamCodegenUtils")).defineEvents({WebcMessageQuery:[1876,{webcAudioMessageCount:[14,e.TYPES.INTEGER],webcBrowserNetworkType:[1,e.TYPES.STRING],webcBrowserStorageQuotaBytes:[20,e.TYPES.INTEGER],webcBrowserStorageQuotaUsedBytes:[21,e.TYPES.INTEGER],webcChatPosition:[2,e.TYPES.INTEGER],webcChatType:[13,o("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE],webcDocumentMessageCount:[16,e.TYPES.INTEGER],webcEarliestMessageIndex:[11,e.TYPES.INTEGER],webcEarliestMessageT:[12,e.TYPES.TIMER],webcMessageCount:[4,e.TYPES.INTEGER],webcMessageQueryTrigger:[19,o("WAWebWamEnumWebcQueryTriggerType").WEBC_QUERY_TRIGGER_TYPE],webcMessageQueryType:[3,o("WAWebWamEnumWebcMessageQueryDirection").WEBC_MESSAGE_QUERY_DIRECTION],webcOtherMessageCount:[18,e.TYPES.INTEGER],webcPhotoMessageCount:[7,e.TYPES.INTEGER],webcPttMessageCount:[15,e.TYPES.INTEGER],webcQueryT:[9,e.TYPES.TIMER],webcResponseBytes:[10,e.TYPES.INTEGER],webcStickerMessageCount:[17,e.TYPES.INTEGER],webcTextMessageCount:[5,e.TYPES.INTEGER],webcVideoMessageCount:[6,e.TYPES.INTEGER]},[1,1,5],"regular"]},{WebcMessageQuery:[]});l.WebcMessageQueryWamEvent=s}),98); __d("WAWebMsgCountReporter",["WAWebMsgType","WAWebWebcMessageQueryWamEvent"],(function(t,n,r,o,a,i,l){function e(e){return new(o("WAWebWebcMessageQueryWamEvent")).WebcMessageQueryWamEvent({webcResponseBytes:0,webcMessageCount:0,webcTextMessageCount:0,webcVideoMessageCount:0,webcPhotoMessageCount:0,webcAudioMessageCount:0,webcPttMessageCount:0,webcStickerMessageCount:0,webcDocumentMessageCount:0,webcOtherMessageCount:0,webcMessageQueryTrigger:e})}function s(e,t){e.webcMessageCount+=t.length;for(var n=0,r=t[n];n=s;if(d||!o("WAWebChatGetters").getIsNewsletter(e)||!o("WAWebNewsletterGatingUtils").isNewsletterEnabled())return{msgs:c,hasMoreMsgs:d};try{var m=c[0];if(t==="before"&&m!=null&&o("WAWebNewsletterSystemMessages").isNewsletterSystemMsg(m))return{msgs:c,hasMoreMsgs:!1};var p=c.length>s,_=p?[]:yield o("WAWebNewsletterPullMessagesFromServerAction").pullNewsletterMessagesFromServer(e,{messageCount:s-c.length,cursor:o("WAWebGetNewsletterCursor").getNewsletterCursor(n,t,c),resetUnreadCount:!0}),f=t==="before"?_.concat(c):c.concat(_),h=f.length>=s,y=f[0];if(t==="before"&&!h&&(y==null||!o("WAWebNewsletterSystemMessages").isNewsletterSystemMsg(y))){var C=yield o("WAWebNewsletterSystemMessagesAction").addSystemMessagesToChat(e);f.unshift.apply(f,C)}return{msgs:f,hasMoreMsgs:h}}catch(e){return{msgs:c,hasMoreMsgs:!0}}}),f.apply(this,arguments)}function g(t,a,i,l,u,c,d,m){d===void 0&&(d=!0);var p=o("WAWebStateUtils").unproxy(t),_=self.performance.now();u==="after"?(i.msgLoadState.isLoadingRecentMsgs=!0,c.webcMessageQueryType=o("WAWebWamEnumWebcMessageQueryDirection").WEBC_MESSAGE_QUERY_DIRECTION.LOAD_NEXT):u==="before"?(i.msgLoadState.isLoadingEarlierMsgs=!0,c.webcMessageQueryType=o("WAWebWamEnumWebcMessageQueryDirection").WEBC_MESSAGE_QUERY_DIRECTION.LOAD_PREV):u==="around"&&(i.msgLoadState.isLoadingAroundMsgs=!0,c.webcMessageQueryType=o("WAWebWamEnumWebcMessageQueryDirection").WEBC_MESSAGE_QUERY_DIRECTION.LOAD_AROUND),c.webcBrowserNetworkType=o("WAWebNetworkType").getEffectiveNetworkType(),c.webcChatType=p.getWebcChatType(),typeof p.initialIndex=="number"&&(c.webcChatPosition=p.initialIndex);var f=r("WARaceSignal")([m,p.getDeleteSignal()].filter(Boolean),function(t){return o("WAPromiseLoop").promiseLoop((function(){var d=n("asyncToGeneratorRuntime").asyncToGenerator(function*(d,m,f){if(t.aborted)throw new(o("WAAbortError")).AbortError;var g=o("WAPromiseDelays").delayMs(o("WABackoffUtils").expBackoff(f,12e4,1e3,.1)),y=(s||(s=n("Promise"))).resolve();try{yield y;var C=yield l();if(t.aborted)throw new(o("WAAbortError")).AbortError;c.webcQueryT=Math.ceil(self.performance.now()-_);var b;Array.isArray(C[0])?(b=C[0][0],C.forEach(function(e){return o("WAWebMsgCountReporter").logMessageCounts(c,e)})):(b=C[0],o("WAWebMsgCountReporter").logMessageCounts(c,C)),b&&(c.webcEarliestMessageT=b.t,b.msgChunk===p.msgs&&(c.webcEarliestMessageIndex=p.msgs.length-1)),o("WAStorageEstimator").estimateStorage().then(function(e){if(e.success){var t=e.value,n=t.quota,r=t.usage;c.webcBrowserStorageQuotaBytes=n,c.webcBrowserStorageQuotaUsedBytes=r}}).finally(function(){return c.commit()}),h(a,i,u),d(C)}catch(t){var v=r("getErrorSafe")(t);if(v.name===o("WAAbortError").ABORT_ERROR)throw v;return f>3||t===404?(h(a,i,u),o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["chat:loadMsgs:error ",""])),String(t)),t===404?(s||(s=n("Promise"))).reject(new(o("WAWebBackendErrors")).E404):(s||(s=n("Promise"))).reject(new(o("WAWebMiscErrors")).GaveUpRetry("Gave up msg fetch after "+f+" tries"))):g}});return function(e,t,n){return d.apply(this,arguments)}})(),0)}).catch(o("WAFilteredCatch").filteredCatch(o("WAWebMiscErrors").GaveUpRetry,function(){return[]})).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").E404,function(e){if(d)return[];throw e}));return u==="after"?i.loadRecentPromise=f:u==="before"?i.loadEarlierPromise=f:u==="around"&&(i.loadAroundPromise=f),f}function h(e,t,n){var o=(e==null?void 0:e.msgChunk)&&e.msgChunk!==t;t.msgLoadState.contextLoaded=!0,e&&o===!0&&(r("WANullthrows")(e.msgChunk).msgLoadState.contextLoaded=!0),n==="after"?t.msgLoadState.isLoadingRecentMsgs=!1:n==="before"?t.msgLoadState.isLoadingEarlierMsgs=!1:n==="around"&&(t.msgLoadState.isLoadingAroundMsgs=!1)}l.loadRecentMsgs=u,l.loadEarlierMsgs=d,l.loadMsgsPromiseLoop=g}),98); __d("WAWebChatMedia",["Promise","WAWebCarouselMsgUtils","WAWebChatMediaMsgsCollection","WAWebFrontendMsgGetters","WAWebMessageAssociationUIUtils","WAWebMsgGetters","WAWebMsgLinks","WAWebStateUtils","WAWebViewMode.flow","sumBy"],(function(t,n,r,o,a,i,l){var e;function s(e){var t=o("WAWebStateUtils").unproxy(e),n=t.docMsgs,r=t.linkMsgs,a=t.mediaMsgs,i=t.productMsgs;a&&(a.delete(),a.queryMedia({chat:t})),r&&(r.delete(),r.queryLinks(t)),n&&(n.delete(),n.queryDocs(t)),i&&(i.delete(),i.queryProducts(t))}function u(e){return o("WAWebMsgGetters").getIsMedia(e)&&!e.isViewOnce&&e.viewMode!==o("WAWebViewMode.flow").ViewModeType.HIDDEN}function c(e,t,n){if(t){var r=o("WAWebStateUtils").unproxy(e),a=o("WAWebCarouselMsgUtils").flattenMsgs(Array.isArray(t)?t:[t]),i=[],l=[],s=[],c=[];a.forEach(function(e){u(e)&&i.push(e),o("WAWebFrontendMsgGetters").getAsDoc(e)&&s.push(e),o("WAWebMsgLinks").getGalleryLinks(e).length&&l.push(e),o("WAWebFrontendMsgGetters").getAsProduct(e)!=null&&c.push(e)});var d=r.mediaMsgs;if(d&&i.length){var m=babelHelpers.extends({},n,{silent:!1});d.add(i,m)}r.linkMsgs&&l.length&&r.linkMsgs.add(l,n),r.docMsgs&&s.length&&r.docMsgs.add(s,n),r.productMsgs&&c.length&&r.productMsgs.add(c,n)}}function d(e,t){var n=o("WAWebStateUtils").unproxy(e),a=new(r("WAWebChatMediaMsgsCollection")),i=n.getMediaMsgs().filter(o("WAWebMessageAssociationUIUtils").shouldDisplayOrphanMessage);if(t||a.add(i),!t||t.isViewOnce)return a;if((i.includes(t)||t.msgChunk===n.msgs)&&(a.add(i),a.hasMediaAfter=!1),!i.includes(t)){var l=t.msgChunk!=null?t.msgChunk.slice():[t],s=l.filter(o("WAWebMessageAssociationUIUtils").shouldDisplayOrphanMessage),c=o("WAWebCarouselMsgUtils").flattenMsgs(s);a.add(c.filter(u))}return a}function m(t,a){var i=o("WAWebStateUtils").unproxy(t);return i.promises.sendDelete!=null?(e||(e=n("Promise"))).resolve(0):(e||(e=n("Promise"))).all([i.getMediaMsgs(),i.getLinkMsgs(),i.getDocMsgs()].map(function(e){return e.count(i,a)})).then(function(e){return r("sumBy")(e,function(e){return e!=null?e:0})})}l.resetMediaMsgs=s,l.addMediaMsgs=c,l.constructMediaMsgs=d,l.countAllMedia=m}),98); __d("WAWebChatMediaMsgsCollection",["Promise","WAFilteredCatch","WALogger","WAWebBackendErrors","WAWebBaseCollection","WAWebCarouselMsgUtils","WAWebMessageAssociationUIUtils","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgModel","WAWebNoop","WAWebThreadMsgUtils","WAWebViewMode.flow","asyncToGeneratorRuntime","countWhere"],(function(t,n,r,o,a,i,l){var e,s,u={before:"before",after:"after"};function c(e){return o("WAWebMsgGetters").getIsMedia(e)&&!e.isViewOnce&&o("WAWebMessageAssociationUIUtils").shouldDisplayOrphanMessage(e)&&e.viewMode!==o("WAWebViewMode.flow").ViewModeType.HIDDEN}var d=(function(t){function a(){for(var a,i=arguments.length,l=new Array(i),s=0;s0&&l.length>0?1:0;return a.$ChatMediaMsgsCollection$p_1=m+l.length-p,a.$ChatMediaMsgsCollection$p_1}catch(n){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Failed to count medias for chat "," with error ",""])),t.id,n).verbose().sendLogs("md-failed-medias-count"),null}});return function(e,n){return t.apply(this,arguments)}})(),babelHelpers.assertThisInitialized(a)||babelHelpers.assertThisInitialized(a)}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.delete=function(){t.prototype.delete.call(this),this.stopListening()},i.add=function(n,r){return this.$ChatMediaMsgsCollection$p_1=null,t.prototype.add.call(this,n,r)},i.remove=function(n,r){return this.$ChatMediaMsgsCollection$p_1=null,t.prototype.remove.call(this,n,r)},i.getAfter=function(t){var e=this.indexOf(t);return e<0||e===this.length-1?null:this.at(e+1)},i.getBefore=function(t){var e=this.indexOf(t);return e<=0?null:this.at(e-1)},i.loadEarlierMedias=function(){var e=this.head();if(e){if(e.isCarouselCard){var t;e=(t=o("WAWebCarouselMsgUtils").getParentMsgFromCarouselCard(e))!=null?t:e}this.queryMedia({msg:e})}},i.loadRecentMedias=function(){var e=this.last();if(e){if(e.isCarouselCard){var t;e=(t=o("WAWebCarouselMsgUtils").getParentMsgFromCarouselCard(e))!=null?t:e}this.queryMedia({msg:e,direction:u.after})}},i.loadMoreAroundIfNeeded=function(t){if(!(!t||t.isViewOnce)){var e=this.indexOf(t);e<20&&this.hasMediaBefore&&this.loadEarlierMedias(),this.length-e<20&&this.hasMediaAfter&&this.loadRecentMedias()}},i.queryMedia=function(t){var e,a=this,i=t.chat,l=t.msg,d=(e=t.direction)!=null?e:u.before;if(!l&&i){var p=i.msgs;if(!p||p.length===0)return this.hasMediaBefore=!1,new(s||(s=n("Promise")))(function(e){e({eof:!0})});this.add(p.filter(c),{at:0});var _=this.toArray();if(i.msgs.msgLoadState.noEarlierMsgs)return this.hasMediaBefore=!1,new(s||(s=n("Promise")))(function(e){e({eof:!0})});if(_.length<=2*o("WAWebMsgCollection").MEDIA_QUERY_LIMIT){var f=_.length===0?p.head():_[0];return this.queryMedia({chat:i,msg:f})}return new(s||(s=n("Promise")))(function(e){e({eof:!1})})}if(l&&d===u.before){if(this.queryMediaBefore)return this.queryMediaBefore;var g=0;return this.queryMediaBefore=o("WAWebMsgCollection").MsgCollection.queryMedia(l.id.remote,o("WAWebMsgCollection").MEDIA_QUERY_LIMIT,d,o("WAWebMsgGetters").getIsMedia(l)?l.id:void 0).then(function(e){var t=e.messages;(!t||t.length0&&(n=m(t)),a.add(n,{at:0}),g=n.length,{length:g}}).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").E404,r("WAWebNoop"))).finally(function(){a.queryMediaBefore=null,a.trigger("query_media_before",g)}),this.trigger("query_media_before",0),this.queryMediaBefore}else if(l&&d===u.after)return this.queryMediaAfter?this.queryMediaAfter:this.queryMediaAfter=o("WAWebMsgCollection").MsgCollection.queryMedia(l.id.remote,o("WAWebMsgCollection").MEDIA_QUERY_LIMIT,d,l.id).then(function(e){var t=e.messages;(!t||t.length0&&(n=m(t)),a.add(n),{length:n.length}}).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").E404,r("WAWebNoop"))).finally(function(){a.queryMediaAfter=null,a.trigger("query_media_after")})},a})(o("WAWebBaseCollection").BaseCollection);d.model=o("WAWebMsgModel").Msg,d.comparator=function(e,t){return e.t-t.t};function m(e){return o("WAWebCarouselMsgUtils").flattenMsgs(e).filter(c)}l.default=d}),98); __d("WAWebChatMessageSearch",["WANullthrows","WAWebChatAssignmentUtils","WAWebChatConstants","WAWebChatGetters","WAWebChatLoadMessages","WAWebChatMsgsCollection","WAWebChatSearchFilters","WAWebCollectionConstants","WAWebContactGetters","WAWebFrontendChatGetters","WAWebFrontendContactGetters","WAWebGroupType","WAWebMessageAssociation.flow","WAWebMsgCollection","WAWebMsgCountReporter","WAWebStateUtils","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWamEnumWebcQueryTriggerType","isEmptyObject"],(function(t,n,r,o,a,i,l){function e(e,t,n){var a,i,l,s=o("WAWebStateUtils").unproxy(e),u=o("WAWebMsgCollection").MsgCollection.get(t),c=t,d=n,m=(a=u)==null?void 0:a.parentMsgKey;m&&((i=u)==null?void 0:i.associationType)===o("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_ALBUM&&!o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.CHAT,(l=u)==null?void 0:l.viewMode)&&(u=o("WAWebMsgCollection").MsgCollection.get(m),c=m,d=u);var p=u?u.msgChunk:void 0,_=Math.trunc(o("WAWebCollectionConstants").PAGE_SIZE/3*2);if(!p||!p.msgLoadState.contextLoaded){var f;p||(p=new(o("WAWebChatMsgsCollection")).ChatMsgsCollection,s.msgChunks.push(p),u&&p.add(u));var g=u?u.id.clone():c.clone();g.count=_,g.serverId=(f=u)==null?void 0:f.serverId;var h=function(){if(u)return u.msgChunk;if(c!=null){var e=o("WAWebMsgCollection").MsgCollection.get(c);return e!=null&&e.msgChunk?e.msgChunk:p}return p},y=o("WAWebMsgCountReporter").newMessageQueryEvent(o("WAWebWamEnumWebcQueryTriggerType").WEBC_QUERY_TRIGGER_TYPE.SEARCH_RESULT_CLICK);o("WAWebChatLoadMessages").loadMsgsPromiseLoop(s,u,p,function(){return o("WAWebMsgCollection").MsgCollection.getContext(g,h)},"around",y,d==null).then(function(e){var t=h();t&&p&&t!==p&&s.notifyMsgCollectionMerge(t,p,t);var n=e[0],a=c?o("WAWebMsgCollection").MsgCollection.get(c):u;a&&Array.isArray(n)&&n.length<_&&(r("WANullthrows")(a.msgChunk).msgLoadState.noEarlierMsgs=s.endOfHistoryTransferType!==o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.INCOMPLETE,p&&a.msgChunk!==p&&(p.msgLoadState.noEarlierMsgs=s.endOfHistoryTransferType!==o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.INCOMPLETE))}).catch(function(){d&&(d.isQuotedMsgAvailable=!1)})}return{collection:p,msg:u,key:c,highlightMsg:!0}}function s(e,t,n,r){n===void 0&&(n=1);var a=o("WAWebStateUtils").unproxy(e);if(n===1){var i=a.ftsCache[t];if(i)return i;var l=o("WAWebMsgCollection").MsgCollection.search(t,n,r,a.id);a.ftsCache[t]=l;var s=function(){a.ftsCache[t]=null};return self.setTimeout(s,o("WAWebChatConstants").FTS_TTL),l.catch(s),l}return o("WAWebMsgCollection").MsgCollection.search(t,n,r,a.id)}function u(e){var t=o("WAWebStateUtils").unproxy(e);t.ftsCache={}}function c(e){return!!o("WAWebChatGetters").getHasUnread(e)&&!o("WAWebChatGetters").getIsBroadcast(e)||o("WAWebChatAssignmentUtils").canAssignChats()&&e.isAssignedToMe&&e.unopenedByAssignedAgent}function d(e,t){t===void 0&&(t={});var n=o("WAWebStateUtils").unproxy(e);if(r("isEmptyObject")(t))return!0;if(t.label)return n.labels!=null&&n.labels.includes(t.label);if(t.kind===o("WAWebChatSearchFilters").SearchFilters.UNREAD)return c(n);if(t.kind===o("WAWebChatSearchFilters").SearchFilters.FAVORITES)return n.isFavorite;if(t.kind===o("WAWebChatSearchFilters").SearchFilters.CONTACT)return o("WAWebFrontendContactGetters").getIsMyContact(n.contact)&&!o("WAWebContactGetters").getIsGroup(n.contact)&&!o("WAWebChatGetters").getIsBroadcast(n);if(t.kind===o("WAWebChatSearchFilters").SearchFilters.NON_CONTACT)return!o("WAWebFrontendContactGetters").getIsMyContact(n.contact)&&!o("WAWebContactGetters").getIsGroup(n.contact)&&!o("WAWebChatGetters").getIsBroadcast(n);if(t.kind===o("WAWebChatSearchFilters").SearchFilters.ASSIGNED_TO_YOU)return o("WAWebChatAssignmentUtils").canAssignChats()&&n.isAssignedToMe;if(t.kind===o("WAWebChatSearchFilters").SearchFilters.COMMUNITY){var a,i=(a=n.groupMetadata)==null?void 0:a.groupType;return o("WAWebContactGetters").getIsGroup(n.contact)&&(i===o("WAWebGroupType").GroupType.COMMUNITY||i===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP||i===o("WAWebGroupType").GroupType.LINKED_SUBGROUP||i===o("WAWebGroupType").GroupType.LINKED_GENERAL_GROUP)}var l=o("WAWebFrontendChatGetters").getKind(n);return l!=null&&t.kind===o("WAWebChatSearchFilters").SearchFilters.cast(l)}l.getSearchContext=e,l.fts=s,l.clearFtsCache=u,l.matchFilter=d}),98); __d("WAWebChatParticipantColor",["WALogger","WAMd5","WAWebContactGetters","WAWebLidMigrationUtils","WAWebStateUtils","WAWebUserPrefsGeneral","lodash"],(function(t,n,r,o,a,i,l){var e;function s(e){var t,n,r=o("WAWebStateUtils").unproxy(e);if(r.colors){var a=(t=(n=r.groupMetadata)==null?void 0:n.participants)!=null?t:[],i=r.colors,l=Array.from(new Set(Object.keys(i)).difference(new Set(a.map(function(e){return e.id.toString()}).map(o("WAMd5").md5))));l.forEach(function(e){delete i[e]}),l.length&&r.saveAssignedColorsDebounced()}}function u(e){var t=o("WAWebStateUtils").unproxy(e);return t.groupMetadata&&t.listenTo(t.groupMetadata.participants,"remove reset",s),o("WAWebUserPrefsGeneral").getGroupParticipantAssignedColor(t.id)}function c(e){if(e.isUser()){var t;return(t=o("WAWebLidMigrationUtils").toLid(e))!=null?t:e}return e}function d(e){var t=o("WAWebStateUtils").unproxy(e),n=t.colors;n&&o("WAWebUserPrefsGeneral").setGroupParticipantAssignedColor(t.id,n)}function m(t,n,a){var i=o("WAWebStateUtils").unproxy(t);if(o("WAWebContactGetters").getIsNewsletter(i))return 1;if(n==null)return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["received a null sender wid when getting assigned color-",""])),a).tags("messaging").sendLogs("unexpected null sender wid for getting assigned color"),1;var l=i.colors||(i.colors=u(i)),s,d=o("WAMd5").md5(c(n).toString());if(s=l[d])return s;var m={};r("lodash").forOwn(l,function(e,t){m[e]?m[e].push(t):m[e]=[t]});for(var p=Number.POSITIVE_INFINITY,_=17,f=1;f<=_;f++)if(m[f])m[f].length0)},i.set=function(n,r,o){return typeof n=="string"?(n==="muteExpiration"&&this.mute&&this.mute.setMute(r),n==="isAutoMuted"&&this.mute&&this.mute.setAutoMuted(r)):Object.prototype.hasOwnProperty.call(n,"muteExpiration")&&this.mute&&this.mute.setMute(n.muteExpiration,n.isAutoMuted),t.prototype.set.call(this,n,r,o),this},i.equals=function(t){return this.id.equals(t==null?void 0:t.id)},i.addPendingAction=function(t){var e=this,n=function(){e.decPending()};t.then(n,n),this.pendingAction++},i.decPending=function(){this.pendingAction>0?this.pendingAction--:(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["chat:onPendingActionUpdate pendingAction value is invalid"]))),this.pendingAction=0)},i.$ChatImpl$p_5=function(){if(o("WAWebFrontendChatGetters").getHasDraftMessage(this)){var e;this.draftMessageSortTs=(e=this.draftMessage)==null?void 0:e.timestamp}else this.draftMessageSortTs!=null&&(this.draftMessageSortTs=null)},i.$ChatImpl$p_4=function(){try{o("WAWebLidMigrationUtils").shouldHaveAccountLid(this.id)&&this.accountLid==null&&(o("WAWebLidMigrationUtils").logLidMetadata(),o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["created chat model without account_lid. isEmployee: ",", chat id: ",""])),o("WAWebCurrentUser").isEmployee(),this.id.toLogString()).sendLogs("chat-model-without-account-lid").tags("missing-lid"));var e=this.accountLid;if(e!=null&&!e.isLid()){var t=o("WAWebApiContact").getCurrentLid(e),n=t==null||!t.isLid();o("WAWebLidMigrationUtils").logLidMetadata(),o("WALogger").ERROR(d||(d=babelHelpers.taggedTemplateLiteralLoose(["created chat model with a non-Lid accountLid. Will logout. Chat id: ",", accountLid: ",", currentLid: ",""])),this.id.toLogString(),e.toLogString(),t==null?void 0:t.toLogString()).sendLogs(n?"account-lid-not-lid-unrecoverable":"account-lid-not-lid-recoverable").tags("account-lid-not-lid"),o("WAAsyncSleep").asyncSleep(5e3).then(function(){return o("WAWebSocketLogoutJob").socketLogout(o("WAWebLogoutReasonConstants").LogoutReason.ClientVersionOutdated)})}}catch(e){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["WAWebChatModel: failed to validate lid chat: ",""])),e)}},i.$ChatImpl$p_13=function(){var e=this;if(o("WAWebChatGetters").getIsGroup(this)&&this.active&&(this.squelch=r("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE,this.reactionSquelch=r("WAWebConstantsDeprecated").SQUELCH_RESET_VALUE,this.hasChatBeenOpened=!0),this.presence.chatActive=this.active,!this.active){this.$ChatImpl$p_5(),this.getCollection().sort(),this.deregisterExpiredViewOnceBulkMessages(this.msgs);var t=Array.from(this.$ChatImpl$p_1);o("WAWebDBEphemeralMessage").removeExpiredMessagesFromHistory(t).then(function(){var n=t.map(function(e){return e.id.toString()});n.length>0&&(o("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview(n),o("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(o("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(e.id.toString(),n)))}),this.$ChatImpl$p_1.forEach(function(t){e.$ChatImpl$p_1.delete(t),t.delete({skipUpdatingSortTime:!0,doNotResetLastReceived:!0})})}},i.$ChatImpl$p_10=function(){var e=this.getCollection();e.notSpam[this.id]=this.notSpam,this.isTrusted(),this.notSpam&&this.stopListening(this,"change:notSpam")},i.senderMsgCount=function(){return r("countWhere")(this.getAllMsgs(),function(e){return!o("WAWebMsgGetters").getIsSentByMe(e)&&!o("WAWebMsgGetters").getIsNotification(e)})},i.isCAGAdmin=function(){var e,t=(e=this.groupMetadata)==null?void 0:e.participants.iAmAdmin();return t!=null?t&&o("WAWebFrontendChatGetters").getIsCAG(this):!1},i.hasMaybeSentMsgToChat=function(){return this.getAllMsgs().some(function(e){return o("WAWebMsgGetters").getIsSentByMe(e)})},i.isTrusted=function(){var e=!1;if(o("WAWebChatGetters").getIsGroup(this)){var t;e=this.isReadOnly||this.notSpam||((t=this.groupMetadata)==null?void 0:t.isTrusted())}else o("WAWebChatGetters").getIsBroadcast(this)||o("WAWebChatGetters").getIsNewsletter(this)?e=!0:o("WAWebChatGetters").getIsUser(this)&&(e=this.notSpam||o("WAWebFrontendContactGetters").getIsMyContact(this.contact));return e!==!0&&this.hasMaybeSentMsgToChat()&&(e=!0),o("WAWebChatGetters").getIsGroup(this)&&e!==this.trusted&&o("WAWebGroupSafetyCheckUtils").handleIsTrustedChangeForGroupSafety(this,!!e),this.trusted=!!e},i.isGroupSafetyChecked=function(){var e=!1;if(this.groupMetadata){var t;e=(t=this.groupMetadata)==null?void 0:t.groupSafetyCheck,e!==this.groupSafetyChecked&&o("WAWebGroupSafetyCheckUtils").handleGroupSafetyCheckStateUpdate(this,!!this.trusted,e)}return this.groupSafetyChecked=!!e},i.isSuspendedOrTerminated=function(){if(o("WAWebChatGetters").getIsGroup(this)){var e;return!!((e=this.groupMetadata)!=null&&e.isSuspendedOrTerminated())}else if(o("WAWebChatGetters").getIsNewsletter(this)){var t;return!!((t=this.newsletterMetadata)!=null&&t.isSuspendedOrTerminated)}return!1},i.isSuspended=function(){if(o("WAWebChatGetters").getIsGroup(this)){var e;return!!((e=this.groupMetadata)!=null&&e.suspended)}else if(o("WAWebChatGetters").getIsNewsletter(this)){var t;return!!((t=this.newsletterMetadata)!=null&&t.suspended)}return!1},i.canBlockFromNotification=function(){return o("WAWebABProps").getABPropConfigValue("block_from_notification")&&o("WAWebChatGetters").getIsUser(this)&&!this.isTrusted()},i.canToggleFavorite=function(){var e,t,n,r;return o("WAWebListsGatingUtils").isListsEnabled()||this.isFavorite?!0:(o("WAWebChatGetters").getIsGroup(this)&&((e=this.groupMetadata)==null?void 0:e.groupType)!==o("WAWebGroupType").GroupType.COMMUNITY&&((t=this.groupMetadata)==null?void 0:t.groupType)!==o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&((n=this.groupMetadata)==null?void 0:n.participants.iAmMember())&&!((r=this.groupMetadata)!=null&&r.isSuspendedOrTerminated())||o("WAWebFrontendChatGetters").getKind(this)===o("WAWebChatFlowTypes").ChatKindType.Chat&&o("WAWebFrontendContactGetters").getIsMyContact(this.contact)&&!o("WAWebContactGetters").getId(this.contact).isBot()&&!o("WAWebContactGetters").getIsMe(this.contact))&&this.trusted},i.title=function(){var e;return o("WAWebChatGetters").getIsGroup(this)?(e=this.formattedTitle)!=null?e:s._(/*BTDS*/"Asunto desconocido").toString():this.formattedTitle},i.getTcToken=function(){return this.tcToken==null||this.tcTokenTimestamp==null||o("WAWebTrustedContactsUtils").isTokenExpired(this.tcTokenTimestamp,o("WAWebTrustedContactsUtils").TcTokenMode.Receiver)?null:this.tcToken},i.shouldShowUnreadDivider=function(){return o("WAWebFrontendChatGetters").getShouldShowUnreadDivider(this)},i.delete=function(){t.prototype.delete.call(this),this.getCollection().remove(this.id),this.$ChatImpl$p_3.abort(),this.presence.delete(),o("WAWebCmd").Cmd.closeChat(this),this.groupMetadata&&this.groupMetadata.delete(),this.mediaMsgs&&this.mediaMsgs.delete(),this.linkMsgs&&this.linkMsgs.delete(),this.docMsgs&&this.docMsgs.delete(),this.productMsgs&&this.productMsgs.delete(),this.eventMsgs&&this.eventMsgs.delete();var e=this.starredMsgs;e&&(e.delete(),e.stopListening(),e.reset()),o("WAWebChatGetters").clearChatGetterCacheFor(this),o("WAWebFrontendChatGetters").clearFrontendChatGetterCacheFor(this)},i.isDirty=function(){return this.unreadCount!==0},i.canPin=function(){var e;if(this.archive)return!1;var t=((e=this.promises)==null||(e=e.setArchive)==null?void 0:e.archive)===!0;return!t},i.canArchive=function(){return!o("WAWebChatGetters").getIsBroadcast(this)},i.supportsChatLock=function(){return!0},i.hasUnreadEdit=function(){return this.unreadEditTimestampMs!=null},i.setComposeContents=function(t){var e,n=t.text;if(((e=t.text)==null?void 0:e.trim())===""){var r;n=(r=t.text)==null?void 0:r.trim()}var a={text:n,ctwaContext:t.ctwaContext,ctwaContextLinkData:t.ctwaContextLinkData,timestamp:t.timestamp,omittedUrl:t.omittedURL};o("WAWebUpdateDraftMessageChatAction").updateDraftMessageChat(this.id,a)},i.getComposeContents=function(){if(this.draftMessage){var e={timestamp:this.draftMessage.timestamp,text:this.draftMessage.text},t=this.draftMessage,n=t.ctwaContext,r=t.ctwaContextLinkData,o=t.omittedUrl;return o!=null&&(e.omittedURL=o),n!=null&&(e.ctwaContext=n),r!=null&&(e.ctwaContextLinkData=r),e}},i.setAttachMediaContents=function(t){this.attachMediaContents=t,this.draftAttachMediaContentsSortTs=t?o("WATimeUtils").unixTime():null},i.isComposingWithUnsavedChanges=function(){return this.isComposingPoll},i.isBusinessGroup=function(){var e,t=(e=this.groupMetadata)==null?void 0:e.participants.getAdmins();if(!t)return!1;for(var n of t){var r=o("WAWebContactCollection").ContactCollection.get(n.id);if(r!=null&&r.isBusiness)return!0}return!1},i.isCAG=function(){return o("WAWebFrontendChatGetters").getIsCAG(this)},i.preload=function(){this.msgs.length===1&&o("WAWebChatLoadMessages").loadEarlierMsgs(this).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").E404,r("WAWebNoop"))).catch(function(e){o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["chat:preload failed\n",""],["chat:preload failed\\n",""])),e)})},i.onEmptyMRM=function(){o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["models:Chat:removeMsg 0 messages left, querying..."]))),o("WAWebChatLoadMessages").loadEarlierMsgs(this).catch(o("WAFilteredCatch").filteredCatch(o("WAWebBackendErrors").E404,r("WAWebNoop"))).catch(function(e){o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["chat:onEmptyMRM failed\n",""],["chat:onEmptyMRM failed\\n",""])),e)})},i.deleteMsgs=function(t,n){this.deleteMsgsBeforeMsgInclusive(void 0,!t,n)},i.deleteMsgsBeforeMsgInclusive=function(t,n,a){n===void 0&&(n=!1);var e;if(!t)e=this.msgs.length;else if(this.msgs.get(t.id))e=this.msgs.indexOf(t);else return;var i=function(i,l,s){return!r("isStringNullOrEmpty")(a)&&!o("WAWebMsgModelUtils").msgMatchesType(i,a)||i.msgChunk===this.msgs&&l>e||n&&i.star||o("WAWebMsgGetters").getIsInitialE2ENotification(i)&&n};this.deleteMsgsPartial(i,!0)},i.deleteMsgsPartial=function(t,n){var e=this;n===void 0&&(n=!1);var a=this.unreadCount,i=[];this.getAllCMCs().forEach(function(r){var a=r.filter(function(n,r,o){return!t.apply(e,[n,r,o])});r.remove(a,void 0,n),i.push.apply(i,a),a.forEach(function(e){o("WAWebMsgGetters").getIsAuthenticationMessage(e)&&o("WAWebOTPLoggingHelper").logOTPMessageDeleted(o("WAWebMsgDataFromModel").msgDataFromMsgModel(e)),e.delete()})});var l=this.aiThreads;if(l!=null){var s=o("WAWebDecrementThreadUnreadCountsAction").getThreadUnreadDeltasFromMessages(i);o("WAWebDecrementThreadUnreadCountsAction").decrementThreadUnreadCountsAction(s,l)}if(r("lodash").clone(this.msgChunks).forEach(function(t){t.length===0&&e.removeMsgsCollection(t)}),this.msgs.length>0){var u=a>this.msgs.length?this.msgs.length:a;o("WAWebDBUpdateChatTable").updateChatTable(this.id,{unreadCount:u}).then(function(){e.unreadCount=u,e.msgs.msgLoadState.noEarlierMsgs=e.endOfHistoryTransferType!==o("WAWebChatConstants").ConversationEndOfHistoryTransferModelPropType.INCOMPLETE})}},i.deleteMessages=function(t){var e=function(n,r,o){return!t.includes(n.id.toString())};this.deleteMsgsPartial(e,!0),this.getAllMsgs().length===0&&o("WAWebChatLoadMessages").loadEarlierMsgs(this),o("WAWebLimitSharingModelUtils").createLimitSharingMsgOnChatClear(this.id)},i.getLastMsgKeyForAction=function(){var e=this.msgs.last(),t;return e&&(!this.lastReceivedKey||e.id.fromMe&&e.local&&e.ack===o("WAWebAck").ACK.CLOCK?t=e.id:t=this.lastReceivedKey),t||void 0},i.getWebcChatType=function(){var e=o("WAWebFrontendChatGetters").getKind(this);if(e!=null)switch(e){case o("WAWebChatFlowTypes").ChatKindType.Chat:return o("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.INDIVIDUAL;case o("WAWebChatFlowTypes").ChatKindType.Group:return o("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.GROUP;case o("WAWebChatFlowTypes").ChatKindType.Broadcast:return o("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.BROADCAST_LIST;case o("WAWebChatFlowTypes").ChatKindType.Newsletter:return o("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.NEWSLETTER;case o("WAWebChatFlowTypes").ChatKindType.Community:return o("WAWebWamEnumWebcChatType").WEBC_CHAT_TYPE.COMMUNITY}else throw new TypeError("Invalid Chat.kind "+String(e))},i.getMdChatAssignmentChatType=function(){return o("WAWebChatModelDerivedMethods").getMdChatAssignmentChatTypeFn(this)},i.getChatAssignmentChatType=function(){var e=o("WAWebFrontendChatGetters").getKind(this);if(e!=null)switch(e){case o("WAWebChatFlowTypes").ChatKindType.Chat:return o("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE.INDIVIDUAL;case o("WAWebChatFlowTypes").ChatKindType.Group:return o("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE.GROUP;case o("WAWebChatFlowTypes").ChatKindType.Broadcast:case o("WAWebChatFlowTypes").ChatKindType.Community:return o("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE.COMMUNITY;case o("WAWebChatFlowTypes").ChatKindType.Newsletter:return o("WAWebWamEnumChatAssignmentChatType").CHAT_ASSIGNMENT_CHAT_TYPE.CHANNEL}else throw new TypeError("Invalid Chat.kind "+String(e))},i.deregisterExpiredViewOnceBulkMessages=function(t){var e=this;t.forEach(function(t){return e.$ChatImpl$p_11(t)})},i.$ChatImpl$p_11=function(t){o("WAWebViewOnceState").isExpired(t.safe())&&(o("WAWebAppTracker").AppTracker.mark(o("WAWebAppTracker").AppTrackerType.PurgeViewOnce),o("WAWebMedia").deregisterMsg(t))},i.$ChatImpl$p_12=function(t){var e=this;r("WAWebAlarm").clearTimeout(this.$ChatImpl$p_2.get(t)),this.$ChatImpl$p_2.delete(t),this.$ChatImpl$p_1.delete(t);var a=o("WAWebMsgGetters").getEphemeralExpirationTimestamp(t);if(!(a==null||!this.msgs.includes(t)||o("WAWebMsgGetters").getIsKept(t))){var i=(function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){e.$ChatImpl$p_2.delete(t),e.active?e.$ChatImpl$p_1.add(t):(yield o("WAWebDBEphemeralMessage").removeExpiredMessagesFromHistory([t]),o("WAWebUpdateLastAddOnPreviewChatAction").deleteModelsForLastAddOnPreview([t.id.toString()]),yield o("WAWebPersistedJobManager").getJobManager().waitUntilPersisted(o("WAWebPersistedJobDefinitions").jobSerializers.deleteAddOns(e.id.toString(),[t.id.toString()])),t.delete({skipUpdatingSortTime:!0,doNotResetLastReceived:!0}))});return function(){return r.apply(this,arguments)}})();if(t.isExpired())i();else{var l=r("WAWebAlarm").setGlobalTimeout(function(){return void i()},a*1e3);this.$ChatImpl$p_2.set(t,l)}}},i.isUnreadMsg=function(t){var e=this.msgs.filter(function(e){return o("WAWebMsgGetters").getIsUnreadType(e)});return e.includes(t,e.length-this.unreadCount)},i.isActiveUnreadMsg=function(t){var e=this.msgs.filter(function(e){return o("WAWebMsgGetters").getIsUnreadType(e)});return e.includes(t,e.length-this.activeUnreadCount)},i.setCelebrationAnimationLastPlayed=function(){this.animationCandidateData&&this.celebrationAnimationLastPlayed0&&this.linkMsgs?this.linkMsgs.remove(t):o("WAWebFrontendMsgGetters").getAsDoc(t)&&this.docMsgs?this.docMsgs.remove(t):o("WAWebFrontendMsgGetters").getAsProduct(t)!=null&&this.productMsgs?this.productMsgs.remove(t):o("WAWebFrontendMsgGetters").getAsEventCreation(t)!=null&&this.eventMsgs&&this.eventMsgs.remove(t),o("WAWebMsgGetters").getIsKept(t)&&this.keptMsgs&&this.keptMsgs.remove(t),o("WAWebChatGetters").getIsGroup(o("WAWebFrontendMsgGetters").getChat(t))){var e;(e=o("WAWebFrontendMsgGetters").getChat(t).groupMetadata)==null||e.unreadMentionMetadata.removeUnreadMentions(t.id.toString())}},i.getMediaMsgs=function(){return this.mediaMsgs||(this.mediaMsgs=new(r("WAWebChatMediaMsgsCollection"))),this.mediaMsgs},i.getLinkMsgs=function(){return this.linkMsgs||(this.linkMsgs=new(r("WAWebChatLinkMsgsCollection"))),this.linkMsgs},i.getDocMsgs=function(){return this.docMsgs||(this.docMsgs=new(r("WAWebChatDocMsgsCollection"))),this.docMsgs},i.getEventMsgs=function(){return this.eventMsgs||(this.eventMsgs=new(o("WAWebEventMsgsCollection")).EventMsgsCollection(this)),this.eventMsgs},i.getParticipantCount=function(){var e;return((e=this.groupMetadata)==null?void 0:e.participants.length)||1},i.iAmAdmin=function(){return this.groupMetadata?this.groupMetadata.participants.iAmAdmin():!1},i.getProductMsgs=function(){return this.productMsgs||(this.productMsgs=new(r("WAWebChatProductMsgsCollection"))),this.productMsgs},i.getStarredMsgs=function(){var e=this,t=this.starredMsgs;return t||(this.starredMsgs=t=new(o("WAWebStarredMsgCollection")).StarredMsgCollection,this.starredMsgs.add(o("WAWebStarredMsgCollection").AllStarredMsgsCollection.filter(function(t){return o("WAWebFrontendMsgGetters").getChat(t)===e}))),t},i.getKeptMsgs=function(){var e=this.keptMsgs;return e||(this.keptMsgs=e=new(o("WAWebKeptMsgCollection")).KeptMsgCollection,this.keptMsgs.add(this.msgs.filter(function(e){return o("WAWebMsgGetters").getIsKept(e)}))),e},i.hasKeptMsgs=function(){return this.msgs.some(function(e){return o("WAWebMsgGetters").getIsKept(e)})},i.canSendPolls=function(){return o("WAWebChatModelDerivedMethods").canSendPolls(this)},i.canInvokeBot=function(){var e,t;return!(!o("WAWebBotGating").isBotEnabled()||o("WAWebChatGetters").getIsNewsletter(this)||o("WAWebContactGetters").getIsMe(this.contact)||o("WAWebFrontendChatGetters").getIsCapiHostedGroup(this)||this.id.isBot()||o("WAWebChatEphemerality").isEphemeralSettingOn(this)||((e=this.contact.businessProfile)==null?void 0:e.isBizBot3p)===!0||((t=this.contact.businessProfile)==null?void 0:t.isBizBot1p)===!0||o("WAWebTosGating").shouldBlockBotInvokeAsTosNotAvailable()||!o("WAWebMobilePlatforms").isSMB()&&this.contact.isBusiness)},i.getAbortController=function(){return this.$ChatImpl$p_3},i.getDeleteSignal=function(){return this.getAbortController().signal},i.getCollection=function(){return o("WAWebChatGetters").getIsNewsletter(this)?r("WAWebNewsletterCollection"):o("WAWebChatCollection").ChatCollection},i.getGroupMetadataCollection=function(){return r("WAWebGroupMetadataCollection")},i.getNewsletterMetadataCollection=function(){return r("WAWebNewsletterMetadataCollection")},i.getBroadcastMetadataCollection=function(){return r("WAWebBroadcastMetadataCollection")},i.updateBotInvokeSystemMsgCreated=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAWebDBUpdateChatTable").updateChatTable(this.id,{hasCreatedBotInvokeSystemMsg:!0}),this.hasCreatedBotInvokeSystemMsg=!0});function t(){return e.apply(this,arguments)}return t})(),i.updateBizBotSysMsgCreated=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){yield o("WAWebDBUpdateChatTable").updateChatTable(this.id,{bizBotSystemMsgType:e}),this.bizBotSystemMsgType=e});function t(t){return e.apply(this,arguments)}return t})(),i.supportsKIC=function(){return!(o("WAWebFrontendChatGetters").getIsCAG(this)&&!o("WAWebEphemeralKeepInChatAbpropUtils").isKeepInChatInCAGEnabled())},a})(r("WAWebSuperChatMsgs"));C.Proxy="chat",C.idClass=r("WAWebWid");var b=o("WAWebBaseModel").defineModel(C);l.Chat=b}),226); __d("WAWebChatModelDerivedMethods",["WAWebABProps","WAWebChatFlowTypes","WAWebChatGetters","WAWebChatGroupUtils","WAWebFrontendChatGetters","WAWebMsgType","WAWebNewsletterGatingUtils","WAWebPollsGatingUtils","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWamEnumMdChatAssignmentChatType"],(function(t,n,r,o,a,i,l){function e(e){var t=o("WAWebFrontendChatGetters").getKind(e);if(t!=null)switch(t){case o("WAWebChatFlowTypes").ChatKindType.Chat:return o("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.INDIVIDUAL;case o("WAWebChatFlowTypes").ChatKindType.Group:return o("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.GROUP;case o("WAWebChatFlowTypes").ChatKindType.Broadcast:return o("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.BROADCAST_LIST;case o("WAWebChatFlowTypes").ChatKindType.Newsletter:return o("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.CHANNEL;case o("WAWebChatFlowTypes").ChatKindType.Community:return o("WAWebWamEnumMdChatAssignmentChatType").MD_CHAT_ASSIGNMENT_CHAT_TYPE.COMMUNITY}else throw new TypeError("Invalid Chat.kind "+String(t))}function s(e){return e.type!==o("WAWebMsgType").MSG_TYPE.E2E_NOTIFICATION&&(e.type!==o("WAWebMsgType").MSG_TYPE.NOTIFICATION_TEMPLATE||e.subtype==="chat_assignment"||e.subtype==="chat_assignment_unassign"||e.subtype==="limit_sharing_system_message"||e.subtype==="change_username")&&e.type!==o("WAWebMsgType").MSG_TYPE.REACTION&&e.type!==o("WAWebMsgType").MSG_TYPE.POLL_UPDATE&&e.type!==o("WAWebMsgType").MSG_TYPE.KEEP_IN_CHAT&&e.subtype!=="newsletter_admin_context_card"&&e.subtype!=="newsletter_privacy"&&!e.pendingDeleteForMe&&e.botPluginReferenceIndex==null&&o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.CHAT_LIST,e.viewMode)}function u(e){if(o("WAWebChatGetters").getIsNewsletter(e))return o("WAWebNewsletterGatingUtils").isNewsletterPollsCreationEnabled();if(o("WAWebChatGetters").getIsBroadcast(e))return!1;var t=e.groupMetadata;return t==null?!0:o("WAWebFrontendChatGetters").getIsCAG(e)?o("WAWebChatGroupUtils").getGroupParticipantsCount(t)<=o("WAWebABProps").getABPropConfigValue("pnh_cag_disable_polls_group_size")&&o("WAWebPollsGatingUtils").isPollsCreationEnabledInCags():!0}l.getMdChatAssignmentChatTypeFn=e,l.isPreviewMessage=s,l.canSendPolls=u}),98); __d("WAWebChatMsgsCollectionComparator",[],(function(t,n,r,o,a,i){function e(e,t){return e.serverId==null||t.serverId==null?0:e.serverId-t.serverId}i.msgComparator=e}),66); __d("WAWebChatMsgsCollection",["invariant","WAWebBaseCollection","WAWebBaseModel","WAWebBizSystemMsgSubtypes","WAWebChatMsgsCollectionComparator","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgModel","WAWebViewModeUtils"],(function(t,n,r,o,a,i,l,s){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0){var p=o("WAWebMsgCollection").MsgCollection.add(i.filter(Boolean),r);p.forEach(function(e){e&&t.isModel(e)&&(e.msgChunk=t)}),this.trigger("bulk_add",i,r)}return i},n.remove=function(n,r,o){r===void 0&&(r={}),o===void 0&&(o=!1);var t=e.prototype.remove.call(this,n,r),a=r?r.silent:!1,i=t.filter(function(e){return!!e});return i.length&&a!==!0&&(this.trigger("remove_msgs",i,r),o||this.trigger("update_sort_time")),t},n.replace=function(t){var e=this;this.msgLoadState=t.msgLoadState,this.loadRecentPromise=t.loadRecentPromise,this.loadEarlierPromise=t.loadEarlierPromise,this.loadAroundPromise=t.loadAroundPromise;var n=t.getModelsArray();this.set(n,{silent:!0,merge:!1}),n.forEach(function(t){e.isModel(t)&&(t.msgChunk=e)}),this.trigger("bulk_add",n)},n.onMsgLoadStateChange=function(t){var e=this,n,r=function(){t()},o=function(){n!=null||s(0,56282),n.off("change",r);var o=e.msgLoadState;o.on("change",r),n=o,t()};n=this.msgLoadState,n.on("change",r),this.on("bulk_add",o);var a=function(){n!=null||s(0,56281),e.off("bulk_add",o),n.off("change",r)};return function(){var e=a;e&&(a=null,e())}},t})(o("WAWebBaseCollection").BaseCollection);c.model=o("WAWebMsgModel").Msg,c.comparator=o("WAWebChatMsgsCollectionComparator").msgComparator,l.ChatMsgsCollection=c}),98); __d("WAWebWallpaper",["fbt"],(function(t,n,r,o,a,i,l,s){var e="default_chat_wallpaper",u=-1,c="0.06",d="0.1",m="data-asset-chat-background-beige",p={"#BBE4E5":{doodle:"dark",opacity:"0.42",getColorName:function(){return s._(/*BTDS*/"Cruise")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Cruise, color hexadecimal: #BBE4E5, tono: verde")}},"#AED8C7":{doodle:"dark",opacity:"0.3",getColorName:function(){return s._(/*BTDS*/"Scandal")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Scandal, color hexadecimal: #AED8C7, tono: verde")}},"#7ACBA5":{doodle:"dark",opacity:"0.26",getColorName:function(){return s._(/*BTDS*/"Monte carlo")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Monte Carlo, color hexadecimal: #7ACBA5, tono: verde")}},"#CBDAEC":{doodle:"dark",opacity:"0.42",getColorName:function(){return s._(/*BTDS*/"Hawkes blue")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Hawkes Blue, color hexadecimal: #CBDAEC, tono: azul")}},"#66D2D5":{doodle:"dark",opacity:"0.26",getColorName:function(){return s._(/*BTDS*/"Downy")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Downy, color hexadecimal: #66D2D5, tono: verde")}},"#63BDCF":{doodle:"dark",opacity:"0.26",getColorName:function(){return s._(/*BTDS*/"Seagull")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Seagull, color hexadecimal: #63BDCF, tono: azul")}},"#D6D0F0":{doodle:"dark",opacity:"0.36",getColorName:function(){return s._(/*BTDS*/"Quartz")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Quartz, color hexadecimal: #D6D0F0, tono: blanco")}},"#CECECE":{doodle:"dark",opacity:"0.36",getColorName:function(){return s._(/*BTDS*/"Gris muy claro")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Very Light Grey, color hexadecimal: #CECECE, tono: gris")}},"#D1DABE":{doodle:"dark",opacity:"0.36",getColorName:function(){return s._(/*BTDS*/"Orinoco")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Orinoco, color hexadecimal: #D1DABE, tono: verde")}},"#E6E1B1":{doodle:"dark",opacity:"0.42",getColorName:function(){return s._(/*BTDS*/"Tusk")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Tusk, color hexadecimal: #E6E1B1, tono: verde")}},"#FEEFA9":{doodle:"light",opacity:"0.06",getColorName:function(){return s._(/*BTDS*/"Cape honey")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Cape Honey, color hexadecimal: #FEEFA9, tono: amarillo")}},"#FED297":{doodle:"dark",opacity:"0.42",getColorName:function(){return s._(/*BTDS*/"Caramel")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Caramel, color hexadecimal: #FED297, tono: amarillo")}},"#FD9A9B":{doodle:"dark",opacity:"0.26",getColorName:function(){return s._(/*BTDS*/"Rose bud")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Rose Bud, color hexadecimal: #FD9A9B, tono: rojo")}},"#FD6769":{doodle:"dark",opacity:"0.26",getColorName:function(){return s._(/*BTDS*/"Bittersweet")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Bittersweet, color hexadecimal: #FD6769, tono: naranja")}},"#FB4668":{doodle:"dark",opacity:"0.26",getColorName:function(){return s._(/*BTDS*/"Radical red")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Radical Red, color hexadecimal: #FB4668, tono: rojo")}},"#922040":{doodle:"dark",opacity:"0.17",invertTransparentWallpaperColors:!0,getColorName:function(){return s._(/*BTDS*/"Mandarian orange")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Mandarian Orange, color hexadecimal: #922040, tono: naranja")}},"#DC6E4F":{doodle:"dark",opacity:"0.2",getColorName:function(){return s._(/*BTDS*/"Flamingo")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Flamingo, color hexadecimal: #DC6E4F, tono: naranja")}},"#644D52":{doodle:"dark",opacity:"0.13",invertTransparentWallpaperColors:!0,getColorName:function(){return s._(/*BTDS*/"Buccaneer")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Buccaneer, color hexadecimal: #644D52, tono: rojo")}},"#517E7E":{doodle:"dark",opacity:"0.13",getColorName:function(){return s._(/*BTDS*/"Breaker bay")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Breaker Bay, color hexadecimal: #517E7E, tono: verde")}},"#3190BB":{doodle:"dark",opacity:"0.13",getColorName:function(){return s._(/*BTDS*/"Pelorous")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Pelorous, color hexadecimal: #3190BB, tono: azul")}},"#35558A":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0,getColorName:function(){return s._(/*BTDS*/"Tory blue")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Tory Blue, color hexadecimal: #35558A, tono: azul")}},"#55626F":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0,getColorName:function(){return s._(/*BTDS*/"Fiord")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Fiord, color hexadecimal: #55626F, tono: azul")}},"#1D2326":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0,getColorName:function(){return s._(/*BTDS*/"Cinder")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Cinder, color hexadecimal: #1D2326, tono: gris")}},"#301E34":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0,getColorName:function(){return s._(/*BTDS*/"Tolopea")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Tolopea, color hexadecimal: #301E34, tono: violeta")}},"#ECF0F1":{doodle:"light",opacity:"0.06",getColorName:function(){return s._(/*BTDS*/"Solitude")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Solitude, color hexadecimal: #ECF0F1, tono: azul")}},"#FFFEA2":{doodle:"light",opacity:"0.06",getColorName:function(){return s._(/*BTDS*/"Canary")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Canary, color hexadecimal: #FFFEA2, tono: amarillo")}},"#E7E8D2":{doodle:"light",opacity:"0.06",getColorName:function(){return s._(/*BTDS*/"Willow Brook")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Willow Brook, color hexadecimal: #E7E8D2, tono: verde")}}},_={"#0F2424":{doodle:"dark",opacity:"0.05",getColorName:function(){return s._(/*BTDS*/"Nordic")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Nordic, color hexadecimal: #0F2424, tono: azul")}},"#12261F":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Cardin green")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Cardin Green, color hexadecimal: #12261F, tono: verde")}},"#11241C":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Cardin green")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Cardin Green, color hexadecimal: #11241C, tono: verde")}},"#111E27":{doodle:"dark",opacity:"0.06",getColorName:function(){return s._(/*BTDS*/"Tangaroa")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Tangaroa, color hexadecimal: #111E27, tono: azul")}},"#0F2224":{doodle:"dark",opacity:"0.06",getColorName:function(){return s._(/*BTDS*/"Nordic")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Nordic, color hexadecimal: #0F2224, tono: azul")}},"#0E2125":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Tiber")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Tiber, color hexadecimal: #0E2125, tono: verde")}},"#1F1D25":{doodle:"dark",opacity:"0.06",getColorName:function(){return s._(/*BTDS*/"Black russian")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Black Russian, color hexadecimal: #1F1D25, tono: gris")}},"#212121":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Nero")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Nero, color hexadecimal: #212121, tono: gris")}},"#1F211C":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Marshland")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Marshland, color hexadecimal: #1F211C, tono: verde")}},"#23231B":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Maire")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Maire, color hexadecimal: #23231B, tono: amarillo")}},"#262419":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Black magic")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Black Magic, color hexadecimal: #262419, tono: marr\u00f3n")}},"#261F17":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Cocoa brown")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Cocoa Brown, color hexadecimal: #261F17, tono: marr\u00f3n")}},"#261717":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Wood Bark")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Wood Bark, color hexadecimal: #261717, tono: marr\u00f3n")}},"#260F10":{doodle:"dark",opacity:"0.06",getColorName:function(){return s._(/*BTDS*/"Seal brown")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Seal Brown, color hexadecimal: #260F10, tono: marr\u00f3n")}},"#260A10":{doodle:"dark",opacity:"0.07",getColorName:function(){return s._(/*BTDS*/"Seal brown")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Seal Brown, color hexadecimal: #260A10, tono: marr\u00f3n")}},"#19050B":{doodle:"dark",opacity:"0.075",getColorName:function(){return s._(/*BTDS*/"Seal brown")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Seal Brown, color hexadecimal: #19050B, tono: marr\u00f3n")}},"#21100C":{doodle:"dark",opacity:"0.07",getColorName:function(){return s._(/*BTDS*/"Seal brown")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Seal Brown, color hexadecimal: #21100C, tono: marr\u00f3n")}},"#0F0C0C":{doodle:"dark",opacity:"0.065",getColorName:function(){return s._(/*BTDS*/"Black")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Black, color hexadecimal: #0F0C0C, tono: negro")}},"#101919":{doodle:"dark",opacity:"0.06",getColorName:function(){return s._(/*BTDS*/"Black pearl")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Black Pearl, color hexadecimal: #101919, tono: azul")}},"#0A1D25":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Cyprus")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Cyprus, color hexadecimal: #0A1D25, tono: verde")}},"#0D1523":{doodle:"dark",opacity:"0.065",getColorName:function(){return s._(/*BTDS*/"Blue whale")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Blue Whale, color hexadecimal: #0D1523, tono: azul")}},"#0D0F11":{doodle:"dark",opacity:"0.07",getColorName:function(){return s._(/*BTDS*/"Black pearl")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Black Pearl, color hexadecimal: #0D0F11, tono: azul")}},"#0A0C0D":{doodle:"dark",opacity:"0.07",getColorName:function(){return s._(/*BTDS*/"Black pearl")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Black Pearl, color hexadecimal: #0A0C0D, tono: azul")}},"#110B12":{doodle:"dark",opacity:"0.07",getColorName:function(){return s._(/*BTDS*/"Tolopea")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Tolopea, color hexadecimal: #110B12, tono: violeta")}},"#1E1F1F":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Woodsmoke")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Woodsmoke, color hexadecimal: #1E1F1F, tono: gris")}},"#262618":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Black magic")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Black Magic, color hexadecimal: #262618, tono: marr\u00f3n")}},"#23231F":{doodle:"dark",opacity:"0.055",getColorName:function(){return s._(/*BTDS*/"Maire")},getAriaLabel:function(){return s._(/*BTDS*/"Color: Maire, color hexadecimal: #23231F, tono: amarillo")}}},f=Object.keys(p),g=Object.keys(_);function h(e){return e==="light"?f:g}function y(t,n){var r=h(n);if(t===e)return e;var o=r.findIndex(function(e){return e.toUpperCase()===t.toUpperCase()});return o!==-1?n==="light"?g[o]:f[o]:t}function C(e){if(e==null)return u;var t=f.findIndex(function(t){return t.toUpperCase()===e.toUpperCase()});return t!==-1?t:g.findIndex(function(t){return t.toUpperCase()===e.toUpperCase()})}function b(t,n){if(t===u)return e;var r=h(n),o=r.at(t);return o==null?e:o}function v(t,n){var r=h(n);return t===e?!0:r.some(function(e){return e.toUpperCase()===t.toUpperCase()})}function S(e,t,n){var r=t==="light"?p:_;for(var o in r)if(o.toUpperCase()===e.toUpperCase())return r[o][n];return null}function R(t,n){var r=S(t,n,"opacity");return r||(n==="light"&&t===e?d:c)}function L(t,n){var r;if(t===e)return n==="light"?s._(/*BTDS*/"Color: Beige, color hexadecimal: #F5F1EB, tono: beige"):s._(/*BTDS*/"Color: Black, color hexadecimal: #161717, tono: negro");var o=n==="light"?p:_,a=(r=o[t])==null||r.getAriaLabel==null?void 0:r.getAriaLabel();return a}function E(t,n){var r;if(t===e)return n==="light"?s._(/*BTDS*/"Beige"):s._(/*BTDS*/"Negro");var o=n==="light"?p:_,a=(r=o[t])==null?void 0:r.getColorName();return a}function k(t,n){if(n==="light"&&t!==e){var r=S(t,n,"doodle");if(r)return"data-asset-chat-background-"+r}var o="data-asset-chat-background-"+n;return n==="light"&&t===e&&(o=m),o}function I(t,n){return t==="light"&&n!==e?!!S(n,t,"invertTransparentWallpaperColors"):!1}l.DEFAULT_CHAT_WALLPAPER=e,l.getWallpaperColors=h,l.toggleWallpaperColor=y,l.getWallpaperId=C,l.getWallpaperColor=b,l.colorExistsInTheme=v,l.getWallpaperColorPropValue=S,l.getDoodleOpacity=R,l.getWallpaperColorAriaLabel=L,l.getWallpaperColorName=E,l.getDoodleAssetName=k,l.invertTransparentWallpaperColors=I}),226); __d("WAWebChatPreferenceCollection",["WANullthrows","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebChatPreferenceModel","WAWebUserPrefsKeys","WAWebWallpaper"],(function(t,n,r,o,a,i,l){var e={id:o("WAWebChatPreferenceModel").DEFAULT_PREFERENCE,wallpaper:o("WAWebWallpaper").DEFAULT_CHAT_WALLPAPER,saveToCameraRoll:!0,showDoodle:!0,spellcheck:!0,transformTextEmoji:!0,enterIsSend:!0,showExpandedComposer:!1,autoplayAnimatedImages:!0,hdMediaEnabled:!1},s=(function(t){function n(){return t.apply(this,arguments)||this}babelHelpers.inheritsLoose(n,t);var a=n.prototype;return a.initializeFromCache=function(n){var t=n||[];this.add([e].concat(t),{merge:!0})},a.get=function(n){return t.prototype.get.call(this,n)||t.prototype.get.call(this,o("WAWebChatPreferenceModel").DEFAULT_PREFERENCE)},a.getDefault=function(){return r("WANullthrows")(t.prototype.get.call(this,o("WAWebChatPreferenceModel").DEFAULT_PREFERENCE))},a.delete=function(){t.prototype.delete.call(this),this.add(e)},n})(o("WAWebBaseCollection").BaseCollection);s.model=o("WAWebChatPreferenceModel").ChatPreference,s.cachePolicy={id:o("WAWebUserPrefsKeys").COLLECTIONS_KEYS.CHAT_PREFERENCE_COLLECTION,policy:o("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:1e3};var u=new s;l.default=u}),98); __d("WAWebChatPreferenceModel",["WAWebBaseModel","WAWebChatPreferenceCollection","WAWebWid"],(function(t,n,r,o,a,i,l){var e="defaultPreference",s=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a=0;n--){var r=t.msgs.at(n);if(r&&(!r.local||r.ack>o("WAWebAck").ACK.CLOCK))return r}}function s(e){for(var t=o("WAWebStateUtils").unproxy(e),n=t.msgs.length-1;n>=0;n--){var r=t.msgs.at(n);if(r&&o("WAWebMsgDataUtils").eventTypeFromMsgType(r)!==o("WAWebCommonMsgUtils").EventType.IGNORE)return r}}function u(e){for(var t=o("WAWebStateUtils").unproxy(e),n=t.msgs.length-1;n>=0;n--){var r=t.msgs.at(n);if(r!=null&&o("WAWebMsgGetters").getIsSentByMe(r))return r}}l.getLastReceivedMsg=e,l.getLastTimestampMsg=s,l.getLastSentMsg=u}),98); __d("WAWebChatUpdates",["WAAbortError","WAPromiseDelays","WARaceSignal","WAWebChatGetMessage","WAWebChatLoadMessages","WAWebDBUpdateChatTable","WAWebNoop"],(function(t,n,r,o,a,i,l){function e(e){var t=Number(e.mute.expiration);o("WAWebDBUpdateChatTable").updateChatTable(e.id,{muteExpiration:t}).then(function(){return e.muteExpiration=t})}function s(e){var t,n=(t=e.mute.mentionAllMuteExpiration)!=null?t:0;e.mentionAllMuteExpiration!==n&&o("WAWebDBUpdateChatTable").updateChatTable(e.id,{mentionAllMuteExpiration:n}).then(function(){e.mentionAllMuteExpiration=n})}function u(e){if(!e.promises.updateSortTime){var t=new AbortController,n=t.signal,a=r("WARaceSignal")([n,e.getAbortController().signal],function(t){return o("WAPromiseDelays").releaseToMainThread().then(function(){var t=o("WAWebChatGetMessage").getLastTimestampMsg(e);if(t){e.t=t.t;return}else{if(e.msgs.msgLoadState.noEarlierMsgs)return;if(e.pendingMsgs)return}return o("WAWebChatLoadMessages").loadEarlierMsgs(e)}).then(function(n){if(t.aborted)throw new(o("WAAbortError")).AbortError;if(n){var r=o("WAWebChatGetMessage").getLastTimestampMsg(e);e.t=r?r.t:void 0}}).catch(r("WAWebNoop")).finally(function(){e.promises.updateSortTime=void 0})});e.promises.updateSortTime={promise:a,abortController:t}}}l.updateMuteExpiration=e,l.updateMentionAllMuteExpiration=s,l.updateSortTime=u}),98); __d("WAWebMuteCollection",["WALogger","WAWebABProps","WAWebBaseCachePolicy","WAWebBaseCollection","WAWebConnModel","WAWebMuteModel","WAWebUserPrefsKeys","WAWebUserPrefsNotifications","WAWebUserPrefsStore","gkx"],(function(t,n,r,o,a,i,l){var e,s;function u(e){throw new TypeError('"'+e+'" is read-only')}var c=!0,d=!0,m=!0,p=!1,_=!1,f=!1,g=!1,h=!1,y=!1,C=!1,b=!1,v=!0,S=!1,R=!1,L=!0,E=!1,k=!1,I=!0,T=(function(t){function n(){for(var e,n=arguments.length,r=new Array(n),o=0;o2e9&&o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:mute called with wrong units?"," exp:",""])),this.id.toString(),b);var v=function(){if(o("WAWebMuteGetters").getIsMuted(t)&&(r("WAWebAlarm").clearTimeout(t.$MuteImpl$p_1),t.unset("_unmuteTimer")),b===x)o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:mute "," muted, no expiration"])),t.id.toString());else{var e=b-r("WAWeb-moment")().unix();o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:mute "," duration:",""])),t.id.toString(),e),t.$MuteImpl$p_1=r("WAWebAlarm").setGlobalTimeout(function(){return void t.unmute()},b*1e3)}t.set({expiration:b,isAutoMuted:f})},S=P(this.id,p);if(g===!0){var R;if(!r("WAWebWid").isNewsletter(this.id)&&this.promises.mute!=null)return this.promises.mute;var L=r("WAWebWid").isNewsletter(this.id)?(R=this.promises.mute)!=null?R:(k||(k=n("Promise"))).reject(r("err")("No promise for newsletter mute")):this.promises.mute=o("WAWebChatMuteBridge").sendConversationMute(this.id,b,this.expiration,r("WAWebWid").isGroup(this.id)?this.mentionAllMuteExpiration:void 0),E=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Silenciando el chat\u2026"));S==="group"?E=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Silenciando grupo\u2026")):S==="newsletter"&&(E=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Silenciando el canal\u2026")));var I=C!=null?C:o("WAWebActionToast.react").genId(),T=this.promises.mute.catch(function(e){o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:mute dropped"])));var n=s._(/*BTDS*/"No se pudo silenciar el chat.");if(S==="group"?n=s._(/*BTDS*/"No se pudo silenciar el grupo."):S==="newsletter"&&(E=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo silenciar el canal"))),!r("WAWebWid").isNewsletter(t.id))throw new(o("WAWebActionToast.react")).ActionType(n,{actionText:s._(/*BTDS*/"Vuelve a intentarlo."),actionHandler:function(){return t.mute({expiration:b,isAutoMuted:f,sendDevice:g,toastId:I})}})}).then(function(e){if(e.status===200){var n=s._(/*BTDS*/"Chat silenciado");return S==="group"?n=s._(/*BTDS*/"Grupo silenciado"):S==="newsletter"&&(n=s._(/*BTDS*/"Se desactivaron las notificaciones.")),p?new(o("WAWebActionToast.react")).ActionType(n):new(o("WAWebActionToast.react")).ActionType(n,{actionText:s._(/*BTDS*/"Deshacer"),actionHandler:function(){return r("WAWebWid").isNewsletter(t.id)?o("WAWebNewsletterToggleAdminActivityMuteStateAction").toggleNewsletterAdminActivityMuteStateAction(t.id,o("WAWebNewsletterModelUtils").UNMUTED_STATE,{eventSurface:o("WAWebWamEnumChannelEventSurface").CHANNEL_EVENT_SURFACE.CHANNEL_PROFILE}):t.unmute({sendDevice:g,toastId:I})}})}else if(e.status>=400)throw S==="newsletter"?new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Error al silenciar el canal")):S==="group"?new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo silenciar el grupo.")):new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo silenciar el chat."))});return y&&o("WAWebToastManager").ToastManager.open(D.jsx(o("WAWebActionToast.react").ActionToast,{id:I,initialAction:E,pendingAction:T})),L.then(function(e){e.status===200&&v()}).finally(function(){t.promises.mute=null})}return v(),(k||(k=n("Promise"))).resolve()},i.muteCall=function(t){var e=this,a=t;if(!o("WATypeUtils").isNumber(a))return o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteCall called with invalid expiration ",""])),a),(k||(k=n("Promise"))).reject(new(o("WAWebMiscErrors")).ActionError);if(a=Math.round(a),a>2e9&&o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteCall called with wrong units?"," exp:",""])),this.id.toString(),a),o("WAWebMuteGetters").getIsCallMuted(this)&&(r("WAWebAlarm").clearTimeout(this.$MuteImpl$p_2),this.unset("_unmuteCallTimer")),a===x)o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteCall "," muted, no expiration"])),this.id.toString());else{var i=a-r("WAWeb-moment")().unix();o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteCall "," duration:",""])),this.id.toString(),i),this.$MuteImpl$p_2=r("WAWebAlarm").setGlobalTimeout(function(){return void e.unmuteCall()},a*1e3)}return this.set({callExpiration:a}),(k||(k=n("Promise"))).resolve()},i.canMute=function(){var e=!1;if(o("WAWebUserPrefsMeUser").isMeAccount(this.id))return!1;if(r("WAWebWid").isGroup(this.id)){var t=r("WAWebGroupMetadataCollection").get(this.id);t&&(e=t.participants.iAmMember())}if(o("WAWebNewsletterGatingUtils").isNewsletterEnabled()&&r("WAWebWid").isNewsletter(this.id)){var n=r("WAWebNewsletterMetadataCollection").get(this.id);n!=null&&(e=n.canBeMuted)}return e||r("WAWebWid").isUser(this.id)},i.$MuteImpl$p_3=function(){r("WAWebAlarm").clearTimeout(this.$MuteImpl$p_1),this.unset("_unmuteTimer"),this.expiration=0},i.$MuteImpl$p_4=function(){r("WAWebAlarm").clearTimeout(this.$MuteImpl$p_2),this.unset("_unmuteCallTimer"),this.callExpiration=0},i.unmute=function(t){var e=this,a=t===void 0?{}:t,i=a.fromMultiselect,l=i===void 0?!1:i,u=a.sendDevice,c=a.showToast,d=c===void 0?!0:c,m=a.toastId,p=!1,_=function(){o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:unmute ",""])),e.id.toString()),e.$MuteImpl$p_3(),e.set(babelHelpers.extends({isAutoMuted:p},r("WAWebWid").isGroup(e.id)&&{mentionAllMuteExpiration:0}))},f=P(this.id,l);if(u===!0){var g;if(!r("WAWebWid").isNewsletter(this.id)&&this.promises.unmute)return this.promises.unmute;var C=r("WAWebWid").isNewsletter(this.id)?(g=this.promises.unmute)!=null?g:(k||(k=n("Promise"))).reject(r("err")("No promise for newsletter mute")):this.promises.unmute=o("WAWebChatMuteBridge").sendConversationMute(this.id,0,this.expiration),b=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Desactivando el silencio en el chat\u2026"));f==="group"?b=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Desactivando el silencio del grupo\u2026")):f==="newsletter"&&(b=new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Desactivando el silencio del canal\u2026")));var v=m||o("WAWebActionToast.react").genId(),S=this.promises.unmute.catch(function(t){o("WALogger").WARN(y||(y=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:unmute dropped"])));var n=s._(/*BTDS*/"No se pudo desactivar el silencio en el chat.");if(f==="group"?n=s._(/*BTDS*/"No se pudo desactivar el silencio del grupo."):f==="newsletter"&&(n=s._(/*BTDS*/"No se pudo desactivar el silencio del canal.")),!r("WAWebWid").isNewsletter(e.id))throw new(o("WAWebActionToast.react")).ActionType(n,{actionText:s._(/*BTDS*/"Vuelve a intentarlo."),actionHandler:function(){return e.unmute({sendDevice:u,toastId:v})}})}).then(function(t){if(t.status===200)return f==="group"?new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Silencio desactivado")):f==="newsletter"?new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Se activaron las notificaciones."),{actionText:s._(/*BTDS*/"Deshacer"),actionHandler:function(){return o("WAWebNewsletterToggleAdminActivityMuteStateAction").toggleNewsletterAdminActivityMuteStateAction(e.id,o("WAWebNewsletterModelUtils").MUTED_STATE,{eventSurface:o("WAWebWamEnumChannelEventSurface").CHANNEL_EVENT_SURFACE.CHANNEL_THREAD})}}):new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Silencio desactivado"));if(t.status>=400)throw f==="newsletter"?new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"Error al desactivar el silencio del canal")):f==="group"?new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo desactivar el silencio del grupo.")):new(o("WAWebActionToast.react")).ActionType(s._(/*BTDS*/"No se pudo desactivar el silencio en el chat."))});return d&&o("WAWebToastManager").ToastManager.open(D.jsx(o("WAWebActionToast.react").ActionToast,{id:v,initialAction:b,pendingAction:S})),C.then(function(e){e.status===200&&_()}).finally(function(){e.promises.unmute=null})}return _(),(k||(k=n("Promise"))).resolve()},i.unmuteCall=function(){return o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:unmuteCall ",""])),this.id.toString()),this.$MuteImpl$p_4(),(k||(k=n("Promise"))).resolve()},i.muteMentionAll=function(t){var e,a=this;if(!r("WAWebWid").isGroup(this.id))return o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteMentionAll called on non-group chat ",""])),this.id.toString()),(k||(k=n("Promise"))).reject();var i=t;if(!o("WATypeUtils").isNumber(i))return o("WALogger").LOG(v||(v=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteMentionAll called with invalid expiration ",""])),i),(k||(k=n("Promise"))).reject();if(i=Math.round(i),i>2e9&&o("WALogger").LOG(S||(S=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteMentionAll called with wrong units?"," exp:",""])),this.id.toString(),i),i===x)o("WALogger").LOG(R||(R=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteMentionAll "," muted, no expiration"])),this.id.toString());else{var l=i-r("WAWeb-moment")().unix();o("WALogger").LOG(L||(L=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:muteMentionAll "," duration:",""])),this.id.toString(),l)}return this.promises.muteMentionAll?this.promises.muteMentionAll.then(r("WAWebNoop")):(this.promises.muteMentionAll=o("WAWebChatMuteBridge").sendConversationMute(this.id,(e=this.expiration)!=null?e:0,this.expiration,i),this.promises.muteMentionAll.then(function(e){e.status===200&&a.set({mentionAllMuteExpiration:i})}).finally(function(){a.promises.muteMentionAll=null}))},i.unmuteMentionAll=function(){var e,t=this;return o("WALogger").LOG(E||(E=babelHelpers.taggedTemplateLiteralLoose(["models:Mute:unmuteMentionAll ",""])),this.id.toString()),this.promises.unmuteMentionAll?this.promises.unmuteMentionAll.then(r("WAWebNoop")):(this.promises.unmuteMentionAll=o("WAWebChatMuteBridge").sendConversationMute(this.id,(e=this.expiration)!=null?e:0,this.expiration,0),this.promises.unmuteMentionAll.then(function(e){e.status===200&&t.set({mentionAllMuteExpiration:0})}).finally(function(){t.promises.unmuteMentionAll=null}))},i.getIsMentionAllMuted=function(){if(!r("WAWebWid").isGroup(this.id)||!o("WAWebMuteGetters").getIsMuted(this))return!1;var e=this.mentionAllMuteExpiration;return e==null||e===0?!1:e===x?!0:e>r("WAWeb-moment")().unix()},i.delete=function(){t.prototype.delete.call(this),this.getCollection().remove(this.id),this.$MuteImpl$p_3(),o("WAWebMuteGetters").clearMuteGetterCacheFor(this)},i.getCollection=function(){return o("WAWebMuteCollection").MuteCollection},a})(o("WAWebBaseModel").BaseModel);N.Proxy="mute",N.idClass=r("WAWebWid"),N.allowedIds=[$];var M=o("WAWebBaseModel").defineModel(N);l.GLOBAL_REACTIONS_MUTE=$,l.Mute=M}),226); __d("WAWebSuperChatMsgs",["WALogger","WAWebBaseModel","WAWebChatMsgsCollection","err","lodash"],(function(t,n,r,o,a,i,l){var e,s,u=(function(t){function n(){for(var e,n=arguments.length,r=new Array(n),a=0;a=d():!0}function p(){return o("WAWebABProps").getABPropConfigValue("wa_web_global_search_prefix_based")}l.isFuzzySearchEnabled=e,l.getFuzzySearchDistanceThreshold=s,l.getFuzzySearchTimeoutThreshold=u,l.isFuzzySearchSimilarityOptimizationEnabled=c,l.getMinimumFuzzySearchTermLength=d,l.canTermMeetFuzzySearchThreshold=m,l.isPrefixSearchEnabled=p}),98); __d("WAWebContactCollection",["Promise","WALogger","WATimeUtils","WAWebBaseCollection","WAWebContactComparator","WAWebContactGetters","WAWebContactModel","WAWebContactSearchGatingUtils","WAWebFrontendContactGetters","WAWebSocketConstants","WAWebSocketModel","WAWebUserPrefsMeUser","WAWebUsernameGatingUtils","WAWebWid","lodash"],(function(t,n,r,o,a,i,l){var e,s,u,c=(function(t){function a(){var e;return e=t.call(this)||this,e._sort=r("lodash").debounce(function(){return t.prototype.sort.call(e)},1e3),e._silentSort=r("lodash").debounce(function(){return t.prototype.sort.call(e,{silent:!0})},1e3),e.findImpl=function(t){var r=e.get(t);return r?(u||(u=n("Promise"))).resolve({id:r.id,stale:r.stale}):(u||(u=n("Promise"))).resolve({id:t})},e.listenTo(o("WAWebSocketModel").Socket,"change:stream",function(){o("WAWebSocketModel").Socket.stream===o("WAWebSocketConstants").SOCKET_STREAM.RESUMING&&e.forEach(function(e){e.unset("verificationString"),e.unset("verificationBinary")})}),e}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.sort=function(t){return this},i.ensureSorted=function(){this._sort.flush()},i.initializeFromCache=function(n){n&&(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Store:Contact init from cache"]))),this.add(n,{silent:!0,merge:!0}))},i.isFilteredContact=function(t){return!!t.name&&!o("WAWebContactGetters").getIsMe(t)&&!o("WAWebContactGetters").getIsPSA(t)&&o("WAWebContactGetters").getIsWAContact(t)},i.getFilteredContacts=function(t){var e=t.cancelAt,n=e===void 0?null:e,a=t.filterFn,i=a===void 0?null:a,l=t.showMe,s=l===void 0?!1:l,u=t.showWithoutName,c=u===void 0?!1:u,d=[];for(var m of this._models){if(n!=null&&d.length>=n){d=[];break}var p=o("WAWebUsernameGatingUtils").onlyShowLidContacts();if(!(p&&!m.id.isLid())){{if(!p&&m.id.isLid())continue;if(m.id.isBot())continue;if(r("WAWebWid").isPSA(m.id))continue;if(o("WAWebContactGetters").getIsMe(m)){if(s){if(i!=null&&i(m)!==!0)continue;d.push(m)}continue}}(!(m.name||c)||!o("WAWebContactGetters").getIsWAContact(m))&&!o("WAWebFrontendContactGetters").getIsUsernameContact(m)||m.isActive()&&(i!=null&&i(m)!==!0||d.push(m))}}return d.sort(o("WAWebContactComparator").ContactComparator)},i.searchContacts=function(t){var e=t.query,n=t.filter,r=n===void 0?{}:n,a=o("WAWebContactSearchGatingUtils").isPrefixSearchEnabled(),i=this.getFilteredContacts(babelHelpers.extends({},r,{filterFn:function(n){var t=a?n.searchMatchPrefix(e.text,e.number,e.label):n.searchMatchExact(e.text,e.number,e.label);return t?r.filterFn==null||r.filterFn(n):!1}}));if(i.length>0||!o("WAWebContactSearchGatingUtils").isFuzzySearchEnabled()||!o("WAWebContactSearchGatingUtils").canTermMeetFuzzySearchThreshold(e.text))return i;var l=o("WAWebContactSearchGatingUtils").getFuzzySearchTimeoutThreshold()*1e3,u=new(o("WATimeUtils")).MonotonicTimer,c=!1;return this.getFilteredContacts(babelHelpers.extends({},r,{filterFn:function(n){var t=u.elapsed();return c||t>l?(c||o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Fuzzy search timed out after ","ms (limit: ","ms). Returning partial results."])),t,l),c=!0,!1):n.searchMatchFuzzy(e.text)?r.filterFn==null||r.filterFn(n):!1}}))},i.getGroupContacts=function(){return this.filter(function(e){return o("WAWebContactGetters").getIsGroup(e)})},i.getMeContact=function(){var e=o("WAWebUserPrefsMeUser").getMaybeMePnUser();return e==null?null:this.get(e)},a})(o("WAWebBaseCollection").BaseCollection);c.model=r("WAWebContactModel"),c.comparator=o("WAWebContactComparator").ContactComparator;var d=new c;l.ContactCollectionImpl=c,l.ContactCollection=d}),98); __d("WAWebContactShortName",["WALogger","WAWebAlphaRegex","WAWebNonEmptyString"],(function(t,n,r,o,a,i,l){var e;function s(t){if(t==null)return null;var n=t.split(/\s/),a=n[0];return r("WAWebAlphaRegex").exec(a)?o("WAWebNonEmptyString").asMaybeNonEmptyString(a):(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[short-name] unable to get short name for contact"]))),null)}l.getShortName=s}),98); __d("WAWebFuzzySearchMatchResult",[],(function(t,n,r,o,a,i){var e=10,l=(function(){function t(e,t,n){this.startIndex=e,this.length=t,this.cost=n}var n=t.prototype;return n.isMatch=function(){return this.startIndex>=0},n.getSimilarityRating=function(){if(this.length===0)return 0;var e=1-this.cost/this.length;return Math.max(0,Math.min(1,e))},n.compareTo=function(t){return this.cost!==t.cost?this.cost-t.cost:this.startIndex!==t.startIndex?this.startIndex-t.startIndex:t.length-this.length},t.noMatch=function(){return new t(-1,0,e+1)},t})();i.MAX_ALLOWED_COST=e,i.WAWebFuzzySearchMatchResult=l}),66); __d("WAWebL10NIsWordSeparator",[],(function(t,n,r,o,a,i){function e(e){var t=e.charCodeAt(0),n=t>=48&&t<=57,r=t>=65&&t<=90,o=t>=97&&t<=122;return n||r||o?!1:t<=127?!0:!/(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])|(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDD40-\uDD49\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDED0-\uDEE3\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59\uDFF0-\uDFF9]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDDE0-\uDDE9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD818[\uDD30-\uDD39]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDD70-\uDD79\uDE80-\uDE96\uDFF4-\uDFF6]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9\uDDF1-\uDDFA]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/.test(e)}i.isWordSeparator=e}),66); __d("WAWebL10NRemoveDiacritics",["WAWebAccentDiacriticRegex","WAWebL10NHelpers"],(function(t,n,r,o,a,i,l){function e(e){return e===void 0&&(e=""),o("WAWebL10NHelpers").normalizeForm(e).replace(r("WAWebAccentDiacriticRegex"),"")}l.removeDiacritics=e}),98); __d("WAWebFuzzyMatcher",["WAWebFuzzySearchMatchResult","WAWebL10NIsWordSeparator","WAWebL10NRemoveDiacritics"],(function(t,n,r,o,a,i,l){var e=(function(){function e(e,t){this.length=e,this.cost=t}var t=e.prototype;return t.compareTo=function(t){return this.cost!==t.cost?this.cost-t.cost:t.length-this.length},t.plus=function(n,r){return new e(this.length+n,this.cost+r)},e})(),s=1,u=1,c=1,d=1,m=Object.freeze(new e(0,0));function p(e,t,n,r){return e[n].toLowerCase()===t[r].toLowerCase()?0:c}function _(t,n,r,a,i){for(var l=n.length,c=t.length,_=new Array(l+1).fill(m),f=new Array(l+1).fill(m),g=new Array(l+1).fill(m),h=new(o("WAWebFuzzySearchMatchResult")).WAWebFuzzySearchMatchResult(0,c,c),y=[m,m,m,m],C=0;C0&&b>0){var T=p(t,n,b,R-1)+p(t,n,b-1,R)+d;I=_[R-1].plus(2,T)}else I=new e(0,Number.MAX_SAFE_INTEGER);y[0]=L,y[1]=E,y[2]=k,y[3]=I,y.sort(function(e,t){return e.compareTo(t)}),g[R+1]=y[0]}var D=g[l],x=new(o("WAWebFuzzySearchMatchResult")).WAWebFuzzySearchMatchResult(b-D.length+1,D.length,D.cost);x.compareTo(h)<0&&(h=x);var $=_;_=f,f=g,g=$}return h.cost<=r?h:o("WAWebFuzzySearchMatchResult").WAWebFuzzySearchMatchResult.noMatch()}function f(e,t,n,r,a,i){if(n===void 0&&(n=0),r===void 0&&(r=0),a===void 0&&(a=o("WAWebL10NRemoveDiacritics").removeDiacritics),i===void 0&&(i=o("WAWebL10NIsWordSeparator").isWordSeparator),e==null||e.trim()===""||t==null||t.trim()==="")return o("WAWebFuzzySearchMatchResult").WAWebFuzzySearchMatchResult.noMatch();var l=a(e),s=a(t);return _(l,s,n,r,i)}l.fuzzyMatch=f}),98); __d("WAWebContactModel",["fbt","WALogger","WATimeUtils","WAWebAlarm","WAWebApiContact","WAWebBaseModel","WAWebBizBusinessChangeAction","WAWebBizGatingUtils","WAWebBizLabelUtils","WAWebBlocklistCollection","WAWebBotGating","WAWebBotUtils","WAWebBusinessProfileCollection","WAWebConnModel","WAWebContactCollection","WAWebContactGetters","WAWebContactManagementGating","WAWebContactSearchGatingUtils","WAWebContactShortName","WAWebFrontendContactGetters","WAWebFuzzyMatcher","WAWebFuzzySearchMatchResult","WAWebL10N","WAWebL10NAccentFold","WAWebL10NIsWordSeparator","WAWebL10NRemoveDiacritics","WAWebListsGatingUtils","WAWebOptOutListCollection","WAWebProfilePicThumbCollection","WAWebTextStatusCollection","WAWebTextStatusGatingUtils","WAWebTextStatusUtils","WAWebUpdateTextStatusForContact","WAWebUsernameGatingUtils","WAWebWid","WAWebWidFactory","err","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l,s){var e,u,c=1e3,d=(function(t){function n(){for(var e,n=arguments.length,r=new Array(n),a=0;a0?this.pendingAction--:(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["contact:onPendingActionUpdate pendingAction value is invalid"]))),this.pendingAction=0)},a.updateContactBlocked=function(){if(this.id.isUser())if(o("WAWebBlocklistCollection").BlocklistCollection.get(this.id))this.isContactBlocked=!0;else if(this.id.isLid()&&this.phoneNumber!=null)this.isContactBlocked=o("WAWebBlocklistCollection").BlocklistCollection.get(this.phoneNumber)!=null;else{var e=o("WAWebApiContact").getAlternateUserWid(o("WAWebWidFactory").asUserWidOrThrow(this.id)),t=e!=null&&o("WAWebBlocklistCollection").BlocklistCollection.get(e)!=null;this.isContactBlocked=t}},a.updateContactOptedOutOfMarketingMessages=function(){if(this.id.isUser()){if(o("WAWebOptOutListCollection").OptOutListCollection.get(this.id))this.isContactOptedOut=!0;else if(this.id.isLid()&&this.phoneNumber!=null)this.isContactOptedOut=o("WAWebOptOutListCollection").OptOutListCollection.get(this.phoneNumber)!=null;else{var e=o("WAWebApiContact").getAlternateUserWid(o("WAWebWidFactory").asUserWidOrThrow(this.id)),t=e!=null&&o("WAWebOptOutListCollection").OptOutListCollection.get(e)!=null;this.isContactOptedOut=t}this.isContactOptedOut&&(this.isEverOptedOutOfMarketingMessages=!0)}},a.setIsMarketingMessageThread=function(t){this.isMarketingMessageThread=t},a.getIsMarketingMessageThread=function(){return this.isMarketingMessageThread},a.$Contact$p_2=function(){var e=o("WAWebFrontendContactGetters").getUsername(this);if(r("isStringNullOrEmpty")(e))return!1;var t=o("WAWebFrontendContactGetters").getSearchName(this);if(!r("isStringNullOrEmpty")(t))return!1;var n=o("WAWebFrontendContactGetters").getSearchVerifiedName(this);return r("isStringNullOrEmpty")(n)},a.$Contact$p_3=function(t){return t.slice(1).replace(/#.*/,"")},a.$Contact$p_4=function(t){if(r("isStringNullOrEmpty")(t)||this.$Contact$p_2())return!1;var e=o("WAWebContactGetters").getUserid(this);if(this.id.isLid()){if(e!=null){var n=o("WAWebWidFactory").asUserLidOrThrow(o("WAWebWidFactory").createUserWidOrThrow(e,"lid")),a=o("WAWebApiContact").getPhoneNumber(n);return a!=null&&a.toString().includes(t)}}else return e!=null&&e.includes(t);return!1},a.$Contact$p_5=function(t,n,r){return this.$Contact$p_6(t,n,r,function(e,t){return e.includes(t)})},a.$Contact$p_7=function(t,n,r){var e=o("WAWebL10NRemoveDiacritics").removeDiacritics(t).toLowerCase();return this.$Contact$p_6(t,n,r,function(t,n){var r=o("WAWebL10NRemoveDiacritics").removeDiacritics(t).toLowerCase(),a=0,i;do{if(i=r.indexOf(e,a),i!==-1&&(i===0||o("WAWebL10NIsWordSeparator").isWordSeparator(r[i-1])))return!0;a=i+1}while(i!==-1);return!1})},a.$Contact$p_6=function(t,n,a,i){var e=o("WAWebFrontendContactGetters").getSearchName(this);if((o("WAWebBizGatingUtils").canDisplayLabel()||o("WAWebListsGatingUtils").isListsEnabled())&&!r("isStringNullOrEmpty")(a)){var l,u=o("WAWebFrontendContactGetters").getUsername(this);return t&&!r("isStringNullOrEmpty")(e)&&!i(e,t)&&!r("isStringNullOrEmpty")(u)&&!i(u,t)?!1:!!((l=this.labels)!=null&&l.includes(a))}if(!t)return!1;if(!r("isStringNullOrEmpty")(e)&&i(e,t))return!0;var c=o("WAWebContactGetters").getUserid(this);if(!r("isStringNullOrEmpty")(c)&&c.includes(t)&&!this.$Contact$p_2()||this.$Contact$p_4(n))return!0;var d=o("WAWebFrontendContactGetters").getSearchVerifiedName(this);if(!r("isStringNullOrEmpty")(d)&&i(d,t)||this.pushname&&i(o("WAWebL10NAccentFold").accentFold(this.pushname),t))return!0;if(this.username!=null){var m=o("WAWebL10NAccentFold").accentFold(this.username);if(i(m,t)&&o("WAWebUsernameGatingUtils").usernameDisplayedEnabled())return!0}if(o("WAWebContactGetters").getIsMe(this)){var p=o("WAWebL10NAccentFold").accentFold(s._(/*BTDS*/"Yo").toString());if(i(p,t))return!0}return!1},a.$Contact$p_8=function(t,n,a){if(a<0||a>1)throw r("err")("similarityThreshold must be between 0.0 and 1.0, got: "+a);if(t.length===0)return!0;var e=o("WAWebFuzzyMatcher").fuzzyMatch(n,t,o("WAWebFuzzySearchMatchResult").MAX_ALLOWED_COST);return e.isMatch()?e.getSimilarityRating()>=a:!1},a.$Contact$p_9=function(t){var e=this,n=[o("WAWebFrontendContactGetters").getSearchName(this),o("WAWebFrontendContactGetters").getSearchVerifiedName(this),o("WAWebL10NAccentFold").accentFold(this.pushname)].concat(o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()&&this.username!=null?[o("WAWebL10NAccentFold").accentFold(this.username)]:[]).filter(Boolean);return n.some(function(n){return e.$Contact$p_8(t,n,1-o("WAWebContactSearchGatingUtils").getFuzzySearchDistanceThreshold())})},a.searchMatchPrefix=function(t,n,r){if(t.startsWith("@")&&o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()){var e=this.$Contact$p_3(t);return this.$Contact$p_7(e,n,r)||this.$Contact$p_7(t,n,r)}return this.$Contact$p_7(t,n,r)},a.searchMatchExact=function(t,n,r){if(t.startsWith("@")&&o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()){var e=this.$Contact$p_3(t);return this.$Contact$p_5(e,n,r)||this.$Contact$p_5(t,n,r)}return this.$Contact$p_5(t,n,r)},a.searchMatchFuzzy=function(t){if(t.startsWith("@")&&o("WAWebUsernameGatingUtils").usernameDisplayedEnabled()){var e=this.$Contact$p_3(t);return this.$Contact$p_9(e)||this.$Contact$p_9(t)}return this.$Contact$p_9(t)},a.set=function(n,r,a){var e=t.prototype.set.call(this,n,r,a);if(typeof n!="string"&&r!=null&&r.merge&&e){if(o("WAWebContactGetters").getIsPSA(e)||e.id.isBot())return e;!n.name&&e.name&&(e.unset("name"),e.unset("shortName")),!n.verifiedName&&e.verifiedName&&e.unset("verifiedName")}return e},a.getCollection=function(){return o("WAWebContactCollection").ContactCollection},a.setNotMyContact=function(){this.name&&(this.set("name",void 0),this.set("shortName",void 0),this.set("type","out")),this.set("isUsernameContact",!1)},a.getSyncToAddressbook=function(){var e;return o("WAWebContactManagementGating").contactManagementEnabled()?(e=this.syncToAddressbook)!=null?e:!0:!1},a.canToggleFavorite=function(){return o("WAWebListsGatingUtils").isListsEnabled()||this.isFavorite?!0:o("WAWebFrontendContactGetters").getIsMyContact(this)&&!this.id.isBot()&&!o("WAWebContactGetters").getIsMe(this)},n})(o("WAWebBaseModel").BaseModel);d.Proxy="contact",d.idClass=r("WAWebWid");var m=o("WAWebBaseModel").defineModel(d);l.default=m}),226); __d("WAWebDailyAggregatedStats",["$InternalEnum","WAWebBaseModel"],(function(t,n,r,o,a,i,l){var e=n("$InternalEnum")({NARRATIVE_APPEAR:1,DIALOG_APPEAR:2,DIALOG_SELECT:3}),s=1440*60*1e3,u=21*s,c=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;as&&this.remove(this.slice(s)))},a.delete=function(){t.prototype.delete.call(this),this.dirty=!1},a.increment=function(t){var e=o("WAWebEmoji").EmojiUtil.getSkinToneBase(t)||t;this.get(e)||this.add({id:e,weight:0}),this.forEach(function(t){t.id===e?t.weight+=1:t.weight*=.9}),this.dirty=!0},n})(o("WAWebBaseCollection").BaseCollection);u.cachePolicy={id:o("WAWebUserPrefsKeys").COLLECTIONS_KEYS.RECENT_EMOJI_COLLECTION,policy:o("WAWebBaseCachePolicy").CACHE_POLICY.LOAD,delay:2e3},u.comparator=function(e,t){return e.weight>t.weight?-1:1},u.model=r("WAWebRecentEmojiModel");var c=new u;l.RecentEmojiCollection=c}),98); __d("WAWebCommunityActivityModel",["$InternalEnum","WATimeUtils","WAWebBaseModel","WAWebModelUtils"],(function(t,n,r,o,a,i,l){var e=n("$InternalEnum").Mirrored(["SUB_GROUP_LINK","NEW_COMMUNITY"]),s=5*o("WATimeUtils").DAY_SECONDS,u=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;at})},a.syncActivityFor=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t,n=this,a=(t=o("WAWebUserPrefsMultiDevice").getCommunityTabLastSeenTimestamp())!=null?t:0,i=yield o("WAWebDBMessageStoreUtils").getMessagesBefore(e.toString(),function(e){return e.ta&&n.add({id:e.toString(),communityId:e,timestamp:l,type:o("WAWebCommunityActivityModel").ActivityTypeType.NEW_COMMUNITY})}}})});function t(t){return e.apply(this,arguments)}return t})(),a.addDeduppedSubgroupLink=function(t){var e=this,n=t.filter(function(t){return!e.some(function(e){var n;return(n=e.subgroupId)==null?void 0:n.equals(t.subgroupId)})});return this.add(n)},t})(o("WAWebBaseCollection").BaseCollection);e.model=o("WAWebCommunityActivityModel").CommunityActivity,e.comparator=function(e,t){return e.timestamp-t.timestamp};var u=new e;l.default=u}),226); __d("WAWebGroupMembershipApprovalRequestCollection",["WAWebCollection","WAWebGroupMembershipApprovalRequestModel"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){return e.apply(this,arguments)||this}return babelHelpers.inheritsLoose(t,e),t})(r("WAWebCollection"));e.model=r("WAWebGroupMembershipApprovalRequestModel"),e.comparator=function(e,t){return t.t-e.t},l.default=e}),98); __d("WAWebGroupMembershipApprovalRequestModel",["WAWebBaseModel","WAWebContactCollection","WAWebWid"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a0;var r=o("WAWebChatCollection").ChatCollection.get(t);return r?r.isReadOnly===!1:!1},i.$GroupMetadata$p_3=function(){this.groupType===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&!this.canSetDescription()&&(this.desc==null||this.desc==="")?this.displayedDesc=s._(/*BTDS*/"Recibe los avisos m\u00e1s recientes de quienes administran esta comunidad.").toString():this.displayedDesc=this.desc},i.$GroupMetadata$p_4=function(){o("WAWebUpdateSubgroupsCommunityAction").updateJoinedSubgroups(this),o("WAWebUpdateSubgroupsCommunityAction").updateUnjoinedSubgroups(this)},i.revokeGroupsV4AddInvite=function(r){var t=this;if(this.revokeGroupsV4AddInvitePromise)return this.revokeGroupsV4AddInvitePromise;var a=o("WAWebWidToJid").widToGroupJid(this.id),i=this.pendingParticipants,l=(u||(u=n("Promise"))).resolve();return l=o("WAWebInviteV4QueryGroupAction").revokeGroupInviteV4(r,a),this.revokeGroupsV4AddInvitePromise=l.then(function(e){return e.status>=200&&e.status<300&&i.remove(r),e.status}).catch(function(t){return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["models:groupMetadata:participantCollection:revokeGroupsV4AddInvite failed"]))),500}).finally(function(){t.revokeGroupsV4AddInvitePromise=null})},i.queryGroupsV4PendingInvite=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=this,t=yield o("WAWebInviteV4QueryGroupAction").getPendingParticipants(this.id,this.isLidAddressingMode===!0);t.forEach(function(t){e.pendingParticipants.add({id:o("WAWebWidFactory").createUserWidOrThrow(t)})})});function t(){return e.apply(this,arguments)}return t})(),i.getJoinedSubgroupsMetadata=function(){var e=this.getCollection();return r("compactMap")(this.joinedSubgroups,function(t){return e.get(t.toString())})},i.getJoinedSubgroupsChat=function(){return r("compactMap")(this.joinedSubgroups,function(e){return o("WAWebChatCollection").ChatCollection.get(e.toString())})},i.getUnjoinedSubgroupsMetadata=function(){var e=this.getUnjoinedCollection();return r("compactMap")(this.unjoinedSubgroups,function(t){return e.get(t.toString())})},i.getSubgroupsMetadata=function(){return[].concat(this.getJoinedSubgroupsMetadata(),this.getUnjoinedSubgroupsMetadata())},i.getSubgroupSuggestions=function(){var e=new Set;return this.subgroupSuggestions.filter(function(t){var n=t.groupId,r=t.isExistingGroup;return e.has(n.toString())?!1:e.add(n.toString())&&!(r&&!o("WAWebCommunityGatingUtils").memberSuggestedGroupsM3ReceiverEnabled())})},i.getParentGroupChat=function(){var e=this.parentGroup;if(e)return o("WAWebChatCollection").ChatCollection.get(e)},i.isParentGroupParticipant=function(){var e=this.parentGroup;if(!e)return!1;var t=this.getCollection().get(e);return!!(t!=null&&t.joinedSubgroups.length)},i.getUnjoinedCollection=function(){return r("WAWebUnjoinedSubgroupMetadataCollection")},i.getCollection=function(){return r("WAWebGroupMetadataCollection")},a})(o("WAWebBaseModel").BaseModel);d.Proxy="groupMetadata",d.idClass=r("WAWebWid"),d.UPDATE_NAME_MAP_DEBOUNCE_TIME=200;var m=o("WAWebBaseModel").defineModel(d);l.default=m}),226); __d("WAWebGroupParticipantComparator",["WAWebContactComparator"],(function(t,n,r,o,a,i,l){var e=function(t,n){return o("WAWebContactComparator").ContactComparator(t.contact,n.contact)},s=e;l.default=s}),98); __d("WAWebGroupParticipantCollection",["WAWebApiContact","WAWebBotGroupGatingUtils","WAWebChatCollection","WAWebCollection","WAWebContactCollection","WAWebFrontendContactGetters","WAWebGroupMetadataCollection","WAWebGroupParticipantComparator","WAWebGroupParticipantModel","WAWebGroupType","WAWebHostedGroupUtils","WAWebL10N","WAWebProfilePicPrivacyTokenGating","WAWebSchemaGroupMetadata","WAWebSendForNeededAddRequest","WAWebUpdateSubgroupsCommunityAction","WAWebUserPrefsMeUser","WAWebWidFactory","lodash"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(t,n){var a;return n===void 0&&(n={}),a=e.call(this,t,n)||this,a.$ParticipantCollection$p_2=function(e,t,n){a.$ParticipantCollection$p_3(e),o("WAWebProfilePicPrivacyTokenGating").isProfilePicIQPrivacyTokenEnabled()&&n.add===!0&&a.$ParticipantCollection$p_4(e)},a.$ParticipantCollection$p_4=function(e){if(o("WAWebProfilePicPrivacyTokenGating").isProfilePicIQPrivacyTokenEnabled()&&a.iAmMember()){var t=o("WAWebChatCollection").ChatCollection.get(a.parent.id);t&&(t==null?void 0:t.tcToken)==null&&(e==null||e.contact.set({maybeCommonGroupChatModel:t},{isSilent:!0}))}},a.$ParticipantCollection$p_3=function(e){var t,n;if(!(!e||!o("WAWebUserPrefsMeUser").isMeAccount(e.id))){var r=a.parent.id,i=r?(t=o("WAWebChatCollection").ChatCollection.get(r.toString()))==null?void 0:t.groupMetadata:null,l=i==null||(n=i.getParentGroupChat())==null?void 0:n.groupMetadata;l!=null&&(a.iAmMember()?o("WAWebUpdateSubgroupsCommunityAction").subgroupUnjoinedToJoined(l,r):o("WAWebUpdateSubgroupsCommunityAction").subgroupJoinedToUnjoined(l,r))}},a.$ParticipantCollection$p_1=r("lodash").debounce(function(){return a.sort()},1e3),a.sendForNeededAddRequest=function(e){var t,n,r,i=a.getChat(),l=a.getGroupMetadata(),s=(t=l==null?void 0:l.desc)!=null?t:"",u=(n=(r=i==null?void 0:i.formattedTitle)!=null?r:i==null?void 0:i.name)!=null?n:"";o("WAWebSendForNeededAddRequest").sendForNeededAddRequest({participants:e,gid:o("WAWebWidFactory").asGroupWidOrThrow(a.parent.id)},u,s)},a.listenTo(a,"change:contact.name",a.$ParticipantCollection$p_1),a.listenTo(r("WAWebL10N"),"locale_change",a.$ParticipantCollection$p_1),a.listenTo(a,"add remove",a.$ParticipantCollection$p_2),a}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.delete=function(){this.forEach(function(e){e.delete()}),this.stopListening(),this.reset()},n.ensureSorted=function(){this.$ParticipantCollection$p_1.flush()},n.set=function(n,r){var t=r||{};t.isParticipantCollectionAdd!==!0&&(t=babelHelpers.extends({},t,{remove:!0}));var o=e.prototype.set.call(this,n,t);return this.trigger("bulk_add",o),t.remove===!0&&this.trigger("bulk_remove",o),o},n.add=function(n,r){var t=r||{};t=babelHelpers.extends({},t,{isParticipantCollectionAdd:!0});var o=e.prototype.add.call(this,n,t);return this.trigger("bulk_add",o),o},n.remove=function(n,r){var t=r||{},o=e.prototype.remove.call(this,n,t);return this.trigger("bulk_remove",o),o},n.canAdd=function(){if(this.iAmAdmin())return!0;var e=this.getGroupMetadata();return this.iAmMember()&&(e==null?void 0:e.memberAddMode)===o("WAWebSchemaGroupMetadata").MemberAddMode.ALL_MEMBER_ADD},n.canTransferOwnership=function(t){if(o("WAWebUserPrefsMeUser").isMeAccount(t.id)||!this.iAmSuperAdmin()||!t.isAdmin)return!1;var e=this.getGroupMetadata();return(e==null?void 0:e.groupType)===o("WAWebGroupType").GroupType.COMMUNITY},n.canPromote=function(t){var e;if(!t||o("WAWebUserPrefsMeUser").isMeAccount(t.id)||!this.iAmAdmin()||t.isAdmin)return!1;var n=this.getGroupMetadata();return!(n!=null&&n.isCag||o("WAWebBotGroupGatingUtils").isOpenGroupBotParticipantAddEnabled()&&(e=t.id)!=null&&e.isBot())},n.canDemote=function(t){if(!t||!this.iAmAdmin())return!1;var e=this.getGroupMetadata();if((e==null?void 0:e.groupType)!==o("WAWebGroupType").GroupType.COMMUNITY&&(e==null?void 0:e.groupType)!==o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP&&o("WAWebUserPrefsMeUser").isMeAccount(t.id))return!1;var n=t.isSuperAdmin;return n?(e==null?void 0:e.groupType)===o("WAWebGroupType").GroupType.COMMUNITY||(e==null?void 0:e.groupType)===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP?o("WAWebUserPrefsMeUser").isMeAccount(t.id):!1:!(!t.isAdmin||(e==null?void 0:e.groupType)===o("WAWebGroupType").GroupType.LINKED_ANNOUNCEMENT_GROUP)},n.canRemove=function(t){if(!t||o("WAWebUserPrefsMeUser").isMeAccount(t.id)||!this.iAmAdmin())return!1;var e=this.getGroupMetadata();return!(e!=null&&e.isCag&&(t.isAdmin||t.isSuperAdmin))},n.canVerifyIdentity=function(t){var e,n;if(!t||o("WAWebUserPrefsMeUser").isMeAccount(t.id))return!1;var r=this.getGroupMetadata();return!(o("WAWebHostedGroupUtils").isWAHostedGroupEnabled()&&(r==null?void 0:r.hasCapi)===!0&&t.id.toString()===(r==null||(e=r.owner)==null?void 0:e.toString())||o("WAWebBotGroupGatingUtils").isOpenGroupBotParticipantAddEnabled()&&(n=t.id)!=null&&n.isBot())},n.userIsMember=function(t){return this.isParticipantWidOrAlternateWidValid(t,function(e){return e!=null})},n.userIsAdmin=function(t){return this.isParticipantWidOrAlternateWidValid(t,function(e){return(e==null?void 0:e.isAdmin)===!0})},n.userIsSuperAdmin=function(t){return this.isParticipantWidOrAlternateWidValid(t,function(e){return(e==null?void 0:e.isSuperAdmin)===!0})},n.isParticipantWidOrAlternateWidValid=function(t,n){var e=this.get(t);if(n(e))return!0;var r=o("WAWebApiContact").getAlternateUserWid(o("WAWebWidFactory").asUserWidOrThrow(t)),a=r?this.get(r):null;return n(a)},n.iAmMember=function(){var e=this.getMeParticipant();return!!e},n.iAmRestrictedMember=function(){var e=this.getGroupMetadata(),t=(e==null?void 0:e.restrict)===!0;return t&&!this.iAmAdmin()},n.iAmAdmin=function(){var e=this.getMeParticipant();return(e==null?void 0:e.isAdmin)===!0},n.iAmSuperAdmin=function(){var e=this.getMeParticipant();return(e==null?void 0:e.isSuperAdmin)===!0},n.getAdmins=function(){return this.where({isAdmin:!0})},n.getSuperAdmin=function(){return this.findFirst(function(e){return e.isSuperAdmin})},n.getMyContacts=function(){return this.filter(function(e){var t=o("WAWebContactCollection").ContactCollection.get(e.id);return t!=null&&o("WAWebFrontendContactGetters").getIsMyContact(t)})},n.getMeParticipant=function(){var e;return(e=this.get(o("WAWebUserPrefsMeUser").getMePnUserOrThrow()))!=null?e:this.get(o("WAWebUserPrefsMeUser").getMeLidUserOrThrow())},n.getChat=function(){var e=this.parent.id;return o("WAWebChatCollection").ChatCollection.get(e)},n.getGroupMetadata=function(){var e=this.parent.id;return r("WAWebGroupMetadataCollection").get(e)},t})(r("WAWebCollection"));e.model=r("WAWebGroupParticipantModel"),e.comparator=r("WAWebGroupParticipantComparator"),l.default=e}),98); __d("WAWebGroupParticipantModel",["WAWebBaseModel","WAWebContactCollection","WAWebWid"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;ao("WATimeUtils").WEEK_SECONDS?null:t.reduce(function(e,t){if(typeof t!="string")return e;var n=o("WAWebCountriesUtils").asISOCountryCode(t);return n!=null&&e.add(n),e},new Set)}l.setMusicEligibleCountries=e,l.getMusicEligibleCountries=s}),98); __d("WAWebMusicEligibleCountriesProvider",["JSResourceForInteraction","WALogger","WAWebCountriesUtils","WAWebMusicGatingUtils","WAWebMusicUserPrefs","compactMap"],(function(t,n,r,o,a,i,l){"use strict";var e,s=r("JSResourceForInteraction")("WAWebFetchMusicEligibleCountries").__setRef("WAWebMusicEligibleCountriesProvider");function u(){if(!o("WAWebMusicGatingUtils").isStatusMusicReceiverEnabled())return new Set;var t=o("WAWebMusicUserPrefs").getMusicEligibleCountries();return t!=null?t:(s.load().then(function(e){return e.fetchMusicEligibleCountries()}).then(o("WAWebMusicUserPrefs").setMusicEligibleCountries).catch(function(t){return o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Failed to fetch music eligible countries"])))}),c())}var c=function(){return new Set(r("compactMap")(["AS","AU","GU","MP","NZ","PR","US","GB","FR","DE","SE","IT","MX","PT","CZ","BE","CH","LI","ES","IE","LU","MC","GP","GF","RE","YT","MQ","CY","GI","MT","DZ","BF","EG","GH","KE","LS","MW","MA","NA","NG","ZA","SZ","TZ","TN","UG","ZM","ZW","VN","ID","MY","AR","BR","RO","NL","DK","FI","NO","IS","CO","CL","PE","UY","PY","VE","VI","EC","BO","HN","CR","DO","PA","NI","GT","SV","SK","AL","AM","GE","LV","CM","CV","GN","ML","RW","SN","SC","CA","TR","JP","HR","IN","AT","LT","EE","RS","BA","ME","MK","IL","KR","BG","TH","SA","AE","IQ","JO","KW","LB","LY","OM","PS","QA","TJ","YE","IM","JE","GG","AF","BD","KH","LK","NP","PK","RU","KG","UZ","TM","XK","SM","VA","LA","PL","SG","PH","KZ","MN","CX","CC","HM","NF","SB","VU","FJ","FM","NR","PW","KI","WS","TV","CK","TK","TO","NU","JM","TT","AI","AG","AW","BB","BZ","BM","BS","CW","DM","FK","GS","GY","GD","KY","MS","KN","LC","VC","SX","TC","SR","HK","MO","TW","UA","TF","AO","TG","BW","BJ","IO","MZ","SH","PF","WF","PG","MH","PN","BN","FO","SJ","HU","GR","BL","MF","PM","GL"],o("WAWebCountriesUtils").asISOCountryCode))};l.provideMusicEligibleCountries=u,l.getDefaultMusicEligibleCountries=c}),98); __d("WAWebMusicPlaybackUtils",["WAWebCountriesUtils","WAWebL10NCountryCodes","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l){"use strict";function e(e,t){var n=s();return n!=null&&t.has(n)&&!e.has(n)}function s(){var e=o("WAWebUserPrefsMeUser").getMaybeMePnUser();return e==null?null:o("WAWebCountriesUtils").asISOCountryCode(o("WAWebL10NCountryCodes").getCountryShortcodeByPhone(e.user))}function u(){var e=s();if(e==null)return null;switch(e){case"AC":return"SH";default:return e}}l.canPlaybackMusic=e,l.getUserCountryCode=s,l.getUserCountryCodeForSNAPL=u}),98); __d("WAWebMsgActionCapability",["WALogger","WANullthrows","WATimeUtils","WAWebABProps","WAWebAck","WAWebBizCoexGatingUtils","WAWebBizCtwaAGMUtils","WAWebBotGating","WAWebBotGenTypingIndicatorMsg","WAWebBotProfileCollection","WAWebBusinessHSMTypes","WAWebChatGetters","WAWebChatGroupUtils","WAWebCommonMsgSubtypeTypes","WAWebContactGetters","WAWebContactModel","WAWebDisplayType","WAWebFrontendChatGetters","WAWebFrontendMsgGetters","WAWebInteractiveMessagesNativeFlowName","WAWebMediaTypes","WAWebMessageAssociation.flow","WAWebMessageEditUtils","WAWebMiscGatingUtils","WAWebMobilePlatforms","WAWebMsgGetters","WAWebMsgLinks","WAWebMsgModel","WAWebMsgType","WAWebMusicEligibleCountriesProvider","WAWebMusicGatingUtils","WAWebMusicParsingUtils","WAWebMusicPlaybackUtils","WAWebNewsletterFutureProofUtils","WAWebNewsletterGatingUtils","WAWebNewsletterMembershipUtil","WAWebPinMsgGatingUtils","WAWebPollCreationUtils","WAWebProtobufsE2E.pb","WAWebQuestionsGatingUtils","WAWebRevokeMsgConstants","WAWebSpamUtils","WAWebStateUtils","WAWebUserPrefsMultiDevice","WAWebWid","cr:6009"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(e,t){return e.isWamoSub===!0&&!o("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(t)}function m(e){var t=e.ctwaContext;return(t==null?void 0:t.sourceApp)==="whatsapp"}function p(e,t){return!(o("WAWebChatGetters").getIsNewsletter(t)&&e.isWamoSub===!0&&!o("WAWebNewsletterMembershipUtil").iAmAdminOrOwner(t.newsletterMetadata)&&o("WAWebNewsletterGatingUtils").isWamoSubMessagesSupported())}function _(e,t){if(!C(e))return!1;if(t instanceof r("WAWebContactModel")||!o("WAWebChatGetters").getIsNewsletter(t))return!0;switch(e.type){case o("WAWebMsgType").MSG_TYPE.PTV:return o("WAWebNewsletterGatingUtils").isNewsletterPTVForwardingEnabled();case o("WAWebMsgType").MSG_TYPE.AUDIO:case o("WAWebMsgType").MSG_TYPE.PTT:return o("WAWebNewsletterGatingUtils").isNewsletterAudioFileSendingEnabled()||o("WAWebMsgGetters").getHasOriginatedFromNewsletter(e)}return o("WAWebNewsletterFutureProofUtils").isMsgTypeSupported(e.type)}function f(e,t,n){if(!e.isBot())return!0;var r=o("WAWebBotProfileCollection").BotProfileCollection.get(e);return(r==null?void 0:r.isDefault)!==!0?!1:y(t)}function g(e,t){return e.isNewsletter()?!0:t.hasMusicAnnotations!==!0}function h(e,t,n){n===void 0&&(n={});var r=e.id;return f(r,t,n)&&g(r,n)}function y(e){return e.length===1&&e[0].type===o("WAWebMsgType").MSG_TYPE.CHAT}function C(e){var t,n,a,i,l=o("WAWebStateUtils").unproxy(e);if(l.isCarouselCard||l.carouselCards||l.associationType===o("WAWebMessageAssociation.flow").MessageAssociationType.MEDIA_POLL)return!1;var s=o("WAWebFrontendMsgGetters").getMaybeChat(l);if(s!=null&&s.isSuspendedOrTerminated()&&o("WAWebMiscGatingUtils").isGroupSuspendV2Enabled())return!1;var u=s!=null&&o("WAWebChatGetters").getIsNewsletter(s);if(u&&(!o("WAWebNewsletterGatingUtils").isNewsletterMessageForwardSendingEnabled()||s!=null&&!p(l,s))||o("WAWebMsgGetters").getIsQuestion(l)&&!o("WAWebQuestionsGatingUtils").isQuestionForwardingEnabledForMsg(l)||o("WAWebMsgGetters").getQuestionReplyQuotedMessage(l)!=null&&!o("WAWebQuestionsGatingUtils").isQuestionReplyForwardingEnabledForMsg(l))return!1;switch(l.type){case o("WAWebMsgType").MSG_TYPE.CALL_LOG:case o("WAWebMsgType").MSG_TYPE.CIPHERTEXT:case o("WAWebMsgType").MSG_TYPE.DEBUG_PLACEHOLDER:case o("WAWebMsgType").MSG_TYPE.EVENT_CREATION:case o("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE:case o("WAWebMsgType").MSG_TYPE.NEWSLETTER_ADMIN_INVITE:case o("WAWebMsgType").MSG_TYPE.ORDER:case o("WAWebMsgType").MSG_TYPE.OVERSIZED:case o("WAWebMsgType").MSG_TYPE.PAYMENT:case o("WAWebMsgType").MSG_TYPE.QUARANTINED:case o("WAWebMsgType").MSG_TYPE.REQUEST_PHONE_NUMBER:case o("WAWebMsgType").MSG_TYPE.REVOKED:case o("WAWebMsgType").MSG_TYPE.RICH_RESPONSE:case o("WAWebMsgType").MSG_TYPE.UNKNOWN:return!1;case o("WAWebMsgType").MSG_TYPE.POLL_CREATION:return u&&l.pollContentType!==o("WAWebPollCreationUtils").PollContentType.IMAGE&&o("WAWebNewsletterGatingUtils").isNewsletterPollForwardingEnabled();case o("WAWebMsgType").MSG_TYPE.POLL_RESULT_SNAPSHOT:return o("WAWebNewsletterGatingUtils").isNewsletterPollForwardingEnabled();case o("WAWebMsgType").MSG_TYPE.LIST:return((t=l.list)==null?void 0:t.listType)===o("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST;case o("WAWebMsgType").MSG_TYPE.INTERACTIVE_RESPONSE:return(l==null?void 0:l.nativeFlowName)!==r("WAWebInteractiveMessagesNativeFlowName").CTA_FLOW}if(l.type===o("WAWebMsgType").MSG_TYPE.LOCATION&&l.isLive)return!1;if(l.type===o("WAWebMsgType").MSG_TYPE.INTERACTIVE){if(l.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").PAYMENT_REMINDER||l.nativeFlowName===r("WAWebInteractiveMessagesNativeFlowName").CTA_URL&&r("WAWebWid").isPSA(l.id.remote)&&o("WAWebABProps").getABPropConfigValue("web_chatpsa_forwarding"))return!0;if(l.nativeFlowName!=null)return!1}if(!l.interactiveButtonsReleased()||l.ack=o("WAWebAck").ACK.SENT:o("WAWebMsgGetters").getIsUserCreatedType(e)&&!(e.broadcast!=null&&e.broadcast)&&(e instanceof o("WAWebMsgModel").Msg&&!e.isUnsentPhoneMsg()||o("WAWebMsgGetters").getIsEdited(e))&&!o("WAWebFrontendMsgGetters").getIsUnsentMedia(e)&&!o("WAWebChatGroupUtils").isSuspendedGroup(o("WAWebFrontendMsgGetters").getCurrentChat(e))&&!o("WAWebChatGroupUtils").isTerminatedGroup(o("WAWebFrontendMsgGetters").getCurrentChat(e))}function O(e){var t=e;e instanceof o("WAWebMsgModel").Msg&&(t=o("WAWebStateUtils").unproxy(e));var n=o("WATimeUtils").unixTime()-o("WAWebMsgGetters").getT(t)<=o("WAWebRevokeMsgConstants").REVOKE_WINDOW;return F(t)&&t.id.fromMe&&n}function B(e){var t,n=e;e instanceof o("WAWebMsgModel").Msg&&(n=o("WAWebStateUtils").unproxy(e));var r=o("WAWebFrontendMsgGetters").getCurrentChat(n);if(o("WAWebChatGetters").getIsNewsletter(r))return N(n);var a=o("WATimeUtils").unixTime()-o("WAWebMsgGetters").getT(n)<=o("WAWebRevokeMsgConstants").REVOKE_WINDOW;return F(n)&&!n.id.fromMe&&!!((t=r.groupMetadata)!=null&&t.participants.iAmAdmin())&&a}function W(e){var t=e;e instanceof o("WAWebMsgModel").Msg&&(t=o("WAWebStateUtils").unproxy(e));var n=o("WAWebRevokeMsgConstants").REVOKE_WINDOW,r=o("WAWebMsgGetters").isMetaBotResponseToMyInvoke(t),a=o("WATimeUtils").unixTime()-o("WAWebMsgGetters").getT(t)<=n;return o("WAWebBotGating").isBotEnabled()&&F(t)&&a&&r}function q(e,t){var n=o("WAWebStateUtils").unproxy(e);if(o("WAWebFrontendMsgGetters").getChat(n).isSuspendedOrTerminated()&&o("WAWebMiscGatingUtils").isGroupSuspendV2Enabled())return!1;if(o("WAWebMsgGetters").getIsNewsletterMsg(n)&&n.type===o("WAWebMsgType").MSG_TYPE.VIDEO){var r,a=(r=o("WAWebMsgGetters").getFirstMusicAnnotation(n))==null||(r=r.embeddedContent)==null?void 0:r.embeddedMusic;if(a!=null){if(Number(a.overlapDurationInMs)>o("WAWebMusicGatingUtils").MAX_MUSIC_DOWNLOAD_EMBED_DURATION_MS)return!1;var i=o("WAWebMusicEligibleCountriesProvider").provideMusicEligibleCountries(),l=o("WAWebMusicParsingUtils").toMusicMetadata(a);if(l&&!o("WAWebMusicPlaybackUtils").canPlaybackMusic(l.countryBlocklist,i)||!o("WAWebMusicGatingUtils").isStatusMusicSaveToDiskEnabled())return!1}}return n.type===o("WAWebMsgType").MSG_TYPE.STICKER||n.type===o("WAWebMsgType").MSG_TYPE.STICKER_PACK||o("WAWebFrontendMsgGetters").getAsRevoked(n)||n.isViewOnce?!1:n.type===o("WAWebMsgType").MSG_TYPE.VCARD||n.type===o("WAWebMsgType").MSG_TYPE.MULTI_VCARD?!0:!(n.mediaData==null||t!==!0&&!n.mediaData.isDownloadable()||n.type===o("WAWebMsgType").MSG_TYPE.PTV&&!o("WAWebMsgGetters").getIsSentByMe(n)||!p(n,o("WAWebFrontendMsgGetters").getChat(n)))}function U(e){var t=o("WAWebFrontendMsgGetters").getChat(e);return!o("WAWebMobilePlatforms").isSMB()||o("WAWebChatGetters").getIsNewsletter(t)?!1:!o("WAWebFrontendMsgGetters").getAsRevoked(e)}function V(e){var t,n;return o("WAWebBizCtwaAGMUtils").isAutomatedGreetingMessage((t=e.ctwaContext)==null?void 0:t.sourceApp,e.type,(n=e.ctwaContext)==null?void 0:n.automatedGreetingMessageShown)?!1:!o("WAWebChatGetters").getIsNewsletter(o("WAWebFrontendMsgGetters").getChat(e))||N(e)}l.isWamoSubMsgAndNotAdminOrOwner=d,l.isWamoMsg=m,l.canWamoSubMsgBeSharedByUser=p,l.canForwardMsgToChat=_,l.allowedChatOrContactForForwarding=h,l.canForwardMsgToMetaAi=y,l.canForwardMsg=C,l.canQuickForwardMsg=b,l.canStarMsg=v,l.canPinMsg=S,l.canReportToAdmin=L,l.displayTypeSupportsEditing=I,l.canEnterEditingFlow=T,l.canEditText=D,l.canEditCaption=x,l.canReportMsg=$,l.isNewsletterMsgOnServer=P,l.canRevokeNewsletterMsg=N,l.canCopyNewsletterMessageLink=M,l.canAddPaidPartnershipLabelToMsg=w,l.canSenderRevokeMsg=O,l.canAdminRevokeMsg=B,l.canBotResponseBeRevokeByInvoker=W,l.canDownloadMsg=q,l.canAddLabelToMsg=U,l.canDeleteMsg=V}),98); __d("WAWebFtsConstants",[],(function(t,n,r,o,a,i){var e=6e4,l=300,s=30;i.FTS_TTL=e,i.FTS_TYPING_DELAY=l,i.FTS_NUM_RESULTS=s}),66); __d("WAWebMsgOpaqueData",["WAWebDBMsgOpaqueDataKeys","WAWebMsgKey","WAWebPollsDbUtils","WAWebProtobufsMdStorageMsgRowOpaqueData.pb","WAWebUserPrefsInfoStore","asyncToGeneratorRuntime","decodeProtobuf","encodeProtobuf"],(function(t,n,r,o,a,i,l){function e(e){return s.apply(this,arguments)}function s(){return s=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=o("WAWebUserPrefsInfoStore").waNoiseInfo.cachedPasscodeDerivedKey;if(t==null){location.reload();return}var n=m(e),r=new Uint8Array(16);self.crypto.getRandomValues(r);var a=yield self.crypto.subtle.encrypt({iv:r,name:"AES-GCM"},t,n);e.encryptedData={iv:r,data:a}}),s.apply(this,arguments)}function u(e,t){return c.apply(this,arguments)}function c(){return c=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n=e.encryptedData;if(n!=null){var r=yield self.crypto.subtle.decrypt({iv:n.iv,name:"AES-GCM"},t,n.data);d(e,r),e.encryptedData=null}}),c.apply(this,arguments)}function d(e,t){var n=o("decodeProtobuf").decodeProtobuf(o("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgRowOpaqueDataSpec,t),r=n.currentMsg,a=n.quotedMsg;r&&_(e,r),e.quotedMsg&&a&&_(e.quotedMsg,r),e.encryptedData=null}function m(e){var t={currentMsg:{},quotedMsg:{}};t.currentMsg=p(e),e.quotedMsg&&(t.quotedMsg=p(e.quotedMsg));var n=o("encodeProtobuf").encodeProtobuf(o("WAWebProtobufsMdStorageMsgRowOpaqueData.pb").MsgRowOpaqueDataSpec,t);return n.readBuffer()}var p=function(t){var e,n={};return(e=t.paymentNoteMsg)!=null&&e.body&&(n.paymentNoteMsgBody=t.paymentNoteMsg.body,t.paymentNoteMsg.body=void 0),o("WAWebDBMsgOpaqueDataKeys").MSG_OPAQUE_DATA_KEYS.forEach(function(e){t[e]&&o("WAWebDBMsgOpaqueDataKeys").MsgKeyFieldsInOpaqueData.includes(e)?n[e]=t[e].toString():n[e]=t[e],t[e]=void 0}),n.pollOptions=o("WAWebPollsDbUtils").compressPollOptions(t.pollOptions),t.pollOptions=void 0,n.pollVotesSnapshot=o("WAWebPollsDbUtils").compressPollVotesSnapshot(t.pollVotesSnapshot),t.pollVotesSnapshot=void 0,n},_=function(t,n){n.paymentNoteMsgBody!=null&&t.paymentNoteMsg&&(t.paymentNoteMsg.body=n==null?void 0:n.paymentNoteMsgBody),o("WAWebDBMsgOpaqueDataKeys").MSG_OPAQUE_DATA_KEYS.forEach(function(e){var a=n[o("WAWebDBMsgOpaqueDataKeys").getKey(t.type,e)];a&&o("WAWebDBMsgOpaqueDataKeys").MsgKeyFieldsInOpaqueData.includes(e)?t[e]=r("WAWebMsgKey").fromString(a):t[e]=a}),t.pollOptions=o("WAWebPollsDbUtils").expandPollOptions(n==null?void 0:n.pollOptions),t.pollVotesSnapshot=o("WAWebPollsDbUtils").expandPollVotesSnapshot(n==null?void 0:n.pollVotesSnapshot)};l.encryptDataInMsgModel=e,l.decryptDataInMsgModel=u}),98); __d("WAWebMsgCollection",["Promise","WALogger","WANullthrows","WAPromiseProps","WATimeUtils","WATypeUtils","WAWebAck","WAWebBackendErrors","WAWebBaseCollection","WAWebBotGenTypingIndicatorMsg","WAWebChatCollection","WAWebCollectionConstants","WAWebCollectionUtils","WAWebDBMessageFindLocal","WAWebDBMsgUtils","WAWebEventsWaitForBbEvent","WAWebFrontendMsgGetters","WAWebFtsConstants","WAWebInvisiblePlaceholderViewModeProcessor","WAWebLidMigrationUtils","WAWebMessageAssociationUIUtils","WAWebMsgDataFromModel","WAWebMsgGetters","WAWebMsgModel","WAWebMsgOpaqueData","WAWebMsgType","WAWebNewsletterMsgHistoryUtils","WAWebNewsletterViewModeUIUtils","WAWebNoop","WAWebProcessMultipleMsgsAction","WAWebProductMessageListCollection","WAWebProtobufsE2E.pb","WAWebSyncButtonState","WAWebUserPrefsMeUser","WAWebViewMode.flow","WAWebViewModeUtils","WAWebWid","WAWebWorkerSafeBackendApi","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E,k,I,T,D=50,x=(function(t){function a(){var a;return a=t.call(this)||this,a.pendingAdd={},a.ftsCache={},a.productListMessagesPrefetchChain=(T||(T=n("Promise"))).resolve([]),a._editKeyByParentKey=new Map,a._parentKeyByEditKey=new Map,a._encryptedData=null,a.findQueryImpl=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){var i=a,l;switch(t.direction){case"before":case"after":l=t.direction;break;default:l="before";break}var u={add:l,isHistory:!0},c=yield o("WAWebDBMessageFindLocal").msgFindQuery(l,t);if(c.status>=400)return o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:findQuery error ",""])),c.status),(T||(T=n("Promise"))).reject(c.status);var d=i.get(t);r("WAWebWid").isNewsletter(t.remote)&&d!=null&&(c=yield o("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:t.remote,msgs:l==="before"?c.concat(o("WAWebMsgDataFromModel").msgDataFromMsgModel(d)):[o("WAWebMsgDataFromModel").msgDataFromMsgModel(d)].concat(c),serverIdsToSkip:o("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(t.remote)}));var m=function(){var e=i.get(t);if(e!=null)return e.msgChunk;var n=o("WAWebChatCollection").ChatCollection.get(t.remote);return n!=null?n.msgs:void 0};return c.forEach(function(e){e.invis=!0}),o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:findQuery:got:",":",""])),c.length,t.direction),i.processMultipleMessages(t.remote,c,u,"msgCollectionFindQuery",m)});return function(e){return t.apply(this,arguments)}})(),a.byParentMessage=o("WAWebCollectionUtils").aggregated(function(e){var t=e.parentMsgKey,n=e.type;return n===o("WAWebMsgType").MSG_TYPE.CIPHERTEXT||n===o("WAWebMsgType").MSG_TYPE.UNKNOWN?"UNCATEGORIZED":t},{subscribeToKey:"parentMsgKey"}),a.byChat=o("WAWebCollectionUtils").aggregated(function(e){var t=e.id;return t.remote}),a.byThreadId=o("WAWebCollectionUtils").aggregated(function(e){var t=e.threadIds;return t}),a.listenTo(a,"remove",a.removeFromCollection),a}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.removeFromCollection=function(t){var e=o("WAWebFrontendMsgGetters").getMaybeChat(t);e==null||e.removeFromCollection(t)},i.add=function(n,a){var e=Array.isArray(n)?n:[n],i=e.filter(function(e){if(e.ephemeralDuration==null||e.ephemeralDuration===0)return!0;var t=new(o("WAWebMsgModel")).Msg(e);return!t.isExpiredAndNotKept()}),l=t.prototype.add.call(this,i,a);return this.makeParentMessagesVisibleInChat(l),r("WAWebSyncButtonState")(l),this._prefetchProductListMessages(l),this.processVCardMessagesForLidMappings(l),this.processEditedMessages(l),l},i.makeParentMessagesVisibleInChat=function(t){var e=this;t.filter(Boolean).forEach(function(t){var n=t.parentMsgKey,r=t.viewMode;if(n&&!o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.CHAT,r)){var a,i=e.get(n);i&&(a=o("WAWebInvisiblePlaceholderViewModeProcessor").InvisiblePlaceholderViewModeProcessor.compatibleMessageTypes)!=null&&a.includes(i.type)&&!o("WAWebMessageAssociationUIUtils").shouldHideParentMessage({parentMsg:i,duringDetach:!1})&&!o("WAWebViewModeUtils").isViewModeVisibleInSurface(o("WAWebViewMode.flow").ViewModeSurface.CHAT,i==null?void 0:i.viewMode)&&i.set("viewMode",o("WAWebViewMode.flow").ViewModeType.VISIBLE)}})},i.processVCardMessagesForLidMappings=function(t){var e=t.reduce(function(e,t){if(t==null||t.type!==o("WAWebMsgType").MSG_TYPE.VCARD&&t.type!==o("WAWebMsgType").MSG_TYPE.MULTI_VCARD)return e;var n=t.type===o("WAWebMsgType").MSG_TYPE.VCARD?t.getVcardWids():t.getMultiVcardWids();if(n==null)return e;var r=n.filter(function(e){return o("WAWebLidMigrationUtils").toUserLid(e)==null});return r.length===0?e:e==null?new Set(r):(r.forEach(function(t){return e.add(t)}),e)},null);e!=null&&o("WAWebWorkerSafeBackendApi").workerSafeFireAndForget("syncContactListJob",{contactIds:Array.from(e),shouldSyncDevice:!1,mode:"query"})},i._prefetchProductListMessages=function(t){this.productListMessagesPrefetchChain=t.filter(function(e){var t,n;return e!=null&&e.isNewMsg&&e.type===o("WAWebMsgType").MSG_TYPE.LIST&&((t=e.list)==null?void 0:t.listType)===o("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.PRODUCT_LIST&&((n=e.list)==null?void 0:n.productListInfo)!=null}).reduce(function(e,t){var n,r;if(t==null)return e;var a=t.requiresDirectConnection,i=t.isForwarded?t.businessOwnerJid:t.from.toString({legacy:!0}),l=(n=t.list)==null?void 0:n.productListInfo;if(i==null||l==null)return e;var s=o("WAWebProductMessageListCollection").ProductMessageListCollection.getOrAdd(t.id,l,a,i,(r=t.list)==null?void 0:r.title);return s!=null&&s.productCollection.getModelsArray().length===0&&!s.isFetching()?e.then(function(){return o("WAWebProductMessageListCollection").ProductMessageListCollection.update(s.id)}):e},this.productListMessagesPrefetchChain)},i.getStarred=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r){var a={count:typeof t=="number"&&!isNaN(t)?t:o("WAWebCollectionConstants").PAGE_SIZE,chat:e||void 0,remote:r==null?void 0:r.remote,id:r==null?void 0:r.id,fromMe:r==null?void 0:r.fromMe,participant:r==null?void 0:r.participant},i={add:"search"},l=yield o("WAWebDBMessageFindLocal").msgFindQuery("star",a),s=l.status;return l.status>=400?(s===499?o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getStarred error 499 (unimplemented)"]))):o("WALogger").WARN(c||(c=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getStarred error ",""])),s),(T||(T=n("Promise"))).reject(s)):this.processMultipleMessages(void 0,l,i,"msgCollectionGetStarred")});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.getEventMsgs=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,n){var r={count:typeof t=="number"&&!Number.isNaN(t)?t:o("WAWebCollectionConstants").PAGE_SIZE,chat:e,remote:n==null?void 0:n.remote,id:n==null?void 0:n.id,fromMe:n==null?void 0:n.fromMe,participant:n==null?void 0:n.participant},a={add:"search"},i=yield o("WAWebDBMessageFindLocal").msgFindQuery("event",r),l=i.status;if(i.status>=400)throw l===499?o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getEventMsgs error 499 (unimplemented)"]))):o("WALogger").WARN(m||(m=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getEventMsgs error ",""])),l),new(o("WAWebBaseCollection")).CollectionSilentQueryError(l);return this.processMultipleMessages(void 0,i,a,"msgCollectionGetEvents")});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.getVoipCallLogMsgs=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var r={count:typeof e=="number"&&!isNaN(e)?e:o("WAWebCollectionConstants").PAGE_SIZE,chat:void 0,remote:t==null?void 0:t.remote,id:t==null?void 0:t.id,fromMe:t==null?void 0:t.fromMe,participant:t==null?void 0:t.participant},a=yield o("WAWebDBMessageFindLocal").msgFindQuery("call_log",r),i=a.status;return a.status>=400?(i===499?o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getVoipCallLogMsgs error 499 (unimplemented)"]))):o("WALogger").WARN(_||(_=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getVoipCallLogMsgs error ",""])),i),(T||(T=n("Promise"))).reject(i)):this.processMultipleMessages(void 0,a,{add:"search"},"msgCollectionGetVoipCallLogs")});function t(t,n){return e.apply(this,arguments)}return t})(),i.getAllMediaMsgs=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var r={count:e!=null?e:D,chat:void 0,remote:t==null?void 0:t.remote,id:t==null?void 0:t.id,fromMe:t==null?void 0:t.fromMe,participant:t==null?void 0:t.participant,media:"allMedia"},a=yield o("WAWebDBMessageFindLocal").msgFindQuery("media",r),i=a.status;return a.status!=null&&a.status>=400?(i===499?o("WALogger").LOG(f||(f=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllMediaMsgs error 499 (unimplemented)"]))):o("WALogger").WARN(g||(g=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllMediaMsgs error ",""])),i),(T||(T=n("Promise"))).reject(i)):this.processMultipleMessages(void 0,Array.isArray(a)?a:a.messages,{add:"search"},"msgCollectionGetAllMedia")});function t(t,n){return e.apply(this,arguments)}return t})(),i.getAllLinksMsgs=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var r={count:e!=null?e:D,chat:void 0,remote:t==null?void 0:t.remote,id:t==null?void 0:t.id,fromMe:t==null?void 0:t.fromMe,participant:t==null?void 0:t.participant,media:"allLinks"},a=yield o("WAWebDBMessageFindLocal").msgFindQuery("media",r),i=a.status;return a.status!=null&&a.status>=400?(i===499?o("WALogger").LOG(h||(h=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllLinksMsgs error 499 (unimplemented)"]))):o("WALogger").WARN(y||(y=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllLinksMsgs error ",""])),i),(T||(T=n("Promise"))).reject(i)):this.processMultipleMessages(void 0,Array.isArray(a)?a:a.messages,{add:"search"},"msgCollectionGetAllMedia")});function t(t,n){return e.apply(this,arguments)}return t})(),i.getAllDocsMsgs=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r){var a={count:e!=null?e:D,chat:t==null?void 0:t.remote,remote:t==null?void 0:t.remote,id:t==null?void 0:t.id,fromMe:t==null?void 0:t.fromMe,participant:t==null?void 0:t.participant,media:"allDocs",direction:r},i=yield o("WAWebDBMessageFindLocal").msgFindQuery("media",a),l=i.status;return i.status!=null&&i.status>=400?(l===499?o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllDocsMsgs error 499 (unimplemented)"]))):o("WALogger").WARN(b||(b=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:getAllDocsMsgs error ",""])),l),(T||(T=n("Promise"))).reject(l)):this.processMultipleMessages(void 0,Array.isArray(i)?i:i.messages,{add:"search"},"msgCollectionGetAllMedia")});function t(t,n,r){return e.apply(this,arguments)}return t})(),i.getMessagesById=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebDBMsgUtils").getMsgsByMsgKey(e);return o("WAPromiseProps").promiseProps({messages:this.processMultipleMessages(void 0,t,{add:"search"},"msgCollectionGetMessagesById"),eof:!0,canceled:!1})});function t(t){return e.apply(this,arguments)}return t})(),i.hydrateOrGetMessages=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this,n=e.filter(function(e){return!t.get(e)});if(n.length>0){var a=yield this.getMessagesById(n),i=a.messages;if(i.length!==n.length)throw new(o("WAWebBaseCollection")).CollectionSilentQueryError("No message found for one or more ids")}return e.map(function(e){return r("WANullthrows")(t.get(e))})});function t(t){return e.apply(this,arguments)}return t})(),i.queryVcard=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=yield o("WAWebDBMessageFindLocal").queryVcard(e);return this.processMultipleMessages(void 0,t,{add:"search"},"msgCollectionQueryVCard")});function t(t){return e.apply(this,arguments)}return t})(),i.incrementalStarredUpdate=function(t){return this.processMultipleMessages(void 0,t,{add:"search"},"msgCollectionIncrementalStarredUpdate")},i.search=function(t,n,r,a,i){var e=this;n===void 0&&(n=1),i===void 0&&(i={});var l=t+"__"+(i.label||i.kind&&i.kind||"");if(n===1&&!a){var s=this.ftsCache[l];if(s)return s;var u=this._search(t,n,r,a,i.label,i.kind);this.ftsCache[l]=u;var c=function(){e.ftsCache[l]=null};return self.setTimeout(c,o("WAWebFtsConstants").FTS_TTL),u.catch(c),u}return this._search(t,n,r,a,i.label,i.kind)},i._search=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a,i,l){var s={searchTerm:e,page:o("WATypeUtils").isNumber(t)&&t!==0?t:1,count:o("WATypeUtils").isNumber(r)&&r!==0?r:o("WAWebCollectionConstants").PAGE_SIZE,remote:a,tagToCancel:a?this.pendingSearchTag:void 0,label:i,kind:l},u={add:"search"},c=yield o("WAWebDBMessageFindLocal").msgFindQuery("search",s);if(s.tagToCancel===this.pendingSearchTag&&(this.pendingSearchTag=void 0),c.status===499)return o("WAPromiseProps").promiseProps({messages:(T||(T=n("Promise"))).resolve([]),eof:!1,canceled:!0});if(c.status===404)return(T||(T=n("Promise"))).reject(new(o("WAWebBackendErrors")).E404);if(c.status>=400)return o("WALogger").WARN(v||(v=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:search error ",""])),c.status),(T||(T=n("Promise"))).reject(new(o("WAWebBackendErrors")).ServerStatusCodeError(c.status,"failed to find a msg during fts"));var d=Array.isArray(c)?c:c.messages,m=Array.isArray(c)?!0:c.eof,p=d.filter(function(e){return(e==null?void 0:e.isGroupStatus)!==!0});return o("WAPromiseProps").promiseProps({messages:this.processMultipleMessages(void 0,p,u,"msgCollectionSearch"),eof:m,canceled:!1})});function t(t,n,r,o,a,i){return e.apply(this,arguments)}return t})(),i.queryMedia=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t,r,a,i){var l={remote:e,count:o("WATypeUtils").isNumber(t)&&t!==0?t:o("WAWebCollectionConstants").PAGE_SIZE,id:a==null?void 0:a.id,fromMe:a==null?void 0:a.fromMe,participant:a==null?void 0:a.participant,direction:r||"before",media:i,msgKey:a},s={add:"search"},u=yield o("WAWebDBMessageFindLocal").msgFindQuery("media",l);return u.status>=400?(o("WALogger").WARN(S||(S=babelHelpers.taggedTemplateLiteralLoose(["model:Msg:media error ",""])),u.status),u.status===404?(T||(T=n("Promise"))).reject(new(o("WAWebBackendErrors")).E404):(T||(T=n("Promise"))).reject(new(o("WAWebBackendErrors")).ServerStatusCodeError(u.status,"failed to find a msg during media query"))):i?this.processMultipleMessages(void 0,u,{add:"search"},"msgCollectionQueryMedia"):o("WAPromiseProps").promiseProps({docCount:u.docCount,linkCount:u.linkCount,mediaCount:u.mediaCount,messages:this.processMultipleMessages(void 0,u.messages,s,"msgCollectionQueryMedia")})});function t(t,n,r,o,a){return e.apply(this,arguments)}return t})(),i.getContext=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a=this,i=this.get(e),l=r("WAWebWid").isNewsletter(e.remote);if(i&&!i.fromQuotedMsg)return(T||(T=n("Promise"))).all([o("WAWebDBMessageFindLocal").msgFindQuery("before",e),o("WAWebDBMessageFindLocal").msgFindQuery("after",e)]).then((function(){var r=n("asyncToGeneratorRuntime").asyncToGenerator(function*(r){var s=r[0],u=r[1];if((!Array.isArray(s)||!Array.isArray(u))&&!l)throw o("WALogger").WARN(R||(R=babelHelpers.taggedTemplateLiteralLoose(["model:msg:getContext fetch error"]))),s.status||u.status;var c=Array.isArray(s)?s:[],d=Array.isArray(u)?u:[],m=i.serverId;return i.search=!1,(T||(T=n("Promise"))).all([a.processMultipleMessages(e.remote,!l||m==null?c:yield o("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:e.remote,msgs:c.concat(o("WAWebMsgDataFromModel").msgDataFromMsgModel(i)),range:{start:m-e.count,end:m},serverIdsToSkip:o("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(e.remote)}),{add:"before",isHistory:!0},"msgCollectionGetContext",t),a.processMultipleMessages(e.remote,!l||m==null?d:yield o("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:e.remote,msgs:[o("WAWebMsgDataFromModel").msgDataFromMsgModel(i)].concat(d),range:{start:m,end:m+e.count},serverIdsToSkip:o("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(e.remote)}),{add:"after",isHistory:!0},"msgCollectionGetContext",t)])});return function(e){return r.apply(this,arguments)}})());var s={add:"after",isHistory:!0};return o("WAWebDBMessageFindLocal").msgFindQuery("after",e).then((function(){var i=n("asyncToGeneratorRuntime").asyncToGenerator(function*(n){if(!Array.isArray(n))throw o("WALogger").WARN(L||(L=babelHelpers.taggedTemplateLiteralLoose(["model:msg:getContext:after fetch error"]))),n.status;if(r("WAWebWid").isStatus(n[0].id.remote))throw r("err")("status, stop querying before the msg");var i=e.serverId;return a.processMultipleMessages(e.remote,!l||i==null?n:yield o("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:e.remote,msgs:n,range:{start:i,end:i+e.count},serverIdsToSkip:o("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(e.remote)}),s,"msgCollectionFindQuery",t)});return function(e){return i.apply(this,arguments)}})()).then(function(t){var i=r("WANullthrows")(t[0]),s=i.id.clone();s.count=e.count+1;var u={add:"before",isHistory:!0};return(T||(T=n("Promise"))).all([o("WAWebDBMessageFindLocal").msgFindQuery("before",s).then((function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){if(!Array.isArray(t))throw o("WALogger").WARN(E||(E=babelHelpers.taggedTemplateLiteralLoose(["model:msg:getContext:before fetch error"]))),t.status;var n=t[t.length-1];n.fromQuotedMsg=!1;var r=n.id;if(!r.equals(e))throw o("WALogger").WARN(k||(k=babelHelpers.taggedTemplateLiteralLoose(["model:msg:getContext:before ctx message mismatch"]))),405;var s=function(){return i.msgChunk},c=i.serverId;return a.processMultipleMessages(e.remote,!l||c==null?t:yield o("WAWebNewsletterMsgHistoryUtils").fillMsgHistoryGaps({jid:e.remote,msgs:t,range:{start:c,end:c-e.count},serverIdsToSkip:o("WAWebNewsletterViewModeUIUtils").getHiddenMessageServerIdsForChat(e.remote)}),u,"msgCollectionFindQuery",s)});return function(e){return t.apply(this,arguments)}})()),T.resolve(t)])})});function t(t,n){return e.apply(this,arguments)}return t})(),i.hasSynced=function(){return r("WAWebEventsWaitForBbEvent")(this,o("WAWebCollectionConstants").COLLECTION_HAS_SYNCED)},i.processMultipleMessages=function(t,n,a,i,l,s){var e=this;s===void 0&&(s=!0),t!=null&&t.isRegularUser()&&o("WALogger").LOG(I||(I=babelHelpers.taggedTemplateLiteralLoose(["processMultipleMessages. processMessageOrigin: ",""])),i).tags("missing-lid");var u=function(){return o("WAWebProcessMultipleMsgsAction")._processMultipleMessages(t,n,a,i,l)};if(t){var c,d=this.pendingAdd[t];return d&&s?c=d.then(u):c=u(),c.finally(function(){t&&e.pendingAdd[t]===c&&(e.pendingAdd[t]=null)}).catch(r("WAWebNoop")),this.pendingAdd[t]=c}return u()},i.hasUnsentMessages=function(){return this.some(function(e){return e.ack===o("WAWebAck").ACK.CLOCK&&e.local&&o("WAWebMsgGetters").getIsSentByMe(e)})},i.getByEditMsgKey=function(t){var e=this._parentKeyByEditKey.get(t.toString());return e&&this.get(e)},i.processEditedMessages=function(t){var e=this;t.forEach(function(t){if(!(!t||!o("WAWebMsgGetters").getIsEdited(t))){var n=e._editKeyByParentKey.get(t.id.toString());n!=null&&e._parentKeyByEditKey.delete(n);var r=t.latestEditMsgKey;r&&(e._editKeyByParentKey.set(t.id.toString(),r.toString()),e._parentKeyByEditKey.set(r.toString(),t.id))}})},i.addInitialBotTypingIndicatorToChat=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var n,r=o("WAWebChatCollection").ChatCollection.get(e);if(!(!r||!(r!=null&&r.id.isBot())&&!((n=r.contact.businessProfile)!=null&&n.isBizBot3p))){if(r.botInitialTypingIndicatorMsgId!=null){var a=this.get(r.botInitialTypingIndicatorMsgId);if(a==null)return;a==null||a.delete({skipUpdatingSortTime:!0})}r.set({botInitialTypingIndicatorMsgId:t},{silent:!0});var i={id:t,t:o("WATimeUtils").unixTime(),from:e,to:o("WAWebUserPrefsMeUser").getMaybeMePnUser(),type:"chat",subtype:o("WAWebBotGenTypingIndicatorMsg").BOT_TYPING_PLACEHOLDER_MSG_SUBTYPE,body:""};this.processMultipleMessages(e,[babelHelpers.extends({},i,{recvFresh:!0,isNewMsg:!0})],{add:"after",isHistory:!1},"createChatOnNewMsg",null,!0)}});function t(t,n){return e.apply(this,arguments)}return t})(),i.encryptAndClearModels=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e=this._models.map(function(e){return o("WAWebMsgOpaqueData").encryptDataInMsgModel(e)});yield(T||(T=n("Promise"))).all(e)});function t(){return e.apply(this,arguments)}return t})(),i.decryptAndSetModels=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=this._models.map(function(t){return o("WAWebMsgOpaqueData").decryptDataInMsgModel(t,e)});yield(T||(T=n("Promise"))).all(t)});function t(t){return e.apply(this,arguments)}return t})(),a})(o("WAWebBaseCollection").BaseCollection);x.model=o("WAWebMsgModel").Msg;var $=new x;l.MEDIA_QUERY_LIMIT=D,l.MsgCollectionImpl=x,l.MsgCollection=$}),98); __d("WAWebMsgInfoAction",["WAWebAck","WAWebStateUtils","WAWebWid"],(function(t,n,r,o,a,i,l){function e(e,t,n,a){var i=o("WAWebStateUtils").unproxy(e),l=i.id,c=r("WAWebWid").isUser(l.remote);c?s(i,t,n,a):u(i,t,n,a)}function s(e,t,n,r){t===o("WAWebAck").ACK.PLAYED?(e.played.get(n)||(e.playedRemaining-=1),e.played.add({id:n,t:r})):t===o("WAWebAck").ACK.READ?(e.read.get(n)||(e.readRemaining-=1),e.read.add({id:n,t:r})):t===o("WAWebAck").ACK.RECEIVED&&(e.delivery.get(n)||(e.deliveryRemaining-=1),e.delivery.add({id:n,t:r}))}function u(e,t,n,r){var a,i=o("WAWebAck").ACK.CLOCK;if(e.played.get(n)?i=o("WAWebAck").ACK.PLAYED:e.read.get(n)?i=o("WAWebAck").ACK.READ:e.delivery.get(n)&&(i=o("WAWebAck").ACK.RECEIVED),!(t<=i)){if(t>o("WAWebAck").ACK.RECEIVED){var l=e.delivery.get(n);l?e.delivery.remove(l):e.deliveryRemaining-=1}if(t>o("WAWebAck").ACK.READ){var s=e.read.get(n);s?e.read.remove(s):e.readRemaining-=1}t===o("WAWebAck").ACK.READ&&e!=null&&(a=e.id)!=null&&(a=a.remote)!=null&&a.isGroup()&&n!=null&&n.isBot()&&(e.readRemaining+=1),t===o("WAWebAck").ACK.PLAYED?(e.played.get(n)||(e.playedRemaining-=1),e.played.add({id:n,t:r})):t===o("WAWebAck").ACK.READ?(e.read.get(n)||(e.readRemaining-=1),e.read.add({id:n,t:r})):t===o("WAWebAck").ACK.RECEIVED&&(e.delivery.get(n)||(e.deliveryRemaining-=1),e.delivery.add({id:n,t:r}))}}l.updateMsgInfo=e}),98); __d("WAWebMsgInfoCollection",["Promise","WALogger","WAWebApiMessageInfoStore","WAWebBaseCollection","WAWebHandleMsgTypes.flow","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgInfoAction","WAWebMsgInfoModel","WAWebMsgKey","WAWebMsgType","asyncToGeneratorRuntime","err"],(function(t,n,r,o,a,i,l){var e,s,u,c;function d(t,n){var a=n.delivery,i=n.deliveryPrivacyMode,l=n.deliveryRemaining,s=n.played,u=n.playedRemaining,c=n.read,d=n.readRemaining,m={id:t,read:c.map(function(e){return babelHelpers.extends({},e)}),readRemaining:d,played:s.map(function(e){return babelHelpers.extends({},e)}),playedRemaining:u,delivery:a.map(function(e){return babelHelpers.extends({},e)}),deliveryRemaining:l};if(i!=null){var p=o("WAWebHandleMsgTypes.flow").HostStorageEnumType.cast(i.hostStorage),_=o("WAWebHandleMsgTypes.flow").ActualActorsEnumType.cast(i.actualActors);if(_==null||p==null)throw o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["queryMsgInfo: got unsupported host storage or actual actors"]))).sendLogs("queryMsgInfo-incorrect-enums"),r("err")("queryMsgInfo: got unsupported host storage or actual actors");var f={hostStorage:p,privacyModeTs:i.privacyModeTs,actualActors:_};m.deliveryPrivacyMode=f}return m}var m=(function(e){function t(){for(var t,r=arguments.length,a=new Array(r),i=0;i=c)return[a,c];var d=o("WAUnicodeUtils").firstNCodepoints(t,c),m=!1,p=o("WAWebLinkify").findLinks(d,m,n);return p.length>0&&(p=s(p,t,d,c,n)),[p,c]}var s=function(t,n,r,a,i){var e=o("WAUnicodeUtils").numCodepoints(r),l=o("WAUnicodeUtils").numCodepoints(n);if(e0){var s=t[t.length-1];if(s==null||s.index==null||s.url==null||s.href==null)return t.pop(),t;var u=o("WAUnicodeUtils").numCodepoints(r.slice(0,s.index)),c=u+o("WAUnicodeUtils").numCodepoints(s.url);if(c===a){var d=o("WAWebLinkify").findLinks(n,!1,i),m=u,p=d[d.length-1];if(p==null||p.url==null)return t.filter(function(e){return e.href!==s.href});var _=m+o("WAUnicodeUtils").numCodepoints(p.url);if(_>e)return t.filter(function(e){return e.href!==s.href})}}return t};function u(t,n){var r=o("WAWebStateUtils").unproxy(t),a=n!=null?n:r.linksIndexParsed?r.linksIndexParsed:o("WAWebMsgGetters").getInitialPageSize(r)+1,i=o("WAWebFrontendMsgGetters").getText(r);if(i==null||r.linksIndexParsed===1/0)return r.getRawLinks();var l=e({content:i,sender:o("WAWebMsgGetters").getSender(r),cachedValue:r.getRawLinks(),currentIndex:r.linksIndexParsed,endIndex:a}),s=l[0],u=l[1];return r.linksIndexParsed=u,r.setRawLinks(s),s}function c(t,n){var r,a=o("WAWebStateUtils").unproxy(t);if(a.pollOptions==null)return null;if(a.getRawPollOptionsToLinks()==null){var i,l=new Map((i=a.pollOptions)==null?void 0:i.map(function(t){var n=e({content:t.name,sender:o("WAWebMsgGetters").getSender(a)}),r=n[0];return[t,r]}));a.setRawPollOptionsToLinks(l)}return(r=a.getRawPollOptionsToLinks())==null?void 0:r.get(n)}function d(e,t){if(t){var n,r;return e.type==="list"&&((n=e.list)==null?void 0:n.listType)===o("WAWebProtobufsE2E.pb").Message$ListMessage$ListType.SINGLE_SELECT&&((r=e.list)==null?void 0:r.title)!=null}return e.isDynamicReplyButtonsMsg===!0&&e.title!=null}function m(t,n){if(t.getRawHeaderLinks().length>0)return t.getRawHeaderLinks();var r=e({content:n,sender:o("WAWebMsgGetters").getSender(t),cachedValue:t.getRawHeaderLinks()}),a=r[0];return a.length>0&&t.setRawHeaderLinks(a),a}function p(e){var t,n=o("WAWebStateUtils").unproxy(e);if(d(n,!0)){var r;return m(n,((r=n.list)==null?void 0:r.title)||"")}else{if(d(n,!1))return m(n,n.title);if(n.type===o("WAWebMsgType").MSG_TYPE.INTERACTIVE&&((t=n.interactiveHeader)==null?void 0:t.title)!=null)return m(n,n.interactiveHeader.title)}return[]}function _(t){var n=o("WAWebStateUtils").unproxy(t),r=n.footer;if(!o("WAWebMsgGetters").getSupportsMessageFooterLinks(n)||r==null)return[];if(n.getRawFooterLinks().length>0)return n.getRawFooterLinks();var a=e({content:r,sender:o("WAWebMsgGetters").getSender(n),cachedValue:n.getRawFooterLinks()}),i=a[0];return i.length>0&&n.setRawFooterLinks(i),i}function f(e){var t=o("WAWebStateUtils").unproxy(e);return r("uniqueBy")(u(t),function(e){return e.href}).filter(function(e){return e.isHttp})}function g(e){var t=o("WAWebStateUtils").unproxy(e);return u(t).filter(function(e){var t;return(t=e.suspiciousCharacters)==null?void 0:t.size})}l.getLinksFromMsgImpl=e,l.getLinksFromMsg=u,l.getPollOptionLinks=c,l.shouldDisplayHeaderLinks=d,l.getHeaderLinks=p,l.getFooterLinks=_,l.getGalleryLinks=f,l.getSuspiciousLinks=g}),98); __d("WAWebSuspendedGroupMediaDownloadFailureModal.react",["fbt","WAWebConfirmPopup.react","WAWebModalManager","react"],(function(t,n,r,o,a,i,l,s){var e,u=e||(e=r("react"));function c(){var e=function(){return o("WAWebModalManager").ModalManager.close()};return u.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{onOK:e,title:s._(/*BTDS*/"Descarga fallida"),children:s._(/*BTDS*/"El archivo multimedia ya no est\u00e1 disponible.")})}c.displayName=c.name+" [from "+i.id+"]",l.default=c}),226); __d("WAWebMsgModel",["Promise","WAJids","WALogger","WATimeUtils","WATypeUtils","WAWebAck","WAWebApiContact","WAWebBaseModel","WAWebBizLabelUtils","WAWebBotGenTypingIndicatorMsg","WAWebBotTypes","WAWebBusinessHSMTypes","WAWebBusinessProfileTypes","WAWebCarouselCardsCollection","WAWebChangePresenceHandlerAction","WAWebChatCollection","WAWebChatCommunityUtils","WAWebChatContactUtils","WAWebChatGetMessage","WAWebChatGetters","WAWebChatGroupUtils","WAWebCmd","WAWebCommonMsgUtils","WAWebCompactMapString","WAWebConnModel","WAWebConstantsDeprecated","WAWebContactCollection","WAWebDBUpdateMessageTable","WAWebDirectConnectionGatingUtils","WAWebEphemeralKeepInChatAbpropUtils","WAWebEphemeralityTypes","WAWebEventsWaitForBbEvent","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebInvisiblePlaceholderViewModeProcessor","WAWebLabelCollection","WAWebLidMigrationUtils","WAWebMedia","WAWebMediaData","WAWebMediaTypes","WAWebMessageAssociationGatingUtils","WAWebMessageAssociationUIUtils","WAWebMessageReceiptUtils","WAWebMiscGatingUtils","WAWebModalManager","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModelPropUtils","WAWebMsgModelUtils","WAWebMsgType","WAWebMuteCollection","WAWebNewsletterCollection","WAWebNewsletterSendMsgAction","WAWebNotificationsMsgNotification","WAWebPinInChatCollection","WAWebPromiseQueue","WAWebSendMessageEditAction","WAWebSendMsgRecordAction","WAWebStarredMsgCollection","WAWebSuspendedGroupMediaDownloadFailureModal.react","WAWebUserPrefsMeUser","WAWebUsernameGatingUtils","WAWebVcardParsingUtils","WAWebViewMode.flow","WAWebViewModeUtils","WAWebViewOnceState","WAWebWamEnumDisappearingChatInitiatorType","WAWebWamEnumWebcRmrReasonCode","WAWebWamMsgUtils","WAWebWid","WAWebWidFactory","WAWebWidFormat","asyncToGeneratorRuntime","err","fbs","gkx","isStringNullOrEmpty","lodash","react"],(function(t,n,r,o,a,i,l){var e=["ack","author","broadcast","buttons","from","id","invis","isNewMsg","latestEditMsgKey","latestEditSenderTimestampMs","multicast","notifyName","quotedMsg","quotedParticipant","quotedRemoteJid","quotedStanzaID","quotedType","recipients","recvFresh","replyButtons","senderObj","star","t","to"],s,u,c,d,m,p,_,f,g,h=g||(g=r("react")),y=(function(t){function a(){for(var e,n=arguments.length,a=new Array(n),i=0;i0&&this.clearRawLinks(),this.$MsgImpl$p_1},i.setRawLinks=function(t){t.length>0&&(this.$MsgImpl$p_1=t)},i.clearRawLinks=function(){this.$MsgImpl$p_1=[],this.linksIndexParsed=0},i.getRawPollOptionsToLinks=function(){return this.$MsgImpl$p_4},i.setRawPollOptionsToLinks=function(t){this.$MsgImpl$p_4=t},i.getRawHeaderLinks=function(){return this.$MsgImpl$p_2},i.setRawHeaderLinks=function(t){t.length>0&&(this.$MsgImpl$p_2=t)},i.getRawFooterLinks=function(){return this.$MsgImpl$p_3},i.setRawFooterLinks=function(t){t.length>0&&(this.$MsgImpl$p_3=t)},i.getRawPhoneNumbers=function(){return this.$MsgImpl$p_5},i.setRawPhoneNumbers=function(t){t.length>0&&(this.$MsgImpl$p_5=t)},i.clearRawPhoneNumbers=function(){this.$MsgImpl$p_5=[],this.phoneNumbersIndexParsed=0},i.getRawHeaderPhoneNumbers=function(){return this.$MsgImpl$p_6},i.setRawHeaderPhoneNumbers=function(t){t.length>0&&(this.$MsgImpl$p_6=t)},i.getRawFooterPhoneNumbers=function(){return this.$MsgImpl$p_7},i.setRawFooterPhoneNumbers=function(t){t.length>0&&(this.$MsgImpl$p_7=t)},i.$MsgImpl$p_10=function(){this.addChild("mediaData",new(r("WAWebMediaData")))},i.mayFail=function(){return o("WAWebMsgGetters").getIsSentByMe(this)&&this.ack=o("WAWebAck").ACK.RECEIVED&&this.id.fromMe)){var a=this.id;if(this.id.remote.isStatus()){var i=yield o("WAWebMessageReceiptUtils").fixStatusReceiptKeys([a]);a=i[0]}o("WATypeUtils").isNumber(e)&&(n===void 0||e>n||e===o("WAWebAck").ACK.FAILED)?(this.ack=e,t||this.$MsgImpl$p_9.enqueue(function(){return o("WAWebDBUpdateMessageTable").updateMessageTable(a,{ack:e})})):e===o("WAWebAck").ACK.FAILED&&this.ack===o("WAWebAck").ACK.CLOCK&&(this.ack=o("WAWebAck").ACK.FAILED,this.$MsgImpl$p_9.enqueue(function(){return o("WAWebDBUpdateMessageTable").updateMessageTable(a,{ack:e})}))}});function t(t,n){return e.apply(this,arguments)}return t})(),i.updateErrorCode=function(t){return this.errorCode=t,o("WAWebDBUpdateMessageTable").updateMessageTable(this.id,{errorCode:t})},i.updateReadQuestionResponsesCount=function(){return this.readQuestionResponsesCount=this.questionResponsesCount,o("WAWebDBUpdateMessageTable").updateMessageTable(this.id,{readQuestionResponsesCount:this.questionResponsesCount})},i.updateGalaxyFlowMsgLoggingIds=function(t,n){return this.galaxyFlowWAMMessageId=t,this.galaxyFlowQPLMessageId=n,o("WAWebDBUpdateMessageTable").updateMessageTable(this.id,{galaxyFlowWAMMessageId:t,galaxyFlowQPLMessageId:n})},i.updateNFMButtonsState=function(t){return o("WAWebDBUpdateMessageTable").updateMessageTable(this.id,{galaxyFlowDisabled:t})},i.updateLastPlaybackProgress=function(t){this.lastPlaybackProgress=t,this.$MsgImpl$p_18(this.id,t)},i.avParams=function(){return o("WAWebMedia").mediaMetadata(this)},i.resend=function(){var e=this;if(o("WAWebMsgGetters").getIsFailed(this)){if(o("WAWebMsgGetters").getIsEdited(this))return o("WAWebSendMessageEditAction").resendLatestEdit(this);var t={ack:o("WAWebAck").ACK.CLOCK};return t.isSendFailure=!1,this.$MsgImpl$p_9.enqueue(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){yield o("WAWebDBUpdateMessageTable").updateMessageTable(e.id,t),e.set(t)})),o("WAWebMsgGetters").getIsNewsletterMsg(this)?o("WAWebNewsletterSendMsgAction").resendNewsletterMsg(this).then(function(e){return e&&e.messageSendResult}):o("WAWebFrontendMsgGetters").getAsMms(this)?o("WAWebMsgGetters").getIsSentByMeFromWeb(this)?this.resumeUpload():this.resumeRemoteUpload():o("WAWebSendMsgRecordAction").sendMsgRecord(this).then(function(e){return e.messageSendResult})}return(f||(f=n("Promise"))).resolve()},i.$MsgImpl$p_12=function(){if(this.calledCiphertextDecrypted=!0,!o("WAWebMsgGetters").getIsStatus(this)){var e=o("WAWebFrontendMsgGetters").getChat(this),t=e.msgs.length,n=e.msgs.indexOf(this);n!==-1&&t-n<=10&&!o("WAWebMsgGetters").getIsSentByMe(this)&&o("WAWebCmd").Cmd.alertNewMsg(this)}},i.$MsgImpl$p_13=function(){if(this.isViewOnce&&this.mediaData!=null){var e=o("WAWebMsgGetters").getIsSentByMe(this)&&this.ack>=o("WAWebAck").ACK.SENT&&this.mediaData.mediaStage===o("WAWebMediaTypes").MediaDataStage.RESOLVED,t=!o("WAWebMsgGetters").getIsSentByMe(this)&&this.ack>=o("WAWebAck").ACK.PLAYED;(e||t)&&(this.stopListening(this,"change:ack",this.$MsgImpl$p_13),this.stopListening(this.mediaData,"change:mediaStage",this.$MsgImpl$p_13),o("WAWebMedia").deregisterMsg(this))}},i.isReaction=function(){return o("WAWebMsgGetters").getIsReaction(this)},i.isEditProtocolMsg=function(){return o("WAWebMsgGetters").getIsEditProtocolMsg(this)},i.getWamDisappearingModeInitiator=function(){var e=this.disappearingModeInitiator;if(e==null)return null;switch(e){case o("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByMe:return o("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE.INITIATED_BY_ME;case o("WAWebEphemeralityTypes").DisappearingModeInitiator.InitiatedByOther:case o("WAWebEphemeralityTypes").DisappearingModeInitiator.BizUpgradeFbHosting:return o("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE.INITIATED_BY_OTHER;case o("WAWebEphemeralityTypes").DisappearingModeInitiator.ChangedInChat:return o("WAWebWamEnumDisappearingChatInitiatorType").DISAPPEARING_CHAT_INITIATOR_TYPE.CHAT}},i.getWamMessageType=function(){return o("WAWebWamMsgUtils").getWamMessageType(this)},i.getWamMediaType=function(){return o("WAWebWamMsgUtils").getWamMediaType(this)},i.getWamEditType=function(){return o("WAWebMsgGetters").getWamEditType(this)},i.getForwardingScoreWhenForwarded=function(){var e=5,t=o("WAWebMsgGetters").getNumTimesForwarded(this)+(o("WAWebMsgGetters").getShouldDisplayAsForwarded(this)?1:0);return t>=e?r("WAWebConstantsDeprecated").FREQUENTLY_FORWARDED_SENTINEL:t},i.isExpired=function(){var e=o("WAWebMsgGetters").getEphemeralExpirationTimestamp(this);return e==null?!1:e<=o("WATimeUtils").unixTime()},i.isRealMessage=function(){var e=this.type===o("WAWebMsgType").MSG_TYPE.GROUPS_V4_INVITE&&this.from.equals(o("WAWebUserPrefsMeUser").getMaybeMePnUser());return!e&&!o("WAWebMsgGetters").getIsInitialE2ENotification(this)&&this.type!==o("WAWebMsgType").MSG_TYPE.CALL_LOG&&!o("WAWebMsgGetters").getIsBizNotification(this)&&!["change_number","change_username","masked_thread_created"].includes(this.subtype)&&!o("WAWebMsgGetters").getIsDisappearingModeSystemMessage(this)},i.isExpiredAndNotKept=function(){return this.isExpired()&&!o("WAWebMsgGetters").getIsKept(this)},i.timeUntilExpiration=function(){var e=o("WAWebMsgGetters").getEphemeralExpirationTimestamp(this);return e==null?null:this.isExpired()?0:e-o("WATimeUtils").unixTime()},i.getCollection=function(){return o("WAWebMsgCollection").MsgCollection},i.$MsgImpl$p_17=function(){return o("WAWebMsgGetters").getIsNewsletterMsg(this)?r("WAWebNewsletterCollection"):o("WAWebChatCollection").ChatCollection},i.safe=function(){return this},i.unsafe=function(){return this},i.$MsgImpl$p_19=function(){return o("WAWebUserPrefsMeUser").isMeAccount(o("WAWebMsgGetters").getKicSender(this))},i.keepIsLockedForMe=function(){return this.keepIsLockedByDmSettingsForUser(o("WAWebUserPrefsMeUser").getMePnUserOrThrow())},i.keepIsLockedForUser=function(t){return this.keepIsLockedByDmSettingsForUser(t)},i.keepIsLockedForMeSenderSuperpower=function(){var e=o("WAWebMsgGetters").getKicSender(this),t=r("WAWebWid").equals.apply(r("WAWebWid"),o("WAWebLidMigrationUtils").toCommonAddressingMode(e,o("WAWebMsgGetters").getSender(this)));return o("WAWebMsgGetters").getIsUnkept(this)&&t&&!this.$MsgImpl$p_19()},i.keepIsLockedByDmSettingsForUser=function(t){var e,n=o("WAWebChatGetters").getIsGroup(o("WAWebFrontendMsgGetters").getChat(this))?!((e=o("WAWebFrontendMsgGetters").getChat(this).groupMetadata)!=null&&e.userCanSetEphemeralSetting(t)):!1;return n},i.$MsgImpl$p_20=function(){return o("WAWebFrontendMsgGetters").getChat(this).supportsKIC()?o("WAWebMsgGetters").getIsEphemeral(this)&&this.type!==o("WAWebMsgType").MSG_TYPE.REVOKED&&!this.isViewOnce&&!o("WAWebFrontendMsgGetters").getAsAlbum(this):!1},i.canShowKeepOrUnkeepOption=function(){return this.canShowKeepOption()||this.canShowUnkeepOption()},i.canShowKeepOption=function(){var e;return this.$MsgImpl$p_20()&&(o("WAWebChatGroupUtils").canSendToGroup(o("WAWebFrontendMsgGetters").getChat(this))||((e=o("WAWebFrontendMsgGetters").getChat(this).groupMetadata)==null?void 0:e.pastParticipants.get(o("WAWebUserPrefsMeUser").getMePnUserOrThrow()))!=null)&&!this.keepIsLockedForMe()&&!this.star&&!this.isGif&&!o("WAWebMsgGetters").getIsStickerMsg(this)},i.canShowUnkeepOption=function(){return o("WAWebMsgGetters").getIsKept(this)&&this.$MsgImpl$p_20()&&(this.canRevokeUnkeep()||this.canShowKeepOption()||this.isGif||o("WAWebMsgGetters").getIsStickerMsg(this))},i.canRevokeUnkeep=function(){if(o("WAWebMsgGetters").getIsSentByMe(this)){var e;if(o("WAWebChatGetters").getIsGroup(o("WAWebFrontendMsgGetters").getChat(this))&&((e=o("WAWebFrontendMsgGetters").getChat(this).groupMetadata)==null?void 0:e.participants.iAmMember())===!0)return!0;if(o("WAWebChatGetters").getIsUser(o("WAWebFrontendMsgGetters").getChat(this))&&!o("WAWebFrontendMsgGetters").getChat(this).contact.isContactBlocked)return!0}return!1},i.isPastUnkeepExpirationLimit=function(){var e=o("WAWebMsgGetters").getEphemeralExpirationTimestamp(this);if(e!=null){var t=Math.trunc(+new Date/1e3)-e;return o("WAWebMsgGetters").getIsKept(this)&&t>o("WAWebEphemeralKeepInChatAbpropUtils").getUndoKeepInChatExpiration()}return!1},i.shouldShowNotificationPreview=function(){var e;return!((e=o("WAWebFrontendMsgGetters").getAsViewOnce(this))!=null&&e.isViewOnce)&&o("WAWebMuteCollection").MuteCollection.getGlobalPreviews()},i.senderIsGroupParticipant=function(){var e=o("WAWebFrontendMsgGetters").getChat(this).groupMetadata;if(e==null)return!1;var t=o("WAWebMsgGetters").getSender(this);if(t!=null&&e.participants.get(t)!=null)return!0;if(!e.isCag)return!1;var n=t!=null?o("WAWebApiContact").getCurrentLid(o("WAWebWidFactory").asUserWidOrThrow(t)):null;return n==null?!1:e.participants.get(n)!=null},i.detachAssociatedMsg=function(){this.hideParentMessageInChat({duringDetach:!0}),this.set({viewMode:o("WAWebViewMode.flow").ViewModeType.VISIBLE,associationType:null,parentMsgKey:null})},i.updateGroupHistoryBundleProcessState=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return this.groupHistoryBundleMetadata==null?(f||(f=n("Promise"))).reject():(this.set({groupHistoryBundleMetadata:babelHelpers.extends({},this.groupHistoryBundleMetadata,{processState:e})}),(f||(f=n("Promise"))).resolve())});function t(t){return e.apply(this,arguments)}return t})(),a})(o("WAWebBaseModel").BaseModel);y.Proxy="msg",y.idClass=r("WAWebMsgKey"),y.kind="__MOCKED_KIND__";var C=o("WAWebBaseModel").defineModel(y);l.Msg=C}),226); __d("WAWebMsgModelPropUtils",["WAWebBusinessProfileTypes","WAWebChatGetters","WAWebFrontendContactGetters","WAWebFrontendMsgGetters","WAWebInteractiveMessageType","WAWebInteractiveMessagesNativeFlowName","WAWebMsgGetters","WAWebMsgType","WAWebStateUtils","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l){var e=[r("WAWebInteractiveMessagesNativeFlowName").ORDER_DETAILS,r("WAWebInteractiveMessagesNativeFlowName").PAYMENT_INFO,r("WAWebInteractiveMessagesNativeFlowName").BOOKING_CONFIRMATION],s=["loading_media","image","video","ptv","audio","ptt","location","vcard","multi_vcard","document","ciphertext","debug_placeholder","oversized","unknown","call_log","revoked","sticker","payment","poll_creation","poll_result_snapshot","groups_v4_invite","newsletter_admin_invite","product","order","event_creation","biz_content_placeholder","album","sticker-pack","newsletter_follower_invite"];function u(t){var n=o("WAWebStateUtils").unproxy(t);return n.type===o("WAWebMsgType").MSG_TYPE.INTERACTIVE?n.interactiveType===r("WAWebInteractiveMessageType").SHOPS_STOREFRONT||n.interactiveType===r("WAWebInteractiveMessageType").NATIVE_FLOW&&n.nativeFlowName!=null&&e.includes(n.nativeFlowName):n.type===o("WAWebMsgType").MSG_TYPE.NATIVE_FLOW?n.nativeFlowName!=null&&e.includes(n.nativeFlowName):n.type===o("WAWebMsgType").MSG_TYPE.PROTOCOL?n.subtype==="event_edit_decrypted":s.includes(n.type)}function c(e){var t=o("WAWebStateUtils").unproxy(e);if(o("WAWebUserPrefsMeUser").isMeAccount(o("WAWebMsgGetters").getSender(t))||t.senderObj!=null&&o("WAWebFrontendContactGetters").getIsMyContact(t.senderObj))return!0;var n=o("WAWebFrontendMsgGetters").getChat(t);if(o("WAWebChatGetters").getIsGroup(n)||o("WAWebChatGetters").getIsNewsletter(n))return n.isTrusted();if(o("WAWebMsgGetters").getIsPSA(t)||o("WAWebMsgGetters").getIsCAPISupport(t)||t.isFromTemplate)return!0;var r=o("WAWebChatGetters").getIsGroup(n)?t.senderObj:n.contact;return(r==null?void 0:r.verifiedLevel)===o("WAWebBusinessProfileTypes").VERIFIED_LEVEL.HIGH?!0:n.notSpam}function d(e){var t,n=o("WAWebStateUtils").unproxy(e);return((t=o("WAWebFrontendMsgGetters").getChat(n).groupMetadata)==null?void 0:t.participants.iAmMember())===!0}l.hasSymbol=u,l.isTrusted=c,l.iAmGroupParticipant=d}),98); __d("WAWebCongratulationsAnimationsGatingUtils",["WAWebABProps","gkx"],(function(t,n,r,o,a,i,l){function e(){return!r("gkx")("26258")&&o("WAWebABProps").getABPropConfigValue("fullscreen_animation_for_keyword")}l.isCongratulationsAnimationsEnabled=e}),98); __d("WAWebCongratulationsAnimationsUtils",["$InternalEnum","WAWebURLUtils"],(function(t,n,r,o,a,i,l){var e=n("$InternalEnum").Mirrored(["DEFAULT"]),s="https://static.whatsapp.net/wa/static/test";function u(t){var n=null;if(t===e.DEFAULT){var o={cat:"test",id:"confetti-falling",test:"1"};n=r("WAWebURLUtils").build(s,o)}return n}l.CelebrationAnimationType=e,l.getCongratulationsAnimationPath=u}),98); __d("WAWebMsgModelUtils",["WALogger","WAWebAck","WAWebAnimatedEmojiGatingUtils","WAWebBackendErrors","WAWebChatEphemerality","WAWebChatMsgsCollection","WAWebChatPreferenceCollection","WAWebCommonMsgUtils","WAWebCongratulationsAnimationsGatingUtils","WAWebCongratulationsAnimationsUtils","WAWebEmoji","WAWebEmojiConst","WAWebFileUtils","WAWebFindChatAction","WAWebFrontendMsgGetters","WAWebGroupMetadataCollection","WAWebInteractiveMessageHeaderMediaType","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgKey","WAWebMsgModel","WAWebMsgType","WAWebProtobufsE2E.pb","WAWebWid","WAWebWidJsonReviver","promiseDone"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_,f={image:!0,video:!0,audio:!0,ptt:!0,sticker:!0,document:!0,product:!0};function g(e){var t;switch(e.type){case"image":case"video":case"ptv":case"audio":case"ptt":case"sticker":case"document":case"product":case"sticker-pack":case o("WAWebMsgType").MSG_TYPE.MESSAGE_HISTORY_BUNDLE:return!0;case"protocol":return e.subtype==="history_sync_notification";case o("WAWebMsgType").MSG_TYPE.NATIVE_FLOW:return e.headerType===o("WAWebProtobufsE2E.pb").Message$ButtonsMessage$HeaderType.IMAGE;case o("WAWebMsgType").MSG_TYPE.INTERACTIVE:return!!((t=e.interactiveHeader)!=null&&t.mediaType&&o("WAWebInteractiveMessageHeaderMediaType").IM_MEDIA_HEADER_TYPES.has(e.interactiveHeader.mediaType));default:return!1}}function h(e){return e.type===o("WAWebMsgType").MSG_TYPE.CHAT&&e.subtype==="url"}function y(e){return e.type===o("WAWebMsgType").MSG_TYPE.CHAT&&e.subtype==="url"}function C(e,t){switch(t){case"text":return e.type===o("WAWebMsgType").MSG_TYPE.CHAT&&e.subtype!=="url";case"image":return e.type===o("WAWebMsgType").MSG_TYPE.IMAGE;case"video":return e.type===o("WAWebMsgType").MSG_TYPE.VIDEO&&!e.isGif;case"gif":return e.type===o("WAWebMsgType").MSG_TYPE.VIDEO&&e.isGif;case"audio":return e.type===o("WAWebMsgType").MSG_TYPE.AUDIO;case"ptt":return e.type===o("WAWebMsgType").MSG_TYPE.PTT;case"document":return e.type===o("WAWebMsgType").MSG_TYPE.DOCUMENT;case"location":return e.type===o("WAWebMsgType").MSG_TYPE.LOCATION;case"vcard":return e.type===o("WAWebMsgType").MSG_TYPE.VCARD||e.type===o("WAWebMsgType").MSG_TYPE.MULTI_VCARD;case"url":return e.type===o("WAWebMsgType").MSG_TYPE.CHAT&&e.subtype==="url";case"sticker":return e.type===o("WAWebMsgType").MSG_TYPE.STICKER;case void 0:return!1;default:return!1}}function b(e){if(!e)return null;var t=typeof e.id=="string"?e.id:e.id.id,n=new(r("WAWebMsgKey"))({from:e.from,to:e.to,id:t,participant:e.participant,selfDir:e.self});e.id=n;var a=new(o("WAWebMsgModel")).Msg(e);return a.fromQuotedMsg=!0,a}function v(e){var t=e.filter(function(e){return!o("WAWebMsgGetters").getHasOriginatedFromNewsletter(e)&&(o("WAWebMsgGetters").getIsMedia(e)||o("WAWebFileUtils").isDocument(e))&&!!e.caption});return t}function S(t){var n,a,i,l;if(t instanceof o("WAWebMsgModel").Msg)i=t,l=t.id;else if(t instanceof r("WAWebMsgKey"))l=t;else{o("WALogger").WARN(e||(e=babelHelpers.taggedTemplateLiteralLoose(["model:msgs:broadcastFanout: unknown msgOrKey: ",""])),String(t));return}if(!r("WAWebWid").isStatus(l.remote)){if((n=i)!=null&&n.recipients&&i.recipients.length!==0)a=i.recipients;else{var u=r("WAWebGroupMetadataCollection").get(l.remote);u?a=u.participants.map(function(e){return e.id}):o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["model:msgs:broadcastFanout no group_metadata rec for bclist, cant fanout: ",""])),l.remote.toString())}return a?a.map(function(e){return new(r("WAWebMsgKey"))({fromMe:l.fromMe,remote:e,id:l.id})}):void 0}}function R(e){var t;if(!e.invis){var n=S(e);n&&(t=n.map(function(e){return e.remote}),n.forEach(function(t){if(!o("WAWebMsgCollection").MsgCollection.some(function(e){return e.id.equals(t)})){var n=I(e);n.to=t.remote,n.id=t,n.broadcast=!0;var a=o("WAWebMsgCollection").MsgCollection.add(n,{merge:!0});r("promiseDone")(o("WAWebFindChatAction").findOrCreateLatestChat(t.remote,"msgModelBroadcastFanout"),function(e){var t=e.chat,n=a.reduce(function(e,n){if(n==null)return e;if(n.type!==o("WAWebMsgType").MSG_TYPE.PROTOCOL){o("WAWebChatEphemerality").isEphemeralSettingOn(t)&&(n.ephemeralDuration=o("WAWebChatEphemerality").getEphemeralSetting(t));var r=o("WAWebChatEphemerality").getEphemeralSettingTimestamp(t);r!=null&&(n.ephemeralSettingTimestamp=r);var a=o("WAWebChatEphemerality").getDisappearingModeInitiator(t);a!=null&&(n.disappearingModeInitiator=a)}return e.push(n),e},[]);L(n,t,!0)})}}))}return t}function L(e,t,n,r,a,i,l){var s=r||t.msgs;if(e.length!==0){var d=s===t.msgs;if(i===!0)if(d)o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["models:msg:store:resetMostRecentMsgs .msgs === cmc !"]))),E(t,s,e);else{d=!0,E(t,s,e);var m=new(o("WAWebChatMsgsCollection")).ChatMsgsCollection;m.replace(t.msgs),t.msgChunks.push(m),t.replaceMsgsCollection(s),t.msgs.trigger("change:last",t.msgs.last())}else if(n)d?E(t,s,e):k(s,e);else{var p=0;if(l){var _=s.get(l);if(_){var f=s.indexOf(_);f!==-1&&(p=f,o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["models:msg:store:insert group history messages at index "," before anchor ",""])),p,l.toString()))}}k(s,e,{at:p,silent:e.every(T)})}var g=a;g&&!t.unreadMsgAnchor&&(t.disableUnreadAnchor?t.disableUnreadAnchor=!1:t.unreadMsgAnchor=e.find(function(e){return e.id.toString()===g.toString()}))}}function E(e,t,n){var r=n.at(-1);r&&(k(t,n),e.lastReceivedKey=r.id)}function k(e,t,n){try{e.add(t,n)}catch(e){if(e instanceof o("WAWebBackendErrors").LogoutDrop)o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["setRecords LogoutDrop: ",""])),e.toString());else throw e}}function I(e){return e!=null&&typeof e=="object"?JSON.parse(JSON.stringify(e),o("WAWebWidJsonReviver").jsonWidReviver):e}function T(e){return o("WAWebFrontendMsgGetters").getEventType(e)===o("WAWebCommonMsgUtils").EventType.IGNORE}function D(e){return e.filter(function(e){return e.ack===o("WAWebAck").ACK.READ}).map(function(e){return e.id.toString()})}var x=new RegExp(["congratulations","congrats"].join("|"));function $(e){if(!o("WAWebCongratulationsAnimationsGatingUtils").isCongratulationsAnimationsEnabled())return null;if(e!=null){var t=x.test(e.toLocaleLowerCase());if(t)return o("WAWebCongratulationsAnimationsUtils").CelebrationAnimationType.DEFAULT}return null}function P(e,t){if(t===o("WAWebMsgType").MSG_TYPE.CHAT&&!(e==null||e==="")){var n=o("WAWebEmoji").EmojiUtil.matchLargeEmojiPattern(e);if(!(n==null||n.length!==1)){var r=o("WAWebEmoji").EmojiUtil.normalizeEmoji(n[0]);return r}}}function N(e,t){if(!o("WAWebAnimatedEmojiGatingUtils").isAnimatedEmojiEnabled()||!r("WAWebChatPreferenceCollection").get("autoplayAnimatedImages"))return!1;var n=P(e,t);return n!=null&&o("WAWebEmojiConst").getSupportedAnimatedEmojis().includes(n)}var M=new Set([(_=o("WAWebMsgType")).MSG_TYPE.NOTIFICATION,_.MSG_TYPE.NOTIFICATION_TEMPLATE,_.MSG_TYPE.GP2,_.MSG_TYPE.BROADCAST_NOTIFICATION,_.MSG_TYPE.E2E_NOTIFICATION,_.MSG_TYPE.CALL_LOG,_.MSG_TYPE.PROTOCOL,_.MSG_TYPE.DEBUG,_.MSG_TYPE.CIPHERTEXT]);function w(e){var t=o("WAWebMsgGetters").getSender(e);if(t==null&&!M.has(e.type)){var n,r,a;o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["Undefined sender for "," subtype:"," from:",", author:",""])),(n=e.id)==null?void 0:n.toString(),e.subtype,(r=e.from)==null?void 0:r.toString(),(a=e.author)==null?void 0:a.toString()),o("WALogger").ERROR(p||(p=babelHelpers.taggedTemplateLiteralLoose(["Messages should have a sender!"]))).sendLogs(e.type+"-msg-missing-sender",{sampling:.01})}return t}function A(e){var t=o("WAWebMsgGetters").getSender(e);return o("WAWebMsgGetters").getIsNewsletterMsg(e)?t=e.id.remote:o("WAWebMsgGetters").getIsGroupStatus(e)&&(t=e.author),t}l.typeIsMms=g,l.typeIsUrl=h,l.notRefiningTypeIsUrl=y,l.msgMatchesType=C,l.createQuotedMsg=b,l.getMediaMsgWithCaptionForForwarding=v,l.getBroadcastFanoutKeys=S,l.broadcastFanout=R,l.addRecordsToChat=L,l.getReadMsgKeys=D,l.getCelebrationAnimationType=$,l.isSingleEmojiMessageText=P,l.isAnimatedEmoji=N,l.getValidatedSender=w,l.getQuotedParticipantForContextInfo=A}),98); __d("WAWebLogoFacebookIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="logo-facebook";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=28,R=28;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 28 28",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),version:"1.1",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{d:"M15.0896028,14.7272727 L15.1043384,26 L4.33333333,26 C1.91438192,26 0,24.0856181 0,21.6666667 L0,4.33333333 C0,1.91438192 1.91438192,0 4.33333333,0 L21.6666667,0 C24.0856181,0 26,1.91438192 26,4.33333333 L26,21.6666667 C26,24.0856181 24.0856181,26 21.6666667,26 L16.3649427,26 L16.3502071,14.7272727 L19.8103776,14.7272727 L20.017785,13.4545455 L16.3550034,13.4545455 L16.3636733,12.4459498 L16.3818182,10.3393939 C16.3818182,8.69776256 17.1633755,7.73939393 18.9587599,7.74051324 L20.1818182,7.68259683 L20.1818182,6.38433052 L20.1617937,6.38468908 C19.4139177,6.39804401 18.7382334,6.4060606 18.2060606,6.4060606 C16.1406731,6.4060606 15.1030303,7.44259476 15.103009,9.67926308 L15.0783339,13.4545455 L11.8018536,13.4545455 L11.8042105,14.7272727 L15.0896028,14.7272727 Z M14.1030303,25 L14.0909091,15.7272727 L10.8060606,15.7272727 L10.8,12.4545455 L14.0848485,12.4545455 L14.1030303,9.67272727 C14.1030303,6.8060606 15.6727273,5.4060606 18.2060606,5.4060606 C19.4060606,5.4060606 21.1818182,5.36363637 21.1818182,5.36363636 L21.1818182,8.63636364 L19.0060606,8.73939393 C17.6060606,8.73939393 17.3818182,9.4060606 17.3818182,10.3393939 L17.3636364,12.4545455 L21.1939394,12.4545455 L20.6606061,15.7272727 L17.3515151,15.7272727 L17.3636364,25 L21.6666667,25 C23.5333333,25 25,23.5333333 25,21.6666667 L25,4.33333333 C25,2.46666667 23.5333333,1 21.6666667,1 L4.33333333,1 C2.46666667,1 1,2.46666667 1,4.33333333 L1,21.6666667 C1,23.5333333 2.46666667,25 4.33333333,25 L14.1030303,25 Z",fillOpacity:.3,fill:"#263238",fillRule:"nonzero"}),c.jsx("path",{d:"M14.1030303,25 L4.33333333,25 C2.46666667,25 1,23.5333333 1,21.6666667 L1,4.33333333 C1,2.46666667 2.46666667,1 4.33333333,1 L21.6666667,1 C23.5333333,1 25,2.46666667 25,4.33333333 L25,21.6666667 C25,23.5333333 23.5333333,25 21.6666667,25 L17.3636364,25 L17.3515151,15.7272727 L20.6606061,15.7272727 L21.1939394,12.4545455 L17.3636364,12.4545455 L17.3818182,10.3393939 C17.3818182,9.4060606 17.6060606,8.73939393 19.0060606,8.73939393 L21.1818182,8.63636364 L21.1818182,5.36363636 C21.1818182,5.36363637 19.4060606,5.4060606 18.2060606,5.4060606 C15.6727273,5.4060606 14.1030303,6.8060606 14.1030303,9.67272727 L14.0848485,12.4545455 L10.8,12.4545455 L10.8060606,15.7272727 L14.0909091,15.7272727 L14.1030303,25 Z",fillOpacity:.6,fill:"#FFFFFF"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.LogoFacebookIcon=m}),98); __d("WAWebLogoInstagramIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="logo-instagram";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=28,R=28;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 28 28",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),version:"1.1",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{d:"M13.0000238,0 C16.0471863,0 16.5726824,0.00844009118 17.9931478,0.0732517966 C19.2870609,0.132267821 20.2814874,0.332106718 21.2226416,0.697902272 C22.1770489,1.06875343 22.952994,1.56696125 23.6930681,2.30698242 C24.4330127,3.04697986 24.9312153,3.82289637 25.3021335,4.77732795 C25.667913,5.71859186 25.8677347,6.71299539 25.9267474,8.00683567 C25.9915599,9.42731803 26,9.95281754 26,13.0000238 C26,16.0471863 25.9915599,16.5726824 25.9267482,17.9931478 C25.8677347,19.2870046 25.667913,20.2814081 25.3021264,21.2226904 C24.9312153,22.1771036 24.4330127,22.9530201 23.6930176,23.6930681 C22.9530201,24.4330127 22.1771036,24.9312153 21.222672,25.3021335 C20.2814081,25.667913 19.2870046,25.8677347 17.9931643,25.9267474 C16.5726824,25.9915599 16.0471863,26 13.0000238,26 C9.95281754,26 9.42731803,25.9915599 8.00685221,25.9267482 C6.71299539,25.8677347 5.71859186,25.667913 4.77730956,25.3021264 C3.82289637,24.9312153 3.04697986,24.4330127 2.30693194,23.6930176 C1.56696125,22.952994 1.06875343,22.1770489 0.697933759,21.2227226 C0.332106718,20.2814874 0.132267821,19.2870609 0.0732525511,17.9931643 C0.00844009118,16.5726824 0,16.0471863 0,13.0000238 C0,9.95281754 0.00844007012,9.42731803 0.0732517966,8.00685221 C0.132267821,6.71293915 0.332106718,5.71851257 0.697902272,4.77735844 C1.06875343,3.82295107 1.56696125,3.04700595 2.30698242,2.30693194 C3.04700595,1.56696125 3.82295107,1.06875343 4.77727742,0.697933759 C5.71851257,0.332106718 6.71293915,0.132267821 8.00683567,0.0732525511 C9.42731803,0.00844007012 9.95281754,0 13.0000238,0 Z M13.0000238,4.1621583 C10.0092642,4.1621583 9.54871163,4.16940019 8.19652181,4.23109475 C7.31647529,4.27122389 6.77862056,4.38554609 6.284987,4.57739421 C5.8537324,4.74499635 5.57155295,4.92857388 5.25004154,5.25012175 C4.92857388,5.57155295 4.74499635,5.8537324 4.57739222,6.28499212 C4.38554609,6.77862056 4.27122389,7.31647529 4.23109353,8.19654849 C4.16940019,9.54871163 4.1621583,10.0092642 4.1621583,13.0000238 C4.1621583,15.9907394 4.16940021,16.4512887 4.23109475,17.8034782 C4.27122389,18.6835247 4.38554609,19.2213794 4.57739421,19.715013 C4.74497012,20.1462001 4.92857819,20.4284149 5.25012175,20.7499585 C5.57155295,21.0714261 5.8537324,21.2550037 6.28499212,21.4226078 C6.77862056,21.6144539 7.31647529,21.7287761 8.19655363,21.7689067 C9.54857728,21.8306006 10.0090682,21.8378417 13.0000238,21.8378417 C15.9909551,21.8378417 16.4514881,21.8306 17.8034782,21.7689053 C18.6835247,21.7287761 19.2213794,21.6144539 19.715013,21.4226058 C20.1462676,21.2550037 20.4284471,21.0714261 20.7499585,20.7498782 C21.0714261,20.4284471 21.2550037,20.1462676 21.4226078,19.7150079 C21.6144539,19.2213794 21.7287761,18.6835247 21.7689065,17.8034515 C21.8305998,16.4512887 21.8378417,15.9907394 21.8378417,13.0000238 C21.8378417,10.0092642 21.8305998,9.54871163 21.7689053,8.19652181 C21.7287761,7.31647529 21.6144539,6.77862056 21.4226058,6.284987 C21.2550037,5.8537324 21.0714261,5.57155295 20.7498782,5.25004154 C20.4284471,4.92857388 20.1462676,4.74499635 19.7150079,4.57739222 C19.2213794,4.38554609 18.6835247,4.27122389 17.8034515,4.23109353 C16.4512887,4.16940021 15.9907394,4.1621583 13.0000238,4.1621583 Z M13.0000238,5.8378417 C16.9555813,5.8378417 20.1621583,9.04443587 20.1621583,13.0000238 C20.1621583,16.9555727 16.9555727,20.1621583 13.0000238,20.1621583 C9.04443587,20.1621583 5.8378417,16.9555813 5.8378417,13.0000238 C5.8378417,9.04442731 9.04442731,5.8378417 13.0000238,5.8378417 Z M13.0000238,16 C14.6568646,16 16,14.6568646 16,13.0000238 C16,11.343141 14.6568701,10 13.0000238,10 C11.3431354,10 10,11.3431354 10,13.0000238 C10,14.6568701 11.343141,16 13.0000238,16 Z M19.8456418,6.59438394 C19.8456418,6.83737839 19.6486491,7.03436203 19.4056161,7.03436203 C19.1626284,7.03436203 18.965638,6.83737614 18.965638,6.59438394 C18.965638,6.35137243 19.1626477,6.15435822 19.4056161,6.15435822 C19.6486298,6.15435822 19.8456418,6.35137018 19.8456418,6.59438394 Z M21.8456418,6.59438394 C21.8456418,5.24680068 20.7531993,4.15435822 19.4056161,4.15435822 C18.0580679,4.15435822 16.965638,5.24681316 16.965638,6.59438394 C16.965638,7.94195587 18.0580691,9.03436203 19.4056161,9.03436203 C20.7531982,9.03436203 21.8456418,7.94196835 21.8456418,6.59438394 Z M13.0000238,1 C9.74099567,1 9.33234294,1.01381388 8.05241535,1.07221326 C6.77515526,1.13046973 5.90283244,1.33334326 5.13954402,1.63000828 C4.35043794,1.93662882 3.68122682,2.34694874 3.01406396,3.01406396 C2.34694874,3.68122682 1.93662882,4.35043794 1.63000828,5.13954402 C1.33334326,5.90283244 1.13046973,6.77515526 1.07221326,8.05241535 C1.01381388,9.33234294 1,9.74099567 1,13.0000238 C1,16.2590043 1.01381388,16.6676571 1.07221326,17.9475847 C1.13046973,19.2248447 1.33334326,20.0971676 1.63000828,20.860456 C1.93662882,21.6495621 2.34694874,22.3187732 3.01406396,22.985936 C3.68122682,23.6530513 4.35043794,24.0633712 5.13954402,24.3700394 C5.90283244,24.6666567 6.77515526,24.8695303 8.05241535,24.9277867 C9.33234294,24.9861861 9.74099567,25 13.0000238,25 C16.2590043,25 16.6676571,24.9861861 17.9475847,24.9277867 C19.2248447,24.8695303 20.0971676,24.6666567 20.860456,24.3700394 C21.6495621,24.0633712 22.3187732,23.6530513 22.985936,22.985936 C23.6530513,22.3187732 24.0633712,21.6495621 24.3700394,20.860456 C24.6666567,20.0971676 24.8695303,19.2248447 24.9277867,17.9475847 C24.9861861,16.6676571 25,16.2590043 25,13.0000238 C25,9.74099567 24.9861861,9.33234294 24.9277867,8.05241535 C24.8695303,6.77515526 24.6666567,5.90283244 24.3700394,5.13954402 C24.0633712,4.35043794 23.6530513,3.68122682 22.985936,3.01406396 C22.3187732,2.34694874 21.6495621,1.93662882 20.860456,1.63000828 C20.0971676,1.33334326 19.2248447,1.13046973 17.9475847,1.07221326 C16.6676571,1.01381388 16.2590043,1 13.0000238,1 Z M13.0000238,3.1621583 C16.2041299,3.1621583 16.5836782,3.17440026 17.8490298,3.23213276 C19.0190179,3.28548292 19.6544088,3.48097316 20.0772565,3.64531072 C20.6373856,3.86299845 21.0371308,4.12303286 21.4570251,4.54297487 C21.8769671,4.96286924 22.1370016,5.3626144 22.3546893,5.92274348 C22.5190268,6.34559117 22.7145171,6.9809821 22.7678672,8.15097025 C22.8255997,9.41632182 22.8378417,9.79587013 22.8378417,13.0000238 C22.8378417,16.2041299 22.8255997,16.5836782 22.7678672,17.8490298 C22.7145171,19.0190179 22.5190268,19.6544088 22.3546893,20.0772565 C22.1370016,20.6373856 21.8769671,21.0371308 21.4570251,21.4570251 C21.0371308,21.8769671 20.6373856,22.1370016 20.0772565,22.3546893 C19.6544088,22.5190268 19.0190179,22.7145171 17.8490298,22.7678672 C16.5838687,22.8255997 16.204368,22.8378417 13.0000238,22.8378417 C9.79563196,22.8378417 9.41617891,22.8255997 8.15097025,22.7678672 C6.9809821,22.7145171 6.34559117,22.5190268 5.92274348,22.3546893 C5.3626144,22.1370016 4.96286924,21.8769671 4.54297487,21.4570251 C4.1230805,21.0371308 3.86299845,20.6373856 3.64531072,20.0772565 C3.48097316,19.6544088 3.28548292,19.0190179 3.23213276,17.8490298 C3.17440026,16.5836782 3.1621583,16.2041299 3.1621583,13.0000238 C3.1621583,9.79587013 3.17440026,9.41632182 3.23213276,8.15097025 C3.28548292,6.9809821 3.48097316,6.34559117 3.64531072,5.92274348 C3.86299845,5.3626144 4.12303286,4.96286924 4.54297487,4.54297487 C4.96286924,4.12303286 5.3626144,3.86299845 5.92274348,3.64531072 C6.34559117,3.48097316 6.9809821,3.28548292 8.15097025,3.23213276 C9.41632182,3.17440026 9.79587013,3.1621583 13.0000238,3.1621583 Z M13.0000238,6.8378417 C9.59671206,6.8378417 6.8378417,9.59671206 6.8378417,13.0000238 C6.8378417,16.4032879 9.59671206,19.1621583 13.0000238,19.1621583 C16.4032879,19.1621583 19.1621583,16.4032879 19.1621583,13.0000238 C19.1621583,9.59671206 16.4032879,6.8378417 13.0000238,6.8378417 Z M13.0000238,17 C10.7908507,17 9,15.2091493 9,13.0000238 C9,10.7908507 10.7908507,9 13.0000238,9 C15.2091493,9 17,10.7908507 17,13.0000238 C17,15.2091493 15.2091493,17 13.0000238,17 Z M20.8456418,6.59438394 C20.8456418,5.79908543 20.2009146,5.15435822 19.4056161,5.15435822 C18.6103652,5.15435822 17.965638,5.79908543 17.965638,6.59438394 C17.965638,7.38968246 18.6103652,8.03436203 19.4056161,8.03436203 C20.2009146,8.03436203 20.8456418,7.38968246 20.8456418,6.59438394 Z",fillOpacity:.3,fill:"#263238",fillRule:"nonzero"}),c.jsx("path",{d:"M13.0000238,1 C16.2590043,1 16.6676571,1.01381388 17.9475847,1.07221326 C19.2248447,1.13046973 20.0971676,1.33334326 20.860456,1.63000828 C21.6495621,1.93662882 22.3187732,2.34694874 22.985936,3.01406396 C23.6530513,3.68122682 24.0633712,4.35043794 24.3700394,5.13954402 C24.6666567,5.90283244 24.8695303,6.77515526 24.9277867,8.05241535 C24.9861861,9.33234294 25,9.74099567 25,13.0000238 C25,16.2590043 24.9861861,16.6676571 24.9277867,17.9475847 C24.8695303,19.2248447 24.6666567,20.0971676 24.3700394,20.860456 C24.0633712,21.6495621 23.6530513,22.3187732 22.985936,22.985936 C22.3187732,23.6530513 21.6495621,24.0633712 20.860456,24.3700394 C20.0971676,24.6666567 19.2248447,24.8695303 17.9475847,24.9277867 C16.6676571,24.9861861 16.2590043,25 13.0000238,25 C9.74099567,25 9.33234294,24.9861861 8.05241535,24.9277867 C6.77515526,24.8695303 5.90283244,24.6666567 5.13954402,24.3700394 C4.35043794,24.0633712 3.68122682,23.6530513 3.01406396,22.985936 C2.34694874,22.3187732 1.93662882,21.6495621 1.63000828,20.860456 C1.33334326,20.0971676 1.13046973,19.2248447 1.07221326,17.9475847 C1.01381388,16.6676571 1,16.2590043 1,13.0000238 C1,9.74099567 1.01381388,9.33234294 1.07221326,8.05241535 C1.13046973,6.77515526 1.33334326,5.90283244 1.63000828,5.13954402 C1.93662882,4.35043794 2.34694874,3.68122682 3.01406396,3.01406396 C3.68122682,2.34694874 4.35043794,1.93662882 5.13954402,1.63000828 C5.90283244,1.33334326 6.77515526,1.13046973 8.05241535,1.07221326 C9.33234294,1.01381388 9.74099567,1 13.0000238,1 Z M13.0000238,3.1621583 C9.79587013,3.1621583 9.41632182,3.17440026 8.15097025,3.23213276 C6.9809821,3.28548292 6.34559117,3.48097316 5.92274348,3.64531072 C5.3626144,3.86299845 4.96286924,4.12303286 4.54297487,4.54297487 C4.12303286,4.96286924 3.86299845,5.3626144 3.64531072,5.92274348 C3.48097316,6.34559117 3.28548292,6.9809821 3.23213276,8.15097025 C3.17440026,9.41632182 3.1621583,9.79587013 3.1621583,13.0000238 C3.1621583,16.2041299 3.17440026,16.5836782 3.23213276,17.8490298 C3.28548292,19.0190179 3.48097316,19.6544088 3.64531072,20.0772565 C3.86299845,20.6373856 4.1230805,21.0371308 4.54297487,21.4570251 C4.96286924,21.8769671 5.3626144,22.1370016 5.92274348,22.3546893 C6.34559117,22.5190268 6.9809821,22.7145171 8.15097025,22.7678672 C9.41617891,22.8255997 9.79563196,22.8378417 13.0000238,22.8378417 C16.204368,22.8378417 16.5838687,22.8255997 17.8490298,22.7678672 C19.0190179,22.7145171 19.6544088,22.5190268 20.0772565,22.3546893 C20.6373856,22.1370016 21.0371308,21.8769671 21.4570251,21.4570251 C21.8769671,21.0371308 22.1370016,20.6373856 22.3546893,20.0772565 C22.5190268,19.6544088 22.7145171,19.0190179 22.7678672,17.8490298 C22.8255997,16.5836782 22.8378417,16.2041299 22.8378417,13.0000238 C22.8378417,9.79587013 22.8255997,9.41632182 22.7678672,8.15097025 C22.7145171,6.9809821 22.5190268,6.34559117 22.3546893,5.92274348 C22.1370016,5.3626144 21.8769671,4.96286924 21.4570251,4.54297487 C21.0371308,4.12303286 20.6373856,3.86299845 20.0772565,3.64531072 C19.6544088,3.48097316 19.0190179,3.28548292 17.8490298,3.23213276 C16.5836782,3.17440026 16.2041299,3.1621583 13.0000238,3.1621583 Z M13.0000238,6.8378417 C16.4032879,6.8378417 19.1621583,9.59671206 19.1621583,13.0000238 C19.1621583,16.4032879 16.4032879,19.1621583 13.0000238,19.1621583 C9.59671206,19.1621583 6.8378417,16.4032879 6.8378417,13.0000238 C6.8378417,9.59671206 9.59671206,6.8378417 13.0000238,6.8378417 Z M13.0000238,17 C15.2091493,17 17,15.2091493 17,13.0000238 C17,10.7908507 15.2091493,9 13.0000238,9 C10.7908507,9 9,10.7908507 9,13.0000238 C9,15.2091493 10.7908507,17 13.0000238,17 Z M20.8456418,6.59438394 C20.8456418,7.38968246 20.2009146,8.03436203 19.4056161,8.03436203 C18.6103652,8.03436203 17.965638,7.38968246 17.965638,6.59438394 C17.965638,5.79908543 18.6103652,5.15435822 19.4056161,5.15435822 C20.2009146,5.15435822 20.8456418,5.79908543 20.8456418,6.59438394 Z",id:"IG-logo",fillOpacity:.6,fill:"#FFFFFF"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.LogoInstagramIcon=m}),98); __d("WAWebLogoYoutubeIcon.react",["WAWebSvgComponentBase","react","stylex"],(function(t,n,r,o,a,i,l){var e=["height","iconXstyle","name","viewBox","width"],s,u,c=s||(s=r("react")),d="logo-youtube";function m(t){var n=t.height,a=t.iconXstyle,i=t.name,l=t.viewBox,s=t.width,m=babelHelpers.objectWithoutPropertiesLoose(t,e),p;if(l){var _=l.height,f=_===void 0?0:_,g=l.width,h=g===void 0?0:g,y=l.x,C=y===void 0?0:y,b=l.y,v=b===void 0?0:b;p=[C,v,h,f].join(" ")}var S=20,R=75;return(n!=null||s!=null)&&(S=n,R=s),c.jsx(o("WAWebSvgComponentBase").BaseSvgSpan,babelHelpers.extends({name:i!=null?i:d},m,{children:c.jsxs("svg",{viewBox:p!=null?p:"0 0 75 20",height:S,width:R,preserveAspectRatio:"xMidYMid meet",className:(u||(u=r("stylex")))(a),version:"1.1",children:[c.jsx("title",{children:i!=null?i:d}),c.jsx("path",{d:"M58.0577137,16.5924517 L58.0577137,16.6109096 L54.4614664,16.6109096 L54.435877,16.4445786 C53.9935766,16.6634739 53.4952699,16.777363 52.9520481,16.777363 C52.0069701,16.777363 51.2207817,16.4221346 50.7048004,15.724042 C50.6344039,15.6287022 50.5702014,15.5280378 50.5119372,15.4219109 L50.5119372,16.5924147 L46.683398,16.5924147 L46.683398,16.6109096 L43.0871507,16.6109096 L43.0615614,16.4445786 C42.619261,16.6634739 42.1209542,16.777363 41.5777324,16.777363 C40.6326544,16.777363 39.8464661,16.4221346 39.3304847,15.724042 C39.1528633,15.4834847 39.0146744,15.2090287 38.9118132,14.898461 C38.6441723,15.4298888 38.2837063,15.8583571 37.8229911,16.1655005 C37.198009,16.5821553 36.399029,16.777326 35.4319956,16.7770426 C34.4663993,16.7540523 33.666818,16.5571404 33.0516159,16.1470057 C32.3952164,15.709406 31.9472728,15.0440781 31.7037147,14.1915153 C31.5447488,13.6510314 31.4469181,12.9965579 31.4067673,12.235867 L31.4067673,16.5925257 L27.2243783,16.5925257 L27.2243783,11.4300087 L24.3773733,1.10961535 L28.6991282,1.10961535 L28.8690811,1.89918819 L29.3165231,3.97793852 L29.9567738,1.10961535 L34.2774102,1.10961535 L33.1365212,5.18539989 C33.1442322,5.18016703 33.1519706,5.17496321 33.1597365,5.16978843 C33.7981445,4.7612073 34.5762693,4.5681841 35.492788,4.5681841 C36.4004338,4.5681841 37.1822463,4.76517621 37.8043363,5.17990291 C38.1487847,5.40943954 38.4371395,5.7067374 38.6725808,6.06418313 L38.6725808,4.75316931 L44.1471592,4.75316931 L44.1471592,1.10968933 L52.712821,1.10968933 L52.712821,4.75316931 L57.3893779,4.75316931 L57.3893779,0.610181175 L61.5349622,0.610181175 L61.5349622,4.70857657 C61.8471504,4.6027659 62.1755901,4.54976326 62.5137233,4.54976326 C63.2696894,4.54976326 63.9414049,4.78115764 64.43659,5.24539378 C64.7667068,5.55468494 65.0163437,5.95885855 65.1930604,6.44995282 C65.2727761,6.28602999 65.3610538,6.13229383 65.458189,5.98853377 C66.1229151,5.00473908 67.2126941,4.53117596 68.6169406,4.53117596 C69.5534434,4.53117596 70.3406071,4.7233183 70.9372855,5.13032953 C71.5435056,5.54366138 71.95366,6.17559898 72.1876248,6.98072766 C72.3797416,7.66456937 72.4653282,8.55012146 72.4653282,9.69251096 L72.4653282,12.3755398 L72.3518452,12.3755398 L72.3713658,12.4721766 C72.4058099,12.642692 72.4098437,12.7425382 72.4098437,13.021579 C72.4098437,14.2001549 72.0663789,15.1527839 71.3344147,15.8034187 C70.634676,16.4254086 69.6959688,16.721823 68.5614561,16.721823 C67.1615954,16.721823 66.0766331,16.2286583 65.4293218,15.2303041 C65.3280412,15.074163 65.2365958,14.9066861 65.1546963,14.7277305 C65.0949496,14.8887045 65.0290421,15.0394995 64.9568553,15.1799998 C64.4332835,16.199587 63.5533459,16.7587202 62.4212491,16.7587202 C61.9417607,16.7587202 61.4944835,16.6598433 61.0408162,16.4583658 L61.0086088,16.5924517 L58.0577137,16.5924517 L58.0577137,16.5924517 Z M24.3259002,5.62700608 C24.4236017,6.80523705 24.4550259,7.99393883 24.452758,8.86763092 C24.4527188,8.88030443 24.4527188,8.88030443 24.4527142,8.87879427 C24.4527142,8.93207856 24.4521755,9.02871609 24.4505765,9.16258163 C24.4479325,9.38394029 24.4431816,9.63016676 24.4357956,9.89517645 C24.4146551,10.6536972 24.3765715,11.41283 24.3169931,12.125387 C24.2352291,13.1032848 24.1195818,13.917554 23.9559594,14.5392558 C23.6044034,15.8450354 22.5773994,16.87197 21.265891,17.2253029 C20.4937667,17.4284935 18.9802227,17.5536738 16.85366,17.6336198 C15.8403408,17.6717145 14.7566214,17.6961593 13.6731798,17.7097362 C13.2941932,17.7144854 12.942212,17.7175391 12.626158,17.7192365 C12.4360536,17.7202574 12.2998065,17.7205989 12.2263571,17.7205989 C12.1527485,17.7205989 12.0162686,17.7202415 11.825867,17.7191733 C11.5093529,17.7173974 11.1568676,17.7142027 10.7773413,17.709234 C9.69233025,17.6950295 8.60702899,17.6694544 7.59215165,17.6295952 C5.47232465,17.5463391 3.95962355,17.4161347 3.18134306,17.2053493 C1.87545563,16.8537642 0.848339874,15.8266484 0.495965191,14.5178102 C0.3319537,13.901127 0.215623574,13.0804506 0.133715024,12.0909953 C0.0750181786,11.3819374 0.0374970877,10.6265128 0.0166687608,9.8716942 C0.0093917654,9.60797588 0.00471093513,9.36295002 0.00210595247,9.14267269 C0.000530665118,9.00946639 0,8.91330987 0,8.86029945 C0,8.80701516 0.000538670764,8.71037762 0.00213763803,8.57651208 C0.00478167356,8.35515343 0.00953263464,8.10892695 0.0169186349,7.84391726 C0.0380591243,7.0853965 0.0761427077,6.32626374 0.135721054,5.61370672 C0.217485081,4.63580895 0.333132432,3.82153968 0.496754797,3.19983788 C0.84683331,1.89954626 1.88747318,0.851922236 3.18682324,0.495296018 C3.9589475,0.292105423 5.47249146,0.166925095 7.59905417,0.0869791289 C8.61237336,0.0488844227 9.69609279,0.0244396234 10.7795344,0.0108626608 C11.158521,0.00611345554 11.5105022,0.00305983032 11.8265562,0.00136244031 C12.0166606,0.000341471398 12.1529077,0 12.2263571,0 C12.2998759,0 12.4361942,0.000355316061 12.6263728,0.00141753781 C12.9425189,0.00318333776 13.294595,0.00635996401 13.6736809,0.0113004323 C14.757431,0.0254244933 15.8414699,0.0508545797 16.8551605,0.0904875938 C18.9847305,0.173748977 20.4997674,0.304064932 21.2713711,0.515249619 C22.576591,0.866654965 23.6033241,1.8929005 23.9554197,3.19783538 C24.1252865,3.81933066 24.2440865,4.64037511 24.3259002,5.62700608 Z M22.9903436,3.45981136 C22.7314161,2.4980806 21.9731284,1.73979289 21.0113977,1.48086538 C19.2543895,1 12.2263571,1 12.2263571,1 C12.2263571,1 5.19832465,1 3.44131653,1.46237056 C2.4980806,1.72129807 1.72129807,2.4980806 1.46237056,3.45981136 C1,5.21681947 1,8.86029945 1,8.86029945 C1,8.86029945 1,12.5222742 1.46237056,14.2607875 C1.72129807,15.2225183 2.47958578,15.980806 3.44131653,16.2397335 C5.21681947,16.7205989 12.2263571,16.7205989 12.2263571,16.7205989 C12.2263571,16.7205989 19.2543895,16.7205989 21.0113977,16.2582283 C21.9731284,15.9991159 22.7314161,15.2410131 22.9903436,14.2792824 C23.4527142,12.5222742 23.4527142,8.87879427 23.4527142,8.87879427 C23.4527142,8.87879427 23.471209,5.21681947 22.9903436,3.45981136 Z M9.9884836,12.2263571 L9.9884836,5.4942418 L15.8328474,8.86029945 L9.9884836,12.2263571 Z M33.6063161,15.3149554 C34.0501918,15.6108726 34.6790158,15.7588311 35.4557983,15.777326 C36.214086,15.777326 36.8244152,15.6293674 37.2682909,15.3334502 C37.7121666,15.0375331 38.0265786,14.5566677 38.2300217,13.9278437 C38.4336497,13.280525 38.5261238,12.448258 38.5261238,11.3940531 L38.5261238,9.96995179 C38.5261238,8.8972521 38.4149699,8.04649028 38.2115268,7.41766632 C38.0080838,6.78884237 37.6938568,6.30797699 37.2497961,6.01205983 C36.8059204,5.71614268 36.214086,5.5681841 35.492788,5.5681841 C34.7529951,5.5681841 34.1611608,5.71614268 33.6987902,6.01205983 C33.2549145,6.30797699 32.9220077,6.77034755 32.7000698,7.41766632 C32.4966268,8.0649851 32.3856578,8.91574692 32.3856578,9.96995179 L32.3856578,11.3940531 C32.3856578,12.4297631 32.478132,13.280525 32.6630802,13.9093489 C32.8480284,14.5566677 33.1624404,15.0190383 33.6063161,15.3149554 Z M36.1031171,13.7613903 C35.9736534,14.0942971 35.7702103,14.2422557 35.4742932,14.2422557 C35.1598812,14.2422557 34.9379433,14.0758023 34.8269744,13.7613903 C34.6975106,13.4469784 34.6420262,12.9106285 34.6420262,12.1893305 L34.6420262,9.11918997 C34.6420262,8.41638672 34.6975106,7.8985317 34.8269744,7.5656249 C34.9379433,7.25121292 35.1598812,7.08475952 35.4557983,7.08475952 C35.7702103,7.08475952 35.9736534,7.2327181 36.1031171,7.5656249 C36.2325809,7.8985317 36.2880653,8.41638672 36.2880653,9.11918997 L36.2880653,12.1893305 C36.2880653,12.9106285 36.2325809,13.4469784 36.1031171,13.7613903 Z M67.7478689,11.3755398 L71.4653282,11.3755398 L71.4653282,9.69251096 C71.4653282,8.65680092 71.3911639,7.84302874 71.2248955,7.25119443 C71.0582571,6.67785494 70.7808348,6.23397921 70.3739487,5.95655687 C69.9672476,5.67913454 69.3754133,5.53117596 68.6169406,5.53117596 C67.525931,5.53117596 66.7491485,5.86408276 66.286778,6.54839118 C65.8244074,7.23269961 65.6022846,8.3053993 65.6022846,9.78498507 L65.6022846,11.5050035 C65.6022846,12.9475997 65.8244074,14.0018045 66.2682831,14.686113 C66.7119739,15.3704214 67.4704466,15.721823 68.5614561,15.721823 C69.4678874,15.721823 70.1706906,15.4998851 70.6700508,15.0560094 C71.169411,14.6121337 71.4098437,13.9278253 71.4098437,13.021579 C71.4098437,12.8736204 71.4098437,12.7626515 71.3911639,12.6701773 L69.4861973,12.5592084 C69.4678874,13.1695375 69.4124029,13.5949185 69.2829392,13.853846 C69.1534754,14.1127735 68.9313526,14.2422372 68.5986307,14.2422372 C68.3395183,14.2422372 68.1545701,14.1682579 68.0437861,14.0202994 C67.9141374,13.8908356 67.840343,13.6504029 67.8033534,13.3359909 C67.7663637,13.021579 67.7478689,12.5407136 67.7478689,11.9118896 L67.7478689,11.3755398 Z M68.0252912,7.26968925 C68.1362602,7.12173067 68.3027136,7.04775138 68.5614561,7.06624621 C68.783579,7.06624621 68.9685272,7.1402255 69.0793112,7.26968925 C69.190465,7.39915301 69.2829392,7.62109087 69.3199288,7.95399767 C69.3567335,8.28690447 69.3754133,8.76776985 69.3754133,9.39659381 L69.3754133,10.0993971 L67.7478689,10.0993971 L67.7478689,9.39659381 C67.7478689,8.74927503 67.7663637,8.26840965 67.8033534,7.95399767 C67.840343,7.6395857 67.9141374,7.41764783 68.0252912,7.26968925 Z M28.2058835,11.2275627 L28.2243783,11.2275627 L28.2243783,15.5925257 L30.4067673,15.5925257 L30.4067673,11.2275627 L32.9590528,2.10961535 L30.758169,2.10961535 L29.8334279,6.25245553 C29.5745003,7.4731138 29.4080469,8.32387562 29.3340677,8.84173065 L29.2785832,8.84173065 C29.1676143,8.12043258 29.0011609,7.25117593 28.779223,6.23396071 L27.8914715,2.10961535 L25.6905877,2.10961535 L28.2058835,11.2275627 Z M45.683398,5.75316931 L43.4640194,5.75316931 L43.4640194,13.5764791 C43.390225,13.7614273 43.2605763,13.9093859 43.0756281,14.0203548 C42.8906799,14.1496337 42.7057317,14.2053031 42.5207834,14.2053031 C42.2988456,14.2053031 42.1325771,14.112829 42.040103,13.9278807 C41.9476289,13.7429325 41.8919595,13.4285205 41.8919595,12.9846448 L41.8919595,5.75316931 L39.6725808,5.75316931 L39.6725808,13.1141086 C39.6725808,14.0388497 39.8207243,14.7044783 40.1349514,15.1300442 C40.4493633,15.5554251 40.9304137,15.777363 41.5777324,15.777363 C42.5207834,15.777363 43.2422664,15.3149924 43.704637,14.4087461 L43.7601215,14.4087461 L43.9450697,15.6109096 L45.683398,15.6109096 L45.683398,5.75316931 Z M57.0577137,5.75316931 L54.838335,5.75316931 L54.838335,13.5764791 C54.7645407,13.7614273 54.634892,13.9093859 54.4499438,14.0203548 C54.2649955,14.1496337 54.0800473,14.2053031 53.8950991,14.2053031 C53.6731612,14.2053031 53.5068928,14.112829 53.4144187,13.9278807 C53.3219446,13.7429325 53.2662751,13.4285205 53.2662751,12.9846448 L53.2662751,5.75316931 L51.0468965,5.75316931 L51.0468965,13.1141086 C51.0468965,14.0388497 51.19504,14.7044783 51.509267,15.1300442 C51.823679,15.5554251 52.3047293,15.777363 52.9520481,15.777363 C53.8950991,15.777363 54.6165821,15.3149924 55.0789527,14.4087461 L55.1344371,14.4087461 L55.3193854,15.6109096 L57.0577137,15.6109096 L57.0577137,5.75316931 Z M51.712821,3.90368709 L51.712821,2.10968933 L45.1471592,2.10968933 L45.1471592,3.90368709 L47.3478581,3.90368709 L47.3478581,15.5924147 L49.5119372,15.5924147 L49.5119372,3.90368709 L51.712821,3.90368709 Z M64.4001951,7.32526619 C64.2707314,6.69625729 64.0489784,6.2525665 63.7528763,5.97514417 C63.4569592,5.69772184 63.0317632,5.54976326 62.5137233,5.54976326 C62.1070221,5.54976326 61.7184459,5.66073219 61.3672292,5.90116488 C61.0156427,6.12310275 60.7382203,6.43751473 60.5532721,6.80741117 L60.5349622,6.80741117 L60.5349622,1.61018118 L58.3893779,1.61018118 L58.3893779,15.5924517 L60.2203653,15.5924517 L60.4424881,14.6677106 L60.4977876,14.6677106 C60.664241,15.0006174 60.9231685,15.25936 61.2747551,15.462988 C61.6259718,15.6479362 61.9958682,15.7587202 62.4212491,15.7587202 C63.1795369,15.7587202 63.7158867,15.4075035 64.0672883,14.7231951 C64.4188749,14.0388867 64.6038231,12.9475072 64.6038231,11.4866012 L64.6038231,9.93285118 C64.5851433,8.80485197 64.5296589,7.93559533 64.4001951,7.32526619 Z M62.3657647,11.3386426 C62.3657647,12.0597557 62.328775,12.6146004 62.2732906,13.0216714 C62.2178061,13.4285575 62.1070221,13.7242897 61.9773734,13.8909281 C61.8295998,14.0571965 61.6446516,14.1496706 61.4225287,14.1496706 C61.2375805,14.1496706 61.0711271,14.112866 60.9231685,14.0203918 C60.77521,13.9279177 60.6457462,13.798454 60.5532721,13.6318156 L60.5532721,8.04656426 C60.6274363,7.78763675 60.7567151,7.56569888 60.9416634,7.38075066 C61.1266116,7.21429726 61.3300546,7.12182315 61.5334977,7.12182315 C61.7554355,7.12182315 61.9403838,7.21429726 62.0513527,7.38075066 C62.1808165,7.56569888 62.2547957,7.86161604 62.3102802,8.26831718 C62.3657647,8.69388304 62.3844444,9.2855324 62.3844444,10.0440051 L62.3844444,11.3386426 L62.3657647,11.3386426 Z",fillOpacity:.3,fill:"#263238",fillRule:"nonzero"}),c.jsx("path",{d:"M22.9903436,3.45981136 C23.471209,5.21681947 23.4527142,8.87879427 23.4527142,8.87879427 C23.4527142,8.87879427 23.4527142,12.5222742 22.9903436,14.2792824 C22.7314161,15.2410131 21.9731284,15.9991159 21.0113977,16.2582283 C19.2543895,16.7205989 12.2263571,16.7205989 12.2263571,16.7205989 C12.2263571,16.7205989 5.21681947,16.7205989 3.44131653,16.2397335 C2.47958578,15.980806 1.72129807,15.2225183 1.46237056,14.2607875 C1,12.5222742 1,8.86029945 1,8.86029945 C1,8.86029945 1,5.21681947 1.46237056,3.45981136 C1.72129807,2.4980806 2.4980806,1.72129807 3.44131653,1.46237056 C5.19832465,1 12.2263571,1 12.2263571,1 C12.2263571,1 19.2543895,1 21.0113977,1.48086538 C21.9731284,1.73979289 22.7314161,2.4980806 22.9903436,3.45981136 Z M9.9884836,12.2263571 L15.8328474,8.86029945 L9.9884836,5.4942418 L9.9884836,12.2263571 Z M33.6063161,15.3149554 C33.1624404,15.0190383 32.8480284,14.5566677 32.6630802,13.9093489 C32.478132,13.280525 32.3856578,12.4297631 32.3856578,11.3940531 L32.3856578,9.96995179 C32.3856578,8.91574692 32.4966268,8.0649851 32.7000698,7.41766632 C32.9220077,6.77034755 33.2549145,6.30797699 33.6987902,6.01205983 C34.1611608,5.71614268 34.7529951,5.5681841 35.492788,5.5681841 C36.214086,5.5681841 36.8059204,5.71614268 37.2497961,6.01205983 C37.6938568,6.30797699 38.0080838,6.78884237 38.2115268,7.41766632 C38.4149699,8.04649028 38.5261238,8.8972521 38.5261238,9.96995179 L38.5261238,11.3940531 C38.5261238,12.448258 38.4336497,13.280525 38.2300217,13.9278437 C38.0265786,14.5566677 37.7121666,15.0375331 37.2682909,15.3334502 C36.8244152,15.6293674 36.214086,15.777326 35.4557983,15.777326 C34.6790158,15.7588311 34.0501918,15.6108726 33.6063161,15.3149554 Z M36.1031171,13.7613903 C36.2325809,13.4469784 36.2880653,12.9106285 36.2880653,12.1893305 L36.2880653,9.11918997 C36.2880653,8.41638672 36.2325809,7.8985317 36.1031171,7.5656249 C35.9736534,7.2327181 35.7702103,7.08475952 35.4557983,7.08475952 C35.1598812,7.08475952 34.9379433,7.25121292 34.8269744,7.5656249 C34.6975106,7.8985317 34.6420262,8.41638672 34.6420262,9.11918997 L34.6420262,12.1893305 C34.6420262,12.9106285 34.6975106,13.4469784 34.8269744,13.7613903 C34.9379433,14.0758023 35.1598812,14.2422557 35.4742932,14.2422557 C35.7702103,14.2422557 35.9736534,14.0942971 36.1031171,13.7613903 Z M67.7478689,11.3755398 L67.7478689,11.9118896 C67.7478689,12.5407136 67.7663637,13.021579 67.8033534,13.3359909 C67.840343,13.6504029 67.9141374,13.8908356 68.0437861,14.0202994 C68.1545701,14.1682579 68.3395183,14.2422372 68.5986307,14.2422372 C68.9313526,14.2422372 69.1534754,14.1127735 69.2829392,13.853846 C69.4124029,13.5949185 69.4678874,13.1695375 69.4861973,12.5592084 L71.3911639,12.6701773 C71.4098437,12.7626515 71.4098437,12.8736204 71.4098437,13.021579 C71.4098437,13.9278253 71.169411,14.6121337 70.6700508,15.0560094 C70.1706906,15.4998851 69.4678874,15.721823 68.5614561,15.721823 C67.4704466,15.721823 66.7119739,15.3704214 66.2682831,14.686113 C65.8244074,14.0018045 65.6022846,12.9475997 65.6022846,11.5050035 L65.6022846,9.78498507 C65.6022846,8.3053993 65.8244074,7.23269961 66.286778,6.54839118 C66.7491485,5.86408276 67.525931,5.53117596 68.6169406,5.53117596 C69.3754133,5.53117596 69.9672476,5.67913454 70.3739487,5.95655687 C70.7808348,6.23397921 71.0582571,6.67785494 71.2248955,7.25119443 C71.3911639,7.84302874 71.4653282,8.65680092 71.4653282,9.69251096 L71.4653282,11.3755398 L67.7478689,11.3755398 Z M68.0252912,7.26968925 C67.9141374,7.41764783 67.840343,7.6395857 67.8033534,7.95399767 C67.7663637,8.26840965 67.7478689,8.74927503 67.7478689,9.39659381 L67.7478689,10.0993971 L69.3754133,10.0993971 L69.3754133,9.39659381 C69.3754133,8.76776985 69.3567335,8.28690447 69.3199288,7.95399767 C69.2829392,7.62109087 69.190465,7.39915301 69.0793112,7.26968925 C68.9685272,7.1402255 68.783579,7.06624621 68.5614561,7.06624621 C68.3027136,7.04775138 68.1362602,7.12173067 68.0252912,7.26968925 Z M28.2058835,11.2275627 L25.6905877,2.10961535 L27.8914715,2.10961535 L28.779223,6.23396071 C29.0011609,7.25117593 29.1676143,8.12043258 29.2785832,8.84173065 L29.3340677,8.84173065 C29.4080469,8.32387562 29.5745003,7.4731138 29.8334279,6.25245553 L30.758169,2.10961535 L32.9590528,2.10961535 L30.4067673,11.2275627 L30.4067673,15.5925257 L28.2243783,15.5925257 L28.2243783,11.2275627 L28.2058835,11.2275627 Z M45.683398,5.75316931 L45.683398,15.6109096 L43.9450697,15.6109096 L43.7601215,14.4087461 L43.704637,14.4087461 C43.2422664,15.3149924 42.5207834,15.777363 41.5777324,15.777363 C40.9304137,15.777363 40.4493633,15.5554251 40.1349514,15.1300442 C39.8207243,14.7044783 39.6725808,14.0388497 39.6725808,13.1141086 L39.6725808,5.75316931 L41.8919595,5.75316931 L41.8919595,12.9846448 C41.8919595,13.4285205 41.9476289,13.7429325 42.040103,13.9278807 C42.1325771,14.112829 42.2988456,14.2053031 42.5207834,14.2053031 C42.7057317,14.2053031 42.8906799,14.1496337 43.0756281,14.0203548 C43.2605763,13.9093859 43.390225,13.7614273 43.4640194,13.5764791 L43.4640194,5.75316931 L45.683398,5.75316931 Z M57.0577137,5.75316931 L57.0577137,15.6109096 L55.3193854,15.6109096 L55.1344371,14.4087461 L55.0789527,14.4087461 C54.6165821,15.3149924 53.8950991,15.777363 52.9520481,15.777363 C52.3047293,15.777363 51.823679,15.5554251 51.509267,15.1300442 C51.19504,14.7044783 51.0468965,14.0388497 51.0468965,13.1141086 L51.0468965,5.75316931 L53.2662751,5.75316931 L53.2662751,12.9846448 C53.2662751,13.4285205 53.3219446,13.7429325 53.4144187,13.9278807 C53.5068928,14.112829 53.6731612,14.2053031 53.8950991,14.2053031 C54.0800473,14.2053031 54.2649955,14.1496337 54.4499438,14.0203548 C54.634892,13.9093859 54.7645407,13.7614273 54.838335,13.5764791 L54.838335,5.75316931 L57.0577137,5.75316931 Z M51.712821,3.90368709 L49.5119372,3.90368709 L49.5119372,15.5924147 L47.3478581,15.5924147 L47.3478581,3.90368709 L45.1471592,3.90368709 L45.1471592,2.10968933 L51.712821,2.10968933 L51.712821,3.90368709 Z M64.4001951,7.32526619 C64.5296589,7.93559533 64.5851433,8.80485197 64.6038231,9.93285118 L64.6038231,11.4866012 C64.6038231,12.9475072 64.4188749,14.0388867 64.0672883,14.7231951 C63.7158867,15.4075035 63.1795369,15.7587202 62.4212491,15.7587202 C61.9958682,15.7587202 61.6259718,15.6479362 61.2747551,15.462988 C60.9231685,15.25936 60.664241,15.0006174 60.4977876,14.6677106 L60.4424881,14.6677106 L60.2203653,15.5924517 L58.3893779,15.5924517 L58.3893779,1.61018118 L60.5349622,1.61018118 L60.5349622,6.80741117 L60.5532721,6.80741117 C60.7382203,6.43751473 61.0156427,6.12310275 61.3672292,5.90116488 C61.7184459,5.66073219 62.1070221,5.54976326 62.5137233,5.54976326 C63.0317632,5.54976326 63.4569592,5.69772184 63.7528763,5.97514417 C64.0489784,6.2525665 64.2707314,6.69625729 64.4001951,7.32526619 Z M62.3657647,11.3386426 L62.3844444,11.3386426 L62.3844444,10.0440051 C62.3844444,9.2855324 62.3657647,8.69388304 62.3102802,8.26831718 C62.2547957,7.86161604 62.1808165,7.56569888 62.0513527,7.38075066 C61.9403838,7.21429726 61.7554355,7.12182315 61.5334977,7.12182315 C61.3300546,7.12182315 61.1266116,7.21429726 60.9416634,7.38075066 C60.7567151,7.56569888 60.6274363,7.78763675 60.5532721,8.04656426 L60.5532721,13.6318156 C60.6457462,13.798454 60.77521,13.9279177 60.9231685,14.0203918 C61.0711271,14.112866 61.2375805,14.1496706 61.4225287,14.1496706 C61.6446516,14.1496706 61.8295998,14.0571965 61.9773734,13.8909281 C62.1070221,13.7242897 62.2178061,13.4285575 62.2732906,13.0216714 C62.328775,12.6146004 62.3657647,12.0597557 62.3657647,11.3386426 Z",fillOpacity:.6,fill:"#FFFFFF"})]})}))}m.displayName=m.name+" [from "+i.id+"]",l.LogoYoutubeIcon=m}),98); __d("WAWebPipConst",["$InternalEnum","WAWebLogoFacebookIcon.react","WAWebLogoInstagramIcon.react","WAWebLogoYoutubeIcon.react"],(function(t,n,r,o,a,i,l){var e={YOUTUBE:"youtube.com",YOUTUBE_MOBILE:"m.youtube.com",YOUTUBE_SHORTENED:"youtu.be",INSTAGRAM:"instagram.com",STREAMABLE:"streamable.com",FACEBOOK:"facebook.com",FBWATCH:"fbwat.ch",FBWATCH_ALT:"fb.watch",SHARECHAT:"sharechat.com"},s=n("$InternalEnum").Mirrored(["FLOATER","OG_FLOATER","MEDIA_VIEWER"]),u=n("$InternalEnum").Mirrored(["OG","YOUTUBE","MSG","VOIP"]),c=16/9;function d(t){switch(t){case e.YOUTUBE:case e.YOUTUBE_MOBILE:case e.YOUTUBE_SHORTENED:return o("WAWebLogoYoutubeIcon.react").LogoYoutubeIcon;case e.INSTAGRAM:return o("WAWebLogoInstagramIcon.react").LogoInstagramIcon;case e.FACEBOOK:return o("WAWebLogoFacebookIcon.react").LogoFacebookIcon;default:return null}}var m={ONLINE_VIDEO_URL:{YOUTUBE:[/^https?:\/\/youtu\.be\/(.{11})/,/^https?:\/\/(m\.)?youtube\.com\/watch\?v=(.{11})/,/^https?:\/\/(m\.)?youtube\.com\/shorts\/(.{11})/]}},p="t",_=/^(\d+h)?(\d+m)?(\d+s)?(\d+)?$/;l.HOSTNAME=e,l.PlayerType=s,l.PiPVideoType=u,l.YOUTUBE_VIDEO_DEFAULT_ASPECT_RATIO=c,l.getAttributionIcon=d,l.URL_PATTERNS=m,l.YOUTUBE_URL_TIME_PARAM_NAME=p,l.YOUTUBE_URL_TIME_PARAM_PATTERN=_}),98); __d("WAWebUtilsYoutubeUrlParser",["WAWebPipConst","WAWebURLUtils"],(function(t,n,r,o,a,i,l){function e(e){for(var t=o("WAWebPipConst").URL_PATTERNS.ONLINE_VIDEO_URL.YOUTUBE,n=0;no("WAWebABProps").getABPropConfigValue("maximum_group_size_for_rcat"))return null;var u=o("WAWebWidToJid").widToUserJid(i),c=new Map,d=a.map(function(e){var n=o("WAWebWidToJid").widToUserJid(e);return m(o("WAWebMsgGetters").getId(t).id,s,u,n).then(function(e){return y(l,e)}).then(function(e){c.set(n,e)})});return yield(e||(e=n("Promise"))).all(d),c}),v.apply(this,arguments)}l.genNonceForMsg=c,l.deriveNonce=m,l.deriveNonceString=_,l.getContentIdString=g,l.genContentBindingForMsg=b}),98); __d("WAWebQuotedMsgModelUtils",["WALogger","WAWebDBProcessReplyMsgs","WAWebLidMigrationUtils","WAWebMsgGetters","WAWebMsgModelUtils","WAWebStateUtils","WAWebUserPrefsMeUser","WAWebWid","isStringNullOrEmpty"],(function(t,n,r,o,a,i,l){var e,s,u;function c(e){var t=d(e);return t?o("WAWebMsgGetters").getIsSentByMe(t):!1}function d(t){var n=o("WAWebStateUtils").unproxy(t);if(n.quotedMsgKey==null){try{var r=o("WAWebDBProcessReplyMsgs").createQuotedMsgKey(n);r!=="missing-stanza-id"&&(n.quotedMsgKey=r)}catch(t){o("WALogger").ERROR(e||(e=babelHelpers.taggedTemplateLiteralLoose(["Failed to create quoted msg key"]))).sendLogs("qmk-fail")}if(n.quotedMsgKey==null)return null}if(!n.quotedMsg&&!n.paymentRequestMessageKey)return null;var a=n.getCollection(),i=n.quotedMsgKey;if(i){var l=a.get(i);if(l)return l.safe();var s=o("WAWebLidMigrationUtils").getAlternateMsgKey(i);if(s){var u=a.get(s);if(u)return u.safe()}}var c;return n.quotedMsg?c=m(n):n.paymentRequestMessageKey&&(c=p(n)),c==null?null:(n.quotedMsgKey=c.id,c.ephemeralDuration=null,a.add(c.unsafe()),c)}function m(e){var t,n=h(e),a=y(e),i=e.quotedStanzaID;if(!n||!a||r("isStringNullOrEmpty")(i))return null;var l=o("WAWebUserPrefsMeUser").isMeAccount(n),s=l?"out":"in",u=e.quotedRemoteJid?e.quotedRemoteJid:e.id.remote,c={id:i,from:l?a:u,to:l?u:a,self:s,author:n,remote:u},d=r("WAWebWid").isGroup(c.from)||r("WAWebWid").isGroup(c.to);(d||r("WAWebWid").isStatus(u))&&(c.participant=n),Object.assign(c,e.quotedMsg);var m=(t=o("WAWebMsgModelUtils").createQuotedMsg(c))!=null?t:void 0;return m==null?null:(e.selectedCarouselCardIndex!=null&&(m.interactiveHeader=void 0,m.isCarouselCard=!1),m.safe())}function p(e){var t,n=h(e),r=y(e);if(!e.paymentRequestMessageKey||!n||!r)return null;var a=e.paymentRequestMessageKey.remote?e.paymentRequestMessageKey.remote:e.id.remote,i=e.paymentRequestMessageKey.fromMe,l=e.paymentRequestMessageKey.self!=null?e.paymentRequestMessageKey.self:i?"out":"in",s=e.paymentRequestMessageKey.participant||e.paymentMessageReceiverJid,u=e.paymentRequestMessageKey.id,c={id:u,from:i?r:a,to:i?a:r,self:l,participant:s,author:s,remote:a,amount1000:e.paymentAmount1000,currency:e.paymentCurrency,receiverJid:o("WAWebMsgGetters").getSender(e),type:e.type,subtype:"request"};return(t=o("WAWebMsgModelUtils").createQuotedMsg(c))==null?void 0:t.safe()}function _(e){var t=o("WAWebStateUtils").unproxy(e);return t.quotedMsg==null?t.quotedRemoteJid:null}function f(e){var t=o("WAWebStateUtils").unproxy(e);return t.quotedMsg==null?t.quotedGroupSubject:null}function g(e){var t=o("WAWebStateUtils").unproxy(e);return t.quotedMsg==null?t.quotedParentGroupJid:null}var h=function(t){return t.quotedParticipant==null&&o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["null quotedParticipant in quotedMsg"]))).sendLogs("null-quoted-participant"),t.quotedParticipant},y=function(t){var e=o("WAWebUserPrefsMeUser").getMaybeMePnUser();return e==null&&o("WALogger").ERROR(u||(u=babelHelpers.taggedTemplateLiteralLoose(["null meUser in quotedMsg"]))).sendLogs("null-me-user"),e};l.isMyQuotedMsg=c,l.getQuotedMsgObj=d,l.createQuotedMsgObj=m,l.getQuotedMsgAdminGroupJid=_,l.getQuotedMsgAdminGroupSubject=f,l.getQuotedMsgAdminParentGroupJid=g}),98); __d("WAWebStarredMsgCollection",["Promise","WALogger","WANullthrows","WAWebBaseCollection","WAWebCollectionConstants","WAWebFrontendMsgGetters","WAWebMsgCollection","WAWebMsgModel","WAWebSocketConstants","WAWebSocketModel"],(function(t,n,r,o,a,i,l){var e,s,u,c=(function(t){function a(){var e;return e=t.call(this)||this,e.syncPromise=null,e.isSynced=!1,e.listenTo(o("WAWebSocketModel").Socket,"change:stream",function(){o("WAWebSocketModel").Socket.stream===o("WAWebSocketConstants").SOCKET_STREAM.DISCONNECTED?e.isSynced=!1:o("WAWebSocketModel").Socket.stream===o("WAWebSocketConstants").SOCKET_STREAM.CONNECTED&&e.delete()}),e}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.process=function(t,n,r,o){o!==!0?this.updateMsgs(t,n,r):this.delete()},i.sync=function(a){if(this.isSynced)return(u||(u=n("Promise"))).resolve();if(this.syncPromise!=null)return this.syncPromise;var t=this,i,l=this.last();return l&&(i=l.id),this.syncPromise=o("WAWebMsgCollection").MsgCollection.getStarred(a,o("WAWebCollectionConstants").PAGE_SIZE,i).then(function(e){e.length&&t.add(e,{silent:!0}),e.length0?o("WAWebMsgCollection").MsgCollection.incrementalStarredUpdate(r):(u||(u=n("Promise"))).resolve([]);return i.then(function(t){var n=t.concat(a);e.isSynced&&e.add(n,{silent:!0}),n.forEach(function(e){var t;(t=o("WAWebFrontendMsgGetters").getChat(e).starredMsgs)==null||t.add(e)}),e.trigger("sync")}).catch(function(e){o("WALogger").WARN(s||(s=babelHelpers.taggedTemplateLiteralLoose(["models:starred:update:error: "])))})}var l=r.concat(a).filter(function(e){return!e.star});p(l)}).finally(function(){e.syncPromise=null})},i.delete=function(){this.isSynced=!1,t.prototype.delete.call(this)},a})(o("WAWebBaseCollection").BaseCollection);c.model=o("WAWebMsgModel").Msg,c.comparator=function(e,t){return t.t-e.t};var d=new c;function m(e){d.add(e),e.forEach(function(e){var t;(t=o("WAWebFrontendMsgGetters").getChat(e).starredMsgs)==null||t.add(e)})}function p(e){d.remove(e),e.forEach(function(e){var t;(t=o("WAWebFrontendMsgGetters").getChat(e).starredMsgs)==null||t.remove(e)})}l.StarredMsgCollection=c,l.AllStarredMsgsCollection=d,l.addStarredMsgs=m,l.removeStarredMsgs=p}),98); __d("WAWebSyncButtonState",["WANullthrows","WAWebBizInteractiveMessageQuickReplyAction","WAWebFrontendMsgGetters","WAWebMsgButtonReplyMsgCollection","WAWebMsgCollection","WAWebMsgGetters","WAWebMsgType","WAWebQuotedMsgModelUtils","WAWebTemplateButtonReplyMsgCollection","WAWebUserPrefsMeUser"],(function(t,n,r,o,a,i,l){function e(e){s(e),u(e),c(e)}function s(e){for(var t=function(){var t=e[a];if(!t||t.selectedCarouselCardIndex!=null)return 0;if(d(t)){var n=o("WAWebFrontendMsgGetters").getChat(t);n.msgUnsyncedButtonReplyMsgs==null&&(n.msgUnsyncedButtonReplyMsgs=new(r("WAWebMsgButtonReplyMsgCollection")));var i=n.msgUnsyncedButtonReplyMsgs,l=o("WAWebQuotedMsgModelUtils").getQuotedMsgObj(t);if(!l)return 0;var s=i.get(l.id);s||(i.add({id:l.id,unsyncedButtonReplies:new(r("WAWebTemplateButtonReplyMsgCollection"))}),s=i.get(l.id));var u=r("WANullthrows")(s),c=u.unsyncedButtonReplies;c.add(t);var m=o("WAWebMsgCollection").MsgCollection.get(l.id);if(m!=null&&m.buttons){var p=m.buttons.get(""+r("WANullthrows")(t.selectedIndex));p&&(p.selected=!0),c.remove(t)}}else if(t.isFromTemplate&&t.buttons){var _=o("WAWebFrontendMsgGetters").getChat(t),f=_.msgUnsyncedButtonReplyMsgs;if(f==null)return 0;var g=f.get(t.id);g&&(g.unsyncedButtonReplies.forEach(function(e){var n=r("WANullthrows")(t.buttons).get(""+r("WANullthrows")(e.selectedIndex));n&&(n.selected=!0)}),g.unsyncedButtonReplies.delete())}},n,a=0;a0,r=this.$PresenceImpl$p_2(),a=r&&o("WAWebContactGetters").getIsMe(r),i=[],l=o("WAWebChatCollection").ChatCollection.get(this.id);l!=null&&o("WAWebChatGetters").getIsGroup(l)?i=this.getGroupStages(l):a===!0?(o("WAWebPrivacyGatingUtils").isDataPrivacyPhase2Enabled()&&l!=null&&o("WAWebFrontendChatGetters").getIsE2ee(l)&&i.push(o("WAWebPresenceEnum").WithholdDisplayStage.E2EE),i.push(o("WAWebPresenceEnum").WithholdDisplayStage.Self),y(this,i)):this.hasData?(o("WAWebChatAssignmentUtils").canAssignChat(l)&&n&&i.push(o("WAWebPresenceEnum").WithholdDisplayStage.ChatAssignment),(r==null?void 0:r.isBusiness)===!0&&i.push(o("WAWebPresenceEnum").WithholdDisplayStage.Business),o("WAWebTextStatusGatingUtils").receiveTextStatusForNewSurfacesEnabled()&&i.push(o("WAWebPresenceEnum").WithholdDisplayStage.LastSeen),i.length>0||o("WAWebTextStatusGatingUtils").receiveTextStatusForNewSurfacesEnabled()&&i.push(o("WAWebPresenceEnum").WithholdDisplayStage.LastSeen),i.push(o("WAWebPresenceEnum").WithholdDisplayStage.None)):(o("WAWebChatAssignmentUtils").canAssignChat(l)&&n&&i.push(o("WAWebPresenceEnum").WithholdDisplayStage.ChatAssignment),(r==null?void 0:r.isBusiness)===!0&&i.push(o("WAWebPresenceEnum").WithholdDisplayStage.Business),o("WAWebPrivacyGatingUtils").isDataPrivacyPhase2Enabled()&&l!=null&&o("WAWebFrontendChatGetters").getIsE2ee(l)?i.push(o("WAWebPresenceEnum").WithholdDisplayStage.E2EE):i.push(o("WAWebPresenceEnum").WithholdDisplayStage.Info),o("WAWebTextStatusGatingUtils").receiveTextStatusForNewSurfacesEnabled()&&i.push(o("WAWebPresenceEnum").WithholdDisplayStage.LastSeen),i.push(o("WAWebPresenceEnum").WithholdDisplayStage.None)),y(this,i),this.forceDisplayTimer=self.setTimeout(function(){e.set({forceDisplay:!0,forceDisplayTimer:void 0})},p)}else this.withholdDisplayTimer&&(self.clearTimeout(this.withholdDisplayTimer),this.withholdDisplayTimer=void 0),this.forceDisplayTimer&&(self.clearTimeout(this.forceDisplayTimer),this.forceDisplayTimer=void 0)},a.subscribe=function(){return this.getCollection().find(this.id)},a.getCollection=function(){return o("WAWebPresenceCollection").PresenceCollection},n})(c.BaseModel);h.Proxy="presence",h.idClass=r("WAWebWid");function y(e,t){if(t.length!==0){var n=t[0],r=babelHelpers.arrayLikeToArray(t).slice(1);e.set({withholdDisplayStage:n,withholdDisplayTimer:n===o("WAWebPresenceEnum").WithholdDisplayStage.None?null:self.setTimeout(function(){y(e,r)},n===o("WAWebPresenceEnum").WithholdDisplayStage.Business?m:d)})}}var C=c.defineModel(h);l.processStagesRecursively=y,l.Presence=C,l.Chatstate=f,l.ChatstateCollection=g}),226); __d("WAWebWamEnumUserNoticeErrorEvent",[],(function(t,n,r,o,a,i){var e=Object.freeze({INVALID_STANZA:1,JSON_FETCH:2,JSON_PARSE:3,IMAGE_FETCH:4,NO_ELIGIBLE_DISCLOSURE:5,DISCLOSURE_STAGE_FETCH:6,UI_TEMPLATE_MISMATCHED:7,ERROR_UNKNOWN:8,SYNC_STAGE_MISMATCH:9,IMAGE_FETCH_400:10,JSON_FETCH_400:11,JSON_FETCH_REDIRECT:12,IMAGE_FETCH_REDIRECT:13,IMAGE_FETCH_FORBIDDEN:14,JSON_FETCH_FORBIDDEN:15,FAIL_TO_SEND_STAGE_TO_SERVER:16});i.USER_NOTICE_ERROR_EVENT=e}),66); __d("WAWebUserNoticeErrorWamEvent",["WAWebWamCodegenUtils","WAWebWamEnumNoticeType","WAWebWamEnumUserNoticeErrorEvent"],(function(t,n,r,o,a,i,l){var e=o("WAWebWamCodegenUtils").defineEvents({UserNoticeError:[2474,{noticeType:[4,o("WAWebWamEnumNoticeType").NOTICE_TYPE],userNoticeContentVersion:[2,o("WAWebWamCodegenUtils").TYPES.INTEGER],userNoticeErrorEvent:[3,o("WAWebWamEnumUserNoticeErrorEvent").USER_NOTICE_ERROR_EVENT],userNoticeId:[1,o("WAWebWamCodegenUtils").TYPES.INTEGER]},[1,1,1],"regular"]},{UserNoticeError:[]});l.UserNoticeErrorWamEvent=e}),98); __d("isNonZeroNumber",[],(function(t,n,r,o,a,i){"use strict";function e(e){return e!=null&&e!==0&&!isNaN(e)}i.isNonZeroNumber=e}),66); __d("WAWebGetUserDisclosuresContentsQueryJob",["Promise","WAAbortError","WALogger","WAWebBackendApi","WAWebConnModel","WAWebCountryCodeUtils","WAWebHttpErrors","WAWebPonyfillsFetch","WAWebURLUtils","WAWebUserNoticeErrorWamEvent","WAWebUserPrefsMeUser","WAWebWamEnumUserNoticeErrorEvent","asyncToGeneratorRuntime","err","getErrorSafe","isNonZeroNumber"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m="https://www.whatsapp.com/user-notice/v1/",p=new Set(["ACCEPT","OK"]),_="zz",f="ZZ";function g(e){return h.apply(this,arguments)}function h(){return h=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){if(o("isNonZeroNumber").isNonZeroNumber(e)){var t,a,i=o("WAWebUserPrefsMeUser").getMePnUserOrThrow(),l=o("WAWebCountryCodeUtils").pnToCountryCodeString(i.user),s=yield o("WAWebBackendApi").frontendSendAndReceive("getDeviceInfo",void 0),u=r("WAWebURLUtils").build(m,{id:e,lg:(t=s.lg)!=null?t:_,lc:(a=s.lc)!=null?a:f,cc:l,platform:o("WAWebConnModel").Conn.isSMB?"smbweb":"web"});return y(u,e)}return(d||(d=n("Promise"))).resolve({disclosureId:e})}),h.apply(this,arguments)}function y(e,t){return C.apply(this,arguments)}function C(){return C=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){try{var n=yield S(e);try{if(n!=null){var a=JSON.parse(n);if(a!=null)return L(a,t)}}catch(e){var i=new(o("WAWebUserNoticeErrorWamEvent")).UserNoticeErrorWamEvent({userNoticeId:t,userNoticeContentVersion:1,userNoticeErrorEvent:o("WAWebWamEnumUserNoticeErrorEvent").USER_NOTICE_ERROR_EVENT.JSON_PARSE});i.commit()}}catch(e){var l=r("getErrorSafe")(e);if(l.name===o("WAAbortError").ABORT_ERROR)return;throw o("WALogger").ERROR(s||(s=babelHelpers.taggedTemplateLiteralLoose(["Notice: Error Message : ",""])),l.message).sendLogs("pdfn-notice-content-error"),new(o("WAWebHttpErrors")).HttpNetworkError}}),C.apply(this,arguments)}function b(e){return v.apply(this,arguments)}function v(){return v=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return new(d||(d=n("Promise")))(function(t,n){var r=new FileReader;r.onload=function(){var e=String(r.result);t(e)},r.onerror=n,r.readAsDataURL(e)})}),v.apply(this,arguments)}function S(e){return R.apply(this,arguments)}function R(){return R=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){var t=new AbortController,n=t.signal,o=yield r("WAWebPonyfillsFetch")(e,{signal:n}),a=o.headers.get("Content-Type");return a==null||a.includes("image/svg+xml")?o.text():a.includes("image/png")?b(yield o.blob()):o.text()}),R.apply(this,arguments)}function L(e,t){return E.apply(this,arguments)}function E(){return E=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e,t){var a=e.policyVersion;if(a==null)throw r("err")("Missing field policyVersion in notice content.");o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Notice:fetchNoticeData successful for policyVersion ",""])),a);var i=I(e),l=k(e),s=parseInt(a,10),m;try{m=yield P(i)}catch(e){var p=r("getErrorSafe")(e),_=new(o("WAWebUserNoticeErrorWamEvent")).UserNoticeErrorWamEvent({userNoticeId:t,userNoticeContentVersion:s,userNoticeErrorEvent:o("WAWebWamEnumUserNoticeErrorEvent").USER_NOTICE_ERROR_EVENT.IMAGE_FETCH});_.commit(),o("WALogger").ERROR(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Notice: Icon fetch error : ",""])),p.message).sendLogs("notice-icon-fetch-error")}return(d||(d=n("Promise"))).resolve({disclosureId:t,policyVersion:s,privacyDisclosureModal:m!=null?m:i,endDate:l})}),E.apply(this,arguments)}function k(e){var t,n=e["privacy-disclosure"]&&((t=e["privacy-disclosure"])==null||(t=t.timing)==null||(t=t.end)==null?void 0:t.time);return n==null?null:new Date(n)}function I(e){var t=e["privacy-disclosure"]&&T(e["privacy-disclosure"].prompts[0]);return t==null?null:$(t)}function T(e){if(e){D(["icon","iconDescription","title","bullets","primaryButton","nav"],e),D(["light","dark","type"],e.icon),D(["dismissButton","backButton"],e.nav);for(var t=0;tnew Date().getTime()&&new Date().getTime()-i.lastUpdated.getTime()=e}l.VIEW_ONCE_EXPIRE_AFTER=e,l.isUnviewed=u,l.isViewed=c,l.isExpired=d}),98); __d("WAWebAppMutex",["fbt","Promise","WACustomError","WAFilteredCatch","WALogger","WAPromiseTimeout","WAResolvable","WAWebAlarm","WAWebCallCollection","WAWebCmd","WAWebEventsWaitForEvent","WAWebL10N","WAWebLaunchSocket","WAWebPageLoadLogging","WAWebUserPrefsKeys","WAWebUserPrefsStore","WAWebUserPrefsTabMutex","WAWebVoipGatingUtils","asyncToGeneratorRuntime","justknobx"],(function(t,n,r,o,a,i,l,s){var e,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R,L,E=6e5,k={INIT:"init",PING:"ping",PONG:"pong",TAKEOVER:"local-takeover",CHECK_ACTIVE_CALL:"check-active-call",ACTIVE_CALL_RESPONSE:"active-call-response",FOCUS_REQUEST:"focus-request"},I=(function(){function t(){var e=this;this.$3=!1,this.$4=!0,this.$5=new(o("WAResolvable")).Resolvable,this.$6=!1,this.$8=function(){e.$10();var t=Date.now();o("WAWebUserPrefsTabMutex").setMutex(e.$1=k.INIT+"_"+t),e.$2=r("WAWebAlarm").setLocalTimeout(e.$8,t+E)},o("WAWebCmd").Cmd.on("ab_props_loaded_from_bridge",D),o("WAWebCmd").Cmd.on("on_ab_props_update_from_bridge",D)}var a=t.prototype;return a.hasShownCallTakeoverModal=function(){return this.$6},a.waitForCompletion=function(){return this.$5.promise},a.setShouldLaunchSocket=function(t){this.$4=t},a.init=(function(){var t=n("asyncToGeneratorRuntime").asyncToGenerator(function*(t){t===void 0&&(t=0),this.$3||(o("WAWebPageLoadLogging").startPageLoadQplMeasure("acquire_mutex"),this.$3=!0);var n=t+1;if(n>3)return o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["[app] AppMutex init generation: ",""])),n),!0;var a=o("WAWebUserPrefsTabMutex").getNoTakeover();o("WAWebUserPrefsTabMutex").setNoTakeover();var i=yield this.$7();if(i)return this.$8(),o("WAWebPageLoadLogging").endPageLoadQplMeasure("acquire_mutex"),this.$4&&(yield o("WAWebLaunchSocket").launchSocket(null)),this.$5.resolve(),r("WAWebL10N").checkForLocaleMismatchBetweenCookieAndUserPref(),!1;if(r("justknobx")._("4316")){var l=yield this.$9();if(l)return o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["app:init: Other tab has active call, setting flag"]))),this.$6=!0,!0}if(a)return o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["[app] AppMutex init no take over"]))),!0;throw n});function a(e){return t.apply(this,arguments)}return a})(),a.takeoverLocal=function(t){var e=this;return o("WAWebUserPrefsTabMutex").getMutex()?(o("WAWebPageLoadLogging").startPageLoadQplMeasure("mutex_takeover"),o("WAWebUserPrefsTabMutex").setMutex(k.TAKEOVER),o("WAPromiseTimeout").promiseTimeout(r("WAWebEventsWaitForEvent")(window,"storage",o("WAWebUserPrefsTabMutex").takeoverFilter),3e4,"takeoverLocalTimeout").then(function(n){return o("WAWebUserPrefsTabMutex").removeMutex(),o("WAWebPageLoadLogging").endPageLoadQplMeasure("mutex_takeover"),e.init(t)}).catch(o("WAFilteredCatch").filteredCatch(o("WACustomError").TimeoutError,function(){return o("WALogger").WARN(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[app] takeoverLocal timeout"]))),o("WAWebUserPrefsTabMutex").removeMutex(),o("WAWebPageLoadLogging").addPageLoadQplAnnotation({mutex_takeover_timeout:!0}),o("WAWebPageLoadLogging").endPageLoadQplMeasure("mutex_takeover"),e.init(t)})).finally(function(){o("WALogger").ERROR(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[mutex] shut down an existing instance of WA Web"])))})):this.init(t)},a.unloadMutex=function(){var e=o("WAWebUserPrefsTabMutex").getMutex();e&&this.$1&&e.includes(this.$1)&&o("WAWebUserPrefsTabMutex").removeMutex()},a.storagePong=function(t){if(o("WAWebUserPrefsTabMutex").mutexFilter(t)){var e=o("WAWebUserPrefsTabMutex").parseMutex(t.newValue);if(e){if(e===k.TAKEOVER)return this.$10(),o("WAWebUserPrefsTabMutex").localTakeoverSuccess(),!0;if(e.indexOf(k.PING)===0)o("WAWebUserPrefsTabMutex").setMutex(k.PONG+Math.random());else if(e.indexOf(k.CHECK_ACTIVE_CALL)===0){if(o("WAWebVoipGatingUtils").isCallingEnabled()){var n=r("WAWebCallCollection").activeCall!=null;o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["app:storagePong: responding to active call check, hasCall: ",""])),n),o("WAWebUserPrefsTabMutex").setMutex(k.ACTIVE_CALL_RESPONSE+"_"+String(n))}}else e.indexOf(k.FOCUS_REQUEST)===0&&o("WAWebVoipGatingUtils").isCallingEnabled()&&(o("WALogger").LOG(_||(_=babelHelpers.taggedTemplateLiteralLoose(["app:storagePong: received focus request, focusing window"]))),this.$11())}}},a.$10=function(){this.$2!=null&&r("WAWebAlarm").clearTimeout(this.$2)},a.$7=function(){var e=o("WAWebUserPrefsTabMutex").getMutex();if(e){o("WAWebPageLoadLogging").startPageLoadQplMeasure("mutex_ping"),e+="";var t=1e3;if(e.indexOf("_")>0){var a=e.split("."),i=parseInt(a[a.length-1],10);if(Number.isFinite(i)){var l=Date.now()-E*1.5;i=0}),2e3,"checkActiveCallTimeout").then(function(e){var t,n=o("WAWebUserPrefsTabMutex").parseMutex((t=e.newValue)!=null?t:"");if(n&&n.indexOf(k.ACTIVE_CALL_RESPONSE)===0){var r=n.split("_")[1]==="true";return o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["app:_checkForActiveCallInOtherTab: other tab has active call: ",""])),r),r}return!1}).catch(o("WAFilteredCatch").filteredCatch(o("WACustomError").TimeoutError,function(){return o("WALogger").LOG(C||(C=babelHelpers.taggedTemplateLiteralLoose(["app:_checkForActiveCallInOtherTab timeout"]))),!1}));return o("WAWebUserPrefsTabMutex").setMutex(k.CHECK_ACTIVE_CALL+Math.random()),t},a.requestFocusOnOtherTab=function(){var e=this;o("WALogger").LOG(b||(b=babelHelpers.taggedTemplateLiteralLoose(["app:requestFocusOnOtherTab: requesting notification permission in this tab first"]))),Notification!==void 0&&Notification.permission==="default"?Notification.requestPermission().then(function(){e.$12()}).catch(function(t){o("WALogger").WARN(v||(v=babelHelpers.taggedTemplateLiteralLoose(["[app] Failed to request notification permission: ",""])),t),e.$12()}):this.$12()},a.$12=function(){o("WALogger").LOG(S||(S=babelHelpers.taggedTemplateLiteralLoose(["app:requestFocusOnOtherTab: sending focus request to other tab"]))),o("WAWebUserPrefsTabMutex").setMutex(k.FOCUS_REQUEST+Math.random())},a.$11=function(){Notification!==void 0&&Notification.permission==="granted"&&this.$13()},a.$13=function(){var e=new Notification(s._(/*BTDS*/"WhatsApp\u00a0Web").toString(),{body:s._(/*BTDS*/"Tienes una llamada activa en esta ventana").toString(),requireInteraction:!0,tag:"wa-web-call-active"});e.onclick=function(){window.focus(),e.close()},window.setTimeout(function(){e.close()},5e3)},t})();function T(e){r("WAWebUserPrefsStore").set(o("WAWebUserPrefsKeys").KEYS.MUTEX_PING_TIMEOUT_SECONDS,e)}function D(){T(1),o("WALogger").LOG(R||(R=babelHelpers.taggedTemplateLiteralLoose(["[mutex] setMutexBlockStrategy: ",""])),0),r("WAWebUserPrefsStore").set(o("WAWebUserPrefsKeys").UserPrefs.MutexBlockStrategy,0)}var x=new I;l.default=x}),226); __d("WAWebUpdater",["Promise","WALogger","WAPromiseDelays","WAWebAlarm","WAWebCallCollection","WAWebMiscBrowserUtils","WAWebStreamModel","WAWebSwUpdater","WAWebUpdaterBaseUpdater","WAWebUpdaterDownloadStateType","WAWebUpdaterVersion","WAWebVoipSignalingEnums","WAWebVoipStackInterface","asyncToGeneratorRuntime","cr:12474","cr:6022"],(function(t,n,r,o,a,i,l){var e,s,u,c,d,m,p,_=6e4,f=1e3,g=(function(t){function a(){return t.apply(this,arguments)||this}babelHelpers.inheritsLoose(a,t);var i=a.prototype;return i.clearHardExpiration=function(){t.prototype.clearHardExpiration.call(this),this.stopListening(r("WAWebCallCollection"),"change:activeCall")},i.showSoftUpdateBanner=function(){o("WAWebStreamModel").Stream.needsUpdate=!0,o("WAWebStreamModel").Stream.isHardRefresh=!1},i.update=function(a,i,l){var t=this;o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["AppUpdate:update current: "," latest: ",""])),String(this.activeVersion),String(a));var u=++this.latestUpdateIteration,c=a==null?void 0:new(o("WAWebUpdaterVersion")).Version(a),d=i===!0,m=typeof l=="number";return this.clearHardExpiration(),typeof l=="number"&&(this.hardExpirationTimer=r("WAWebAlarm").setLocalTimeout(function(){if(r("WAWebCallCollection").activeCall!=null){o("WALogger").LOG(s||(s=babelHelpers.taggedTemplateLiteralLoose(["[reload] Updater: hard expiration deferred due to active call"])));var e=function(){t.stopListening(r("WAWebCallCollection"),"change:activeCall"),t.restart()};t.listenTo(r("WAWebCallCollection"),"change:activeCall",function(){r("WAWebCallCollection").activeCall==null&&e()}),window.setTimeout(e,_)}else t.restart()},Date.now()+l)),this.updateInProgress=(p||(p=n("Promise"))).resolve(this.updateInProgress).then(function(){return t._update(c)}).then(function(e){t.updateInProgress=void 0;var n=u!==t.latestUpdateIteration,r=e===o("WAWebUpdaterDownloadStateType").DownloadState.ERROR,a=e===o("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_NOT_AVAILABLE;return n||r||a||((d||m)&&(o("WAWebStreamModel").Stream.needsUpdate=!0,o("WAWebStreamModel").Stream.isHardRefresh=m),m&&t.listenToAndRun(o("WAWebStreamModel").Stream,"change:couldForce",function(){o("WAWebStreamModel").Stream.couldForce&&t.restart()})),e}),this.updateInProgress},i._update=function(t){if(!this.activeVersion.equals(t)&&n("cr:6022")!=null&&n("cr:6022").alive)return o("WAWebSwUpdater").updateSw();var e=this.activeVersion.equals(t)?o("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_NOT_AVAILABLE:o("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_DOWNLOADED;return(p||(p=n("Promise"))).resolve(e)},i.killServiceWorker=function(){if(!(n("cr:6022")!=null&&n("cr:6022").alive))return(p||(p=n("Promise"))).resolve();var e=navigator.serviceWorker;return e?(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["Killing service worker"]))),e.ready.then(function(e){return e.unregister()}).then(function(e){o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["Service worker unregistration status: ",""])),String(e))})):(p||(p=n("Promise"))).resolve()},i._doRestart=function(){return o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["[reload] Updater.restart"]))),n("cr:12474")==null||n("cr:12474").saveRefreshState(),r("WAWebMiscBrowserUtils").hardRefresh(),o("WAWebUpdaterDownloadStateType").DownloadState.UPDATE_DOWNLOADED},i.restart=(function(){var e=n("asyncToGeneratorRuntime").asyncToGenerator(function*(e){return e===!0?this.update(void 0,!0,0):(r("WAWebCallCollection").activeCall!=null&&(o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["[reload] Updater.restart: ending active call before refresh"]))),yield(p||(p=n("Promise"))).race([n("asyncToGeneratorRuntime").asyncToGenerator(function*(){try{var e=yield o("WAWebVoipStackInterface").getVoipStackInterface();e!=null&&e.type==="web"&&(yield e.endCall(o("WAWebVoipSignalingEnums").EndCallReason.Self,!0))}catch(e){}})(),o("WAPromiseDelays").delayMs(f)])),this._doRestart())});function t(t){return e.apply(this,arguments)}return t})(),a})(o("WAWebUpdaterBaseUpdater").UpdaterBase),h=new g;l.UpdaterImpl=g,l.Updater=h}),98); __d("WAWebUpdaterBaseUpdater",["WACustomError","WAWebAlarm","WAWebBuildConstants","WAWebEventEmitter","WAWebStreamModel","WAWebUpdaterVersion","WAWebWAWCStorage"],(function(t,n,r,o,a,i,l){var e=(function(e){function t(){var t;return t=e.call(this)||this,t.$UpdaterBase$p_1=!1,t.latestUpdateIteration=0,t.activeVersion=new(o("WAWebUpdaterVersion")).Version(o("WAWebBuildConstants").VERSION_BASE),r("WAWebWAWCStorage").onVersionChange(function(){return t.setForceUpdateOnTakeOver()}),t}babelHelpers.inheritsLoose(t,e);var n=t.prototype;return n.setForceUpdateOnTakeOver=function(){this.$UpdaterBase$p_1=!0},n.shouldForceUpdateOnTakeOver=function(){var e=this.$UpdaterBase$p_1;return this.$UpdaterBase$p_1=!1,!!e},n.clearHardExpiration=function(){this.hardExpirationTimer&&(r("WAWebAlarm").clearTimeout(this.hardExpirationTimer),this.hardExpirationTimer=void 0),this.stopListening(o("WAWebStreamModel").Stream,"change:couldForce")},n.update=function(t,n,r,a){throw new(o("WACustomError")).UnimplementedMethod("Updater::update")},n.showSoftUpdateBanner=function(){throw new(o("WACustomError")).UnimplementedMethod("Updater::showSoftUpdateBanner")},n.restart=function(t){throw new(o("WACustomError")).UnimplementedMethod("Updater::restart")},n.manualDownload=function(){throw new(o("WACustomError")).UnimplementedMethod("Updater::manualDownload")},n.killServiceWorker=function(){throw new(o("WACustomError")).UnimplementedMethod("Updater::killServiceWorker")},t})(r("WAWebEventEmitter"));l.UpdaterBase=e}),98);