if (self.CavalryLogger) { CavalryLogger.start_js(["6o+3cN9"]); } __d("LSNativeOperations",["cr:1949"],(function(a,b,c,d,e,f){"use strict";c=(a=b("cr:1949"))!=null?a:{};e.exports=babelHelpers["extends"]({},c)}),null); __d("LSStoredProcedures",["cr:1945"],(function(a,b,c,d,e,f,g){c=(a=b("cr:1945"))!=null?a:{};d=babelHelpers["extends"]({},c);f.exports=d}),34); __d("MWLSPreloadThreadForContact.bs",["LS.bs","LSDatabaseDeferred.bs","LSDatabaseType.bs","LSIssueMessagesRangeQuery","LSMailboxMessagesRangeQueryDirection.bs","LSTransaction.bs","LSVerifyThreadRowExists","ReQL.bs","ReQLTable","bs_caml_format","bs_curry","promiseDone"],(function(a,b,c,d,e,f){"use strict";function g(a){var c=b("LSDatabaseDeferred.bs").db.then(function(c){return b("LSTransaction.bs").run(c,function(c){var d=b("bs_caml_format").caml_int64_of_string(a);return b("ReQL.bs").first(b("ReQL.bs").getKeyRange(b("ReQLTable").table(c,"messages_ranges_v2__generated").asc,{hd:d,tl:0})).then(function(a){if(a!==void 0)if(a.c===a.e&&a.c!=="")return b("LSIssueMessagesRangeQuery")(d,a.b,b("LSMailboxMessagesRangeQueryDirection.bs").before,b("bs_curry")._1(b("LS.bs").make,c));else return;else return b("LSVerifyThreadRowExists")(d,void 0,b("LSDatabaseType.bs").mailbox,b("bs_curry")._1(b("LS.bs").make,c))})},"readWrite")});b("promiseDone")(c,void 0,void 0)}function a(){return g}f.usePreloaderForUser=a}),null); __d("LSLogHistory.bs",[],(function(a,b,c,d,e,f){"use strict";var g={contents:[]};function a(a){return g.contents}function b(a){g.contents=[]}function c(a,b){g.contents.push({date:Date.now(),level:b,category:"lightspeed_log",event:"lightspeed_log_event",args:a})}f.getEntries=a;f.clearEntries=b;f.log=c}),null); __d("LSLogHistory.re",["LSLogHistory.bs","bs_curry"],(function(a,b,c,d,e,f){a=b("LSLogHistory.bs").getEntries;f.getEntries=a;c=function(a,c){a=b("bs_curry")._2(b("LSLogHistory.bs").log,a,c);return a};f.log=c}),null); __d("LSIterationHelpers",["FBLogger","LSDbKeyComparer","LSDict","bs_caml_int64"],(function(a,b,c,d,e,f,g){"use strict";function h(a){var b=[];while(a!==0)b.push(a.hd),a=a.tl;return b}function i(a){return a.reduceRight(function(a,b){return{hd:b,tl:a}},0)}function j(a,b,c){c===void 0&&(c="asc");var e=a.entries(new WeakMap(),c);function f(){var a;return a={},a[typeof Symbol==="function"?Symbol.asyncIterator:"@@asyncIterator"]=f,a.next=async function(){var a=await e.next();outer:while(!a.done){var f=async function(f){var g=b[f]||{},j=g.end;g=g.start;var k=h(a.value[0]),l=k.slice(0,f);if(g){var m=d("LSDbKeyComparer").compareValue(k[f],g[0]);if(m*(c==="asc"?1:-1)=0;i--)h={hd:b.value.item[c[i]],tl:h};if(e!==void 0&&d("LSDbKeyComparer").compareKey(e,h)!==0){for(var i=g.sort(f),j=Array.isArray(i),k=0,i=j?i:i[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var l;if(j){if(k>=i.length)break;l=i[k++]}else{k=i.next();if(k.done)break;l=k.value}l=l;yield l}g=[]}b.done||g.push(b.value);e=h;b=(yield babelHelpers.awaitAsyncGenerator(a.next()))}if(g.length)for(var l=g.sort(f),k=Array.isArray(l),j=0,l=k?l:l[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){if(k){if(j>=l.length)break;i=l[j++]}else{j=l.next();if(j.done)break;i=j.value}h=i;yield h}});return function(){return b.apply(this,arguments)}}();return g()}async function e(a){var b=0,d=await a.next();while(!d.done)b++,d=await a.next();return c("bs_caml_int64").of_int32(b)}function f(a,b){return{forEach:async function(d){var e=await m(a);e=e.reduce(function(a,c){c=c.item[b];var d=(a.get(c)||0)+1;return a.set(c,d)},new(c("LSDict"))());for(var e=e,f=Array.isArray(e),g=0,e=f?e:e[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var h,i;if(f){if(g>=e.length)break;i=e[g++]}else{g=e.next();if(g.done)break;i=g.value}i=i;var j=i[0];i=i[1];await d((h={},h[b]=j,h.group_count=c("bs_caml_int64").of_int32(i),h))}}}}function n(a,b,c){return{delete:function(){return c.delete(a)},item:b,update:function(d){return c.upsert(a,babelHelpers.extends({},b,d))}}}function o(a,b){return p.apply(this,arguments)}function p(){p=babelHelpers.wrapAsyncGenerator(function*(a,b){var c=(yield babelHelpers.awaitAsyncGenerator(a.next()));while(!c.done)yield c.value,c=(yield babelHelpers.awaitAsyncGenerator(a.next()));c=(yield babelHelpers.awaitAsyncGenerator(b.next()));while(!c.done)yield c.value,c=(yield babelHelpers.awaitAsyncGenerator(b.next()))});return p.apply(this,arguments)}function q(a,b,c){return r.apply(this,arguments)}function r(){r=babelHelpers.wrapAsyncGenerator(function*(a,b,c){var e=(yield babelHelpers.awaitAsyncGenerator(a.next())),f=(yield babelHelpers.awaitAsyncGenerator(b.next()));while(!e.done&&!f.done){var g=d("LSDbKeyComparer").compareKey(e.value[0],f.value[0]);g===0?(yield e.value,e=(yield babelHelpers.awaitAsyncGenerator(a.next())),f=(yield babelHelpers.awaitAsyncGenerator(b.next()))):g*(c==="asc"?1:-1)<0?(yield e.value,e=(yield babelHelpers.awaitAsyncGenerator(a.next()))):(yield f.value,f=(yield babelHelpers.awaitAsyncGenerator(b.next())))}while(!e.done)yield e.value,e=(yield babelHelpers.awaitAsyncGenerator(a.next()));while(!f.done)yield f.value,f=(yield babelHelpers.awaitAsyncGenerator(b.next()))});return r.apply(this,arguments)}function s(a,b,c,d,e,f){var g=new Set(),h=a.length>1,k=a.length===1&&a[0][1]===void 0,l=a.map(function(a){var g=a[0],h=a[1];return g.map(function(a){d.key_lookup===!0&&a.length!==0;d.table_scan===!0&&a.length===0;a=a.map(function(a){return f(a,b)});var g=a.length===(h===void 0?c.primaryKeyIds:c.indexes[h].keyIds).length&&a.every(function(a){var b=a.start;a=a.end;return b&&a&&b[0]===a[0]&&b[1]===0&&a[1]===0});if(g){g=function b(){var c,d=!1;return c={},c[typeof Symbol==="function"?Symbol.asyncIterator:"@@asyncIterator"]=b,c.next=async function(){if(d)return{done:!0};d=!0;var b=i(a.map(function(a){a=a.start;return a[0]})),c=await (h===void 0?e:e.index(h)).get(b);return!c?{done:!0}:{value:[b,c],done:!1}},c};return g()}return j(h===void 0?e:e.index(h),a,b)})}).flat().reduce(function(c,d){return a.length>1?o(c,d):q(c,d,b)});function m(){var a;return a={},a[typeof Symbol==="function"?Symbol.asyncIterator:"@@asyncIterator"]=m,a.next=async function(){var a,b,d,f=await l.next();while(!f.done){var i=f.value;b=i[0];d=i[1];a=k?b:c.primaryKeyIds.reduceRight(function(a,b){return{hd:d[b],tl:a}},0);if(h){i=JSON.stringify(a);if(g.has(i)){f=await l.next();continue}g.add(i)}break}return f.done||a===void 0||d===void 0?{done:!0}:{done:!1,value:n(a,d,e)}},a}return m()}g.filter=k;g.slice=l;g.forEach=a;g.toArray=m;g.sortBy=b;g.count=e;g.groupBy=f;g.fetch=s}),98); /** * License: https://www.facebook.com/legal/license/MDzNl_j9yvg/ */ __d("base64-js-1.3.0",[],(function(a,b,c,d,e,f){"use strict";var g={},h={exports:g};function i(){g.byteLength=h;g.toByteArray=d;g.fromByteArray=e;var a=[],b=[],c=typeof Uint8Array!=="undefined"?Uint8Array:Array;h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var d=0,e=h.length;d0)throw new Error("Invalid string. Length must be a multiple of 4");a=a.indexOf("=");a===-1&&(a=b);b=a===b?0:4-a%4;return[a,b]}function h(a){a=f(a);var b=a[0];a=a[1];return(b+a)*3/4-a}function i(a,b,c){return(b+c)*3/4-c}function d(a){var d,e=f(a),g=e[0];e=e[1];var h=new c(i(a,g,e)),j=0;g=e>0?g-4:g;for(var k=0;k>16&255,h[j++]=d>>8&255,h[j++]=d&255;e===2&&(d=b[a.charCodeAt(k)]<<2|b[a.charCodeAt(k+1)]>>4,h[j++]=d&255);e===1&&(d=b[a.charCodeAt(k)]<<10|b[a.charCodeAt(k+1)]<<4|b[a.charCodeAt(k+2)]>>2,h[j++]=d>>8&255,h[j++]=d&255);return h}function j(b){return a[b>>18&63]+a[b>>12&63]+a[b>>6&63]+a[b&63]}function k(a,b,c){var d,e=[];for(var b=b;bh?h:g+f));d===1?(g=b[c-1],e.push(a[g>>2]+a[g<<4&63]+"==")):d===2&&(g=(b[c-2]<<8)+b[c-1],e.push(a[g>>10]+a[g>>4&63]+a[g<<2&63]+"="));return e.join("")}}var j=!1;function k(){j||(j=!0,i());return h.exports}function a(a){switch(a){case void 0:return k()}}e.exports=a}),null); __d("base64-js",["base64-js-1.3.0"],(function(a,b,c,d,e,f){e.exports=b("base64-js-1.3.0")()}),null); __d("LS",["FBLogger","LSDbKeyComparer","LSDict","LSIterationHelpers","LSJson","LSLogHistory.re","QuickPerformanceLogger","base64-js","bs_caml","bs_caml_format","bs_caml_int64","qpl","unrecoverableViolation"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a=babelHelpers.taggedTemplateLiteralLoose(["2"]);h=function(){return a};return a}function i(){var a=babelHelpers.taggedTemplateLiteralLoose(["0"]);i=function(){return a};return a}function j(){var a=babelHelpers.taggedTemplateLiteralLoose(["0"]);j=function(){return a};return a}function k(){var a=babelHelpers.taggedTemplateLiteralLoose(["2"]);k=function(){return a};return a}b="LS_WEB";function l(a){return a.name.match(/secure_|inbox(?!_)/i)}var m=babelHelpers.extends({},c("bs_caml_int64"),{eq:function(a,b){return a==null&&b==null||a!=null&&b!=null&&c("bs_caml").i64_eq(a,b)},neq:function(a,b){return a==null&&b!=null||a!=null&&b==null||a!=null&&b!=null&&c("bs_caml").i64_neq(a,b)},lt:c("bs_caml").i64_lt,gt:c("bs_caml").i64_gt,le:c("bs_caml").i64_le,ge:c("bs_caml").i64_ge,min:c("bs_caml").i64_min,max:c("bs_caml").i64_max,to_int32:function(a){return a==null?a:c("bs_caml_int64").to_int32(a)},to_string:function(a){return a==null?a:c("bs_caml_int64").to_string(a)},from_string:function(a){try{return c("bs_caml_format").caml_int64_of_string(a)}catch(b){throw c("unrecoverableViolation")('Unable to cast "'+a+'" to int64',"messenger_comet")}},random:function(){var b=a.crypto||a.msCrypto;b=Array.from(b.getRandomValues(new Uint32Array(2)));b[0]>>>=1;return b}});function n(a){return c("base64-js").toByteArray(a).buffer}var o={to_string:function(a){if(a==null)return void 0;var b=new TextDecoder();return b.decode(a)},of_string:function(a){if(a==null)return void 0;var b=new TextEncoder();return b.encode(a).buffer},eq:function(a,b){if(a==null&&b==null)return!0;if(a==null||b==null)return!1;a=new Uint8Array(a);b=new Uint8Array(b);if(a.length!==b.length)return!1;for(var c=0;c=0},gt:function(a,b){return o.compareTo(a,b)>0}};function p(a){if(a.length!==1)throw c("unrecoverableViolation")("only literal strings supported","messenger_web_product");a=a[0];var b=parseInt(a.substr(-8),16);a=parseInt(a.substr(0,a.length-8),16);return[a>>>1^-(b&1),((b>>>1)+(a&1)*2147483648^-(b&1))>>>0]}function q(a,b){if(typeof a==="object"&&!Array.isArray(a)){var d,e;if(b==="asc"){Object.prototype.hasOwnProperty.call(a,"gt")&&(d=[a.gt,1]);if(Object.prototype.hasOwnProperty.call(a,"gte")){if(d!==void 0)throw c("unrecoverableViolation")("Cannot specify both gt and gte","messenger_web_product");d=[a.gte,0]}Object.prototype.hasOwnProperty.call(a,"lt")&&(e=[a.lt,1]);if(Object.prototype.hasOwnProperty.call(a,"lte")){if(e!==void 0)throw c("unrecoverableViolation")("Cannot specify both lt and lte","messenger_web_product");e=[a.lte,0]}}else{Object.prototype.hasOwnProperty.call(a,"lt")&&(d=[a.lt,1]);if(Object.prototype.hasOwnProperty.call(a,"lte")){if(d!==void 0)throw c("unrecoverableViolation")("Cannot specify both lt and lte","messenger_web_product");d=[a.lte,0]}Object.prototype.hasOwnProperty.call(a,"gt")&&(e=[a.gt,1]);if(Object.prototype.hasOwnProperty.call(a,"gte")){if(e!==void 0)throw c("unrecoverableViolation")("Cannot specify both gt and gte","messenger_web_product");e=[a.gte,0]}}return{start:d,end:e}}return{start:[a,0],end:[a,0]}}function r(a,b,c){var e=a.table(b.name);return{add:function(a){return e.add(a)},fetch:function(){for(var a=arguments.length,f=new Array(a),g=0;g0?a:b}function b(a,b){return d("LSDbKeyComparer").compareValue([a[0],-a[1]],[b[0],-b[1]])<0?a:b}for(var c=arguments.length,e=new Array(c),f=0;f1?g-1:0),i=1;i2?g-2:0),i=2;i1?n-1:0),p=1;p