;/*FB_PKG_DELIM*/ __d("LSTableSchemas",[],(function(a,b,c,d,e,f){e.exports=[[{name:"sync_groups",id:1,primary_key:["groupId"]},{name:"pending_tasks",id:2,primary_key:["taskId"],indexes:{queueNameTaskId:["queueName","taskId"]},auto_increment:!0},{name:"network_requests",id:3,primary_key:["taskQueueName","syncDatabaseId"]},{name:"_user_info",id:4,primary_key:["id"]},{name:"pending_fire_and_forget_tasks",id:5,primary_key:["taskId"],auto_increment:!0},{name:"user_visible_errors",id:6,primary_key:["errorId"],auto_increment:!0},{name:"mailbox_task_completion_notification_context",id:232,primary_key:["notificationScopeKey"]},{name:"mailbox_task_completion_api_tasks",id:233,primary_key:["taskId"]}],[{name:"contacts",id:7,primary_key:["id"],indexes:{blockedByViewerStatusId:["blockedByViewerStatus","id"]}},{name:"ig_contact_info",id:176,primary_key:["contactId"]},{name:"work_contact_info",id:210,primary_key:["id"]},{name:"contextual_profile_v1",id:216,primary_key:["ownerId","associatedEntityId"]},{name:"fb_transport_contacts",id:240,primary_key:["pk"]}],[{name:"reactions",id:8,primary_key:["threadKey","messageId","actorId"]},{name:"threads",id:9,primary_key:["threadKey"],indexes:{lastActivityTimestampMs:["lastActivityTimestampMs","threadKey"],parentThreadKeyLastActivityTimestampMs:["parentThreadKey","lastActivityTimestampMs","threadKey"],clientThreadKey:["clientThreadKey","threadKey"],threadTypeLastActivityTimestampMs:["threadType","lastActivityTimestampMs","threadKey"]}},{name:"threads_ranges_v2__generated",id:10,primary_key:["parentThreadKey","minThreadKey","minLastActivityTimestampMs"]},{name:"messages",id:12,primary_key:["threadKey","timestampMs","messageId"],indexes:{optimistic:["offlineThreadingId"],messageDisplayOrder:["threadKey","primarySortKey","secondarySortKey","messageId"],messageId:["messageId"]}},{name:"messages_ranges_v2__generated",id:13,primary_key:["threadKey","minTimestampMs","minMessageId"]},{name:"participants",id:14,primary_key:["threadKey","contactId"],indexes:{threadKeyReadWatermarkTimestampMs:["threadKey","readWatermarkTimestampMs","contactId"],threadKeyDeliveredWatermarkTimestampMs:["threadKey","deliveredWatermarkTimestampMs","contactId"]}},{name:"ctas",id:15,primary_key:["ctaId"]},{name:"attachments",id:16,primary_key:["threadKey","messageId","attachmentFbid"],indexes:{fk_messages:["threadKey","timestampMs","messageId","attachmentFbid"]}},{name:"attachments_ranges_v2__generated",id:17,primary_key:["threadKey","mediaGroup","minTimestampMs"]},{name:"attachment_items",id:18,primary_key:["attachmentFbid","attachmentIndex"],indexes:{fk_attachments:["threadKey","messageId","attachmentFbid","attachmentIndex"]}},{name:"attachment_ctas",id:19,primary_key:["ctaId"],indexes:{fk_attachments:["threadKey","messageId","attachmentFbid","ctaId"]}},{name:"quick_reply_ctas",id:20,primary_key:["threadKey","messageId","ctaId"]},{name:"m_suggestions",id:21,primary_key:["threadKey","timestampMs","suggestionId"]},{name:"rtc_signals",id:22,primary_key:["timestampMs","type_"]},{name:"rtc_ongoing_calls_on_threads_v2",id:23,primary_key:["threadKey"]},{name:"rtc_multiway_call_initiation_conference_names",id:24,primary_key:["threadKey"]},{name:"mailbox_metadata",id:25,primary_key:["id"]},{name:"group_membership_approval_requests",id:26,primary_key:["threadKey","contactId"]},{name:"admin_message_ctas",id:27,primary_key:["threadKey","messageId","ctaId"],indexes:{ctaId:["ctaId"]}},{name:"thread_nullstate",id:28,primary_key:["threadKey"]},{name:"thread_nullstate_ctas",id:29,primary_key:["ctaId"],indexes:{threadKeyCtaId:["threadKey","ctaId"]}},{name:"focus_mode_ctas",id:30,primary_key:["threadKey","messageId","ctaId"]},{name:"messages_optimistic_context",id:31,primary_key:["taskId"]},{name:"threads_optimistic_context",id:32,primary_key:["taskId"]},{name:"messages_status",id:33,primary_key:["messageId","threadKey","timestampMs","threadKeyFromParticipants","contactId","type_"]},{name:"message_requests",id:34,primary_key:["threadKey"]},{name:"folder_metadata",id:35,primary_key:["parentThreadKey"]},{name:"polls",id:38,primary_key:["pollId"]},{name:"poll_options_v2",id:39,primary_key:["pollId","optionId"]},{name:"poll_votes_v2",id:40,primary_key:["pollId","optionId","contactId"]},{name:"pinned_messages_v2",id:155,primary_key:["threadKey","messageId"]},{name:"filtered_threads_ranges_v3__generated",id:247,primary_key:["parentThreadKey","minThreadKey","minLastActivityTimestampMs","threadRangeFilter","folderName","secondaryThreadRangeFilter","threadRangeFilterValue"]},{name:"community_folders",id:162,primary_key:["folderId"]},{name:"community_members",id:170,primary_key:["communityId","contactId","source"],indexes:{communityContactId:["communityId","contactId","source"],communitySource:["communityId","source","name","contactId"]}},{name:"community_members_ranges_v2__generated",id:189,primary_key:["communityId","isAdmin","minName","source"]},{name:"attachment_conversion",id:164,primary_key:["attachmentFbid"]},{name:"saved_messages",id:165,primary_key:["threadKey","messageId"]},{name:"rtc_rooms_on_threads",id:181,primary_key:["threadKey"]},{name:"ig_thread_info",id:194,primary_key:["threadKey"]},{name:"group_invites",id:197,primary_key:["threadKey","inviterId","inviteeId"],indexes:{threadKeyInviterIDInviteeID:["threadKey","inviterId","inviteeId"]}},{name:"inbox_threads_ranges",id:198,primary_key:["syncGroup"]},{name:"community_direct_invites_presets",id:199,primary_key:["communityId","presetType","source"]},{name:"msg_pinned_messages_v2",id:205,primary_key:["threadKey","messageId","pinnedTimestampMs"],indexes:{pinnedMessageDisplayOrder:["threadKey","pinnedTimestampMs","messageId"]}},{name:"filtered_messages_ranges_v2__generated",id:211,primary_key:["threadKey","mailboxType","minTimestampMs","minMessageId","messageRangeFilter"]},{name:"taken_down_threads",id:212,primary_key:["threadKey"]},{name:"participant_list_queries",id:219,primary_key:["threadKey"]},{name:"sync_group_threads_ranges",id:220,primary_key:["syncGroup","parentThreadKey"]},{name:"community_chat_message_seen_count",id:221,primary_key:["threadKey","messageId"]},{name:"community_chat_polls",id:223,primary_key:["pollId"]},{name:"community_chat_poll_options",id:224,primary_key:["pollId","optionId"]},{name:"community_chat_poll_votes",id:225,primary_key:["pollId","optionId","contactId"]},{name:"reactions_v2",id:226,primary_key:["threadKey","messageId","reactionFbid","messageTimestamp"],indexes:{optimistic:["threadKey","messageId","reactionFbid"]}},{name:"reactions_v2_details_users",id:227,primary_key:["reactorId","reactionFbid"]},{name:"reactions_v2_details_users_ranges_v2__generated",id:228,primary_key:["reactorId","reactionFbid","minTimestampMs"]},{name:"reaction_v2_types",id:229,primary_key:["reactionFbid"]},{name:"bots",id:230,primary_key:["threadKey","botId"]},{name:"business_comm_items",id:234,primary_key:["threadKey","entId"]},{name:"group_invitations_pending",id:235,primary_key:["linkHash"]},{name:"business_support_notification_settings",id:236,primary_key:["userId"]},{name:"thread_label_mappings",id:237,primary_key:["threadKey","labelId"]},{name:"audio_channel_events",id:238,primary_key:["eventId","roomId"]},{name:"reactions_v2_details",id:239,primary_key:["threadId","messageId","reactorId","reactionFbid"]},{name:"reactions_v2_details_ranges_v2__generated",id:243,primary_key:["threadId","messageId","reactionFbid","minTimestampMs"]},{name:"community_chat_poll_votes_ranges_v2__generated",id:244,primary_key:["pollId","optionId","minTimestampMs"]}],[{name:"media_send_jobs",id:51,primary_key:["offlineAttachmentId"]}],[{name:"typing_indicator",id:52,primary_key:["threadKey","senderId"]}],[{name:"server_search_results",id:65,primary_key:["query","resultId","globalIndex"]},{name:"server_search_sections",id:66,primary_key:["query","globalIndex"]},{name:"search_queries",id:67,primary_key:["query"]},{name:"universal_search_recent_searches",id:68,primary_key:["resultId"]},{name:"message_search_results",id:69,primary_key:["type_","query","threadKey","globalIndex"]},{name:"message_search_queries",id:70,primary_key:["type_","query","threadKeyV2"]},{name:"participant_search_queries",id:214,primary_key:["query","threadKey"]}],[{name:"contact_upload_settings",id:74,primary_key:["userid"]},{name:"gdpr_settings",id:75,primary_key:["userid"]},{name:"presence_settings",id:187,primary_key:["userId"]},{name:"persistent_menu_items",id:77,primary_key:["threadKey","ctaId"]},{name:"video_chat_links_joining",id:78,primary_key:["url","optimisticClientToken"],indexes:{optimistic:["optimisticClientToken"]}},{name:"video_chat_links_attempted_joiners",id:79,primary_key:["userId","url"]},{name:"cowatch_sessions",id:80,primary_key:["cowatchSessionId"]},{name:"self_profile",id:81,primary_key:["userId"]},{name:"pinned_threads",id:82,primary_key:["threadKey"],indexes:{pinnedTimestamp:["pinnedTimestamp","threadKey"]}},{name:"messaging_settings",id:83,primary_key:["id"]},{name:"reachability_settings",id:148,primary_key:["audience"]},{name:"feature_limits",id:150,primary_key:["type_"]},{name:"emoji_sets",id:151,primary_key:["categoryIdx","emojiIdx","type_"]},{name:"epd_cookie_settings",id:163,primary_key:[]},{name:"cm_community_list",id:166,primary_key:["communityId"]},{name:"cm_channel_list",id:167,primary_key:["communityId","threadId"]},{name:"cm_category_list",id:182,primary_key:["communityId","categoryId"]},{name:"notification_settings",id:175,primary_key:["id"]},{name:"encrypted_backups_status_trigger",id:195,primary_key:["pk"],auto_increment:!0},{name:"fb_events",id:200,primary_key:["eventId"]},{name:"cm_channel_events",id:201,primary_key:["eventId","threadId"]},{name:"community_events",id:202,primary_key:["eventId","communityId"]},{name:"avatar_settings",id:209,primary_key:["threadId"]},{name:"thread_labels",id:215,primary_key:["labelId"],indexes:{sortKey:["sortKey"]}},{name:"business_support_case_details",id:222,primary_key:["threadId"]},{name:"rtc_call_events",id:245,primary_key:["pk"],auto_increment:!0}],[{name:"payment_type_paypal",id:85,primary_key:["paymentCredentialId"]},{name:"payment_type_card",id:86,primary_key:["paymentCredentialId"]},{name:"payment_type_bank_v2",id:88,primary_key:["paymentMethodId"]},{name:"payment_method",id:89,primary_key:["paymentMethodId"]},{name:"new_payment_credential_option",id:90,primary_key:["credentialType"]},{name:"paypal_funding_options",id:91,primary_key:["optionId"]},{name:"payments_eligibility",id:92,primary_key:["userId"]},{name:"payments_ofac_blacklisted_countries",id:93,primary_key:["isoCountryCode"]},{name:"p2m_invoice",id:94,primary_key:["orderId"]},{name:"p2m_invoice_attachment",id:95,primary_key:["orderId","productItemId"]},{name:"payment_price_list_item",id:96,primary_key:["orderId","id"]},{name:"p2m_charge",id:97,primary_key:["orderId"]},{name:"payment_p2p_risk_verification",id:98,primary_key:["requestId","transactionId"]},{name:"payment_transaction_v2",id:99,primary_key:["timestampMs","transactionId"],indexes:{optimistic:["optimisticTransactionId"]}},{name:"p2p_request_v2",id:100,primary_key:["timestampMs","transactionId"],indexes:{optimistic:["optimisticTransactionId"]}},{name:"p2p_transfer_v2",id:101,primary_key:["timestampMs","transactionId"],indexes:{optimistic:["optimisticTransactionId"]}},{name:"transaction_history",id:102,primary_key:["transactionId"]},{name:"payments_transaction_details_core",id:103,primary_key:["transactionId"]},{name:"payments_transaction_details_ctas",id:104,primary_key:["transactionId","ctaId"]},{name:"payments_transaction_details_rows",id:105,primary_key:["transactionId","rowOrder"]},{name:"payment_user_auth",id:106,primary_key:["userId"]},{name:"payment_client_auth_token",id:107,primary_key:["userId","deviceId","appId"]},{name:"payment_auth_request_results",id:108,primary_key:["requestId"]},{name:"payment_server_request_results",id:109,primary_key:["requestId"]},{name:"payment_pin_verification_results",id:113,primary_key:["requestId"]}],[{name:"connectivity_status",id:114,primary_key:["statusId"],auto_increment:!0},{name:"user_visible_network_connectivity_error",id:115,primary_key:["statusId"],auto_increment:!0}],[{name:"thread_themes",id:116,primary_key:["fbid"]},{name:"gradient_colors",id:117,primary_key:["themeFbid","gradientIndex"]}],[{name:"in_thread_banner",id:118,primary_key:["threadKey","bannerId"]},{name:"in_thread_banner_ctas",id:119,primary_key:["bannerId","ctaId"]},{name:"in_thread_banner_overflow_menu",id:120,primary_key:["threadKey","bannerId"]}],[{name:"stickers",id:121,primary_key:["stickerId"],indexes:{stickerPackId:["stickerPackId","stickerId"]}},{name:"sticker_packs",id:122,primary_key:["packId"]},{name:"sticker_search_results",id:123,primary_key:["resultIndex","query","type_"]},{name:"sticker_search_queries",id:124,primary_key:["query"]},{name:"sticker_search_featured_tags",id:125,primary_key:["tagIndex"]},{name:"sticker_to_collection",id:126,primary_key:["stickerId","collectionId"]},{name:"sticker_pack_details",id:127,primary_key:["packId"]},{name:"sticker_store_pack_indices",id:128,primary_key:["packId"]}],[{name:"forward_content",id:129,primary_key:["value","type_"]}],[{name:"linked_groups",id:130,primary_key:["id"],indexes:{threadKey:["threadKey"]}}],[{name:"ranking_scores",id:134,primary_key:["contactId","scoreType"],indexes:{scoreTypeContactId:["scoreType","contactId"]}},{name:"ranking_requests",id:135,primary_key:["scoreType"]},{name:"value_model_rules",id:136,primary_key:["product","ruleIndex"]},{name:"value_model_features",id:137,primary_key:["feature"]},{name:"value_model_output",id:138,primary_key:["product","contactId"]}],[{name:"story_buckets",id:53,primary_key:["bucketId"],indexes:{optimistic:["ownerId","bucketType"]}},{name:"stories",id:54,primary_key:["storyId"],indexes:{optimistic:["optimisticClientId"]}},{name:"story_viewers",id:55,primary_key:["storyId","viewerContactId","interactionType"]},{name:"story_reactions",id:56,primary_key:["reactionId"],indexes:{optimistic:["optimisticClientId"]}},{name:"story_ad_unit",id:57,primary_key:["adPosition","clientToken"]},{name:"story_ad_card",id:58,primary_key:["adPosition","clientToken","cardId"]},{name:"story_ad_ctas",id:59,primary_key:["ctaId"]},{name:"story_overlays",id:60,primary_key:["storyId","storyOverlayId"]},{name:"story_buckets_paginated_queries",id:61,primary_key:["queryId"]},{name:"status",id:62,primary_key:["statusId"],indexes:{optimistic:["optimisticClientId"]}},{name:"rooms",id:63,primary_key:["roomId"],indexes:{optimistic:["optimisticClientToken"]}},{name:"room_participants",id:64,primary_key:["roomId","participantId","type_"],indexes:{optimistic:["roomId","participantId"]}}],[{name:"live_location_sharers",id:149,primary_key:["threadKey","userId"]}],[{name:"mi_act_mapping_table",id:173,primary_key:["serverThreadKey","clientThreadPk","jid"],indexes:{fk_threads:["serverThreadKey"],chat_id:["clientThreadPk"],jid:["jid"]}},{name:"media_staging",id:161,primary_key:["offlineAttachmentId"]}],[{name:"data_trace_meta",id:153,primary_key:["traceId"],indexes:{shouldFlushInitTimestampMsTraceId:["shouldFlush","initTimestampMs","traceId"]}},{name:"data_trace_addon",id:154,primary_key:["addonId"],indexes:{traceIdAddonId:["traceId","addonId"]},auto_increment:!0}],[{name:"ad_context",id:160,primary_key:["adId"]}],[{name:"thread_proactive_warning_settings",id:183,primary_key:["threadKey"]},{name:"client_thread_proactive_warning_settings",id:241,primary_key:["threadPk"]}],[{name:"presence_states",id:186,primary_key:["contactId"],indexes:{statusContactId:["status","contactId"]}}],[{name:"available_reactions",id:188,primary_key:["emojiIdx"]}],[{name:"pending_backups_context_v2",id:177,primary_key:["pk"],indexes:{fk_pending_tasks:["pendingBackupTaskId"]},auto_increment:!0},{name:"secure_encrypted_backups_client_state",id:168,primary_key:["backupId"]},{name:"encrypted_backups_debug_metadata",id:206,primary_key:["backupId"]},{name:"encrypted_backups_epoch_debug_metadata",id:207,primary_key:["epochId"]},{name:"encrypted_backups_debug_metadata_v2",id:217,primary_key:["backupId"]},{name:"encrypted_backups_epoch_debug_metadata_v2",id:218,primary_key:["epochId"]},{name:"secure_encrypted_backups_epochs",id:169,primary_key:["epochId"],indexes:{fk_secure_encrypted_backups_client_state:["backupId","epochId"]}},{name:"encrypted_backups",id:172,primary_key:["pk"],auto_increment:!0},{name:"secure_encrypted_backups_generated_recovery_code",id:174,primary_key:["pk"]},{name:"secure_encrypted_backups_recovery_code_status",id:178,primary_key:["pk"]},{name:"secure_recovery_code_data",id:179,primary_key:["taskId"],indexes:{fk_pending_tasks:["taskId"]}},{name:"secure_encrypted_backups_message_thread_id_context",id:180,primary_key:["taskId","listId"],indexes:{fk_pending_tasks:["taskId"]}},{name:"encrypted_backups_virtual_devices",id:184,primary_key:["pk"],auto_increment:!0},{name:"encrypted_backups_metadata",id:196,primary_key:["backupId"]},{name:"device_metadata",id:185,primary_key:["pk"]},{name:"encrypted_backup_restore_task_payload_context",id:190,primary_key:["taskId"]},{name:"encrypted_backups_dyi_backup_restore_status",id:208,primary_key:["pk"]},{name:"encrypted_backups_message_backup_status",id:213,primary_key:["messagePk"]},{name:"encrypted_backups_client_restore_status",id:231,primary_key:["threadId"]},{name:"third_party_id_store",id:242,primary_key:["platform"]}],[{name:"secure_encrypted_backups_devices",id:191,primary_key:["deviceId"]},{name:"secure_encrypted_backups_device_supported_versions",id:192,primary_key:["deviceId","supportedVersion"],indexes:{fk_secure_encrypted_backups_device_supported_versions_device_id:["deviceId","supportedVersion"]}}],[{name:"e2ee_dummy_table_for_sync",id:171,primary_key:["placeholder"]},{name:"cutover_threads",id:193,primary_key:["openThreadId"]}],[{name:"community_messaging_aggregated_user_presence_counts_for_community",id:203,primary_key:["folderId"]},{name:"community_messaging_aggregated_copresence_counts_for_chat",id:204,primary_key:["threadId"]}],[{name:"workrooms_co_presence_states",id:246,primary_key:["userId"],indexes:{userCoPresence:["userId","coPresenceObjectId"]}}]]}),null); __d("LSIntEnum",["I64"],(function(a,b,c,d,e,f,g){"use strict";function a(a){return d("I64").of_float(a)}function b(a){return d("I64").to_float(a)}g.ofNumber=a;g.toNumber=b}),98); __d("BPlusTreeBase",["justknobx","unrecoverableViolation"],(function(a,b,c,d,e,f,g){"use strict";var h={gte:[!0,0],lt:[!0,1],gt:[!1,0],lte:[!1,1]};function* i(a){var b=(yield* a.readHeader());if(b==null||b.rootId==null||b.headId==null)return;var c=(yield* a.readExn(b.rootId));c=[{node:c,id:b.rootId}];while(c.length>0){b=c.shift();var d=b.id;b=b.node;if(!b.isLeaf)for(var b=b.children,e=Array.isArray(b),f=0,b=e?b:b[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var g;if(e){if(f>=b.length)break;g=b[f++]}else{f=b.next();if(f.done)break;g=f.value}g=g;var h=(yield* a.read(g));h!=null&&c.push({node:h,id:g})}yield* a.remove(d)}yield* a.removeHeader()}function* j(a,b,c,d){var e=(yield* b.readExn(c)),f=[];e=e;c=c;var g=-1;while(!e.isLeaf)f.push([e,c,g]),g=k(a,e.keys,d,h.gt),g===-1&&(g=e.keys.length),c=e.children[g],e=(yield* b.readExn(c));return[e,c,f,g]}function k(a,b,c,d){var e=0,f=b.length-1;while(e<=f){var g=e+f>>1;(d[0]?a(b[g],c)<0:a(b[g],c)<=0)?e=g+1:f=g-1}g=[e,f][d[1]];return g===b.length?-1:g}function l(a,b,c){if(!b.length)return[0,0];var d=k(a,b,c,h.gte);if(d===-1)return[b.length,0];else if(a(b[d],c)===0)return[d,1];return[d,0]}function m(a,b,c){for(var d=arguments.length,e=new Array(d>3?d-3:0),f=3;f=c;e=o,i=d){p=h.pop()||[{keys:[],children:[i],isLeaf:!1}];o=p[0];d=p[1];k=Math.floor(e.keys.length/2);p=void 0;var q=void 0;e.isLeaf?(p={isLeaf:!0,children:e.children.slice(k),keys:e.keys.slice(k),nextId:e.nextId,prevId:i},q=e.nextId=(yield* b.writeNew(p)),p.nextId?yield* b.write(p.nextId,babelHelpers.extends({},yield* b.readExn(p.nextId),{prevId:q})):g.tailId=q):(p={isLeaf:!1,children:e.children.slice(k+1),keys:e.keys.slice(k+1)},q=(yield* b.writeNew(p)));p=l(a,o.keys,e.keys[k]);p=p[0];o=babelHelpers.extends({},o,{keys:m(o.keys,p,0,e.keys[k]),children:m(o.children,p+1,0,q)});yield* b.write(i,babelHelpers.extends({},e,{keys:e.keys.slice(0,k),children:e.children.slice(0,k+(e.isLeaf?0:1))}))}i==null?g.rootId=(yield* b.writeNew(e)):yield* b.write(i,e);Object.keys(g).length&&(yield* b.writeHeader(babelHelpers.extends({},f,g)))}function* s(a,b,d,e){var f=(yield* n(b)),g={};d=Math.floor(d/2);var i=(yield* j(a,b,f.rootId,e)),l=i[0],o=i[1],p=i[2];i=i[3];var q=k(a,l.keys,e,h.gte);if(q===-1||a(l.keys[q],e)!==0)return!1;a=babelHelpers.extends({},l,{keys:m(l.keys,q,1),children:m(l.children,q,1)});e=o;yield* b.write(e,a);l=i;for(var o,i,q;a.keys.length=s.length)break;v=s[u++]}else{u=s.next();if(u.done)break;v=u.value}v=v;var w=v[0],x=v[1];v=v[2];w.node=w.node||(yield* b.readExn(w.nodeId));x.node=x.node||(yield* b.readExn(x.nodeId));if(w.node.keys.length+x.node.keys.length>=d*2){a.isLeaf?(x.node=babelHelpers.extends({},x.node,{children:[].concat(w.node.children,x.node.children),keys:[].concat(w.node.keys,x.node.keys)}),w.node=babelHelpers.extends({},w.node,{children:x.node.children.splice(0,d),keys:x.node.keys.splice(0,d)}),o=babelHelpers.extends({},o,{keys:m(o.keys,v,1,x.node.keys[0])})):(x.node=babelHelpers.extends({},x.node,{children:[].concat(w.node.children,x.node.children),keys:[].concat(w.node.keys,[o.keys[v]],x.node.keys)}),w.node=babelHelpers.extends({},w.node,{children:x.node.children.splice(0,d+1)}),o=babelHelpers.extends({},o,{keys:m(o.keys,v,1,x.node.keys.splice(d,1)[0])}),w.node.keys=x.node.keys.splice(0,d));yield* b.write(w.nodeId,w.node);yield* b.write(x.nodeId,x.node);yield* b.write(i,o);Object.keys(g).length&&(yield* b.writeHeader(babelHelpers.extends({},f,g)));return!0}}for(v=r,w=Array.isArray(v),x=0,v=w?v:v[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){if(w){if(x>=v.length)break;u=v[x++]}else{x=v.next();if(x.done)break;u=x.value}t=u;s=t[0];r=t[1];u=t[2];s.node=babelHelpers.extends({},s.node,{children:[].concat(s.node.children,r.node.children)});a.isLeaf?(s.node.keys=[].concat(s.node.keys,r.node.keys),r.node.nextId?yield* b.write(r.node.nextId,babelHelpers.extends({},yield* b.readExn(r.node.nextId),{prevId:s.nodeId})):g.tailId=s.nodeId,s.node.nextId=r.node.nextId):s.node.keys=[].concat(s.node.keys,[o.keys[u]],r.node.keys);o=babelHelpers.extends({},o,{keys:m(o.keys,u,1),children:m(o.children,u+1,1)});c("justknobx")._("672")&&(yield* b.write(i,o));yield* b.write(s.nodeId,s.node);yield* b.remove(r.nodeId);break}}yield* b.write(e,a);u=(yield* b.readExn(f.rootId));if(!u.keys.length&&u.children.length){if(u.isLeaf)throw c("unrecoverableViolation")("cannot be leaf","messenger_web_product");yield* b.remove(f.rootId);g.rootId=u.children[0]}Object.keys(g).length&&(yield* b.writeHeader(babelHelpers.extends({},f,g)));return!0}function t(a,b,d){d=d===void 0?{}:d;var e=d.dir,f=e===void 0?"asc":e,g=babelHelpers.objectWithoutPropertiesLoose(d,["dir"]);function i(){if(f==="asc"){if(Object.prototype.hasOwnProperty.call(g,"gt"))return g.gt;else if(Object.prototype.hasOwnProperty.call(g,"gte"))return g.gte}else if(Object.prototype.hasOwnProperty.call(g,"lt"))return g.lt;else if(Object.prototype.hasOwnProperty.call(g,"lte"))return g.lte}function l(b){if(f==="asc")return Object.prototype.hasOwnProperty.call(g,"gt")?k(a,b.keys,g.gt,h.gt):Object.prototype.hasOwnProperty.call(g,"gte")?k(a,b.keys,g.gte,h.gte):0;else return Object.prototype.hasOwnProperty.call(g,"lt")?k(a,b.keys,g.lt,h.lt):Object.prototype.hasOwnProperty.call(g,"lte")?k(a,b.keys,g.lte,h.lte):b.keys.length-1}if(Object.prototype.hasOwnProperty.call(g,"gt")&&Object.prototype.hasOwnProperty.call(g,"gte"))throw c("unrecoverableViolation")("cannot specify both greater than and greater than or equal","messenger_web_product");if(Object.prototype.hasOwnProperty.call(g,"lt")&&Object.prototype.hasOwnProperty.call(g,"lte"))throw c("unrecoverableViolation")("cannot specify both less than and less than or equal","messenger_web_product");var m;return{next:function*(d){var e,o;if(m==null){var p=(yield* n(b)),q=i();if(q!=null){q=(yield* j(a,b,p.rootId,q));e=q[0];q=q[1]}else if(f==="asc"){var r=[yield* b.readExn(p.headId),p.headId];e=r[0];q=r[1]}else{r=[yield* b.readExn(p.tailId),p.tailId];e=r[0];q=r[1]}p=l(e)}else{r=m;p=r.i;o=r.key;q=r.nodeId;e=(yield* b.read(q));if(d!=null){if(a(d,o)===(f==="asc"?-1:1))throw c("unrecoverableViolation")("key must be ahead of current key","messenger_web_product");if(e==null||a(d,e.keys[0])<0||a(d,e.keys[e.keys.length-1])>0){r=(yield* j(a,b,(yield* n(b)).rootId,d));e=r[0];q=r[1]}p=k(a,e.keys,d,h[f==="asc"?"gte":"lte"])}else{if(e==null||p<0||p>=e.keys.length||a(e.keys[p],o)!==0){if(e==null||!e.keys.length||a(o,e.keys[0])<0||a(o,e.keys[e.keys.length-1])>0){r=(yield* j(a,b,(yield* n(b)).rootId,o));e=r[0];q=r[1]}p=k(a,e.keys,o,h[f==="asc"?"lte":"gte"])}p+=f==="asc"?1:-1}}if(p<0||p>=e.keys.length)if(f==="asc"){if(e.nextId===void 0)return{done:!0};q=e.nextId;e=(yield* b.readExn(q));p=0}else{if(e.prevId===void 0)return{done:!0};q=e.prevId;e=(yield* b.readExn(q));p=e.keys.length-1}o=e.keys[p];m={node:e,nodeId:q,key:o,i:p};if(p<0||p>=e.keys.length)return{done:!0};d=f==="asc"?Object.prototype.hasOwnProperty.call(g,"lt")&&a(o,g.lt)>=0||Object.prototype.hasOwnProperty.call(g,"lte")&&a(o,g.lte)>0:Object.prototype.hasOwnProperty.call(g,"gt")&&a(o,g.gt)<=0||Object.prototype.hasOwnProperty.call(g,"gte")&&a(o,g.gte)<0;return d?{done:!0}:{done:!1,value:[e.keys[p],e.children[p]]}}}}function a(a,b,c){b===void 0&&(b=32);return{get:function(b){return o(a,c,b)},getWithDefault:function(b,d){return p(a,c,b,d)},has:function(b){return q(a,c,b)},set:function(d,e){return r(a,c,b,d,e)},delete:function(d){return s(a,c,b,d)},entries:function(b){return t(a,c,b)},clear:function(){return i(c)}}}g.default=a}),98); __d("BPlusTree",["BPlusTreeBase","unrecoverableViolation"],(function(a,b,c,d,e,f,g){"use strict";function h(){var a={},b=void 0,d=0;return{read:function*(b){return a[b]},readExn:function*(b){if(Object.prototype.hasOwnProperty.call(a,b))return a[b];else throw c("unrecoverableViolation")("expected key","messenger_web_product")},readHeader:function*(){return b},remove:function*(b){delete a[b]},removeHeader:function*(){b=void 0},write:function*(b,c){a[b]=c},writeHeader:function*(a){b=a},writeNew:function*(b){a[d++]=b;return d-1}}}function i(a){var b=a.next();while(!b.done)b=a.next(b.value);return b.value}function a(a,b){b===void 0&&(b=16);var d=c("BPlusTreeBase")(a,b,h()),e;return e={clear:function(){return i(d.clear())},delete:function(a){return i(d.delete(a))},entries:function(a){function b(){var c,e=d.entries(a);return c={next:function(a){return i(e.next(a))}},c[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]=b,c}return b()},get:function(a){return i(d.get(a))},getWithDefault:function(a,b){return i(d.getWithDefault(a,b))},has:function(a){return i(d.has(a))},set:function(a,b){i(d.set(a,b));return e}}}g.default=a}),98); __d("LSDbKeyComparer",["unrecoverableViolation"],(function(a,b,c,d,e,f,g){"use strict";var h=[[]];function i(a,b){var d=a===h,e=b===h;if(d&&e)return 0;if(d)return 1;if(e)return-1;if(a===void 0)return b===void 0?0:-1;else if(b===void 0)return 1;else if(Array.isArray(a)){if(!Array.isArray(b))throw c("unrecoverableViolation")("Expected types to be the same","messenger_comet");d=a[0];e=b[0];if(de)return 1;d=a[1];e=b[1];if(de)return 1}else if(typeof a==="string"){if(typeof b!=="string")throw c("unrecoverableViolation")("Expected types to be the same","messenger_comet");if(ab)return 1}else if(typeof a==="number"){if(typeof b!=="number")throw c("unrecoverableViolation")("Expected types to be the same","messenger_comet");if(ab)return 1}else if(a instanceof Date){if(!(b instanceof Date))throw c("unrecoverableViolation")("Expected types to be the same","messenger_comet");if(ab)return 1}else if(typeof a==="boolean"){if(typeof b!=="boolean")throw c("unrecoverableViolation")("Expected types to be the same","messenger_comet");if(!a&&b)return-1;if(a&&!b)return 1}else throw c("unrecoverableViolation")("Unexpected type","messenger_comet");return 0}function a(a,b){for(a=a,b=b;;a=a.tl,b=b.tl){if(a===0&&b===0)return 0;if(a===0)return-1;if(b===0)return 1;var c=i(a.hd,b.hd);if(c!==0)return c}return 0}g.MAX_KEY=h;g.compareValue=i;g.compareKey=a}),98); __d("PromiseOrValue",["isPromise","unrecoverableViolation"],(function(a,b,c,d,e,f,g){"use strict";function a(a,b){if(c("isPromise")(a)&&c("isPromise")(b))return a.then(function(a){return b.then(function(b){return[a,b]})});if(c("isPromise")(a))return a.then(function(a){return[a,b]});return c("isPromise")(b)?b.then(function(b){return[a,b]}):[a,b]}function b(a,b){return c("isPromise")(a)?a.then(b):b(a)}function h(a,b){b=b;while(!0){var d=a(b);if(c("isPromise")(d))return d.then(function(b){return b.action==="break"?b.value:h(a,b.value)});if(d.action==="break")return d.value;b=d.value}throw c("unrecoverableViolation")("just for flow","messenger_web_product")}g.all2=a;g.map=b;g.loop=h}),98); __d("ReQLBounds",["LSDbKeyComparer"],(function(a,b,c,d,e,f,g){"use strict";function h(a,b){return a?{hd:a.hd,tl:h(a.tl,b)}:b}function i(a){return h(a,{hd:d("LSDbKeyComparer").MAX_KEY,tl:0})}function j(a,b,c){if(a!=null&&b!=null)return d("LSDbKeyComparer").compareKey(a[1],b[1])*c>0?a[0]:b[0];if(a!=null)return a[0];if(b!=null)return b[0]}function a(a,b){return j((a==null?void 0:a.gt)!=null?[{gt:a.gt},i(a.gt)]:(a==null?void 0:a.gte)!=null?[{gte:a.gte},a.gte]:void 0,(b==null?void 0:b.gt)!=null?[{gt:b.gt},i(b.gt)]:(b==null?void 0:b.gte)!=null?[{gte:b.gte},b.gte]:void 0,1)}function b(a,b){return j((a==null?void 0:a.lt)!=null?[{lt:a.lt},a.lt]:(a==null?void 0:a.lte)!=null?[{lte:a.lte},i(a.lte)]:void 0,(b==null?void 0:b.lt)!=null?[{lt:b.lt},b.lt]:(b==null?void 0:b.lte)!=null?[{lte:b.lte},i(b.lte)]:void 0,-1)}function c(a,b,c){a.forEach(function(a){var e=a[0];a=a[1];var f=(e==null?void 0:e.gt)!=null?d("LSDbKeyComparer").compareKey(b,i(e.gt))>=0:(e==null?void 0:e.gte)!=null?d("LSDbKeyComparer").compareKey(b,e.gte)>0:!0;e=(e==null?void 0:e.lt)!=null?d("LSDbKeyComparer").compareKey(b,e.lt)<0:(e==null?void 0:e.lte)!=null?d("LSDbKeyComparer").compareKey(b,i(e.lte))<=0:!0;if(f&&e)return c(a)})}g.getLowerLimit=a;g.getUpperLimit=b;g.forEachMatchingBounds=c}),98); __d("ReQLGlobalQueryContext",[],(function(a,b,c,d,e,f){"use strict";var g={};function a(a){a=a.get(g);return a==null?[]:a}function b(a,b){a.set(g,b)}c={contents:void 0};f.getDependencies=a;f.setDependencies=b;f.globalQueryContext=c}),66); __d("ReQL",["BPlusTree","LSDbKeyComparer","PromiseOrValue","ReQLBounds","ReQLGlobalQueryContext","unrecoverableViolation"],(function(a,b,c,d,e,f,g){"use strict";var h={bounds:b,filter:f,getKeyRange:m,map:o,take:s};function i(a,b){return a?{hd:a.hd,tl:i(a.tl,b)}:b}function j(a,b){b=b;a=a;while(b){if(!a)throw c("unrecoverableViolation")("unexpected end of key","messenger_web_product");b=b.tl;a=a.tl}return a}function k(a,b){try{var c=d("ReQLGlobalQueryContext").globalQueryContext.contents,e=d("ReQLGlobalQueryContext").getDependencies(b);d("ReQLGlobalQueryContext").setDependencies(b,[]);d("ReQLGlobalQueryContext").globalQueryContext.contents=b;var f,g;try{f=a(),g=d("ReQLGlobalQueryContext").getDependencies(b)}finally{d("ReQLGlobalQueryContext").setDependencies(b,e),d("ReQLGlobalQueryContext").globalQueryContext.contents=c}return[f,g]}catch(c){if(c instanceof Promise)return c.then(function(){return k(a,b)});throw c}}function a(){for(var a=arguments.length,b=new Array(a),c=0;c0)throw c("unrecoverableViolation")("Right iterable should always be equal to or ahead","messenger_web_product");else if(g<0)return{done:!1,value:[f,[e,void 0]]};else return{done:!1,value:[f,[e,b]]}})})}}},keyLength:Math.max(a.keyLength,b.keyLength),subscribe:function(c,d){var e=!0,f=a.subscribe(async function(a,d,f){var g=await b.iterator(f,{gte:a,lte:a}).next();if(!e)return;await c(a,d.operation==="add"?{operation:"add",value:[d.value,(a=g.value)==null?void 0:a[1]]}:d.operation==="put"?{operation:"put",value:[d.value,(a=g.value)==null?void 0:a[1]]}:{operation:"delete"},f)},d),g=b.subscribe(async function(b,d,f){var g=await a.iterator(f,{gte:b,lte:b}).next();if(!e||g.done)return;await c(b,d.operation==="add"?{operation:"add",value:[g.value[1],d.value]}:d.operation==="put"?{operation:"put",value:[g.value[1],d.value]}:{operation:"delete"},f)},d);return function(){e=!1,f(),g()}}},h)}function o(a){var b=this,c=new Map();function e(b,c,d,e,g){var h=JSON.stringify(d),i=b.get(h);i==null&&(i=[],b.set(h,i));i.forEach(function(a){return a()});i.length=0;var j=i;g.forEach(function(g){j.push(g.subscribe(async function(g,h,i){await f(b,c,d,e,i),await c(d,{operation:"put",value:a(e)},i)}))})}function f(b,c,f,g,h){return d("PromiseOrValue").map(k(function(){return a(g)},h),function(a){var d=a[0];a=a[1];e(b,c,f,g,a);return d})}function g(a,b){var c=JSON.stringify(b);if(!a.has(c))return;b=(b=a.get(JSON.stringify(b)))!=null?b:[];b.forEach(function(a){return a()});b.length=0;a.delete(c)}return Object.setPrototypeOf({direction:b.direction,iterator:function(f,g){var h=b.iterator(f,g);return{next:function(b){return d("PromiseOrValue").map(h.next(b),function(g){if(g.done)return g;g=g.value;var b=g[0],h=g[1];return d("PromiseOrValue").map(d("PromiseOrValue").map(k(function(){return a(h)},f),function(a){var f=a[0],g=a[1];d("ReQLBounds").forEachMatchingBounds(c,b,function(a){var c=a[0];a=a[1];return e(c,a,b,h,g)});return f}),function(a){return{done:!1,value:[b,a]}})})}}},keyLength:b.keyLength,subscribe:function(d,e){var h={},i=new Map();c.set(h,[e,[i,d]]);var j=b.subscribe(async function(b,c,e){if(c.operation==="delete")g(i,b),await d(b,c,e);else if(c.operation==="add"){var h=c.value,j=await f(i,d,b,h,e);a(h);await d(b,{operation:"add",value:j},e)}else if(c.operation==="put"){h=c.value;j=await f(i,d,b,h,e);a(h);await d(b,{operation:"put",value:j},e)}},e);return function(){i.forEach(function(a){a.forEach(function(a){return a()})}),c.delete(h),j()}}},h)}function p(a,b){var c=q(a,b);for(var d=arguments.length,e=new Array(d>2?d-2:0),f=2;f0)return d("PromiseOrValue").map(d("PromiseOrValue").all2(b,g.next(e)),function(a){return{action:"continue",value:a}});else if(j<0)return d("PromiseOrValue").map(d("PromiseOrValue").all2(f.next(i),a),function(a){return{action:"continue",value:a}});return{action:"break",value:{done:!1,value:[e,[c,h]]}}},a)}return{next:function(a){return d("PromiseOrValue").map(d("PromiseOrValue").all2(f.next(a),g.next(a)),h)}}},keyLength:Math.max(a.keyLength,b.keyLength),subscribe:function(c,d){var e=!0;async function f(a,b,d,f,g){a=await a.iterator(g,{gte:d,lte:d}).next();if(a.done||!e)return;a=a.value[1];b=f.operation==="add"?{operation:"add",value:b(f.value,a)}:f.operation==="put"?{operation:"put",value:b(f.value,a)}:f;await c(d,b,g)}var g=a.subscribe(function(){for(var a=arguments.length,c=new Array(a),d=0;d=a)return{done:!0};else return d("PromiseOrValue").map(g.next(b),function(b){b.done||d("ReQLBounds").forEachMatchingBounds(e,b.value[0],function(c){var d=c[0];c=c[1];c.contents<=a&&(d.has(b.value[0])||(c.contents+=1,d.set(b.value[0],void 0)))});h+=1;return b})}}},keyLength:b.keyLength,subscribe:function(f,g){var h={},i=b.direction==="asc"?1:-1,j=c("BPlusTree")(function(a,b){return d("LSDbKeyComparer").compareKey(a,b)*-i}),k={contents:0};e.set(h,[g,[j,k]]);var l=b.subscribe(async function(c,g,l){var m;m=(m=j.entries().next().value)==null?void 0:m[0];var n=m==null?!0:d("LSDbKeyComparer").compareKey(c,m)*i<=0;if(g.operation==="delete"&&n){k.contents>0&&(j.delete(c),await f(c,g,l));var o=await b.iterator(l,m==null?void 0:i===1?{gt:m}:{lt:m}).next();!o.done&&e.has(h)?(j.set(o.value[0],void 0),await f(o.value[0],{operation:"add",value:o.value[1]},l)):k.contents>0&&(k.contents-=1)}else g.operation==="add"&&k.contents=b.length)break;e=b[d++]}else{d=b.next();if(d.done)break;e=d.value}e=e;if(typeof e!=="string")return null}return a}catch(a){return null}}function a(a){var b={indexName:"string",keyIds:"string",tableName:"string"};for(var d in b){if(!Object.prototype.hasOwnProperty.call(a,d)||a[d]==null){c("FBLogger")("messenger_web_product").warn('Malformed index data, missing key "%s"',d);return null}var e=a[d],f=b[d];e=typeof e;if(e!==f){c("FBLogger")("messenger_web_product").warn('Malformed index data, key "%s" has type "%s" but expected "%s"',d,e,f);return null}}e=h(a.keyIds);if(e==null){c("FBLogger")("messenger_web_product").warn('Malformed index data, key IDs "%s" are invalid',typeof a.keyIds==="string"?a.keyIds:"<"+typeof a.keyIds+">");return null}return typeof a.indexName!=="string"||typeof a.tableName!=="string"?null:{data:e,indexName:a.indexName,tableName:a.tableName}}function b(a,b){if(a==null)return!0;if(a.length!==b.length)return!0;for(var c=0;c=h.length)break;l=h[j++]}else{j=h.next();if(j.done)break;l=j.value}l=l;k={autoIncrement:(k=l.auto_increment)!=null?k:!1,cascadeUpdates:(k=c("LSDbForeignKeys")[l.name])!=null?k:[],id:parseInt(l.id,10),indexes:(k=l.indexes)!=null?k:{},name:l.name,primaryKeyIds:l.primary_key};b[k.id]=k;e[k.name]=k;k.id>f&&(f=k.id)}}l={autoIncrement:!1,cascadeUpdates:[],id:++f,indexes:{},name:d("ReStoreIndexMetadata").indicesTableName,primaryKeyIds:["tableName","indexName"]};b[l.id]=l;e[l.name]=l;k={autoIncrement:!1,cascadeUpdates:[],id:++f,indexes:{},name:d("ReStoreDefaultValuesMetadata").defaultValuesTableName,primaryKeyIds:["t"]};b[k.id]=k;e[k.name]=k;return{tableIds:b,tableNames:e}}function a(a){a=h(a);var b=a.tableIds;a=a.tableNames;return{tableIds:b,tableNames:a}}b=a(c("LSTableSchemas"));g.buildTableData=h;g.buildMetadata=a;g.metadata=b}),98); __d("bs_js_dict",["bs_caml_option"],(function(a,b,c,d,e,f){"use strict";function a(a,c){if(c in a)return b("bs_caml_option").some(a[c])}var g=function(a,b){delete a[b]};function c(a){var b=Object.keys(a),c=b.length,d=new Array(c);for(var e=0;e