diff --git a/README.en.md b/README.en.md index c62a953..aa1e892 100644 --- a/README.en.md +++ b/README.en.md @@ -46,7 +46,7 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest | Channel | Setup | Messaging and replies | | --- | --- | --- | | Feishu | Create a bot by QR code, or bind one with App ID + App Secret | Persistent connection for incoming messages; streaming cards show thinking, tool progress, and replies | -| WeChat | Scan a QR code to bind a WeChat bot | Tencent iLink long polling for sending and receiving messages | +| WeChat | Scan a QR code to bind a WeChat bot | Tencent iLink long polling for sending and receiving messages; long replies are sent in 1,800-character chunks | | DingTalk | Create a bot by QR code, or bind one with Client ID + Client Secret | DingTalk Stream connection; streaming replies through AI Cards | | WeCom | Create an intelligent bot by QR code, or bind one with Bot ID + Secret | Official WebSocket connection; native thinking state, tool progress, and streaming replies | | QQ | Create a bot with mobile QQ QR scanning, or bind one with AppID + AppSecret | WebSocket connection; private chats show typing and receive one Markdown reply, while mentioned group chats receive only the final answer | diff --git a/README.md b/README.md index 9df3152..6332151 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Connect IM bots to DeepSeek Harness by scanning a QR code, using an App Manifest | 渠道 | 接入方式 | 消息与回复 | | --- | --- | --- | | 飞书 | 扫码创建机器人,或使用 App ID + App Secret 手动绑定 | 长连接接收消息;通过飞书流式卡片显示思考、工具进度和回答 | -| 微信 | 使用微信扫码绑定机器人 | 腾讯 iLink 长轮询收发消息 | +| 微信 | 使用微信扫码绑定机器人 | 腾讯 iLink 长轮询收发消息;长回复会按 1,800 字符分段发送 | | 钉钉 | 扫码创建机器人,或使用 Client ID + Client Secret 手动绑定 | 钉钉 Stream 长连接;通过 AI Card 流式显示回答 | | 企业微信 | 使用企业微信 App 扫码创建智能机器人,或使用 Bot ID + Secret 手动绑定 | 官方 WebSocket 长连接;原生显示“正在思考中”、工具执行进度和流式回答 | | QQ | 使用手机 QQ 扫码创建机器人,或使用 AppID + AppSecret 手动绑定 | WebSocket 长连接;私聊显示“正在输入”并以单条 Markdown 回复,群聊被 @ 后只发送最终答案 | diff --git a/lib/index.js b/lib/index.js index a2f13cd..9ab46f4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -291,7 +291,7 @@ ${m.join(` `,r);ea===null))return null;let o=new Set,i=new Set,e=new Set;for(let a of r){if(o.has(a.botId)||i.has(a.accountId)||e.has(a.tokenRef))return null;o.add(a.botId),i.add(a.accountId),e.add(a.tokenRef)}return Object.freeze({version:1,accounts:Object.freeze(r)})}var Dm=class{#e;#A=wv;#t=Promise.resolve();constructor(r){this.#e=r}async load(){try{let r=gRe(JSON.parse(await rRe(this.#e,"utf8")));if(!r)throw new Error("dsh-weixin config contains invalid account data");this.#A=r}catch(r){if(r?.code!=="ENOENT")throw r;this.#A=wv}return this}list(){return structuredClone(this.#A.accounts)}get(r){let o=this.#A.accounts.find(i=>i.botId===r);return o?structuredClone(o):null}getByAccountId(r){let o=this.#A.accounts.find(i=>i.accountId===r);return o?structuredClone(o):null}async save(r){let o=gW(r);if(!o)throw new Error("Refusing to persist incomplete dsh-weixin account data");return this.#r(i=>{let e=i.find(t=>t.accountId===o.accountId&&t.botId!==o.botId),a=i.find(t=>t.tokenRef===o.tokenRef&&t.botId!==o.botId);if(e||a)throw new Error("Duplicate Weixin account identity");let A=i.findIndex(t=>t.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(r){if(!sW(r))throw new TypeError("Invalid Weixin bot id");return this.#r(o=>{let i=o.findIndex(a=>a.botId===r);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let r=this.#t.then(async()=>{try{await iRe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=wv});this.#t=r.then(()=>{},()=>{}),await r}async#r(r){let o,i=this.#t.then(async()=>{let e=[...this.#A.accounts];o=r(e);let a=Object.freeze({version:1,accounts:Object.freeze(e)});await this.#o(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#o(r){await tRe(nRe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await oRe(o,`${JSON.stringify(r,null,2)} `,{encoding:"utf8",mode:384}),await aRe(o,this.#e)}};var wm=class extends nr{constructor(r){super({...r,rpcIdPrefix:"weixin",logPrefix:"dsh-weixin"})}};import{mkdir as cRe,readFile as IRe,rename as lRe,unlink as pRe,writeFile as dRe}from"node:fs/promises";import{dirname as ERe}from"node:path";var Om=Object.freeze({version:1,sessions:{},seenMessageIds:[],getUpdatesBuf:""});function hRe(n){if(!n||typeof n!="object")return structuredClone(Om);let r={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[o,i]of Object.entries(n.sessions))typeof o=="string"&&typeof i=="string"&&i&&(r[o]=i);return{version:1,sessions:r,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(o=>typeof o=="string").slice(-1e3):[],getUpdatesBuf:typeof n.getUpdatesBuf=="string"?n.getUpdatesBuf:""}}var bm=class{#e;#A=structuredClone(Om);#t=Promise.resolve();constructor(r){this.#e=r}async load(){try{this.#A=hRe(JSON.parse(await IRe(this.#e,"utf8")))}catch(r){if(r?.code!=="ENOENT")throw r;this.#A=structuredClone(Om),await this.#r()}return this}sessionFor(r){return this.#A.sessions[r]??null}async setSession(r,o){this.#A.sessions[r]=o,await this.#r()}async clearSession(r){delete this.#A.sessions[r],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(r){return this.#A.seenMessageIds.includes(r)}async markSeen(r){this.hasSeen(r)||(this.#A.seenMessageIds.push(r),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}getUpdatesBuf(){return this.#A.getUpdatesBuf}async setGetUpdatesBuf(r){typeof r!="string"||r===this.#A.getUpdatesBuf||(this.#A.getUpdatesBuf=r,await this.#r())}snapshot(){return structuredClone(this.#A)}async remove(){try{await pRe(this.#e)}catch(r){if(r?.code!=="ENOENT")throw r}this.#A=structuredClone(Om)}async#r(){let r=`${JSON.stringify(this.#A,null,2)} `,o=this.#t.then(async()=>{await cRe(ERe(this.#e),{recursive:!0,mode:448});let i=`${this.#e}.tmp`;await dRe(i,r,{encoding:"utf8",mode:384}),await lRe(i,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};import{randomUUID as CRe}from"node:crypto";var cW=new Set(["starting","pending","scanned","needs_verification","connecting"]),Mm=new Set(["connected","expired","failed","cancelled"]),IW=5*6e4,dW=Object.freeze({"credential-read-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002","credential-save-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002","account-config-save-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002","runtime-prepare-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002","harness-connect-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002","harness-timeout":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002","harness-auth-required":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u9700\u8981\u8EAB\u4EFD\u8BA4\u8BC1\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u3001\u7F51\u5173\u6216\u81EA\u5B9A\u4E49\u9274\u6743\u914D\u7F6E\u3002","harness-proxy-auth-required":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u672C\u673A Harness \u8BF7\u6C42\u88AB\u4EE3\u7406\u8981\u6C42\u8BA4\u8BC1\u3002\u8BF7\u8BA9\u56DE\u73AF\u5730\u5740\u7ED5\u8FC7\u4EE3\u7406\uFF0C\u5E76\u68C0\u67E5 NO_PROXY \u914D\u7F6E\u3002","harness-loopback-forbidden":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5F02\u5E38\u62D2\u7EDD\u4E86\u56DE\u73AF\u5730\u5740\u7684\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 HTTP \u4EE3\u7406\u3001Harness \u6E90\u7801\u7248\u672C\u548C\u6784\u5EFA\u4EA7\u7269\u3002","harness-host-untrusted":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u7684 Host \u4FE1\u4EFB\u68C0\u67E5\u62D2\u7EDD\u4E86\u975E\u56DE\u73AF\u5730\u5740\u8BF7\u6C42\u3002\u8BF7\u68C0\u67E5 harnessBaseUrl \u4E0E trustedHosts \u914D\u7F6E\u3002","harness-request-forbidden":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u5065\u5EB7\u68C0\u67E5\u6536\u5230\u4E86\u975E Harness \u6807\u51C6\u7684 403 \u62D2\u7EDD\u54CD\u5E94\u3002\u8BF7\u68C0\u67E5\u4EE3\u7406\u6216\u7F51\u5173\u914D\u7F6E\u3002","harness-api-not-found":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002","harness-http-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002","harness-response-invalid":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002","harness-rpc-rejected":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002","harness-check-unknown-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002","connection-start-failed":"\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002"});function Fp(n){return typeof n=="string"&&n.trim()?n.trim():null}function uRe(){return new DOMException("Provisioning was cancelled","AbortError")}function lW(n,r){let o=Fp(n);return o?Pp(o.includes("://")?o:`https://${o}`):Pp(r)}function _C(n){return n?{attemptId:n.id,status:n.state,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},pollIntervalMs:1e3,...n.state==="needs_verification"?{verificationRequired:!0}:{},...n.botId?{botId:n.botId}:{},...n.alreadyConnected?{alreadyConnected:!0}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}function Ga(n,r){return Object.freeze({code:n,message:r})}function BRe(n){return!n||typeof n!="object"||typeof n.code!="string"||!n.code||typeof n.reason!="string"||!n.reason||typeof n.message!="string"||!n.message||!Number.isFinite(n.at)?null:{code:n.code.slice(0,64),reason:n.reason.slice(0,128),message:n.message.slice(0,500),at:n.at}}function TC(n,r){let o=new Error(`Weixin activation failed during ${n}`,{cause:r});return o.name="WeixinActivationStageError",o.code=n,o}function fRe(n){if(n instanceof kA)return Ga(n.code,n.message);let r=dW[n?.code];return r?Ga(n.code,w(r)):Ga("activation-unknown-failed",w("\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002"))}function pW(n,r){return n instanceof kA||dW[n?.code]?n:TC(r,n)}var NC=class{#e;#A;#t;#r;#o;#i;#I=new Map;#s=new Map;#l=new Map;#a=null;#n=new Map;#g=0;#c=!1;constructor({api:r,credentials:o,configStore:i,createRuntime:e,deleteState:a=async()=>{},logger:A=console}){if(!r||typeof r.beginLogin!="function"||typeof r.pollLogin!="function")throw new TypeError("WeixinController requires a Weixin API client");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("WeixinController requires the DSH credential provider");if(!i||typeof i.list!="function"||typeof i.save!="function"||typeof i.remove!="function")throw new TypeError("WeixinController requires a config store");if(typeof e!="function")throw new TypeError("createRuntime is required");this.#e=r,this.#A=o,this.#t=i,this.#r=e,this.#o=a,this.#i=A}async initialize(){if(this.#c)return this.status();for(let r of this.#t.list())this.#I.get(r.botId)?.status?.ready!==!0&&await this.#Q(r.botId,async()=>{let i=this.#t.get(r.botId);if(!(!i||this.#c))try{let e=await this.#C(i.tokenRef);if(!e){this.#s.set(i.botId,Ga("missing-token",w("\u767B\u5F55\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002")));return}await this.#E(i,e),this.#s.delete(i.botId)}catch(e){this.#s.set(i.botId,Ga("connection-failed",w("\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#i.warn?.(`[dsh-weixin] account ${i.botId} failed to initialize:`,e)}finally{this.#f()}});return this.status()}async startProvisioning(){if(this.#c)throw new Error("dsh-weixin controller is closed");this.#a&&await this.cancelProvisioning(this.#a);let r={id:CRe(),state:"starting",createdAt:Date.now(),expiresAt:Date.now()+IW,controller:new AbortController,pendingVerifyCode:null,verifyResolve:null,currentBaseUrl:Sm,error:null,botId:null,task:null};this.#l.set(r.id,r),this.#a=r.id,this.#f();try{let o=(await Promise.all(this.#t.list().slice(-10).map(async e=>this.#C(e.tokenRef)))).filter(Boolean),i=await this.#e.beginLogin({localTokens:o,signal:r.controller.signal});return this.#B(r),r.qrcode=i.qrcode,r.verificationUrl=i.qrcodeUrl,r.state="pending",r.expiresAt=Date.now()+IW,this.#f(),r.task=this.#p(r),_C(r)}catch(o){throw r.controller.signal.aborted?(r.state="cancelled",r.error=Ga("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(r.state="failed",r.error=Ga(o instanceof kA?o.code:"qr-start-failed",o instanceof kA?o.message:w("\u65E0\u6CD5\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#a===r.id&&(this.#a=null),this.#f(),o}}registrationStatus(r){return _C(this.#l.get(r))}async submitVerification(r,o){let i=this.#l.get(r);if(!i||i.state!=="needs_verification")throw new Error("The provisioning attempt is not waiting for a verification code");let e=Fp(o);if(!e||!/^\d{4,8}$/.test(e))throw new TypeError("Verification code must contain 4 to 8 digits");return i.pendingVerifyCode=e,i.state="scanned",i.verifyResolve?.(),i.verifyResolve=null,this.#f(),_C(i)}async cancelProvisioning(r){let o=this.#l.get(r);return o?(Mm.has(o.state)||(o.controller.abort(),o.verifyResolve?.(),o.verifyResolve=null,await o.task?.catch(()=>{}),Mm.has(o.state)||(o.state="cancelled"),o.error??=Ga("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))),this.#a===o.id&&(this.#a=null),this.#f(),_C(o)):null}async reconnectBot(r){let o=this.#t.get(r);if(!o)throw new Error("Unknown Weixin account");return await this.#Q(r,async()=>{let i=await this.#C(o.tokenRef);if(!i)throw new Error("The Weixin token is missing");try{await this.#E(o,i),this.#s.delete(r)}catch(e){throw this.#s.set(r,Ga("connection-failed",w("\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#f()}}),this.status()}async sendConnectionTest(r){let o=this.#t.get(r);if(!o)throw new Error("Unknown Weixin account");return this.#Q(r,async()=>{let i=this.#I.get(r);if(!i?.status?.ready||typeof i.sendConnectionTest!="function")throw or(w("\u5FAE\u4FE1\u673A\u5668\u4EBA"));return i.sendConnectionTest(pa(w("\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{name}\uFF09",{name:bv(o.accountId)})))})}async deleteBot(r){let o=this.#t.get(r);if(!o)throw new Error("Unknown Weixin account");return await this.#Q(r,async()=>{let i=await this.#A.resolve(o.tokenRef).catch(()=>{});await this.#d(r);try{await this.#A.unset(o.tokenRef),await this.#t.remove(r)}catch(e){throw i?.value&&(await this.#A.set(o.tokenRef,i.value).catch(()=>{}),await this.#E(o,i.value).catch(()=>{})),new Error("Unable to remove the Weixin account safely.",{cause:e})}try{await this.#o({botId:r,config:o})}catch(e){this.#i.warn?.(`[dsh-weixin] account ${r} state cleanup failed:`,e)}this.#s.delete(r),this.#f()}),this.status()}status(){let r=this.#t.list().map(e=>{let a=this.#I.get(e.botId)?.status??null,A=a?.ready===!0&&a.weixinConnectionState==="connected"&&a.harnessReachable===!0,t=A?"connected":a?.weixinConnectionState==="connecting"?"connecting":this.#s.has(e.botId)||a?.weixinConnectionState==="failed"?"error":"offline",s=this.#s.get(e.botId)??(t==="error"?Ga("connection-failed",w("\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002")):null);return{botId:e.botId,state:t,connected:A,configured:!0,bot:{name:w("\u5FAE\u4FE1\u673A\u5668\u4EBA"),accountIdMasked:bv(e.accountId)},health:{status:A?"healthy":t==="error"?"error":"offline",summary:A?w("\u5FAE\u4FE1\u6D88\u606F\u957F\u8F6E\u8BE2\u8FD0\u884C\u6B63\u5E38"):t==="error"?w("\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:a?.lastCheckedAt??null},stats:{messagesReceived:a?.messagesReceived??0,messagesReplied:a?.messagesReplied??0},lastMessageError:BRe(a?.lastMessageError),error:s?structuredClone(s):null}}),o=r.filter(e=>e.connected).length,i=this.#a?this.#l.get(this.#a):null;return{schemaVersion:1,revision:this.#g,state:i&&cW.has(i.state)?"provisioning":r.length===0?"disconnected":o===r.length?"connected":o>0?"degraded":"offline",bots:r,totals:{configured:r.length,connected:o},...i&&cW.has(i.state)?{provisioning:_C(i)}:{}}}async close(){this.#c||(this.#c=!0,this.#a&&await this.cancelProvisioning(this.#a),await Promise.allSettled([...this.#I.keys()].map(r=>this.#d(r))))}async#p(r){try{for(;!r.controller.signal.aborted&&Date.now(){r.verifyResolve=i,r.controller.signal.aborted&&i()}),r.verifyResolve=null,this.#B(r));let o=await this.#e.pollLogin({qrcode:r.qrcode,baseUrl:r.currentBaseUrl,verifyCode:r.pendingVerifyCode,signal:r.controller.signal});if(this.#B(r),o.status==="wait")r.state="pending";else if(o.status==="scaned")r.pendingVerifyCode=null,r.state="scanned";else if(o.status==="need_verifycode")r.pendingVerifyCode=null,r.state="needs_verification";else if(o.status==="verify_code_blocked"){r.state="failed",r.error=Ga("verification-blocked",w("\u914D\u5BF9\u7801\u591A\u6B21\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"));break}else if(o.status==="expired"){r.state="expired",r.error=Ga("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002"));break}else if(o.status==="scaned_but_redirect")r.currentBaseUrl=lW(o.redirect_host,r.currentBaseUrl),r.state="scanned";else if(o.status==="binded_redirect"){let i=this.#t.list().find(e=>this.#I.get(e.botId)?.status?.ready===!0)??this.#t.list()[0];i?(r.state="connected",r.botId=i.botId,r.alreadyConnected=!0):(r.state="failed",r.error=Ga("already-bound",w("\u8BE5\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ED1\u5B9A\uFF0C\u4F46\u672C\u673A\u6CA1\u6709\u53EF\u6062\u590D\u7684\u51ED\u636E\u3002")));break}else if(o.status==="confirmed"){let i=Fp(o.bot_token),e=Fp(o.ilink_bot_id),a=Fp(o.ilink_user_id);if(!i||!e||!a)throw new kA("incomplete-login",w("\u5FAE\u4FE1\u6388\u6743\u6210\u529F\uFF0C\u4F46\u8FD4\u56DE\u7684\u8D26\u53F7\u51ED\u636E\u4E0D\u5B8C\u6574\u3002"));r.state="connecting",this.#f();let A=lW(o.baseurl,r.currentBaseUrl);r.botId=await this.#h(r,{token:i,accountId:e,ownerUserId:a,baseUrl:A}),r.state="connected",r.error=null;break}this.#f()}!r.controller.signal.aborted&&Date.now()>=r.expiresAt&&!Mm.has(r.state)&&(r.state="expired",r.error=Ga("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")))}catch(o){r.controller.signal.aborted||o?.name==="AbortError"?(r.state="cancelled",r.error=Ga("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(r.state="failed",r.error=fRe(o),this.#i.error?.("[dsh-weixin] provisioning failed:",o))}finally{r.pendingVerifyCode=null,r.verifyResolve?.(),r.verifyResolve=null,this.#a===r.id&&(this.#a=null),this.#f(),this.#m()}}async#h(r,{token:o,accountId:i,ownerUserId:e,baseUrl:a}){let A=Ov(i),t=this.#t.getByAccountId(i),s={botId:A.botId,accountId:i,tokenRef:A.tokenRef,ownerUserId:e,baseUrl:a,createdAt:t?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()},g;try{g=await this.#A.resolve(A.tokenRef)}catch(c){throw TC("credential-read-failed",c)}return this.#Q(A.botId,async()=>{try{try{await this.#A.set(A.tokenRef,o)}catch(c){throw TC("credential-save-failed",c)}this.#B(r);try{await this.#t.save(s)}catch(c){throw TC("account-config-save-failed",c)}return this.#B(r),await this.#E(s,o),this.#B(r),this.#s.delete(A.botId),this.#f(),A.botId}catch(c){throw await this.#d(A.botId),t?await this.#t.save(t).catch(()=>{}):this.#t.get(A.botId)&&await this.#t.remove(A.botId).catch(()=>null)&&await this.#o({botId:A.botId,config:s}).catch(d=>{this.#i.warn?.("[dsh-weixin] failed to clean up cancelled bot state:",d)}),await this.#u(A.tokenRef,g),t&&g?.value&&await this.#E(t,g.value).catch(()=>{}),c}})}async#E(r,o){await this.#d(r.botId);let i;try{i=await this.#r({botId:r.botId,config:r,token:o})}catch(e){throw pW(e,"runtime-prepare-failed")}if(!i||typeof i.start!="function"||typeof i.stop!="function")throw TC("runtime-prepare-failed",new TypeError("createRuntime returned an invalid Weixin runtime"));try{await i.start(),this.#I.set(r.botId,i)}catch(e){throw await i.stop().catch(()=>{}),pW(e,"connection-start-failed")}}async#d(r){let o=this.#I.get(r);this.#I.delete(r),await o?.stop().catch(i=>{this.#i.warn?.(`[dsh-weixin] account ${r} failed to stop cleanly:`,i)})}async#C(r){let o=await this.#A.resolve(r).catch(()=>{});return Fp(o?.value)}async#u(r,o){try{o?.value?await this.#A.set(r,o.value):await this.#A.unset(r)}catch(i){this.#i.error?.(`[dsh-weixin] failed to restore credential ${r}:`,i)}}#B(r){if(r.controller.signal.aborted||this.#a!==r.id)throw uRe()}#Q(r,o){let a=(this.#n.get(r)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#n.get(r)===a&&this.#n.delete(r)});return this.#n.set(r,a),a}#m(){for(let[r,o]of this.#l)r!==this.#a&&Mm.has(o.state)&&this.#l.size>16&&this.#l.delete(r)}#f(){this.#g+=1}};var _m=()=>w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002"),Tm=()=>w("\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"),QRe=()=>[w("\u5FAE\u4FE1\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002"),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u6216\u5E26\u6587\u5B57\u8BC6\u522B\u7ED3\u679C\u7684\u8BED\u97F3\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/workspace \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/sessionlist [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2"),w("/presetlist \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` -`);function yRe(n){return`p2p:${n}`}function Ta(n){return typeof n=="string"&&n.trim()?n.trim():null}function EW(n,r){return{content:Gp(n)??"",images:typeof r?.inboundImages=="function"?r.inboundImages(n):yv(n),files:typeof r?.inboundFiles=="function"?r.inboundFiles(n):mv(n)}}function Nm(n){return Array.isArray(n?.item_list)&&n.item_list.some(r=>r?.image_item&&typeof r.image_item=="object")}function Rm(n){return Array.isArray(n?.item_list)&&n.item_list.some(r=>r?.file_item&&typeof r.file_item=="object")}function mRe(n,r){return r.questions[r.index]&&Ta(n?.from_user_id)===r.actor&&!Nm(n)&&!Rm(n)&&Ta(Gp(n))}function Mv(n,r=Tm()){let o=qO(n);return{code:o?.code??"message-processing-failed",reason:o?.reason??"UNKNOWN",message:o?.userMessage??r,at:Date.now()}}function SRe(n,r){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(r?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u673A\u5668\u4EBA\u5F53\u524D\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u80FD\u529B\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u5FAE\u4FE1\u4F1A\u8BDD\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\u3002",{name:o});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function _v(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null}}var km=class{#e;#A;#t;#r;#o;#i;#I;#s;#l;#a;#n;#g=new Map;#c=new Map;#p=new Map;#h=new Set;#E=new Set;#d=new Set;#C;constructor({api:r,baseUrl:o,token:i,ownerUserId:e,harness:a,state:A,status:t=_v(),logger:s=console,replyTimeoutMs:g=6e5,maxMessageChars:c=4e3,signal:I}){if(!r||typeof r.sendText!="function")throw new TypeError("Weixin API is required");if(!o||!i||!e)throw new TypeError("Weixin account credentials are required");if(!a||!A)throw new TypeError("Harness client and state store are required");this.#e=r,this.#A=o,this.#t=i,this.#r=e,this.#o=a,this.#i=A,this.#I=t,this.#s=s,this.#l=g,this.#a=c,this.#n=I,this.#C=new Va({label:"weixin",logger:s})}get status(){return structuredClone(this.#I)}accept(r){if(this.#n?.aborted||r?.message_type===2)return Promise.resolve();let o=Dv(r),i=Ta(r?.from_user_id);if(!o||!i||this.#i.hasSeen(o)||this.#h.has(o))return Promise.resolve();this.#h.add(o),i===this.#r&&xi(this.#i,{toUserId:i});let e=yRe(i),a=Ta(r?.context_token)??void 0,A=Ta(r?.run_id)??void 0,t=this.#c.get(e),s=Ta(Gp(r))??"",g=Rm(r)?null:fi(s)?zi:Qi(s)?Wi:yi(s)?Zi:null;if(g&&i===this.#r){let I;return I=this.#B(r,o,e,i,a,A,s,g).catch(d=>{if(!(d?.code==="turn-stopped"||this.#n?.aborted))return this.#I.lastError=d?.message??String(d),this.#I.lastMessageError=Mv(d),this.#s.error?.("[dsh-weixin] failed to process a command:",d),this.#b(i,Tm(),a,A).catch(()=>{})}).finally(()=>{this.#h.delete(o),this.#d.delete(I)}),this.#d.add(I),I}let c=this.#C.claimReply({key:e,actor:i,messageId:o,text:Nm(r)||Rm(r)?"":Gp(r),addressed:!0,hasPendingQuestion:!!t,questionCompletion:t?.submitting||t?.claimedReplyMessageId?t.queue:null,isQuestionPending:()=>this.#c.has(e),send:I=>this.#b(i,I,a,A)});if(c){let I;return I=c.process(async()=>this.#i.hasSeen(o)?!1:(await this.#i.markSeen(o),this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#h.delete(o),this.#E.delete(I)}),this.#E.add(I),I}if(t?.submitting||t?.claimedReplyMessageId)return this.#u(r,o,e);if(t){mRe(r,t)&&(t.claimedReplyMessageId=o);let d=(t.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#m(r,o,e,t)).catch(B=>this.#O(r,o,B)).finally(()=>{this.#h.delete(o),t.claimedReplyMessageId===o&&(t.claimedReplyMessageId=null),t.queue===d&&(t.queue=null)});return t.queue=d,d}return this.#u(r,o,e)}#u(r,o,i,{releaseMessageId:e=!0,alreadyRecorded:a=!1}={}){let A=r.from_user_id===this.#r?hl(EW(r,this.#e),{signal:this.#n}):void 0,s=(this.#g.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#Q(r,i,{alreadyRecorded:a,preparedMessage:A})).finally(()=>{e&&this.#h.delete(o),this.#g.get(i)===s&&this.#g.delete(i)});return this.#g.set(i,s),s}async waitForIdle(){await Promise.allSettled([...this.#g.values(),...[...this.#c.values()].flatMap(r=>r.queue?[r.queue]:[]),...this.#E,...this.#d])}async#B(r,o,i,e,a,A,t,s){if(this.#n?.throwIfAborted(),this.#i.hasSeen(o))return;await this.#i.markSeen(o),this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString();let g=await s(t,this.#o,this.#i,i,{signal:this.#n,hasImages:Nm(r),hasFiles:Rm(r),pendingInteraction:this.#c.has(i)||this.#C.hasPending(i),control:{owner:this,key:i}});g?.stopped&&await Promise.allSettled([this.#R(i),this.#C.closeRoute(i)]);for(let c of g?.messages??[g?.message])c&&await this.#b(e,c,a,A);this.#I.lastError=null,this.#I.lastMessageError=null}async#Q(r,o,{alreadyRecorded:i=!1,preparedMessage:e}={}){this.#n?.throwIfAborted();let a=Dv(r),A=Ta(r?.from_user_id);if(!a||!A)return;if(!i){if(this.#i.hasSeen(a))return;this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString()}if(A!==this.#r){this.#I.messagesRejected+=1,this.#I.lastRejectedAt=new Date().toISOString();return}let t=typeof r.context_token=="string"?r.context_token:void 0,s=typeof r.run_id=="string"?r.run_id:void 0;try{let g=e??EW(r,this.#e),c=g.content,I=Er(g),d=Xt(g);if(!c&&!I&&!d){await this.#b(A,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002"),t,s),await this.#i.markSeen(a);return}let B=c.trim().toLowerCase();if(!I&&!d&&B==="/help"){await this.#b(A,QRe(),t,s),await this.#i.markSeen(a);return}if(!I&&!d&&B==="/status"){await this.#o.ensureRunning({signal:this.#n}),await this.#b(A,w("\u5FAE\u4FE1\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"),t,s),await this.#i.markSeen(a);return}if(!I&&!d&&B==="/new"){await this.#i.clearSession(o),await this.#b(A,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"),t,s),await this.#i.markSeen(a);return}let f=I||d?null:await Vi(c,this.#o,o);if(f){for(let x of f.messages??[f.message])await this.#b(A,x,t,s);await this.#i.markSeen(a);return}let Q=I||d?null:await qi(c,this.#o,this.#i,o,{signal:this.#n});if(Q){await this.#b(A,Q.message,t,s),await this.#i.markSeen(a);return}let y=I?await ji(g,{signal:this.#n}):void 0,m,T=[];try{({answer:m,artifacts:T=[]}=await Za({harness:this.#o,state:this.#i,key:o,...I?{content:y}:{text:c},createOptions:{signal:this.#n},existsOptions:{signal:this.#n},askOptions:{timeoutMs:this.#l,signal:this.#n,control:{owner:this,key:o},onInteraction:x=>this.#f(x,{key:o,actor:A,contextToken:t,runId:s}),onInteractionResolved:x=>this.#y(x),files:g.files}}))}finally{await Promise.allSettled([this.#R(o),this.#C.closeRoute(o)])}let N=typeof m=="string"&&m.trim()?m:T.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):m,F=null,J=null;try{J=Ht({deliveryId:a,presentation:"weixin-text",providerMessageIds:await this.#b(A,N,t,s)})}catch(x){F=x}let j=await this.#N(A,a,T,t,s,J);if(F&&!j.userVisible)throw F;return await this.#i.markSeen(a),this.#I.messagesReplied+=1,this.#I.lastReplyAt=new Date().toISOString(),this.#I.lastError=null,this.#I.lastMessageError=null,j.receipt}catch(g){if(g?.code==="turn-stopped"){await this.#i.markSeen(a);return}if(this.#n?.aborted)return;this.#I.lastError=g?.message??String(g);let c=$i(g)??Ji(g)??Tm();this.#I.lastMessageError=Mv(g,c),this.#s.error?.("[dsh-weixin] failed to process an inbound message:",g);try{await this.#b(A,c,t,s),await this.#i.markSeen(a)}catch(I){this.#s.error?.("[dsh-weixin] failed to send the safe error reply:",I)}}}async#m(r,o,i,e){this.#n?.throwIfAborted();let a=this.#c.get(i),A=e.claimedReplyMessageId===o;if(!a||a!==e||a.submitting)return A&&(!a||a!==e)?this.#w(r,o):this.#u(r,o,i,{releaseMessageId:!1});if(this.#i.hasSeen(o))return;await this.#i.markSeen(o),this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString();let t=Ta(Gp(r)),s=Ta(r?.context_token)??void 0,g=Ta(r?.run_id)??void 0;if(!t||Nm(r)){await this.#b(e.actor,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"),s,g);return}let c=this.#c.get(i);if(!c||c!==e||c.submitting){if(A&&(!c||c!==e)){await this.#b(e.actor,_m(),s,g);return}return this.#u(r,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}if(c.contextToken=s,c.runId=g,c.needsPresentation){try{await this.#D(c)}catch{this.#I.lastError=w("\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to retry an interaction question"),c.interaction.reconnect?.();return}let d=this.#c.get(i);if(!d||d!==e||d.submitting){if(A&&(!d||d!==e)){await this.#b(e.actor,_m(),s,g).catch(()=>{});return}return this.#u(r,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}}let I=c.questions[c.index];if(I){if(c.answers.push(za(I,t)),c.index+=1,c.index{});return}if(this.#c.get(i)!==c)return;c.submitting=!1,c.answers.pop(),c.index-=1,this.#I.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to answer a Harness interaction"),await this.#b(c.actor,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002"),c.contextToken,c.runId).catch(()=>{})}}}async#f(r,{key:o,actor:i,contextToken:e,runId:a}){if(r?.kind==="approval")return this.#C.handleRequested(r,{key:o,actor:i,send:c=>this.#b(i,c,e,a)});if(r?.kind!=="question")return;let A=r?.payload?.questions,t=typeof r?.interactionId=="string"?r.interactionId:r?.rpcId;if(typeof r?.rpcId!="string"||typeof t!="string"||typeof r.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!Ja(c))){this.#s.warn?.("[dsh-weixin] ignored an invalid Harness question interaction");return}if(r.recovered===!0){await r.respond({ok:!1,error:{code:"cancelled",message:"Weixin safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#b(i,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"),e,a).catch(()=>{});return}let s=this.#c.get(o);if(s?.interactionId===t){s.interaction=r,s.needsPresentation&&await this.#D(s);return}if(this.#p.has(t))return;if(s){await r.respond({ok:!1,error:{code:"cancelled",message:"Weixin is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:t,sessionId:r.sessionId,interaction:r,actor:i,questions:A,answers:[],index:0,contextToken:e,runId:a,queue:null,claimedReplyMessageId:null,presentationPromise:null,submitting:!1,needsPresentation:!0};this.#c.set(o,g),this.#p.set(t,o),await this.#D(g)}async#y(r){if(r?.kind==="approval"){await this.#C.handleResolved(r);return}let o=r?.interactionId;if(r?.kind!=="question"||typeof o!="string")return;let i=this.#p.get(o);i&&this.#M(i,o)}#D(r){if(!r.needsPresentation)return Promise.resolve();if(r.presentationPromise)return r.presentationPromise;let o=r.questions[r.index];if(!o)return Promise.resolve();let i=this.#b(r.actor,qa(o,r.index,r.questions.length),r.contextToken,r.runId).then(()=>{r.needsPresentation=!1}).finally(()=>{r.presentationPromise===i&&(r.presentationPromise=null)});return r.presentationPromise=i,i}async#w(r,o){this.#i.hasSeen(o)||(await this.#i.markSeen(o),this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString(),await this.#b(Ta(r?.from_user_id),_m(),Ta(r?.context_token)??void 0,Ta(r?.run_id)??void 0).catch(()=>{}))}#_(r,o){let i=this.#c.get(r);return!i||o!==void 0&&i.interactionId!==o?null:(this.#c.delete(r),this.#p.delete(i.interactionId),i)}#M(r,o){return this.#_(r,o)!==null}async#R(r){let o=this.#_(r);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Weixin interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#s.warn?.("[dsh-weixin] failed to cancel a pending Harness interaction")}}async#O(r,o,i){this.#n?.aborted||(this.#I.lastError=i?.message??String(i),this.#I.lastMessageError=Mv(i),this.#s.error?.("[dsh-weixin] failed to process an interaction reply:",i),this.#i.hasSeen(o)||await this.#i.markSeen(o).catch(()=>{}),await this.#b(Ta(r?.from_user_id),Tm(),Ta(r?.context_token)??void 0,Ta(r?.run_id)??void 0).catch(()=>{}))}async#b(r,o,i,e){let a=[];for(let A of nW(o,this.#a)){let t=await this.#e.sendText({baseUrl:this.#A,token:this.#t,toUserId:r,text:A,contextToken:i,runId:e,signal:this.#n});a.push(...Xa(t))}return a}async#N(r,o,i,e,a,A){let t=(g,c)=>this.#e[g]({baseUrl:this.#A,token:this.#t,toUserId:r,file:c,contextToken:e,runId:a,signal:this.#n}),s=await eo({artifacts:i,baseReceipt:A,deliveryId:o,aggregatePresentation:A?"weixin-text-and-files":"weixin-files",channelKey:"weixin",signal:this.#n,sendImage:typeof this.#e.sendImage=="function"?g=>t("sendImage",g):void 0,sendFile:typeof this.#e.sendFile=="function"?g=>t("sendFile",g):void 0,sendFailureNotice:(g,c)=>this.#b(r,SRe(g?.fileName,c),e,a),logger:this.#s});return this.#I.artifactsSent=(this.#I.artifactsSent??0)+s.artifactsSent,this.#I.artifactSendErrors=(this.#I.artifactSendErrors??0)+s.artifactSendErrors,{receipt:s.receipt,userVisible:s.userVisible}}};var DRe=Object.freeze([250,1e3,3e3]),wRe=new Set(["harness-connect-failed","harness-timeout","harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden","harness-api-not-found","harness-http-failed","harness-response-invalid","harness-rpc-rejected"]);function ORe(n){if(n===void 0)return[...DRe];if(!Array.isArray(n))throw new TypeError("startRetryDelaysMs must be an array");return n.map(r=>{if(!Number.isFinite(r)||r<0)throw new TypeError("startRetryDelaysMs must contain non-negative delays");return r})}function bRe(n){return n instanceof kA?n.code==="network-error"||n.code==="timeout"?!0:n.code==="http-error"&&(n.status===408||n.status===425||n.status===429||n.status>=500):!1}function MRe(n,r){let o=new Error(`Weixin runtime failed during ${n}`,{cause:r});return o.name="WeixinRuntimeStartError",o.code=n,o}function _Re(n){let r=wRe.has(n?.code)?n.code:"harness-check-unknown-failed";return MRe(r,n)}function hW(n,r){return new Promise((o,i)=>{if(r?.aborted){i(r.reason??new DOMException("Aborted","AbortError"));return}let a=setTimeout(()=>{r?.removeEventListener("abort",A),o()},n),A=()=>{clearTimeout(a),r?.removeEventListener("abort",A),i(r.reason??new DOMException("Aborted","AbortError"))};r?.addEventListener("abort",A,{once:!0})})}function TRe(){return{startedAt:null,ready:!1,weixinConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastError:null,..._v()}}var RC=class{#e;#A;#t;#r;#o;#i;#I;#s;#l;#a=TRe();#n=null;#g=null;#c=null;#p=null;constructor({api:r,config:o,token:i,harness:e,state:a,logger:A=console,replyTimeoutMs:t=6e5,maxMessageChars:s=4e3,startRetryDelaysMs:g}){if(!r||!o||!i||!e||!a)throw new TypeError("WeixinRuntime requires API, account, token, Harness, and state");this.#e=r,this.#A=o,this.#t=i,this.#r=e,this.#o=a,this.#i=A,this.#I=t,this.#s=s,this.#l=ORe(g)}get status(){return structuredClone(this.#a)}async start(){return this.#a.ready&&this.#c?this.status:this.#p?this.#p:(this.#p=this.#h().finally(()=>{this.#p=null}),this.#p)}async#h(){await this.stop(),this.#a.startedAt=new Date().toISOString(),this.#a.weixinConnectionState="connecting",this.#a.lastError=null;try{try{await this.#r.ensureRunning()}catch(o){throw _Re(o)}this.#a.harnessReachable=!0,await this.#E(),this.#g=new AbortController;let r=this.#g.signal;return this.#n=new km({api:this.#e,baseUrl:this.#A.baseUrl,token:this.#t,ownerUserId:this.#A.ownerUserId,harness:this.#r,state:this.#o,status:this.#a,logger:this.#i,replyTimeoutMs:this.#I,maxMessageChars:this.#s,signal:r}),this.#a.ready=!0,this.#a.weixinConnectionState="connected",this.#a.lastCheckedAt=Date.now(),this.#c=this.#d(r).catch(o=>{r.aborted||(this.#a.ready=!1,this.#a.weixinConnectionState="failed",this.#a.lastError=o?.message??String(o),this.#i.error?.(`[dsh-weixin] account ${this.#A.botId} monitor stopped:`,o))}),this.status}catch(r){throw this.#g?.abort(),this.#g=null,this.#n=null,this.#a.ready=!1,this.#a.weixinConnectionState="failed",this.#a.lastError=r?.message??String(r),r}}async#E(){for(let r=0;;r+=1)try{return await this.#e.notifyStart({baseUrl:this.#A.baseUrl,token:this.#t})}catch(o){let i=this.#l[r];if(i===void 0||!bRe(o))throw o;this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} start request failed; retrying in ${i}ms:`,o),await hW(i)}}async#d(r){let o=0;for(;!r.aborted;)try{let i=await this.#e.getUpdates({baseUrl:this.#A.baseUrl,token:this.#t,getUpdatesBuf:this.#o.getUpdatesBuf(),signal:r});if(r.aborted)return;if(i?.ret!==void 0&&i.ret!==0||i?.errcode!==void 0&&i.errcode!==0){let a=i.errcode??i.ret;throw new kA(a===-14?"stale-token":"updates-rejected",a===-14?w("\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002"))}o=0,this.#a.ready=!0,this.#a.weixinConnectionState="connected",this.#a.lastCheckedAt=Date.now(),this.#a.lastError=null;for(let a of i?.msgs??[])this.#n.accept(a).catch(A=>{r.aborted||this.#i.error?.(`[dsh-weixin] account ${this.#A.botId} message handling failed:`,A)});typeof i?.get_updates_buf=="string"&&i.get_updates_buf&&await this.#o.setGetUpdatesBuf(i.get_updates_buf)}catch(i){if(r.aborted)return;if(o+=1,this.#a.lastError=i?.message??String(i),this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} poll failed (${o}/3):`,i),i instanceof kA&&i.code==="stale-token"||o>=3)throw i;await hW(Math.min(2e3*2**(o-1),1e4),r)}}async stop(){let r=this.#c,o=this.#n,i=!!(this.#g||r||this.#a.ready);if(this.#g?.abort(),this.#g=null,this.#c=null,await r?.catch(()=>{}),await o?.waitForIdle(),this.#n=null,i)try{await this.#e.notifyStop({baseUrl:this.#A.baseUrl,token:this.#t,signal:AbortSignal.timeout(1e4)})}catch(e){this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} stop notification failed:`,e)}return this.#a.ready=!1,this.#a.weixinConnectionState="idle",this.status}async sendConnectionTest(r){let o=hE(this.#o),i=typeof o?.toUserId=="string"&&o.toUserId.trim()?o.toUserId.trim():typeof this.#A.ownerUserId=="string"&&this.#A.ownerUserId.trim()?this.#A.ownerUserId.trim():null;if(!i)throw or(w("\u5FAE\u4FE1\u673A\u5668\u4EBA"));if(!this.#a.ready||!this.#g)throw new Error("Weixin runtime is not connected");return await this.#e.sendText({baseUrl:this.#A.baseUrl,token:this.#t,toUserId:i,text:r,signal:this.#g.signal}),{sent:!0}}};var CW=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function NRe(n){if(!Array.isArray(n)||n.length===0)return[...CW];let r=n.filter(o=>Number.isFinite(o)&&o>=0);return r.length>0?r:[...CW]}var vm=class{#e;#A;#t;#r;#o;#i;#I;#s=null;#l=null;#a=0;#n=!1;#g=!1;#c;#p;constructor({controller:r,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:t=clearTimeout}){if(!r||typeof r.initialize!="function"||typeof r.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=r,this.#A=o,this.#t=i,this.#r=NRe(e),this.#o=Number.isFinite(a)&&a>=0?a:15e3,this.#i=A,this.#I=t,this.#c=new Promise(s=>{this.#p=s})}get ready(){return this.#c}start(){return this.#g||this.#n?this:(this.#g=!0,this.#h(0),this)}async close(){this.#n||(this.#n=!0,this.#s!==null&&this.#I(this.#s),this.#s=null,await this.#l?.catch(()=>{}),this.#p?.(null),this.#p=null)}#h(r){this.#n||(this.#s=this.#i(()=>{this.#s=null,this.#E()},r),this.#s?.unref?.())}async#E(){if(this.#n||this.#l)return;let r=this.#d();this.#l=r;try{await r}finally{this.#l===r&&(this.#l=null)}}async#d(){try{if(await this.#A.ensureRunning(),this.#n)return;let r=await this.#e.initialize();if(this.#n)return;this.#p?.(r),this.#p=null;let{configured:o,connected:i}=r.totals;if(i65535)throw new Error("dsh-weixin requires an initialized DSH webServer port");return new URL(`http://127.0.0.1:${o}`)}function PRe(n){let r=fI(n.dshHome??process.env.DSH_HOME??kC(kRe(),".dsh")),o=fI(n.dataDir??kC(r,"integrations","dsh-weixin"));return{root:o,config:fI(n.configPath??kC(o,"config.json")),accounts:fI(n.accountsDir??kC(o,"accounts")),workspaces:fI(n.workspacesPath??kC(o,"workspaces.json"))}}async function Nv(n,r={},o={}){if(!n?.credentials)throw new TypeError("dsh-weixin requires ctx.credentials");if(!n?.webServer)throw new TypeError("dsh-weixin requires ctx.webServer");let i=o.ConfigStore??Dm,e=o.StateStore??bm,a=o.HarnessClient??wm,A=o.Controller??NC,t=o.Runtime??RC,s=o.api??oW(),g=o.createConnectionSupervisor??Tv,c=typeof n.logger=="function"?n.logger("dsh-weixin"):n.logger??console,I=()=>Ca(n),d=PRe(r),B=await new i(d.config).load(),f=fI(r.workspace??process.cwd()),Q=o.WorkspaceStore??xr,y=o.workspaces??await new Q(d.workspaces,{defaultWorkspace:f}).load(),m=B.list();await y.reconcile(m.map(_=>_.botId)),await Promise.all(m.map(_=>y.ensure(_.botId,{defaultAgentPreset:r.agentPreset})));let T=typeof B.remove=="function"?ua(B,{workspaces:y}):B,N=new Map,F=_=>fI(d.accounts,_,"state.json"),J=async _=>{let P=N.get(_);return P||(P=await new e(F(_)).load(),N.set(_,P)),P},j=Qa(n,o.commandExecutor),{controlExecutor:x,sessionMaintenanceExecutor:q,fileIngressExecutor:Y}=ya(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),L=new a({baseUrl:vRe(n.webServer,r.harnessBaseUrl),workspace:f,autostart:!1,dshBin:r.dshBin??"dsh",...j?{commandExecutor:j}:{},...x?{controlExecutor:x}:{},...q?{sessionMaintenanceExecutor:q}:{},...Y?{fileIngressExecutor:Y}:{}}),v=new A({api:s,credentials:n.credentials,configStore:T,logger:c,createRuntime:async({botId:_,config:P,token:Z})=>{let ge=await J(_);await y.ensure(_,{defaultAgentPreset:r.agentPreset});let ye=Ba(L,{botId:_,workspaces:y,state:ge,agentPresetCatalog:I});return new t({api:s,config:P,token:Z,harness:ye.harness,state:ye.state,replyTimeoutMs:r.replyTimeoutMs??6e5,maxMessageChars:r.maxMessageChars??4e3,logger:{error:(...Me)=>c.error?.(`[${_}]`,...Me),warn:(...Me)=>c.warn?.(`[${_}]`,...Me),info:(...Me)=>c.info?.(`[${_}]`,...Me),debug:(...Me)=>c.debug?.(`[${_}]`,...Me)}})},deleteState:async({botId:_})=>{let P=N.get(_);if(N.delete(_),P&&typeof P.remove=="function")await P.remove();else try{await RRe(F(_))}catch(Z){if(Z?.code!=="ENOENT")throw Z}}}),V=fa(v,{workspaces:y,stateFor:J,agentPresetCatalog:I}),K=g({controller:V,harness:L,logger:c,retryDelaysMs:r.retryDelaysMs,healthyIntervalMs:r.healthyIntervalMs}).start();return{controller:V,ready:K.ready,async close(){await K.close(),await V.close(),L.stopManagedProcess()}}}import GRe from"qrcode";var uW="/weixin",_r=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",submitVerification:"provision.verify",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:ei,setAgentPreset:Ai}),BW=Object.freeze(Object.values(_r));function fW(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Lp(n,r){return fW(n)&&Object.keys(n).every(o=>r.includes(o))}function Pm(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function FRe(n,r){return fW(r)?n===_r.status?Lp(r,[])?null:"connection.status does not accept fields.":n===_r.beginProvisioning?Lp(r,["locale"])&&(r.locale===void 0||r.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[_r.pollProvisioning,_r.cancelProvisioning].includes(n)?Lp(r,["attemptId"])&&Pm(r.attemptId)?null:`${n} requires an attemptId.`:n===_r.submitVerification?Lp(r,["attemptId","verifyCode"])&&Pm(r.attemptId)&&typeof r.verifyCode=="string"&&/^\d{4,8}$/.test(r.verifyCode)?null:"provision.verify requires an attemptId and a 4-to-8-digit code.":n===_r.reconnectBot?Lp(r,["botId","sendTest"])&&Pm(r.botId)&&(r.sendTest===void 0||r.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===_r.deleteBot?Lp(r,["botId","confirm"])&&Pm(r.botId)&&r.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===_r.setWorkspace?ma(r)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===_r.setAgentPreset?Da(r)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":"Unknown Weixin endpoint.":"Payload must be an object."}function Gm(n){return{ok:!1,error:{code:"bad-request",message:n}}}function vC(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function LRe(){return{ok:!1,error:{code:"weixin-operation-failed",message:"\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}async function URe(n){return GRe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function Fm(n,r){return!n||!n.verificationUrl?n:{...n,qrCodeDataUrl:await r(n.verificationUrl)}}async function PC(n,r){let o=structuredClone(n);return o.provisioning&&(o.provisioning=await Fm(o.provisioning,r)),o}function HRe(n){if(!n||typeof n.status!="function"||typeof n.startProvisioning!="function"||typeof n.registrationStatus!="function"||typeof n.submitVerification!="function"||typeof n.cancelProvisioning!="function"||typeof n.reconnectBot!="function"||typeof n.deleteBot!="function")throw new TypeError("A complete Weixin controller is required")}function QW(n,{encodeQr:r=URe}={}){HRe(n);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>r(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return vC();if(!BW.includes(e))return Gm("Unknown Weixin endpoint.");let t=FRe(e,a);if(t)return Gm(t);try{let s;if(e===_r.status)s=await PC(await n.status(),i);else if(e===_r.beginProvisioning){let g=await n.startProvisioning();if(A?.aborted)return await n.cancelProvisioning(g.attemptId),vC();s=await Fm(g,i)}else if(e===_r.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return Gm("The provisioning attempt no longer exists.");s=await Fm(g,i)}else if(e===_r.submitVerification)s=await Fm(await n.submitVerification(a.attemptId,a.verifyCode),i);else if(e===_r.cancelProvisioning){if(s=await n.cancelProvisioning(a.attemptId),!s)return Gm("The provisioning attempt no longer exists.")}else if(e===_r.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return vC();let c;if(a.sendTest===!0)if(!g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)||typeof n.sendConnectionTest!="function")c=Zt(or("\u5FAE\u4FE1\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(a.botId),c=Zt()}catch(d){c=Zt(d)}s=await PC({...g,...c?{testMessage:c}:{}},i)}else if(e===_r.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await PC(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===_r.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await PC(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else s=await PC(await n.deleteBot(a.botId),i);return A?.aborted?vC():{ok:!0,value:s}}catch(s){let g=Sa(s);return A?.aborted?vC():g?{ok:!1,error:g}:LRe()}}}function Lm(n,r,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(uW,QW(r,o),{authority:ur(i)})}async function yW(n,r={}){if(r?.controller)return Lm(n,r.controller,r.rpcOptions,r.rpcAuthority);let o=await Nv(n,r,r.internals),i=Lm(n,o.controller,r.rpcOptions,r.rpcAuthority);return n.effect(()=>async()=>{await o.close()},"dsh-weixin: close account connections"),i}import{rm as J4e,unlink as q4e}from"node:fs/promises";import{homedir as z4e}from"node:os";import{join as lE,resolve as sg}from"node:path";import{createHash as KRe}from"node:crypto";import{mkdir as xRe,readFile as YRe,rename as jRe,unlink as JRe,writeFile as qRe}from"node:fs/promises";import{dirname as zRe}from"node:path";var Rv=Object.freeze({version:2,bots:Object.freeze([])}),mW=/^whatsapp_[a-f0-9]{24}$/,VRe=/^[a-f0-9-]{36}$/,WRe=/^[1-9]\d{4,14}$/,Hp=Object.freeze({selfOnly:"self-only",privateAllowlist:"private-allowlist",open:"open"});function Up(n){return typeof n=="string"&&n.trim()?n.trim():null}function Um(n){let r=Up(n)?.toLowerCase();return/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(r??"")?r:null}function kv(n){let r=Um(n);if(!r)throw new TypeError("A valid WhatsApp account JID is required");return`whatsapp_${KRe("sha256").update(r).digest("hex").slice(0,24)}`}function vv(n){let r=Um(n)?.split("@")[0]??"";return r?r.length<=7?`${r.slice(0,2)}\u2022\u2022\u2022${r.slice(-2)}`:`${r.slice(0,4)}\u2022\u2022\u2022\u2022${r.slice(-4)}`:w("WhatsApp\u8D26\u53F7")}function ZRe(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedNumbers must be an array of WhatsApp phone numbers");let r=n.map(o=>{let i=typeof o=="string"?o.trim().replace(/^\+/,""):"";if(!WRe.test(i))throw new TypeError("allowedNumbers contains an invalid WhatsApp phone number");return i});return Object.freeze([...new Set(r)])}function Ps(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("WhatsApp access policy must be an object");let r=n.accessMode??Hp.selfOnly;if(!Object.values(Hp).includes(r))throw new TypeError("WhatsApp accessMode is invalid");return Object.freeze({accessMode:r,allowedNumbers:ZRe(n.allowedNumbers)})}var Hm=class{#e;#A=Rv;#t=Promise.resolve();constructor(r){this.#e=r}async load(){try{let r=this.#o(JSON.parse(await YRe(this.#e,"utf8")));if(!r)throw new Error("dsh-im WhatsApp config contains invalid account data");this.#A=r}catch(r){if(r?.code!=="ENOENT")throw r;this.#A=Rv}return this}list(){return structuredClone(this.#A.bots)}get(r){let o=this.#A.bots.find(i=>i.botId===r);return o?structuredClone(o):null}getByAccountJid(r){let o=Um(r),i=this.#A.bots.find(e=>e.accountJid===o);return i?structuredClone(i):null}async save(r){let o=this.#r(r);if(!o)throw new Error("Refusing to persist incomplete WhatsApp account data");return this.#i(i=>{let e=i.find(t=>t.accountJid===o.accountJid&&t.botId!==o.botId),a=i.find(t=>t.authDirectory===o.authDirectory&&t.botId!==o.botId);if(e||a)throw new Error("Duplicate WhatsApp account identity");let A=i.findIndex(t=>t.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(r){if(!mW.test(r))throw new TypeError("Invalid WhatsApp bot id");return this.#i(o=>{let i=o.findIndex(a=>a.botId===r);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let r=this.#t.then(async()=>{try{await JRe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=Rv});this.#t=r.then(()=>{},()=>{}),await r}#r(r){if(!r||typeof r!="object")return null;let o=Um(r.accountJid),i=Up(r.botId),e=Up(r.authDirectory),a=Up(r.name);if(!o||!i||!e||!a||!mW.test(i)||!VRe.test(e)||kv(o)!==i)return null;let A;try{A=Ps(r)}catch{return null}return Object.freeze({botId:i,accountJid:o,authDirectory:e,name:a,createdAt:Up(r.createdAt)??new Date().toISOString(),connectedAt:Up(r.connectedAt),...A})}#o(r){if(!r||r.version!==2||!Array.isArray(r.bots))return null;let o=r.bots.map(A=>this.#r(A));if(o.some(A=>A===null))return null;let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.botId)||e.has(A.accountJid)||a.has(A.authDirectory))return null;i.add(A.botId),e.add(A.accountJid),a.add(A.authDirectory)}return Object.freeze({version:2,bots:Object.freeze(o)})}async#i(r){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=r(e);let a=Object.freeze({version:2,bots:Object.freeze(e)});await this.#I(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#I(r){await xRe(zRe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await qRe(o,`${JSON.stringify(r,null,2)} +`);function yRe(n){return`p2p:${n}`}function Ta(n){return typeof n=="string"&&n.trim()?n.trim():null}function EW(n,r){return{content:Gp(n)??"",images:typeof r?.inboundImages=="function"?r.inboundImages(n):yv(n),files:typeof r?.inboundFiles=="function"?r.inboundFiles(n):mv(n)}}function Nm(n){return Array.isArray(n?.item_list)&&n.item_list.some(r=>r?.image_item&&typeof r.image_item=="object")}function Rm(n){return Array.isArray(n?.item_list)&&n.item_list.some(r=>r?.file_item&&typeof r.file_item=="object")}function mRe(n,r){return r.questions[r.index]&&Ta(n?.from_user_id)===r.actor&&!Nm(n)&&!Rm(n)&&Ta(Gp(n))}function Mv(n,r=Tm()){let o=qO(n);return{code:o?.code??"message-processing-failed",reason:o?.reason??"UNKNOWN",message:o?.userMessage??r,at:Date.now()}}function SRe(n,r){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(r?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u673A\u5668\u4EBA\u5F53\u524D\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u80FD\u529B\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u5FAE\u4FE1\u4F1A\u8BDD\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\u3002",{name:o});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function _v(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null}}var km=class{#e;#A;#t;#r;#o;#i;#I;#s;#l;#a;#n;#g=new Map;#c=new Map;#p=new Map;#h=new Set;#E=new Set;#d=new Set;#C;constructor({api:r,baseUrl:o,token:i,ownerUserId:e,harness:a,state:A,status:t=_v(),logger:s=console,replyTimeoutMs:g=6e5,maxMessageChars:c=1800,signal:I}){if(!r||typeof r.sendText!="function")throw new TypeError("Weixin API is required");if(!o||!i||!e)throw new TypeError("Weixin account credentials are required");if(!a||!A)throw new TypeError("Harness client and state store are required");this.#e=r,this.#A=o,this.#t=i,this.#r=e,this.#o=a,this.#i=A,this.#I=t,this.#s=s,this.#l=g,this.#a=c,this.#n=I,this.#C=new Va({label:"weixin",logger:s})}get status(){return structuredClone(this.#I)}accept(r){if(this.#n?.aborted||r?.message_type===2)return Promise.resolve();let o=Dv(r),i=Ta(r?.from_user_id);if(!o||!i||this.#i.hasSeen(o)||this.#h.has(o))return Promise.resolve();this.#h.add(o),i===this.#r&&xi(this.#i,{toUserId:i});let e=yRe(i),a=Ta(r?.context_token)??void 0,A=Ta(r?.run_id)??void 0,t=this.#c.get(e),s=Ta(Gp(r))??"",g=Rm(r)?null:fi(s)?zi:Qi(s)?Wi:yi(s)?Zi:null;if(g&&i===this.#r){let I;return I=this.#B(r,o,e,i,a,A,s,g).catch(d=>{if(!(d?.code==="turn-stopped"||this.#n?.aborted))return this.#I.lastError=d?.message??String(d),this.#I.lastMessageError=Mv(d),this.#s.error?.("[dsh-weixin] failed to process a command:",d),this.#b(i,Tm(),a,A).catch(()=>{})}).finally(()=>{this.#h.delete(o),this.#d.delete(I)}),this.#d.add(I),I}let c=this.#C.claimReply({key:e,actor:i,messageId:o,text:Nm(r)||Rm(r)?"":Gp(r),addressed:!0,hasPendingQuestion:!!t,questionCompletion:t?.submitting||t?.claimedReplyMessageId?t.queue:null,isQuestionPending:()=>this.#c.has(e),send:I=>this.#b(i,I,a,A)});if(c){let I;return I=c.process(async()=>this.#i.hasSeen(o)?!1:(await this.#i.markSeen(o),this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#h.delete(o),this.#E.delete(I)}),this.#E.add(I),I}if(t?.submitting||t?.claimedReplyMessageId)return this.#u(r,o,e);if(t){mRe(r,t)&&(t.claimedReplyMessageId=o);let d=(t.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#m(r,o,e,t)).catch(B=>this.#O(r,o,B)).finally(()=>{this.#h.delete(o),t.claimedReplyMessageId===o&&(t.claimedReplyMessageId=null),t.queue===d&&(t.queue=null)});return t.queue=d,d}return this.#u(r,o,e)}#u(r,o,i,{releaseMessageId:e=!0,alreadyRecorded:a=!1}={}){let A=r.from_user_id===this.#r?hl(EW(r,this.#e),{signal:this.#n}):void 0,s=(this.#g.get(i)??Promise.resolve()).catch(()=>{}).then(()=>this.#Q(r,i,{alreadyRecorded:a,preparedMessage:A})).finally(()=>{e&&this.#h.delete(o),this.#g.get(i)===s&&this.#g.delete(i)});return this.#g.set(i,s),s}async waitForIdle(){await Promise.allSettled([...this.#g.values(),...[...this.#c.values()].flatMap(r=>r.queue?[r.queue]:[]),...this.#E,...this.#d])}async#B(r,o,i,e,a,A,t,s){if(this.#n?.throwIfAborted(),this.#i.hasSeen(o))return;await this.#i.markSeen(o),this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString();let g=await s(t,this.#o,this.#i,i,{signal:this.#n,hasImages:Nm(r),hasFiles:Rm(r),pendingInteraction:this.#c.has(i)||this.#C.hasPending(i),control:{owner:this,key:i}});g?.stopped&&await Promise.allSettled([this.#R(i),this.#C.closeRoute(i)]);for(let c of g?.messages??[g?.message])c&&await this.#b(e,c,a,A);this.#I.lastError=null,this.#I.lastMessageError=null}async#Q(r,o,{alreadyRecorded:i=!1,preparedMessage:e}={}){this.#n?.throwIfAborted();let a=Dv(r),A=Ta(r?.from_user_id);if(!a||!A)return;if(!i){if(this.#i.hasSeen(a))return;this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString()}if(A!==this.#r){this.#I.messagesRejected+=1,this.#I.lastRejectedAt=new Date().toISOString();return}let t=typeof r.context_token=="string"?r.context_token:void 0,s=typeof r.run_id=="string"?r.run_id:void 0;try{let g=e??EW(r,this.#e),c=g.content,I=Er(g),d=Xt(g);if(!c&&!I&&!d){await this.#b(A,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002"),t,s),await this.#i.markSeen(a);return}let B=c.trim().toLowerCase();if(!I&&!d&&B==="/help"){await this.#b(A,QRe(),t,s),await this.#i.markSeen(a);return}if(!I&&!d&&B==="/status"){await this.#o.ensureRunning({signal:this.#n}),await this.#b(A,w("\u5FAE\u4FE1\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"),t,s),await this.#i.markSeen(a);return}if(!I&&!d&&B==="/new"){await this.#i.clearSession(o),await this.#b(A,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"),t,s),await this.#i.markSeen(a);return}let f=I||d?null:await Vi(c,this.#o,o);if(f){for(let x of f.messages??[f.message])await this.#b(A,x,t,s);await this.#i.markSeen(a);return}let Q=I||d?null:await qi(c,this.#o,this.#i,o,{signal:this.#n});if(Q){await this.#b(A,Q.message,t,s),await this.#i.markSeen(a);return}let y=I?await ji(g,{signal:this.#n}):void 0,m,T=[];try{({answer:m,artifacts:T=[]}=await Za({harness:this.#o,state:this.#i,key:o,...I?{content:y}:{text:c},createOptions:{signal:this.#n},existsOptions:{signal:this.#n},askOptions:{timeoutMs:this.#l,signal:this.#n,control:{owner:this,key:o},onInteraction:x=>this.#f(x,{key:o,actor:A,contextToken:t,runId:s}),onInteractionResolved:x=>this.#y(x),files:g.files}}))}finally{await Promise.allSettled([this.#R(o),this.#C.closeRoute(o)])}let N=typeof m=="string"&&m.trim()?m:T.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):m,F=null,J=null;try{J=Ht({deliveryId:a,presentation:"weixin-text",providerMessageIds:await this.#b(A,N,t,s)})}catch(x){F=x}let j=await this.#N(A,a,T,t,s,J);if(F&&!j.userVisible)throw F;return await this.#i.markSeen(a),this.#I.messagesReplied+=1,this.#I.lastReplyAt=new Date().toISOString(),this.#I.lastError=null,this.#I.lastMessageError=null,j.receipt}catch(g){if(g?.code==="turn-stopped"){await this.#i.markSeen(a);return}if(this.#n?.aborted)return;this.#I.lastError=g?.message??String(g);let c=$i(g)??Ji(g)??Tm();this.#I.lastMessageError=Mv(g,c),this.#s.error?.("[dsh-weixin] failed to process an inbound message:",g);try{await this.#b(A,c,t,s),await this.#i.markSeen(a)}catch(I){this.#s.error?.("[dsh-weixin] failed to send the safe error reply:",I)}}}async#m(r,o,i,e){this.#n?.throwIfAborted();let a=this.#c.get(i),A=e.claimedReplyMessageId===o;if(!a||a!==e||a.submitting)return A&&(!a||a!==e)?this.#w(r,o):this.#u(r,o,i,{releaseMessageId:!1});if(this.#i.hasSeen(o))return;await this.#i.markSeen(o),this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString();let t=Ta(Gp(r)),s=Ta(r?.context_token)??void 0,g=Ta(r?.run_id)??void 0;if(!t||Nm(r)){await this.#b(e.actor,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"),s,g);return}let c=this.#c.get(i);if(!c||c!==e||c.submitting){if(A&&(!c||c!==e)){await this.#b(e.actor,_m(),s,g);return}return this.#u(r,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}if(c.contextToken=s,c.runId=g,c.needsPresentation){try{await this.#D(c)}catch{this.#I.lastError=w("\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to retry an interaction question"),c.interaction.reconnect?.();return}let d=this.#c.get(i);if(!d||d!==e||d.submitting){if(A&&(!d||d!==e)){await this.#b(e.actor,_m(),s,g).catch(()=>{});return}return this.#u(r,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}}let I=c.questions[c.index];if(I){if(c.answers.push(za(I,t)),c.index+=1,c.index{});return}if(this.#c.get(i)!==c)return;c.submitting=!1,c.answers.pop(),c.index-=1,this.#I.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to answer a Harness interaction"),await this.#b(c.actor,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002"),c.contextToken,c.runId).catch(()=>{})}}}async#f(r,{key:o,actor:i,contextToken:e,runId:a}){if(r?.kind==="approval")return this.#C.handleRequested(r,{key:o,actor:i,send:c=>this.#b(i,c,e,a)});if(r?.kind!=="question")return;let A=r?.payload?.questions,t=typeof r?.interactionId=="string"?r.interactionId:r?.rpcId;if(typeof r?.rpcId!="string"||typeof t!="string"||typeof r.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!Ja(c))){this.#s.warn?.("[dsh-weixin] ignored an invalid Harness question interaction");return}if(r.recovered===!0){await r.respond({ok:!1,error:{code:"cancelled",message:"Weixin safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#b(i,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"),e,a).catch(()=>{});return}let s=this.#c.get(o);if(s?.interactionId===t){s.interaction=r,s.needsPresentation&&await this.#D(s);return}if(this.#p.has(t))return;if(s){await r.respond({ok:!1,error:{code:"cancelled",message:"Weixin is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:t,sessionId:r.sessionId,interaction:r,actor:i,questions:A,answers:[],index:0,contextToken:e,runId:a,queue:null,claimedReplyMessageId:null,presentationPromise:null,submitting:!1,needsPresentation:!0};this.#c.set(o,g),this.#p.set(t,o),await this.#D(g)}async#y(r){if(r?.kind==="approval"){await this.#C.handleResolved(r);return}let o=r?.interactionId;if(r?.kind!=="question"||typeof o!="string")return;let i=this.#p.get(o);i&&this.#M(i,o)}#D(r){if(!r.needsPresentation)return Promise.resolve();if(r.presentationPromise)return r.presentationPromise;let o=r.questions[r.index];if(!o)return Promise.resolve();let i=this.#b(r.actor,qa(o,r.index,r.questions.length),r.contextToken,r.runId).then(()=>{r.needsPresentation=!1}).finally(()=>{r.presentationPromise===i&&(r.presentationPromise=null)});return r.presentationPromise=i,i}async#w(r,o){this.#i.hasSeen(o)||(await this.#i.markSeen(o),this.#I.messagesReceived+=1,this.#I.lastMessageAt=new Date().toISOString(),await this.#b(Ta(r?.from_user_id),_m(),Ta(r?.context_token)??void 0,Ta(r?.run_id)??void 0).catch(()=>{}))}#_(r,o){let i=this.#c.get(r);return!i||o!==void 0&&i.interactionId!==o?null:(this.#c.delete(r),this.#p.delete(i.interactionId),i)}#M(r,o){return this.#_(r,o)!==null}async#R(r){let o=this.#_(r);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Weixin interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(i){i?.code!=="interaction-not-pending"&&this.#s.warn?.("[dsh-weixin] failed to cancel a pending Harness interaction")}}async#O(r,o,i){this.#n?.aborted||(this.#I.lastError=i?.message??String(i),this.#I.lastMessageError=Mv(i),this.#s.error?.("[dsh-weixin] failed to process an interaction reply:",i),this.#i.hasSeen(o)||await this.#i.markSeen(o).catch(()=>{}),await this.#b(Ta(r?.from_user_id),Tm(),Ta(r?.context_token)??void 0,Ta(r?.run_id)??void 0).catch(()=>{}))}async#b(r,o,i,e){let a=[];for(let A of nW(o,this.#a)){let t=await this.#e.sendText({baseUrl:this.#A,token:this.#t,toUserId:r,text:A,contextToken:i,runId:e,signal:this.#n});a.push(...Xa(t))}return a}async#N(r,o,i,e,a,A){let t=(g,c)=>this.#e[g]({baseUrl:this.#A,token:this.#t,toUserId:r,file:c,contextToken:e,runId:a,signal:this.#n}),s=await eo({artifacts:i,baseReceipt:A,deliveryId:o,aggregatePresentation:A?"weixin-text-and-files":"weixin-files",channelKey:"weixin",signal:this.#n,sendImage:typeof this.#e.sendImage=="function"?g=>t("sendImage",g):void 0,sendFile:typeof this.#e.sendFile=="function"?g=>t("sendFile",g):void 0,sendFailureNotice:(g,c)=>this.#b(r,SRe(g?.fileName,c),e,a),logger:this.#s});return this.#I.artifactsSent=(this.#I.artifactsSent??0)+s.artifactsSent,this.#I.artifactSendErrors=(this.#I.artifactSendErrors??0)+s.artifactSendErrors,{receipt:s.receipt,userVisible:s.userVisible}}};var DRe=Object.freeze([250,1e3,3e3]),wRe=new Set(["harness-connect-failed","harness-timeout","harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden","harness-api-not-found","harness-http-failed","harness-response-invalid","harness-rpc-rejected"]);function ORe(n){if(n===void 0)return[...DRe];if(!Array.isArray(n))throw new TypeError("startRetryDelaysMs must be an array");return n.map(r=>{if(!Number.isFinite(r)||r<0)throw new TypeError("startRetryDelaysMs must contain non-negative delays");return r})}function bRe(n){return n instanceof kA?n.code==="network-error"||n.code==="timeout"?!0:n.code==="http-error"&&(n.status===408||n.status===425||n.status===429||n.status>=500):!1}function MRe(n,r){let o=new Error(`Weixin runtime failed during ${n}`,{cause:r});return o.name="WeixinRuntimeStartError",o.code=n,o}function _Re(n){let r=wRe.has(n?.code)?n.code:"harness-check-unknown-failed";return MRe(r,n)}function hW(n,r){return new Promise((o,i)=>{if(r?.aborted){i(r.reason??new DOMException("Aborted","AbortError"));return}let a=setTimeout(()=>{r?.removeEventListener("abort",A),o()},n),A=()=>{clearTimeout(a),r?.removeEventListener("abort",A),i(r.reason??new DOMException("Aborted","AbortError"))};r?.addEventListener("abort",A,{once:!0})})}function TRe(){return{startedAt:null,ready:!1,weixinConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastError:null,..._v()}}var RC=class{#e;#A;#t;#r;#o;#i;#I;#s;#l;#a=TRe();#n=null;#g=null;#c=null;#p=null;constructor({api:r,config:o,token:i,harness:e,state:a,logger:A=console,replyTimeoutMs:t=6e5,maxMessageChars:s=4e3,startRetryDelaysMs:g}){if(!r||!o||!i||!e||!a)throw new TypeError("WeixinRuntime requires API, account, token, Harness, and state");this.#e=r,this.#A=o,this.#t=i,this.#r=e,this.#o=a,this.#i=A,this.#I=t,this.#s=s,this.#l=ORe(g)}get status(){return structuredClone(this.#a)}async start(){return this.#a.ready&&this.#c?this.status:this.#p?this.#p:(this.#p=this.#h().finally(()=>{this.#p=null}),this.#p)}async#h(){await this.stop(),this.#a.startedAt=new Date().toISOString(),this.#a.weixinConnectionState="connecting",this.#a.lastError=null;try{try{await this.#r.ensureRunning()}catch(o){throw _Re(o)}this.#a.harnessReachable=!0,await this.#E(),this.#g=new AbortController;let r=this.#g.signal;return this.#n=new km({api:this.#e,baseUrl:this.#A.baseUrl,token:this.#t,ownerUserId:this.#A.ownerUserId,harness:this.#r,state:this.#o,status:this.#a,logger:this.#i,replyTimeoutMs:this.#I,maxMessageChars:this.#s,signal:r}),this.#a.ready=!0,this.#a.weixinConnectionState="connected",this.#a.lastCheckedAt=Date.now(),this.#c=this.#d(r).catch(o=>{r.aborted||(this.#a.ready=!1,this.#a.weixinConnectionState="failed",this.#a.lastError=o?.message??String(o),this.#i.error?.(`[dsh-weixin] account ${this.#A.botId} monitor stopped:`,o))}),this.status}catch(r){throw this.#g?.abort(),this.#g=null,this.#n=null,this.#a.ready=!1,this.#a.weixinConnectionState="failed",this.#a.lastError=r?.message??String(r),r}}async#E(){for(let r=0;;r+=1)try{return await this.#e.notifyStart({baseUrl:this.#A.baseUrl,token:this.#t})}catch(o){let i=this.#l[r];if(i===void 0||!bRe(o))throw o;this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} start request failed; retrying in ${i}ms:`,o),await hW(i)}}async#d(r){let o=0;for(;!r.aborted;)try{let i=await this.#e.getUpdates({baseUrl:this.#A.baseUrl,token:this.#t,getUpdatesBuf:this.#o.getUpdatesBuf(),signal:r});if(r.aborted)return;if(i?.ret!==void 0&&i.ret!==0||i?.errcode!==void 0&&i.errcode!==0){let a=i.errcode??i.ret;throw new kA(a===-14?"stale-token":"updates-rejected",a===-14?w("\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002"))}o=0,this.#a.ready=!0,this.#a.weixinConnectionState="connected",this.#a.lastCheckedAt=Date.now(),this.#a.lastError=null;for(let a of i?.msgs??[])this.#n.accept(a).catch(A=>{r.aborted||this.#i.error?.(`[dsh-weixin] account ${this.#A.botId} message handling failed:`,A)});typeof i?.get_updates_buf=="string"&&i.get_updates_buf&&await this.#o.setGetUpdatesBuf(i.get_updates_buf)}catch(i){if(r.aborted)return;if(o+=1,this.#a.lastError=i?.message??String(i),this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} poll failed (${o}/3):`,i),i instanceof kA&&i.code==="stale-token"||o>=3)throw i;await hW(Math.min(2e3*2**(o-1),1e4),r)}}async stop(){let r=this.#c,o=this.#n,i=!!(this.#g||r||this.#a.ready);if(this.#g?.abort(),this.#g=null,this.#c=null,await r?.catch(()=>{}),await o?.waitForIdle(),this.#n=null,i)try{await this.#e.notifyStop({baseUrl:this.#A.baseUrl,token:this.#t,signal:AbortSignal.timeout(1e4)})}catch(e){this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} stop notification failed:`,e)}return this.#a.ready=!1,this.#a.weixinConnectionState="idle",this.status}async sendConnectionTest(r){let o=hE(this.#o),i=typeof o?.toUserId=="string"&&o.toUserId.trim()?o.toUserId.trim():typeof this.#A.ownerUserId=="string"&&this.#A.ownerUserId.trim()?this.#A.ownerUserId.trim():null;if(!i)throw or(w("\u5FAE\u4FE1\u673A\u5668\u4EBA"));if(!this.#a.ready||!this.#g)throw new Error("Weixin runtime is not connected");return await this.#e.sendText({baseUrl:this.#A.baseUrl,token:this.#t,toUserId:i,text:r,signal:this.#g.signal}),{sent:!0}}};var CW=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function NRe(n){if(!Array.isArray(n)||n.length===0)return[...CW];let r=n.filter(o=>Number.isFinite(o)&&o>=0);return r.length>0?r:[...CW]}var vm=class{#e;#A;#t;#r;#o;#i;#I;#s=null;#l=null;#a=0;#n=!1;#g=!1;#c;#p;constructor({controller:r,harness:o,logger:i=console,retryDelaysMs:e,healthyIntervalMs:a=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:t=clearTimeout}){if(!r||typeof r.initialize!="function"||typeof r.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=r,this.#A=o,this.#t=i,this.#r=NRe(e),this.#o=Number.isFinite(a)&&a>=0?a:15e3,this.#i=A,this.#I=t,this.#c=new Promise(s=>{this.#p=s})}get ready(){return this.#c}start(){return this.#g||this.#n?this:(this.#g=!0,this.#h(0),this)}async close(){this.#n||(this.#n=!0,this.#s!==null&&this.#I(this.#s),this.#s=null,await this.#l?.catch(()=>{}),this.#p?.(null),this.#p=null)}#h(r){this.#n||(this.#s=this.#i(()=>{this.#s=null,this.#E()},r),this.#s?.unref?.())}async#E(){if(this.#n||this.#l)return;let r=this.#d();this.#l=r;try{await r}finally{this.#l===r&&(this.#l=null)}}async#d(){try{if(await this.#A.ensureRunning(),this.#n)return;let r=await this.#e.initialize();if(this.#n)return;this.#p?.(r),this.#p=null;let{configured:o,connected:i}=r.totals;if(i65535)throw new Error("dsh-weixin requires an initialized DSH webServer port");return new URL(`http://127.0.0.1:${o}`)}function PRe(n){let r=fI(n.dshHome??process.env.DSH_HOME??kC(kRe(),".dsh")),o=fI(n.dataDir??kC(r,"integrations","dsh-weixin"));return{root:o,config:fI(n.configPath??kC(o,"config.json")),accounts:fI(n.accountsDir??kC(o,"accounts")),workspaces:fI(n.workspacesPath??kC(o,"workspaces.json"))}}async function Nv(n,r={},o={}){if(!n?.credentials)throw new TypeError("dsh-weixin requires ctx.credentials");if(!n?.webServer)throw new TypeError("dsh-weixin requires ctx.webServer");let i=o.ConfigStore??Dm,e=o.StateStore??bm,a=o.HarnessClient??wm,A=o.Controller??NC,t=o.Runtime??RC,s=o.api??oW(),g=o.createConnectionSupervisor??Tv,c=typeof n.logger=="function"?n.logger("dsh-weixin"):n.logger??console,I=()=>Ca(n),d=PRe(r),B=await new i(d.config).load(),f=fI(r.workspace??process.cwd()),Q=o.WorkspaceStore??xr,y=o.workspaces??await new Q(d.workspaces,{defaultWorkspace:f}).load(),m=B.list();await y.reconcile(m.map(_=>_.botId)),await Promise.all(m.map(_=>y.ensure(_.botId,{defaultAgentPreset:r.agentPreset})));let T=typeof B.remove=="function"?ua(B,{workspaces:y}):B,N=new Map,F=_=>fI(d.accounts,_,"state.json"),J=async _=>{let P=N.get(_);return P||(P=await new e(F(_)).load(),N.set(_,P)),P},j=Qa(n,o.commandExecutor),{controlExecutor:x,sessionMaintenanceExecutor:q,fileIngressExecutor:Y}=ya(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),L=new a({baseUrl:vRe(n.webServer,r.harnessBaseUrl),workspace:f,autostart:!1,dshBin:r.dshBin??"dsh",...j?{commandExecutor:j}:{},...x?{controlExecutor:x}:{},...q?{sessionMaintenanceExecutor:q}:{},...Y?{fileIngressExecutor:Y}:{}}),v=new A({api:s,credentials:n.credentials,configStore:T,logger:c,createRuntime:async({botId:_,config:P,token:Z})=>{let ge=await J(_);await y.ensure(_,{defaultAgentPreset:r.agentPreset});let ye=Ba(L,{botId:_,workspaces:y,state:ge,agentPresetCatalog:I});return new t({api:s,config:P,token:Z,harness:ye.harness,state:ye.state,replyTimeoutMs:r.replyTimeoutMs??6e5,maxMessageChars:r.maxMessageChars??4e3,logger:{error:(...Me)=>c.error?.(`[${_}]`,...Me),warn:(...Me)=>c.warn?.(`[${_}]`,...Me),info:(...Me)=>c.info?.(`[${_}]`,...Me),debug:(...Me)=>c.debug?.(`[${_}]`,...Me)}})},deleteState:async({botId:_})=>{let P=N.get(_);if(N.delete(_),P&&typeof P.remove=="function")await P.remove();else try{await RRe(F(_))}catch(Z){if(Z?.code!=="ENOENT")throw Z}}}),V=fa(v,{workspaces:y,stateFor:J,agentPresetCatalog:I}),K=g({controller:V,harness:L,logger:c,retryDelaysMs:r.retryDelaysMs,healthyIntervalMs:r.healthyIntervalMs}).start();return{controller:V,ready:K.ready,async close(){await K.close(),await V.close(),L.stopManagedProcess()}}}import GRe from"qrcode";var uW="/weixin",_r=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",submitVerification:"provision.verify",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:ei,setAgentPreset:Ai}),BW=Object.freeze(Object.values(_r));function fW(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Lp(n,r){return fW(n)&&Object.keys(n).every(o=>r.includes(o))}function Pm(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function FRe(n,r){return fW(r)?n===_r.status?Lp(r,[])?null:"connection.status does not accept fields.":n===_r.beginProvisioning?Lp(r,["locale"])&&(r.locale===void 0||r.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[_r.pollProvisioning,_r.cancelProvisioning].includes(n)?Lp(r,["attemptId"])&&Pm(r.attemptId)?null:`${n} requires an attemptId.`:n===_r.submitVerification?Lp(r,["attemptId","verifyCode"])&&Pm(r.attemptId)&&typeof r.verifyCode=="string"&&/^\d{4,8}$/.test(r.verifyCode)?null:"provision.verify requires an attemptId and a 4-to-8-digit code.":n===_r.reconnectBot?Lp(r,["botId","sendTest"])&&Pm(r.botId)&&(r.sendTest===void 0||r.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===_r.deleteBot?Lp(r,["botId","confirm"])&&Pm(r.botId)&&r.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===_r.setWorkspace?ma(r)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===_r.setAgentPreset?Da(r)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":"Unknown Weixin endpoint.":"Payload must be an object."}function Gm(n){return{ok:!1,error:{code:"bad-request",message:n}}}function vC(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function LRe(){return{ok:!1,error:{code:"weixin-operation-failed",message:"\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}async function URe(n){return GRe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function Fm(n,r){return!n||!n.verificationUrl?n:{...n,qrCodeDataUrl:await r(n.verificationUrl)}}async function PC(n,r){let o=structuredClone(n);return o.provisioning&&(o.provisioning=await Fm(o.provisioning,r)),o}function HRe(n){if(!n||typeof n.status!="function"||typeof n.startProvisioning!="function"||typeof n.registrationStatus!="function"||typeof n.submitVerification!="function"||typeof n.cancelProvisioning!="function"||typeof n.reconnectBot!="function"||typeof n.deleteBot!="function")throw new TypeError("A complete Weixin controller is required")}function QW(n,{encodeQr:r=URe}={}){HRe(n);let o=new Map,i=e=>{let a=o.get(e);return a||(o.size>=16&&o.delete(o.keys().next().value),a=Promise.resolve().then(()=>r(e)),o.set(e,a)),a};return async(e,a,A)=>{if(A?.aborted)return vC();if(!BW.includes(e))return Gm("Unknown Weixin endpoint.");let t=FRe(e,a);if(t)return Gm(t);try{let s;if(e===_r.status)s=await PC(await n.status(),i);else if(e===_r.beginProvisioning){let g=await n.startProvisioning();if(A?.aborted)return await n.cancelProvisioning(g.attemptId),vC();s=await Fm(g,i)}else if(e===_r.pollProvisioning){let g=await n.registrationStatus(a.attemptId);if(!g)return Gm("The provisioning attempt no longer exists.");s=await Fm(g,i)}else if(e===_r.submitVerification)s=await Fm(await n.submitVerification(a.attemptId,a.verifyCode),i);else if(e===_r.cancelProvisioning){if(s=await n.cancelProvisioning(a.attemptId),!s)return Gm("The provisioning attempt no longer exists.")}else if(e===_r.reconnectBot){let g=await n.reconnectBot(a.botId);if(A?.aborted)return vC();let c;if(a.sendTest===!0)if(!g?.bots?.some(d=>d?.botId===a.botId&&d?.connected===!0)||typeof n.sendConnectionTest!="function")c=Zt(or("\u5FAE\u4FE1\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(a.botId),c=Zt()}catch(d){c=Zt(d)}s=await PC({...g,...c?{testMessage:c}:{}},i)}else if(e===_r.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await PC(await n.updateWorkspace(a.botId,a.workspace),i)}else if(e===_r.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await PC(await n.updateAgentPreset(a.botId,a.agentPreset),i)}else s=await PC(await n.deleteBot(a.botId),i);return A?.aborted?vC():{ok:!0,value:s}}catch(s){let g=Sa(s);return A?.aborted?vC():g?{ok:!1,error:g}:LRe()}}}function Lm(n,r,o,i){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(uW,QW(r,o),{authority:ur(i)})}async function yW(n,r={}){if(r?.controller)return Lm(n,r.controller,r.rpcOptions,r.rpcAuthority);let o=await Nv(n,r,r.internals),i=Lm(n,o.controller,r.rpcOptions,r.rpcAuthority);return n.effect(()=>async()=>{await o.close()},"dsh-weixin: close account connections"),i}import{rm as J4e,unlink as q4e}from"node:fs/promises";import{homedir as z4e}from"node:os";import{join as lE,resolve as sg}from"node:path";import{createHash as KRe}from"node:crypto";import{mkdir as xRe,readFile as YRe,rename as jRe,unlink as JRe,writeFile as qRe}from"node:fs/promises";import{dirname as zRe}from"node:path";var Rv=Object.freeze({version:2,bots:Object.freeze([])}),mW=/^whatsapp_[a-f0-9]{24}$/,VRe=/^[a-f0-9-]{36}$/,WRe=/^[1-9]\d{4,14}$/,Hp=Object.freeze({selfOnly:"self-only",privateAllowlist:"private-allowlist",open:"open"});function Up(n){return typeof n=="string"&&n.trim()?n.trim():null}function Um(n){let r=Up(n)?.toLowerCase();return/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(r??"")?r:null}function kv(n){let r=Um(n);if(!r)throw new TypeError("A valid WhatsApp account JID is required");return`whatsapp_${KRe("sha256").update(r).digest("hex").slice(0,24)}`}function vv(n){let r=Um(n)?.split("@")[0]??"";return r?r.length<=7?`${r.slice(0,2)}\u2022\u2022\u2022${r.slice(-2)}`:`${r.slice(0,4)}\u2022\u2022\u2022\u2022${r.slice(-4)}`:w("WhatsApp\u8D26\u53F7")}function ZRe(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedNumbers must be an array of WhatsApp phone numbers");let r=n.map(o=>{let i=typeof o=="string"?o.trim().replace(/^\+/,""):"";if(!WRe.test(i))throw new TypeError("allowedNumbers contains an invalid WhatsApp phone number");return i});return Object.freeze([...new Set(r)])}function Ps(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("WhatsApp access policy must be an object");let r=n.accessMode??Hp.selfOnly;if(!Object.values(Hp).includes(r))throw new TypeError("WhatsApp accessMode is invalid");return Object.freeze({accessMode:r,allowedNumbers:ZRe(n.allowedNumbers)})}var Hm=class{#e;#A=Rv;#t=Promise.resolve();constructor(r){this.#e=r}async load(){try{let r=this.#o(JSON.parse(await YRe(this.#e,"utf8")));if(!r)throw new Error("dsh-im WhatsApp config contains invalid account data");this.#A=r}catch(r){if(r?.code!=="ENOENT")throw r;this.#A=Rv}return this}list(){return structuredClone(this.#A.bots)}get(r){let o=this.#A.bots.find(i=>i.botId===r);return o?structuredClone(o):null}getByAccountJid(r){let o=Um(r),i=this.#A.bots.find(e=>e.accountJid===o);return i?structuredClone(i):null}async save(r){let o=this.#r(r);if(!o)throw new Error("Refusing to persist incomplete WhatsApp account data");return this.#i(i=>{let e=i.find(t=>t.accountJid===o.accountJid&&t.botId!==o.botId),a=i.find(t=>t.authDirectory===o.authDirectory&&t.botId!==o.botId);if(e||a)throw new Error("Duplicate WhatsApp account identity");let A=i.findIndex(t=>t.botId===o.botId);return A===-1?i.push(o):i[A]=o,structuredClone(o)})}async remove(r){if(!mW.test(r))throw new TypeError("Invalid WhatsApp bot id");return this.#i(o=>{let i=o.findIndex(a=>a.botId===r);if(i===-1)return null;let[e]=o.splice(i,1);return structuredClone(e)})}async clear(){let r=this.#t.then(async()=>{try{await JRe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=Rv});this.#t=r.then(()=>{},()=>{}),await r}#r(r){if(!r||typeof r!="object")return null;let o=Um(r.accountJid),i=Up(r.botId),e=Up(r.authDirectory),a=Up(r.name);if(!o||!i||!e||!a||!mW.test(i)||!VRe.test(e)||kv(o)!==i)return null;let A;try{A=Ps(r)}catch{return null}return Object.freeze({botId:i,accountJid:o,authDirectory:e,name:a,createdAt:Up(r.createdAt)??new Date().toISOString(),connectedAt:Up(r.connectedAt),...A})}#o(r){if(!r||r.version!==2||!Array.isArray(r.bots))return null;let o=r.bots.map(A=>this.#r(A));if(o.some(A=>A===null))return null;let i=new Set,e=new Set,a=new Set;for(let A of o){if(i.has(A.botId)||e.has(A.accountJid)||a.has(A.authDirectory))return null;i.add(A.botId),e.add(A.accountJid),a.add(A.authDirectory)}return Object.freeze({version:2,bots:Object.freeze(o)})}async#i(r){let o,i=this.#t.then(async()=>{let e=[...this.#A.bots];o=r(e);let a=Object.freeze({version:2,bots:Object.freeze(e)});await this.#I(a),this.#A=a});return this.#t=i.then(()=>{},()=>{}),await i,o}async#I(r){await xRe(zRe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await qRe(o,`${JSON.stringify(r,null,2)} `,{encoding:"utf8",mode:384}),await jRe(o,this.#e)}};var Km=class extends nr{constructor(r){super({...r,rpcIdPrefix:"whatsapp",logPrefix:"dsh-whatsapp"})}};var xm=class extends Bn{};import{randomUUID as XRe}from"node:crypto";var SW=new Set(["starting","pending","connecting"]),Ym=new Set(["connected","failed","cancelled"]),$Re=6e4;function Ug(n,r){return Object.freeze({code:n,message:r})}function jm(n){return n?{attemptId:n.id,status:n.state,qrRevision:n.qrRevision,pollIntervalMs:1e3,...n.qrValue?{qrValue:n.qrValue}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var GC=class{#e;#A;#t;#r;#o;#i;#I;#s=new Map;#l=new Map;#a=new Map;#n=new Map;#g=null;#c=0;#p=!1;constructor({configStore:r,authPath:o,createSession:i,createRuntime:e,deleteAuth:a=async()=>{},deleteState:A=async()=>{},logger:t=console}){if(!r||typeof r.list!="function"||typeof r.save!="function"||typeof r.remove!="function")throw new TypeError("WhatsappController requires a config store");if(typeof o!="function"||typeof i!="function"||typeof e!="function")throw new TypeError("WhatsappController dependencies are incomplete");this.#e=r,this.#A=o,this.#t=i,this.#r=e,this.#o=a,this.#i=A,this.#I=t}async initialize(){if(this.#p)return this.status();for(let r of this.#e.list())await this.#u(r.botId,async()=>{if(!(this.#p||this.#s.get(r.botId)?.status?.ready))try{await this.#d(r),this.#l.delete(r.botId)}catch(o){this.#l.set(r.botId,Ug(o?.code==="relink-required"?"relink-required":"connection-failed",o?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#I.warn?.(`[dsh-im:whatsapp] bot ${r.botId} failed to initialize`)}finally{this.#B()}});return this.status()}async startProvisioning(){if(this.#p)throw new Error("WhatsApp controller is closed");this.#g&&await this.cancelProvisioning(this.#g);let r,o,i=!1,e=new Promise((t,s)=>{r=()=>{i||(i=!0,t())},o=g=>{i||(i=!0,s(g))}}),a=XRe(),A={id:a,state:"starting",authDirectory:a,createdAt:Date.now(),expiresAt:null,qrRevision:0,qrValue:null,controller:new AbortController,session:null,task:null,error:null,botId:null};this.#a.set(a,A),this.#g=a,this.#B();try{let t=await this.#t({authDir:this.#A(A.authDirectory),signal:A.controller.signal,logger:this.#I,onQr:s=>{A.controller.signal.aborted||Ym.has(A.state)||typeof s!="string"||!s||(A.qrValue=s,A.qrRevision+=1,A.expiresAt=Date.now()+$Re,A.state="pending",this.#B(),r())}});return A.session=t,A.task=t.ready.then(s=>this.#h(A,s)).catch(s=>this.#E(A,s,o)),await e,jm(A)}catch(t){throw await this.#E(A,t,o),t}}registrationStatus(r){return jm(this.#a.get(r))}async cancelProvisioning(r){let o=this.#a.get(r);return o?(Ym.has(o.state)||(o.controller.abort(),await o.session?.close().catch(()=>{}),await o.task?.catch(()=>{}),Ym.has(o.state)||(o.state="cancelled",o.error=Ug("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),await this.#o(o.authDirectory).catch(()=>{})),this.#g===o.id&&(this.#g=null),this.#B(),jm(o)):null}async reconnectBot(r){let o=this.#e.get(r);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#u(r,async()=>{try{await this.#d(o),this.#l.delete(r)}catch(i){throw this.#l.set(r,Ug(i?.code==="relink-required"?"relink-required":"connection-failed",i?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),i}finally{this.#B()}}),this.status()}async sendConnectionTest(r){let o=this.#e.get(r);if(!o)throw new Error("Unknown WhatsApp bot");return this.#u(r,async()=>{let i=this.#s.get(r);if(!i?.status?.ready||typeof i.sendConnectionTest!="function"){let e=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return i.sendConnectionTest(pa(`${o.name}\uFF08${vv(o.accountJid)}\uFF09`,w("WhatsApp\u673A\u5668\u4EBA")))})}async setAccessPolicy(r,o){if(this.#p)throw new Error("WhatsApp controller is closed");let i=Ps(o);return await this.#u(r,async()=>{if(this.#p)throw new Error("WhatsApp controller is closed");let e=this.#e.get(r);if(!e)throw new Error("Unknown WhatsApp bot");let a=await this.#e.save({...e,...i});this.#s.get(r)?.setAccessPolicy?.(a),this.#B()}),this.status()}async deleteBot(r){let o=this.#e.get(r);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#u(r,async()=>{await this.#C(r);try{await this.#e.remove(r)}catch(i){throw await this.#d(o).catch(()=>{}),i}await Promise.allSettled([this.#o(o.authDirectory),this.#i({botId:r,config:o})]),this.#l.delete(r),this.#B()}),this.status()}status(){let r=this.#e.list().map(e=>{let a=this.#s.get(e.botId)?.status??null,A=a?.ready===!0&&a.connectionState==="connected"&&a.harnessReachable===!0,t=A?"connected":a?.connectionState==="connecting"?"connecting":this.#l.has(e.botId)||a?.connectionState==="failed"?"error":"offline";return{botId:e.botId,state:t,connected:A,configured:!0,bot:{name:e.name,idMasked:vv(e.accountJid)},health:{status:A?"healthy":t==="error"?"error":"offline",summary:A?w("WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38"):t==="error"?w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA"):w("WhatsApp \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:a?.lastCheckedAt??null,lastConnectedAt:a?.lastConnectedAt??null},stats:{messagesReceived:a?.messagesReceived??0,messagesReplied:a?.messagesReplied??0},accessPolicy:Ps(e),error:structuredClone(this.#l.get(e.botId)??null)}}),o=r.filter(e=>e.connected).length,i=this.#g?this.#a.get(this.#g):null;return{schemaVersion:1,revision:this.#c,state:i&&SW.has(i.state)?"provisioning":r.length===0?"disconnected":o===r.length?"connected":o>0?"degraded":"offline",bots:r,totals:{configured:r.length,connected:o},...i&&SW.has(i.state)?{provisioning:jm(i)}:{}}}async close(){this.#p||(this.#p=!0,this.#g&&await this.cancelProvisioning(this.#g),await Promise.allSettled([...this.#n.values()]),await Promise.allSettled([...this.#s.keys()].map(r=>this.#C(r))))}async#h(r,o){if(r.controller.signal.aborted||this.#p)return;r.state="connecting",r.qrValue=null,r.expiresAt=null,this.#B();let i=kv(o.accountJid);r.botId=i,await r.session?.close();let e=this.#e.get(i),a={botId:i,accountJid:o.accountJid,authDirectory:r.authDirectory,name:o.name,createdAt:e?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString(),accessMode:e?.accessMode,allowedNumbers:e?.allowedNumbers};try{if(r.controller.signal.aborted||this.#p)throw Object.assign(new Error,{name:"AbortError"});if(await this.#e.save(a),r.controller.signal.aborted||this.#p)throw Object.assign(new Error,{name:"AbortError"});try{await this.#d(a),this.#l.delete(i)}catch{this.#l.set(i,Ug("connection-failed",w("WhatsApp \u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#I.warn?.(`[dsh-im:whatsapp] bot ${i} did not reconnect after QR binding`)}e?.authDirectory&&e.authDirectory!==a.authDirectory&&await this.#o(e.authDirectory).catch(()=>{}),r.state="connected",r.error=null}catch(A){r.controller.signal.aborted||this.#p||A?.name==="AbortError"?(await this.#C(i),e?await this.#e.save(e).catch(()=>{}):await this.#e.remove(i).catch(()=>null)&&await this.#i({botId:i,config:a}).catch(s=>{this.#I.warn?.("[dsh-im:whatsapp] cancelled bot state cleanup failed:",s)}),await this.#o(r.authDirectory).catch(()=>{}),e&&await this.#d(e).catch(()=>{}),r.state="cancelled",r.error=Ug("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(await this.#o(r.authDirectory).catch(()=>{}),r.state="failed",r.error=Ug("activation-failed",w("WhatsApp \u5DF2\u626B\u7801\uFF0C\u4F46\u65E0\u6CD5\u4FDD\u5B58\u5173\u8054\u8BBE\u5907\u3002")),this.#I.error?.("[dsh-im:whatsapp] unable to persist linked-device session"))}finally{this.#g===r.id&&(this.#g=null),this.#B()}}async#E(r,o,i=()=>{}){Ym.has(r.state)||(r.controller.signal.aborted||o?.name==="AbortError"?(r.state="cancelled",r.error=Ug("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(r.state="failed",r.error=Ug("qr-connect-failed",w("\u65E0\u6CD5\u8FDE\u63A5 WhatsApp\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"))),this.#g===r.id&&(this.#g=null),await r.session?.close().catch(()=>{}),await this.#o(r.authDirectory).catch(()=>{}),this.#B(),i(o))}async#d(r){if(this.#p)throw new Error("WhatsApp controller is closed");if(await this.#C(r.botId),this.#p)throw new Error("WhatsApp controller is closed");let o=await this.#r({botId:r.botId,config:r,authDir:this.#A(r.authDirectory)});if(!o||typeof o.start!="function"||typeof o.stop!="function")throw new TypeError("createRuntime returned an invalid WhatsApp runtime");this.#s.set(r.botId,o);try{await o.start()}catch(i){throw await o.stop().catch(()=>{}),this.#s.delete(r.botId),i}}async#C(r){let o=this.#s.get(r);this.#s.delete(r),await o?.stop().catch(()=>{})}#u(r,o){let a=(this.#n.get(r)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#n.get(r)===a&&this.#n.delete(r)});return this.#n.set(r,a),a}#B(){this.#c+=1}};import{createHash as M4e}from"node:crypto";var R=ze(LQ(),1),D=R.default.Reader,k=R.default.Writer,l=R.default.util,p=R.default.roots.default||(R.default.roots.default={});function oe(n,r){if(typeof n=="string")return n;if(typeof n=="number")return String(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!r&&n.high<0?(e-(1n<<64n)).toString():e.toString()}return String(n)}function ne(n,r){if(typeof n=="number")return n;if(typeof n=="string")return Number(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!r&&n.high<0?Number(e-(1n<<64n)):Number(e)}return Number(n)}var ae=p.proto=(()=>{let n={};return n.ADVDeviceIdentity=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.keyIndex=e.uint32();break}case 4:{s.accountType=e.int32();break}case 5:{s.deviceType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ADVDeviceIdentity)return e;var a=new p.proto.ADVDeviceIdentity;switch(e.rawId!=null&&(a.rawId=e.rawId>>>0),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.keyIndex!=null&&(a.keyIndex=e.keyIndex>>>0),e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"E2EE":case 0:a.accountType=0;break;case"HOSTED":case 1:a.accountType=1;break}switch(e.deviceType){default:if(typeof e.deviceType=="number"){a.deviceType=e.deviceType;break}break;case"E2EE":case 0:a.deviceType=0;break;case"HOSTED":case 1:a.deviceType=1;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,a.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?oe(e.timestamp,!0):a.longs===Number?ne(e.timestamp,!0):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),e.keyIndex!=null&&e.hasOwnProperty("keyIndex")&&(A.keyIndex=e.keyIndex,a.oneofs&&(A._keyIndex="keyIndex")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=a.enums===String?p.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:p.proto.ADVEncryptionType[e.accountType]:e.accountType,a.oneofs&&(A._accountType="accountType")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=a.enums===String?p.proto.ADVEncryptionType[e.deviceType]===void 0?e.deviceType:p.proto.ADVEncryptionType[e.deviceType]:e.deviceType,a.oneofs&&(A._deviceType="deviceType")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVDeviceIdentity"},r})(),n.ADVEncryptionType=(function(){let r={},o=Object.create(r);return o[r[0]="E2EE"]=0,o[r[1]="HOSTED"]=1,o})(),n.ADVKeyIndexList=(function(){function r(i){if(this.validIndexes=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.currentIndex=e.uint32();break}case 4:{if(s.validIndexes&&s.validIndexes.length||(s.validIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.currentIndex!=null&&(a.currentIndex=e.currentIndex>>>0),e.validIndexes){if(!Array.isArray(e.validIndexes))throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected");a.validIndexes=[];for(var A=0;A>>0}switch(e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"E2EE":case 0:a.accountType=0;break;case"HOSTED":case 1:a.accountType=1;break}return a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.validIndexes=[]),e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,a.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?oe(e.timestamp,!0):a.longs===Number?ne(e.timestamp,!0):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),e.currentIndex!=null&&e.hasOwnProperty("currentIndex")&&(A.currentIndex=e.currentIndex,a.oneofs&&(A._currentIndex="currentIndex")),e.validIndexes&&e.validIndexes.length){A.validIndexes=[];for(var t=0;t>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignatureKey=e.bytes();break}case 3:{s.accountSignature=e.bytes();break}case 4:{s.deviceSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ADVSignedDeviceIdentity)return e;var a=new p.proto.ADVSignedDeviceIdentity;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,a.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(a.accountSignatureKey=e.accountSignatureKey)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,a.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(a.accountSignature=e.accountSignature)),e.deviceSignature!=null&&(typeof e.deviceSignature=="string"?l.base64.decode(e.deviceSignature,a.deviceSignature=l.newBuffer(l.base64.length(e.deviceSignature)),0):e.deviceSignature.length>=0&&(a.deviceSignature=e.deviceSignature)),a},r.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=a.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,a.oneofs&&(A._accountSignatureKey="accountSignatureKey")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=a.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,a.oneofs&&(A._accountSignature="accountSignature")),e.deviceSignature!=null&&e.hasOwnProperty("deviceSignature")&&(A.deviceSignature=a.bytes===String?l.base64.encode(e.deviceSignature,0,e.deviceSignature.length):a.bytes===Array?Array.prototype.slice.call(e.deviceSignature):e.deviceSignature,a.oneofs&&(A._deviceSignature="deviceSignature")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentity"},r})(),n.ADVSignedDeviceIdentityHMAC=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.details=e.bytes();break}case 2:{s.hmac=e.bytes();break}case 3:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ADVSignedDeviceIdentityHMAC)return e;var a=new p.proto.ADVSignedDeviceIdentityHMAC;switch(e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.hmac!=null&&(typeof e.hmac=="string"?l.base64.decode(e.hmac,a.hmac=l.newBuffer(l.base64.length(e.hmac)),0):e.hmac.length>=0&&(a.hmac=e.hmac)),e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"E2EE":case 0:a.accountType=0;break;case"HOSTED":case 1:a.accountType=1;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.hmac!=null&&e.hasOwnProperty("hmac")&&(A.hmac=a.bytes===String?l.base64.encode(e.hmac,0,e.hmac.length):a.bytes===Array?Array.prototype.slice.call(e.hmac):e.hmac,a.oneofs&&(A._hmac="hmac")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=a.enums===String?p.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:p.proto.ADVEncryptionType[e.accountType]:e.accountType,a.oneofs&&(A._accountType="accountType")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentityHMAC"},r})(),n.ADVSignedKeyIndexList=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignature=e.bytes();break}case 3:{s.accountSignatureKey=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ADVSignedKeyIndexList)return e;var a=new p.proto.ADVSignedKeyIndexList;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,a.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(a.accountSignature=e.accountSignature)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,a.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(a.accountSignatureKey=e.accountSignatureKey)),a},r.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=a.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,a.oneofs&&(A._accountSignature="accountSignature")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=a.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):a.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,a.oneofs&&(A._accountSignatureKey="accountSignatureKey")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedKeyIndexList"},r})(),n.AIHomeState=(function(){function r(i){if(this.capabilityOptions=[],this.conversationOptions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lastFetchTime=e.int64();break}case 2:{s.capabilityOptions&&s.capabilityOptions.length||(s.capabilityOptions=[]),s.capabilityOptions.push(p.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}case 3:{s.conversationOptions&&s.conversationOptions.length||(s.conversationOptions=[]),s.conversationOptions.push(p.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIHomeState)return e;var a=new p.proto.AIHomeState;if(e.lastFetchTime!=null&&(l.Long?(a.lastFetchTime=l.Long.fromValue(e.lastFetchTime)).unsigned=!1:typeof e.lastFetchTime=="string"?a.lastFetchTime=parseInt(e.lastFetchTime,10):typeof e.lastFetchTime=="number"?a.lastFetchTime=e.lastFetchTime:typeof e.lastFetchTime=="object"&&(a.lastFetchTime=new l.LongBits(e.lastFetchTime.low>>>0,e.lastFetchTime.high>>>0).toNumber())),e.capabilityOptions){if(!Array.isArray(e.capabilityOptions))throw TypeError(".proto.AIHomeState.capabilityOptions: array expected");a.capabilityOptions=[];for(var A=0;A>>3){case 1:{c.type=A.int32();break}case 2:{c.title=A.string();break}case 3:{c.promptText=A.string();break}case 4:{c.sessionId=A.string();break}case 5:{c.imageWdsIdentifier=A.string();break}case 6:{c.imageTintColor=A.string();break}case 7:{c.imageBackgroundColor=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIHomeState.AIHomeOption)return A;var t=new p.proto.AIHomeState.AIHomeOption;switch(A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"PROMPT":case 0:t.type=0;break;case"CREATE_IMAGE":case 1:t.type=1;break;case"ANIMATE_PHOTO":case 2:t.type=2;break;case"ANALYZE_FILE":case 3:t.type=3;break}return A.title!=null&&(t.title=String(A.title)),A.promptText!=null&&(t.promptText=String(A.promptText)),A.sessionId!=null&&(t.sessionId=String(A.sessionId)),A.imageWdsIdentifier!=null&&(t.imageWdsIdentifier=String(A.imageWdsIdentifier)),A.imageTintColor!=null&&(t.imageTintColor=String(A.imageTintColor)),A.imageBackgroundColor!=null&&(t.imageBackgroundColor=String(A.imageBackgroundColor)),t},i.toObject=function(A,t){t||(t={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]===void 0?A.type:p.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]:A.type,t.oneofs&&(s._type="type")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,t.oneofs&&(s._title="title")),A.promptText!=null&&A.hasOwnProperty("promptText")&&(s.promptText=A.promptText,t.oneofs&&(s._promptText="promptText")),A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,t.oneofs&&(s._sessionId="sessionId")),A.imageWdsIdentifier!=null&&A.hasOwnProperty("imageWdsIdentifier")&&(s.imageWdsIdentifier=A.imageWdsIdentifier,t.oneofs&&(s._imageWdsIdentifier="imageWdsIdentifier")),A.imageTintColor!=null&&A.hasOwnProperty("imageTintColor")&&(s.imageTintColor=A.imageTintColor,t.oneofs&&(s._imageTintColor="imageTintColor")),A.imageBackgroundColor!=null&&A.hasOwnProperty("imageBackgroundColor")&&(s.imageBackgroundColor=A.imageBackgroundColor,t.oneofs&&(s._imageBackgroundColor="imageBackgroundColor")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIHomeState.AIHomeOption"},i.AIHomeActionType=(function(){let a={},A=Object.create(a);return A[a[0]="PROMPT"]=0,A[a[1]="CREATE_IMAGE"]=1,A[a[2]="ANIMATE_PHOTO"]=2,A[a[3]="ANALYZE_FILE"]=3,A})(),i})(),r})(),n.AIQueryFanout=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}case 3:{s.timestamp=e.int64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIQueryFanout)return e;var a=new p.proto.AIQueryFanout;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIQueryFanout.messageKey: object expected");a.messageKey=p.proto.MessageKey.fromObject(e.messageKey)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.AIQueryFanout.message: object expected");a.message=p.proto.Message.fromObject(e.message)}return e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),a},r.toObject=function(e,a){a||(a={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=p.proto.MessageKey.toObject(e.messageKey,a),a.oneofs&&(A._messageKey="messageKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.Message.toObject(e.message,a),a.oneofs&&(A._message="message")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?oe(e.timestamp):a.longs===Number?ne(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIQueryFanout"},r})(),n.AIRegenerateMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.responseTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRegenerateMetadata)return e;var a=new p.proto.AIRegenerateMetadata;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIRegenerateMetadata.messageKey: object expected");a.messageKey=p.proto.MessageKey.fromObject(e.messageKey)}return e.responseTimestampMs!=null&&(l.Long?(a.responseTimestampMs=l.Long.fromValue(e.responseTimestampMs)).unsigned=!1:typeof e.responseTimestampMs=="string"?a.responseTimestampMs=parseInt(e.responseTimestampMs,10):typeof e.responseTimestampMs=="number"?a.responseTimestampMs=e.responseTimestampMs:typeof e.responseTimestampMs=="object"&&(a.responseTimestampMs=new l.LongBits(e.responseTimestampMs.low>>>0,e.responseTimestampMs.high>>>0).toNumber())),a},r.toObject=function(e,a){a||(a={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=p.proto.MessageKey.toObject(e.messageKey,a),a.oneofs&&(A._messageKey="messageKey")),e.responseTimestampMs!=null&&e.hasOwnProperty("responseTimestampMs")&&(typeof e.responseTimestampMs=="number"?A.responseTimestampMs=a.longs===String?String(e.responseTimestampMs):e.responseTimestampMs:A.responseTimestampMs=a.longs===String?oe(e.responseTimestampMs):a.longs===Number?ne(e.responseTimestampMs):e.responseTimestampMs,a.oneofs&&(A._responseTimestampMs="responseTimestampMs")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRegenerateMetadata"},r})(),n.AIRichResponseCodeMetadata=(function(){function r(i){if(this.codeBlocks=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.codeLanguage=e.string();break}case 2:{s.codeBlocks&&s.codeBlocks.length||(s.codeBlocks=[]),s.codeBlocks.push(p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseCodeMetadata)return e;var a=new p.proto.AIRichResponseCodeMetadata;if(e.codeLanguage!=null&&(a.codeLanguage=String(e.codeLanguage)),e.codeBlocks){if(!Array.isArray(e.codeBlocks))throw TypeError(".proto.AIRichResponseCodeMetadata.codeBlocks: array expected");a.codeBlocks=[];for(var A=0;A>>3){case 1:{c.highlightType=A.int32();break}case 2:{c.codeContent=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock)return A;var t=new p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock;switch(A.highlightType){default:if(typeof A.highlightType=="number"){t.highlightType=A.highlightType;break}break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT":case 0:t.highlightType=0;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD":case 1:t.highlightType=1;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD":case 2:t.highlightType=2;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING":case 3:t.highlightType=3;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER":case 4:t.highlightType=4;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT":case 5:t.highlightType=5;break}return A.codeContent!=null&&(t.codeContent=String(A.codeContent)),t},i.toObject=function(A,t){t||(t={});var s={};return A.highlightType!=null&&A.hasOwnProperty("highlightType")&&(s.highlightType=t.enums===String?p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]===void 0?A.highlightType:p.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]:A.highlightType,t.oneofs&&(s._highlightType="highlightType")),A.codeContent!=null&&A.hasOwnProperty("codeContent")&&(s.codeContent=A.codeContent,t.oneofs&&(s._codeContent="codeContent")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock"},i})(),r.AIRichResponseCodeHighlightType=(function(){let i={},e=Object.create(i);return e[i[0]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT"]=0,e[i[1]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD"]=1,e[i[2]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD"]=2,e[i[3]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING"]=3,e[i[4]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER"]=4,e[i[5]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT"]=5,e})(),r})(),n.AIRichResponseContentItemsMetadata=(function(){function r(i){if(this.itemsMetadata=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.itemsMetadata&&s.itemsMetadata.length||(s.itemsMetadata=[]),s.itemsMetadata.push(p.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.decode(e,e.uint32()));break}case 2:{s.contentType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseContentItemsMetadata)return e;var a=new p.proto.AIRichResponseContentItemsMetadata;if(e.itemsMetadata){if(!Array.isArray(e.itemsMetadata))throw TypeError(".proto.AIRichResponseContentItemsMetadata.itemsMetadata: array expected");a.itemsMetadata=[];for(var A=0;A>>3){case 1:{c.reelItem=p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata)return A;var t=new p.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata;if(A.reelItem!=null){if(typeof A.reelItem!="object")throw TypeError(".proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.reelItem: object expected");t.reelItem=p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.fromObject(A.reelItem)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.reelItem!=null&&A.hasOwnProperty("reelItem")&&(s.reelItem=p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.toObject(A.reelItem,t),t.oneofs&&(s.aIRichResponseContentItem="reelItem")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata"},i})(),r.AIRichResponseReelItem=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.title=A.string();break}case 2:{c.profileIconUrl=A.string();break}case 3:{c.thumbnailUrl=A.string();break}case 4:{c.videoUrl=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem)return A;var t=new p.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem;return A.title!=null&&(t.title=String(A.title)),A.profileIconUrl!=null&&(t.profileIconUrl=String(A.profileIconUrl)),A.thumbnailUrl!=null&&(t.thumbnailUrl=String(A.thumbnailUrl)),A.videoUrl!=null&&(t.videoUrl=String(A.videoUrl)),t},i.toObject=function(A,t){t||(t={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,t.oneofs&&(s._title="title")),A.profileIconUrl!=null&&A.hasOwnProperty("profileIconUrl")&&(s.profileIconUrl=A.profileIconUrl,t.oneofs&&(s._profileIconUrl="profileIconUrl")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,t.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.videoUrl!=null&&A.hasOwnProperty("videoUrl")&&(s.videoUrl=A.videoUrl,t.oneofs&&(s._videoUrl="videoUrl")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem"},i})(),r.ContentType=(function(){let i={},e=Object.create(i);return e[i[0]="DEFAULT"]=0,e[i[1]="CAROUSEL"]=1,e})(),r})(),n.AIRichResponseDynamicMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}case 2:{s.version=e.uint64();break}case 3:{s.url=e.string();break}case 4:{s.loopCount=e.uint32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseDynamicMetadata)return e;var a=new p.proto.AIRichResponseDynamicMetadata;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN":case 0:a.type=0;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE":case 1:a.type=1;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF":case 2:a.type=2;break}return e.version!=null&&(l.Long?(a.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?a.version=parseInt(e.version,10):typeof e.version=="number"?a.version=e.version:typeof e.version=="object"&&(a.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),e.url!=null&&(a.url=String(e.url)),e.loopCount!=null&&(a.loopCount=e.loopCount>>>0),a},r.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]===void 0?e.type:p.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]:e.type,a.oneofs&&(A._type="type")),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=a.longs===String?String(e.version):e.version:A.version=a.longs===String?oe(e.version,!0):a.longs===Number?ne(e.version,!0):e.version,a.oneofs&&(A._version="version")),e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,a.oneofs&&(A._url="url")),e.loopCount!=null&&e.hasOwnProperty("loopCount")&&(A.loopCount=e.loopCount,a.oneofs&&(A._loopCount="loopCount")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseDynamicMetadata"},r.AIRichResponseDynamicMetadataType=(function(){let i={},e=Object.create(i);return e[i[0]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN"]=0,e[i[1]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE"]=1,e[i[2]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF"]=2,e})(),r})(),n.AIRichResponseGridImageMetadata=(function(){function r(i){if(this.imageUrls=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.gridImageUrl=p.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageUrls&&s.imageUrls.length||(s.imageUrls=[]),s.imageUrls.push(p.proto.AIRichResponseImageURL.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseGridImageMetadata)return e;var a=new p.proto.AIRichResponseGridImageMetadata;if(e.gridImageUrl!=null){if(typeof e.gridImageUrl!="object")throw TypeError(".proto.AIRichResponseGridImageMetadata.gridImageUrl: object expected");a.gridImageUrl=p.proto.AIRichResponseImageURL.fromObject(e.gridImageUrl)}if(e.imageUrls){if(!Array.isArray(e.imageUrls))throw TypeError(".proto.AIRichResponseGridImageMetadata.imageUrls: array expected");a.imageUrls=[];for(var A=0;A>>3){case 1:{s.imagePreviewUrl=e.string();break}case 2:{s.imageHighResUrl=e.string();break}case 3:{s.sourceUrl=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseImageURL)return e;var a=new p.proto.AIRichResponseImageURL;return e.imagePreviewUrl!=null&&(a.imagePreviewUrl=String(e.imagePreviewUrl)),e.imageHighResUrl!=null&&(a.imageHighResUrl=String(e.imageHighResUrl)),e.sourceUrl!=null&&(a.sourceUrl=String(e.sourceUrl)),a},r.toObject=function(e,a){a||(a={});var A={};return e.imagePreviewUrl!=null&&e.hasOwnProperty("imagePreviewUrl")&&(A.imagePreviewUrl=e.imagePreviewUrl,a.oneofs&&(A._imagePreviewUrl="imagePreviewUrl")),e.imageHighResUrl!=null&&e.hasOwnProperty("imageHighResUrl")&&(A.imageHighResUrl=e.imageHighResUrl,a.oneofs&&(A._imageHighResUrl="imageHighResUrl")),e.sourceUrl!=null&&e.hasOwnProperty("sourceUrl")&&(A.sourceUrl=e.sourceUrl,a.oneofs&&(A._sourceUrl="sourceUrl")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseImageURL"},r})(),n.AIRichResponseInlineImageMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.imageUrl=p.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageText=e.string();break}case 3:{s.alignment=e.int32();break}case 4:{s.tapLinkUrl=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseInlineImageMetadata)return e;var a=new p.proto.AIRichResponseInlineImageMetadata;if(e.imageUrl!=null){if(typeof e.imageUrl!="object")throw TypeError(".proto.AIRichResponseInlineImageMetadata.imageUrl: object expected");a.imageUrl=p.proto.AIRichResponseImageURL.fromObject(e.imageUrl)}switch(e.imageText!=null&&(a.imageText=String(e.imageText)),e.alignment){default:if(typeof e.alignment=="number"){a.alignment=e.alignment;break}break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED":case 0:a.alignment=0;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED":case 1:a.alignment=1;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED":case 2:a.alignment=2;break}return e.tapLinkUrl!=null&&(a.tapLinkUrl=String(e.tapLinkUrl)),a},r.toObject=function(e,a){a||(a={});var A={};return e.imageUrl!=null&&e.hasOwnProperty("imageUrl")&&(A.imageUrl=p.proto.AIRichResponseImageURL.toObject(e.imageUrl,a),a.oneofs&&(A._imageUrl="imageUrl")),e.imageText!=null&&e.hasOwnProperty("imageText")&&(A.imageText=e.imageText,a.oneofs&&(A._imageText="imageText")),e.alignment!=null&&e.hasOwnProperty("alignment")&&(A.alignment=a.enums===String?p.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]===void 0?e.alignment:p.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]:e.alignment,a.oneofs&&(A._alignment="alignment")),e.tapLinkUrl!=null&&e.hasOwnProperty("tapLinkUrl")&&(A.tapLinkUrl=e.tapLinkUrl,a.oneofs&&(A._tapLinkUrl="tapLinkUrl")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseInlineImageMetadata"},r.AIRichResponseImageAlignment=(function(){let i={},e=Object.create(i);return e[i[0]="AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED"]=0,e[i[1]="AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED"]=1,e[i[2]="AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED"]=2,e})(),r})(),n.AIRichResponseLatexMetadata=(function(){function r(i){if(this.expressions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.text=e.string();break}case 2:{s.expressions&&s.expressions.length||(s.expressions=[]),s.expressions.push(p.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseLatexMetadata)return e;var a=new p.proto.AIRichResponseLatexMetadata;if(e.text!=null&&(a.text=String(e.text)),e.expressions){if(!Array.isArray(e.expressions))throw TypeError(".proto.AIRichResponseLatexMetadata.expressions: array expected");a.expressions=[];for(var A=0;A>>3){case 1:{c.latexExpression=A.string();break}case 2:{c.url=A.string();break}case 3:{c.width=A.double();break}case 4:{c.height=A.double();break}case 5:{c.fontHeight=A.double();break}case 6:{c.imageTopPadding=A.double();break}case 7:{c.imageLeadingPadding=A.double();break}case 8:{c.imageBottomPadding=A.double();break}case 9:{c.imageTrailingPadding=A.double();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression)return A;var t=new p.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression;return A.latexExpression!=null&&(t.latexExpression=String(A.latexExpression)),A.url!=null&&(t.url=String(A.url)),A.width!=null&&(t.width=Number(A.width)),A.height!=null&&(t.height=Number(A.height)),A.fontHeight!=null&&(t.fontHeight=Number(A.fontHeight)),A.imageTopPadding!=null&&(t.imageTopPadding=Number(A.imageTopPadding)),A.imageLeadingPadding!=null&&(t.imageLeadingPadding=Number(A.imageLeadingPadding)),A.imageBottomPadding!=null&&(t.imageBottomPadding=Number(A.imageBottomPadding)),A.imageTrailingPadding!=null&&(t.imageTrailingPadding=Number(A.imageTrailingPadding)),t},i.toObject=function(A,t){t||(t={});var s={};return A.latexExpression!=null&&A.hasOwnProperty("latexExpression")&&(s.latexExpression=A.latexExpression,t.oneofs&&(s._latexExpression="latexExpression")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=t.json&&!isFinite(A.width)?String(A.width):A.width,t.oneofs&&(s._width="width")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=t.json&&!isFinite(A.height)?String(A.height):A.height,t.oneofs&&(s._height="height")),A.fontHeight!=null&&A.hasOwnProperty("fontHeight")&&(s.fontHeight=t.json&&!isFinite(A.fontHeight)?String(A.fontHeight):A.fontHeight,t.oneofs&&(s._fontHeight="fontHeight")),A.imageTopPadding!=null&&A.hasOwnProperty("imageTopPadding")&&(s.imageTopPadding=t.json&&!isFinite(A.imageTopPadding)?String(A.imageTopPadding):A.imageTopPadding,t.oneofs&&(s._imageTopPadding="imageTopPadding")),A.imageLeadingPadding!=null&&A.hasOwnProperty("imageLeadingPadding")&&(s.imageLeadingPadding=t.json&&!isFinite(A.imageLeadingPadding)?String(A.imageLeadingPadding):A.imageLeadingPadding,t.oneofs&&(s._imageLeadingPadding="imageLeadingPadding")),A.imageBottomPadding!=null&&A.hasOwnProperty("imageBottomPadding")&&(s.imageBottomPadding=t.json&&!isFinite(A.imageBottomPadding)?String(A.imageBottomPadding):A.imageBottomPadding,t.oneofs&&(s._imageBottomPadding="imageBottomPadding")),A.imageTrailingPadding!=null&&A.hasOwnProperty("imageTrailingPadding")&&(s.imageTrailingPadding=t.json&&!isFinite(A.imageTrailingPadding)?String(A.imageTrailingPadding):A.imageTrailingPadding,t.oneofs&&(s._imageTrailingPadding="imageTrailingPadding")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression"},i})(),r})(),n.AIRichResponseMapMetadata=(function(){function r(i){if(this.annotations=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.centerLatitude=e.double();break}case 2:{s.centerLongitude=e.double();break}case 3:{s.latitudeDelta=e.double();break}case 4:{s.longitudeDelta=e.double();break}case 5:{s.annotations&&s.annotations.length||(s.annotations=[]),s.annotations.push(p.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.decode(e,e.uint32()));break}case 6:{s.showInfoList=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseMapMetadata)return e;var a=new p.proto.AIRichResponseMapMetadata;if(e.centerLatitude!=null&&(a.centerLatitude=Number(e.centerLatitude)),e.centerLongitude!=null&&(a.centerLongitude=Number(e.centerLongitude)),e.latitudeDelta!=null&&(a.latitudeDelta=Number(e.latitudeDelta)),e.longitudeDelta!=null&&(a.longitudeDelta=Number(e.longitudeDelta)),e.annotations){if(!Array.isArray(e.annotations))throw TypeError(".proto.AIRichResponseMapMetadata.annotations: array expected");a.annotations=[];for(var A=0;A>>3){case 1:{c.annotationNumber=A.uint32();break}case 2:{c.latitude=A.double();break}case 3:{c.longitude=A.double();break}case 4:{c.title=A.string();break}case 5:{c.body=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation)return A;var t=new p.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation;return A.annotationNumber!=null&&(t.annotationNumber=A.annotationNumber>>>0),A.latitude!=null&&(t.latitude=Number(A.latitude)),A.longitude!=null&&(t.longitude=Number(A.longitude)),A.title!=null&&(t.title=String(A.title)),A.body!=null&&(t.body=String(A.body)),t},i.toObject=function(A,t){t||(t={});var s={};return A.annotationNumber!=null&&A.hasOwnProperty("annotationNumber")&&(s.annotationNumber=A.annotationNumber,t.oneofs&&(s._annotationNumber="annotationNumber")),A.latitude!=null&&A.hasOwnProperty("latitude")&&(s.latitude=t.json&&!isFinite(A.latitude)?String(A.latitude):A.latitude,t.oneofs&&(s._latitude="latitude")),A.longitude!=null&&A.hasOwnProperty("longitude")&&(s.longitude=t.json&&!isFinite(A.longitude)?String(A.longitude):A.longitude,t.oneofs&&(s._longitude="longitude")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,t.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,t.oneofs&&(s._body="body")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation"},i})(),r})(),n.AIRichResponseMessage=(function(){function r(i){if(this.submessages=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageType=e.int32();break}case 2:{s.submessages&&s.submessages.length||(s.submessages=[]),s.submessages.push(p.proto.AIRichResponseSubMessage.decode(e,e.uint32()));break}case 3:{s.unifiedResponse=p.proto.AIRichResponseUnifiedResponse.decode(e,e.uint32());break}case 4:{s.contextInfo=p.proto.ContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseMessage)return e;var a=new p.proto.AIRichResponseMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){a.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_TYPE_UNKNOWN":case 0:a.messageType=0;break;case"AI_RICH_RESPONSE_TYPE_STANDARD":case 1:a.messageType=1;break}if(e.submessages){if(!Array.isArray(e.submessages))throw TypeError(".proto.AIRichResponseMessage.submessages: array expected");a.submessages=[];for(var A=0;A>>3){case 1:{s.messageType=e.int32();break}case 2:{s.gridImageMetadata=p.proto.AIRichResponseGridImageMetadata.decode(e,e.uint32());break}case 3:{s.messageText=e.string();break}case 4:{s.imageMetadata=p.proto.AIRichResponseInlineImageMetadata.decode(e,e.uint32());break}case 5:{s.codeMetadata=p.proto.AIRichResponseCodeMetadata.decode(e,e.uint32());break}case 6:{s.tableMetadata=p.proto.AIRichResponseTableMetadata.decode(e,e.uint32());break}case 7:{s.dynamicMetadata=p.proto.AIRichResponseDynamicMetadata.decode(e,e.uint32());break}case 8:{s.latexMetadata=p.proto.AIRichResponseLatexMetadata.decode(e,e.uint32());break}case 9:{s.mapMetadata=p.proto.AIRichResponseMapMetadata.decode(e,e.uint32());break}case 10:{s.contentItemsMetadata=p.proto.AIRichResponseContentItemsMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseSubMessage)return e;var a=new p.proto.AIRichResponseSubMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){a.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_UNKNOWN":case 0:a.messageType=0;break;case"AI_RICH_RESPONSE_GRID_IMAGE":case 1:a.messageType=1;break;case"AI_RICH_RESPONSE_TEXT":case 2:a.messageType=2;break;case"AI_RICH_RESPONSE_INLINE_IMAGE":case 3:a.messageType=3;break;case"AI_RICH_RESPONSE_TABLE":case 4:a.messageType=4;break;case"AI_RICH_RESPONSE_CODE":case 5:a.messageType=5;break;case"AI_RICH_RESPONSE_DYNAMIC":case 6:a.messageType=6;break;case"AI_RICH_RESPONSE_MAP":case 7:a.messageType=7;break;case"AI_RICH_RESPONSE_LATEX":case 8:a.messageType=8;break;case"AI_RICH_RESPONSE_CONTENT_ITEMS":case 9:a.messageType=9;break}if(e.gridImageMetadata!=null){if(typeof e.gridImageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.gridImageMetadata: object expected");a.gridImageMetadata=p.proto.AIRichResponseGridImageMetadata.fromObject(e.gridImageMetadata)}if(e.messageText!=null&&(a.messageText=String(e.messageText)),e.imageMetadata!=null){if(typeof e.imageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.imageMetadata: object expected");a.imageMetadata=p.proto.AIRichResponseInlineImageMetadata.fromObject(e.imageMetadata)}if(e.codeMetadata!=null){if(typeof e.codeMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.codeMetadata: object expected");a.codeMetadata=p.proto.AIRichResponseCodeMetadata.fromObject(e.codeMetadata)}if(e.tableMetadata!=null){if(typeof e.tableMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.tableMetadata: object expected");a.tableMetadata=p.proto.AIRichResponseTableMetadata.fromObject(e.tableMetadata)}if(e.dynamicMetadata!=null){if(typeof e.dynamicMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.dynamicMetadata: object expected");a.dynamicMetadata=p.proto.AIRichResponseDynamicMetadata.fromObject(e.dynamicMetadata)}if(e.latexMetadata!=null){if(typeof e.latexMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.latexMetadata: object expected");a.latexMetadata=p.proto.AIRichResponseLatexMetadata.fromObject(e.latexMetadata)}if(e.mapMetadata!=null){if(typeof e.mapMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.mapMetadata: object expected");a.mapMetadata=p.proto.AIRichResponseMapMetadata.fromObject(e.mapMetadata)}if(e.contentItemsMetadata!=null){if(typeof e.contentItemsMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.contentItemsMetadata: object expected");a.contentItemsMetadata=p.proto.AIRichResponseContentItemsMetadata.fromObject(e.contentItemsMetadata)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.messageType!=null&&e.hasOwnProperty("messageType")&&(A.messageType=a.enums===String?p.proto.AIRichResponseSubMessageType[e.messageType]===void 0?e.messageType:p.proto.AIRichResponseSubMessageType[e.messageType]:e.messageType,a.oneofs&&(A._messageType="messageType")),e.gridImageMetadata!=null&&e.hasOwnProperty("gridImageMetadata")&&(A.gridImageMetadata=p.proto.AIRichResponseGridImageMetadata.toObject(e.gridImageMetadata,a),a.oneofs&&(A._gridImageMetadata="gridImageMetadata")),e.messageText!=null&&e.hasOwnProperty("messageText")&&(A.messageText=e.messageText,a.oneofs&&(A._messageText="messageText")),e.imageMetadata!=null&&e.hasOwnProperty("imageMetadata")&&(A.imageMetadata=p.proto.AIRichResponseInlineImageMetadata.toObject(e.imageMetadata,a),a.oneofs&&(A._imageMetadata="imageMetadata")),e.codeMetadata!=null&&e.hasOwnProperty("codeMetadata")&&(A.codeMetadata=p.proto.AIRichResponseCodeMetadata.toObject(e.codeMetadata,a),a.oneofs&&(A._codeMetadata="codeMetadata")),e.tableMetadata!=null&&e.hasOwnProperty("tableMetadata")&&(A.tableMetadata=p.proto.AIRichResponseTableMetadata.toObject(e.tableMetadata,a),a.oneofs&&(A._tableMetadata="tableMetadata")),e.dynamicMetadata!=null&&e.hasOwnProperty("dynamicMetadata")&&(A.dynamicMetadata=p.proto.AIRichResponseDynamicMetadata.toObject(e.dynamicMetadata,a),a.oneofs&&(A._dynamicMetadata="dynamicMetadata")),e.latexMetadata!=null&&e.hasOwnProperty("latexMetadata")&&(A.latexMetadata=p.proto.AIRichResponseLatexMetadata.toObject(e.latexMetadata,a),a.oneofs&&(A._latexMetadata="latexMetadata")),e.mapMetadata!=null&&e.hasOwnProperty("mapMetadata")&&(A.mapMetadata=p.proto.AIRichResponseMapMetadata.toObject(e.mapMetadata,a),a.oneofs&&(A._mapMetadata="mapMetadata")),e.contentItemsMetadata!=null&&e.hasOwnProperty("contentItemsMetadata")&&(A.contentItemsMetadata=p.proto.AIRichResponseContentItemsMetadata.toObject(e.contentItemsMetadata,a),a.oneofs&&(A._contentItemsMetadata="contentItemsMetadata")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseSubMessage"},r})(),n.AIRichResponseSubMessageType=(function(){let r={},o=Object.create(r);return o[r[0]="AI_RICH_RESPONSE_UNKNOWN"]=0,o[r[1]="AI_RICH_RESPONSE_GRID_IMAGE"]=1,o[r[2]="AI_RICH_RESPONSE_TEXT"]=2,o[r[3]="AI_RICH_RESPONSE_INLINE_IMAGE"]=3,o[r[4]="AI_RICH_RESPONSE_TABLE"]=4,o[r[5]="AI_RICH_RESPONSE_CODE"]=5,o[r[6]="AI_RICH_RESPONSE_DYNAMIC"]=6,o[r[7]="AI_RICH_RESPONSE_MAP"]=7,o[r[8]="AI_RICH_RESPONSE_LATEX"]=8,o[r[9]="AI_RICH_RESPONSE_CONTENT_ITEMS"]=9,o})(),n.AIRichResponseTableMetadata=(function(){function r(i){if(this.rows=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.rows&&s.rows.length||(s.rows=[]),s.rows.push(p.proto.AIRichResponseTableMetadata.AIRichResponseTableRow.decode(e,e.uint32()));break}case 2:{s.title=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseTableMetadata)return e;var a=new p.proto.AIRichResponseTableMetadata;if(e.rows){if(!Array.isArray(e.rows))throw TypeError(".proto.AIRichResponseTableMetadata.rows: array expected");a.rows=[];for(var A=0;A>>3){case 1:{c.items&&c.items.length||(c.items=[]),c.items.push(A.string());break}case 2:{c.isHeading=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIRichResponseTableMetadata.AIRichResponseTableRow)return A;var t=new p.proto.AIRichResponseTableMetadata.AIRichResponseTableRow;if(A.items){if(!Array.isArray(A.items))throw TypeError(".proto.AIRichResponseTableMetadata.AIRichResponseTableRow.items: array expected");t.items=[];for(var s=0;s>>3){case 1:{s.data=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIRichResponseUnifiedResponse)return e;var a=new p.proto.AIRichResponseUnifiedResponse;return e.data!=null&&(typeof e.data=="string"?l.base64.decode(e.data,a.data=l.newBuffer(l.base64.length(e.data)),0):e.data.length>=0&&(a.data=e.data)),a},r.toObject=function(e,a){a||(a={});var A={};return e.data!=null&&e.hasOwnProperty("data")&&(A.data=a.bytes===String?l.base64.encode(e.data,0,e.data.length):a.bytes===Array?Array.prototype.slice.call(e.data):e.data,a.oneofs&&(A._data="data")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseUnifiedResponse"},r})(),n.AIThreadInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.serverInfo=p.proto.AIThreadInfo.AIThreadServerInfo.decode(e,e.uint32());break}case 2:{s.clientInfo=p.proto.AIThreadInfo.AIThreadClientInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AIThreadInfo)return e;var a=new p.proto.AIThreadInfo;if(e.serverInfo!=null){if(typeof e.serverInfo!="object")throw TypeError(".proto.AIThreadInfo.serverInfo: object expected");a.serverInfo=p.proto.AIThreadInfo.AIThreadServerInfo.fromObject(e.serverInfo)}if(e.clientInfo!=null){if(typeof e.clientInfo!="object")throw TypeError(".proto.AIThreadInfo.clientInfo: object expected");a.clientInfo=p.proto.AIThreadInfo.AIThreadClientInfo.fromObject(e.clientInfo)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.serverInfo!=null&&e.hasOwnProperty("serverInfo")&&(A.serverInfo=p.proto.AIThreadInfo.AIThreadServerInfo.toObject(e.serverInfo,a),a.oneofs&&(A._serverInfo="serverInfo")),e.clientInfo!=null&&e.hasOwnProperty("clientInfo")&&(A.clientInfo=p.proto.AIThreadInfo.AIThreadClientInfo.toObject(e.clientInfo,a),a.oneofs&&(A._clientInfo="clientInfo")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIThreadInfo"},r.AIThreadClientInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIThreadInfo.AIThreadClientInfo)return A;var t=new p.proto.AIThreadInfo.AIThreadClientInfo;switch(A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"UNKNOWN":case 0:t.type=0;break;case"DEFAULT":case 1:t.type=1;break;case"INCOGNITO":case 2:t.type=2;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]===void 0?A.type:p.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]:A.type,t.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadClientInfo"},i.AIThreadType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="DEFAULT"]=1,A[a[2]="INCOGNITO"]=2,A})(),i})(),r.AIThreadServerInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.AIThreadInfo.AIThreadServerInfo)return A;var t=new p.proto.AIThreadInfo.AIThreadServerInfo;return A.title!=null&&(t.title=String(A.title)),t},i.toObject=function(A,t){t||(t={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,t.oneofs&&(s._title="title")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadServerInfo"},i})(),r})(),n.Account=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lid=e.string();break}case 2:{s.username=e.string();break}case 3:{s.countryCode=e.string();break}case 4:{s.isUsernameDeleted=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Account)return e;var a=new p.proto.Account;return e.lid!=null&&(a.lid=String(e.lid)),e.username!=null&&(a.username=String(e.username)),e.countryCode!=null&&(a.countryCode=String(e.countryCode)),e.isUsernameDeleted!=null&&(a.isUsernameDeleted=!!e.isUsernameDeleted),a},r.toObject=function(e,a){a||(a={});var A={};return e.lid!=null&&e.hasOwnProperty("lid")&&(A.lid=e.lid,a.oneofs&&(A._lid="lid")),e.username!=null&&e.hasOwnProperty("username")&&(A.username=e.username,a.oneofs&&(A._username="username")),e.countryCode!=null&&e.hasOwnProperty("countryCode")&&(A.countryCode=e.countryCode,a.oneofs&&(A._countryCode="countryCode")),e.isUsernameDeleted!=null&&e.hasOwnProperty("isUsernameDeleted")&&(A.isUsernameDeleted=e.isUsernameDeleted,a.oneofs&&(A._isUsernameDeleted="isUsernameDeleted")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Account"},r})(),n.ActionLink=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.url=e.string();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ActionLink)return e;var a=new p.proto.ActionLink;return e.url!=null&&(a.url=String(e.url)),e.buttonTitle!=null&&(a.buttonTitle=String(e.buttonTitle)),a},r.toObject=function(e,a){a||(a={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,a.oneofs&&(A._url="url")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,a.oneofs&&(A._buttonTitle="buttonTitle")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ActionLink"},r})(),n.AutoDownloadSettings=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.downloadImages=e.bool();break}case 2:{s.downloadAudio=e.bool();break}case 3:{s.downloadVideo=e.bool();break}case 4:{s.downloadDocuments=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AutoDownloadSettings)return e;var a=new p.proto.AutoDownloadSettings;return e.downloadImages!=null&&(a.downloadImages=!!e.downloadImages),e.downloadAudio!=null&&(a.downloadAudio=!!e.downloadAudio),e.downloadVideo!=null&&(a.downloadVideo=!!e.downloadVideo),e.downloadDocuments!=null&&(a.downloadDocuments=!!e.downloadDocuments),a},r.toObject=function(e,a){a||(a={});var A={};return e.downloadImages!=null&&e.hasOwnProperty("downloadImages")&&(A.downloadImages=e.downloadImages,a.oneofs&&(A._downloadImages="downloadImages")),e.downloadAudio!=null&&e.hasOwnProperty("downloadAudio")&&(A.downloadAudio=e.downloadAudio,a.oneofs&&(A._downloadAudio="downloadAudio")),e.downloadVideo!=null&&e.hasOwnProperty("downloadVideo")&&(A.downloadVideo=e.downloadVideo,a.oneofs&&(A._downloadVideo="downloadVideo")),e.downloadDocuments!=null&&e.hasOwnProperty("downloadDocuments")&&(A.downloadDocuments=e.downloadDocuments,a.oneofs&&(A._downloadDocuments="downloadDocuments")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AutoDownloadSettings"},r})(),n.AvatarUserSettings=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.fbid=e.string();break}case 2:{s.password=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.AvatarUserSettings)return e;var a=new p.proto.AvatarUserSettings;return e.fbid!=null&&(a.fbid=String(e.fbid)),e.password!=null&&(a.password=String(e.password)),a},r.toObject=function(e,a){a||(a={});var A={};return e.fbid!=null&&e.hasOwnProperty("fbid")&&(A.fbid=e.fbid,a.oneofs&&(A._fbid="fbid")),e.password!=null&&e.hasOwnProperty("password")&&(A.password=e.password,a.oneofs&&(A._password="password")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AvatarUserSettings"},r})(),n.BizAccountLinkInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.whatsappBizAcctFbid=e.uint64();break}case 2:{s.whatsappAcctNumber=e.string();break}case 3:{s.issueTime=e.uint64();break}case 4:{s.hostStorage=e.int32();break}case 5:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BizAccountLinkInfo)return e;var a=new p.proto.BizAccountLinkInfo;switch(e.whatsappBizAcctFbid!=null&&(l.Long?(a.whatsappBizAcctFbid=l.Long.fromValue(e.whatsappBizAcctFbid)).unsigned=!0:typeof e.whatsappBizAcctFbid=="string"?a.whatsappBizAcctFbid=parseInt(e.whatsappBizAcctFbid,10):typeof e.whatsappBizAcctFbid=="number"?a.whatsappBizAcctFbid=e.whatsappBizAcctFbid:typeof e.whatsappBizAcctFbid=="object"&&(a.whatsappBizAcctFbid=new l.LongBits(e.whatsappBizAcctFbid.low>>>0,e.whatsappBizAcctFbid.high>>>0).toNumber(!0))),e.whatsappAcctNumber!=null&&(a.whatsappAcctNumber=String(e.whatsappAcctNumber)),e.issueTime!=null&&(l.Long?(a.issueTime=l.Long.fromValue(e.issueTime)).unsigned=!0:typeof e.issueTime=="string"?a.issueTime=parseInt(e.issueTime,10):typeof e.issueTime=="number"?a.issueTime=e.issueTime:typeof e.issueTime=="object"&&(a.issueTime=new l.LongBits(e.issueTime.low>>>0,e.issueTime.high>>>0).toNumber(!0))),e.hostStorage){default:if(typeof e.hostStorage=="number"){a.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:a.hostStorage=0;break;case"FACEBOOK":case 1:a.hostStorage=1;break}switch(e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"ENTERPRISE":case 0:a.accountType=0;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.whatsappBizAcctFbid!=null&&e.hasOwnProperty("whatsappBizAcctFbid")&&(typeof e.whatsappBizAcctFbid=="number"?A.whatsappBizAcctFbid=a.longs===String?String(e.whatsappBizAcctFbid):e.whatsappBizAcctFbid:A.whatsappBizAcctFbid=a.longs===String?oe(e.whatsappBizAcctFbid,!0):a.longs===Number?ne(e.whatsappBizAcctFbid,!0):e.whatsappBizAcctFbid,a.oneofs&&(A._whatsappBizAcctFbid="whatsappBizAcctFbid")),e.whatsappAcctNumber!=null&&e.hasOwnProperty("whatsappAcctNumber")&&(A.whatsappAcctNumber=e.whatsappAcctNumber,a.oneofs&&(A._whatsappAcctNumber="whatsappAcctNumber")),e.issueTime!=null&&e.hasOwnProperty("issueTime")&&(typeof e.issueTime=="number"?A.issueTime=a.longs===String?String(e.issueTime):e.issueTime:A.issueTime=a.longs===String?oe(e.issueTime,!0):a.longs===Number?ne(e.issueTime,!0):e.issueTime,a.oneofs&&(A._issueTime="issueTime")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=a.enums===String?p.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:p.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]:e.hostStorage,a.oneofs&&(A._hostStorage="hostStorage")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=a.enums===String?p.proto.BizAccountLinkInfo.AccountType[e.accountType]===void 0?e.accountType:p.proto.BizAccountLinkInfo.AccountType[e.accountType]:e.accountType,a.oneofs&&(A._accountType="accountType")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountLinkInfo"},r.AccountType=(function(){let i={},e=Object.create(i);return e[i[0]="ENTERPRISE"]=0,e})(),r.HostStorageType=(function(){let i={},e=Object.create(i);return e[i[0]="ON_PREMISE"]=0,e[i[1]="FACEBOOK"]=1,e})(),r})(),n.BizAccountPayload=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.vnameCert=p.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 2:{s.bizAcctLinkInfo=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BizAccountPayload)return e;var a=new p.proto.BizAccountPayload;if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizAccountPayload.vnameCert: object expected");a.vnameCert=p.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}return e.bizAcctLinkInfo!=null&&(typeof e.bizAcctLinkInfo=="string"?l.base64.decode(e.bizAcctLinkInfo,a.bizAcctLinkInfo=l.newBuffer(l.base64.length(e.bizAcctLinkInfo)),0):e.bizAcctLinkInfo.length>=0&&(a.bizAcctLinkInfo=e.bizAcctLinkInfo)),a},r.toObject=function(e,a){a||(a={});var A={};return e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=p.proto.VerifiedNameCertificate.toObject(e.vnameCert,a),a.oneofs&&(A._vnameCert="vnameCert")),e.bizAcctLinkInfo!=null&&e.hasOwnProperty("bizAcctLinkInfo")&&(A.bizAcctLinkInfo=a.bytes===String?l.base64.encode(e.bizAcctLinkInfo,0,e.bizAcctLinkInfo.length):a.bytes===Array?Array.prototype.slice.call(e.bizAcctLinkInfo):e.bizAcctLinkInfo,a.oneofs&&(A._bizAcctLinkInfo="bizAcctLinkInfo")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountPayload"},r})(),n.BizIdentityInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.vlevel=e.int32();break}case 2:{s.vnameCert=p.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 3:{s.signed=e.bool();break}case 4:{s.revoked=e.bool();break}case 5:{s.hostStorage=e.int32();break}case 6:{s.actualActors=e.int32();break}case 7:{s.privacyModeTs=e.uint64();break}case 8:{s.featureControls=e.uint64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BizIdentityInfo)return e;var a=new p.proto.BizIdentityInfo;switch(e.vlevel){default:if(typeof e.vlevel=="number"){a.vlevel=e.vlevel;break}break;case"UNKNOWN":case 0:a.vlevel=0;break;case"LOW":case 1:a.vlevel=1;break;case"HIGH":case 2:a.vlevel=2;break}if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizIdentityInfo.vnameCert: object expected");a.vnameCert=p.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}switch(e.signed!=null&&(a.signed=!!e.signed),e.revoked!=null&&(a.revoked=!!e.revoked),e.hostStorage){default:if(typeof e.hostStorage=="number"){a.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:a.hostStorage=0;break;case"FACEBOOK":case 1:a.hostStorage=1;break}switch(e.actualActors){default:if(typeof e.actualActors=="number"){a.actualActors=e.actualActors;break}break;case"SELF":case 0:a.actualActors=0;break;case"BSP":case 1:a.actualActors=1;break}return e.privacyModeTs!=null&&(l.Long?(a.privacyModeTs=l.Long.fromValue(e.privacyModeTs)).unsigned=!0:typeof e.privacyModeTs=="string"?a.privacyModeTs=parseInt(e.privacyModeTs,10):typeof e.privacyModeTs=="number"?a.privacyModeTs=e.privacyModeTs:typeof e.privacyModeTs=="object"&&(a.privacyModeTs=new l.LongBits(e.privacyModeTs.low>>>0,e.privacyModeTs.high>>>0).toNumber(!0))),e.featureControls!=null&&(l.Long?(a.featureControls=l.Long.fromValue(e.featureControls)).unsigned=!0:typeof e.featureControls=="string"?a.featureControls=parseInt(e.featureControls,10):typeof e.featureControls=="number"?a.featureControls=e.featureControls:typeof e.featureControls=="object"&&(a.featureControls=new l.LongBits(e.featureControls.low>>>0,e.featureControls.high>>>0).toNumber(!0))),a},r.toObject=function(e,a){a||(a={});var A={};return e.vlevel!=null&&e.hasOwnProperty("vlevel")&&(A.vlevel=a.enums===String?p.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]===void 0?e.vlevel:p.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]:e.vlevel,a.oneofs&&(A._vlevel="vlevel")),e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=p.proto.VerifiedNameCertificate.toObject(e.vnameCert,a),a.oneofs&&(A._vnameCert="vnameCert")),e.signed!=null&&e.hasOwnProperty("signed")&&(A.signed=e.signed,a.oneofs&&(A._signed="signed")),e.revoked!=null&&e.hasOwnProperty("revoked")&&(A.revoked=e.revoked,a.oneofs&&(A._revoked="revoked")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=a.enums===String?p.proto.BizIdentityInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:p.proto.BizIdentityInfo.HostStorageType[e.hostStorage]:e.hostStorage,a.oneofs&&(A._hostStorage="hostStorage")),e.actualActors!=null&&e.hasOwnProperty("actualActors")&&(A.actualActors=a.enums===String?p.proto.BizIdentityInfo.ActualActorsType[e.actualActors]===void 0?e.actualActors:p.proto.BizIdentityInfo.ActualActorsType[e.actualActors]:e.actualActors,a.oneofs&&(A._actualActors="actualActors")),e.privacyModeTs!=null&&e.hasOwnProperty("privacyModeTs")&&(typeof e.privacyModeTs=="number"?A.privacyModeTs=a.longs===String?String(e.privacyModeTs):e.privacyModeTs:A.privacyModeTs=a.longs===String?oe(e.privacyModeTs,!0):a.longs===Number?ne(e.privacyModeTs,!0):e.privacyModeTs,a.oneofs&&(A._privacyModeTs="privacyModeTs")),e.featureControls!=null&&e.hasOwnProperty("featureControls")&&(typeof e.featureControls=="number"?A.featureControls=a.longs===String?String(e.featureControls):e.featureControls:A.featureControls=a.longs===String?oe(e.featureControls,!0):a.longs===Number?ne(e.featureControls,!0):e.featureControls,a.oneofs&&(A._featureControls="featureControls")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizIdentityInfo"},r.ActualActorsType=(function(){let i={},e=Object.create(i);return e[i[0]="SELF"]=0,e[i[1]="BSP"]=1,e})(),r.HostStorageType=(function(){let i={},e=Object.create(i);return e[i[0]="ON_PREMISE"]=0,e[i[1]="FACEBOOK"]=1,e})(),r.VerifiedLevelValue=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="LOW"]=1,e[i[2]="HIGH"]=2,e})(),r})(),n.BotAgeCollectionMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.ageCollectionEligible=e.bool();break}case 2:{s.shouldTriggerAgeCollectionOnClient=e.bool();break}case 3:{s.ageCollectionType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotAgeCollectionMetadata)return e;var a=new p.proto.BotAgeCollectionMetadata;switch(e.ageCollectionEligible!=null&&(a.ageCollectionEligible=!!e.ageCollectionEligible),e.shouldTriggerAgeCollectionOnClient!=null&&(a.shouldTriggerAgeCollectionOnClient=!!e.shouldTriggerAgeCollectionOnClient),e.ageCollectionType){default:if(typeof e.ageCollectionType=="number"){a.ageCollectionType=e.ageCollectionType;break}break;case"O18_BINARY":case 0:a.ageCollectionType=0;break;case"WAFFLE":case 1:a.ageCollectionType=1;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.ageCollectionEligible!=null&&e.hasOwnProperty("ageCollectionEligible")&&(A.ageCollectionEligible=e.ageCollectionEligible,a.oneofs&&(A._ageCollectionEligible="ageCollectionEligible")),e.shouldTriggerAgeCollectionOnClient!=null&&e.hasOwnProperty("shouldTriggerAgeCollectionOnClient")&&(A.shouldTriggerAgeCollectionOnClient=e.shouldTriggerAgeCollectionOnClient,a.oneofs&&(A._shouldTriggerAgeCollectionOnClient="shouldTriggerAgeCollectionOnClient")),e.ageCollectionType!=null&&e.hasOwnProperty("ageCollectionType")&&(A.ageCollectionType=a.enums===String?p.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]===void 0?e.ageCollectionType:p.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]:e.ageCollectionType,a.oneofs&&(A._ageCollectionType="ageCollectionType")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAgeCollectionMetadata"},r.AgeCollectionType=(function(){let i={},e=Object.create(i);return e[i[0]="O18_BINARY"]=0,e[i[1]="WAFFLE"]=1,e})(),r})(),n.BotAvatarMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.sentiment=e.uint32();break}case 2:{s.behaviorGraph=e.string();break}case 3:{s.action=e.uint32();break}case 4:{s.intensity=e.uint32();break}case 5:{s.wordCount=e.uint32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotAvatarMetadata)return e;var a=new p.proto.BotAvatarMetadata;return e.sentiment!=null&&(a.sentiment=e.sentiment>>>0),e.behaviorGraph!=null&&(a.behaviorGraph=String(e.behaviorGraph)),e.action!=null&&(a.action=e.action>>>0),e.intensity!=null&&(a.intensity=e.intensity>>>0),e.wordCount!=null&&(a.wordCount=e.wordCount>>>0),a},r.toObject=function(e,a){a||(a={});var A={};return e.sentiment!=null&&e.hasOwnProperty("sentiment")&&(A.sentiment=e.sentiment,a.oneofs&&(A._sentiment="sentiment")),e.behaviorGraph!=null&&e.hasOwnProperty("behaviorGraph")&&(A.behaviorGraph=e.behaviorGraph,a.oneofs&&(A._behaviorGraph="behaviorGraph")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=e.action,a.oneofs&&(A._action="action")),e.intensity!=null&&e.hasOwnProperty("intensity")&&(A.intensity=e.intensity,a.oneofs&&(A._intensity="intensity")),e.wordCount!=null&&e.hasOwnProperty("wordCount")&&(A.wordCount=e.wordCount,a.oneofs&&(A._wordCount="wordCount")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAvatarMetadata"},r})(),n.BotCapabilityMetadata=(function(){function r(o){if(this.capabilities=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{if(t.capabilities&&t.capabilities.length||(t.capabilities=[]),(s&7)===2)for(var g=i.uint32()+i.pos;i.pos>>3){case 1:{s.messageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.kind=e.int32();break}case 3:{s.text=e.string();break}case 4:{s.kindNegative=e.uint64();break}case 5:{s.kindPositive=e.uint64();break}case 6:{s.kindReport=e.int32();break}case 7:{s.sideBySideSurveyMetadata=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotFeedbackMessage)return e;var a=new p.proto.BotFeedbackMessage;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.BotFeedbackMessage.messageKey: object expected");a.messageKey=p.proto.MessageKey.fromObject(e.messageKey)}switch(e.kind){default:if(typeof e.kind=="number"){a.kind=e.kind;break}break;case"BOT_FEEDBACK_POSITIVE":case 0:a.kind=0;break;case"BOT_FEEDBACK_NEGATIVE_GENERIC":case 1:a.kind=1;break;case"BOT_FEEDBACK_NEGATIVE_HELPFUL":case 2:a.kind=2;break;case"BOT_FEEDBACK_NEGATIVE_INTERESTING":case 3:a.kind=3;break;case"BOT_FEEDBACK_NEGATIVE_ACCURATE":case 4:a.kind=4;break;case"BOT_FEEDBACK_NEGATIVE_SAFE":case 5:a.kind=5;break;case"BOT_FEEDBACK_NEGATIVE_OTHER":case 6:a.kind=6;break;case"BOT_FEEDBACK_NEGATIVE_REFUSED":case 7:a.kind=7;break;case"BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING":case 8:a.kind=8;break;case"BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT":case 9:a.kind=9;break;case"BOT_FEEDBACK_NEGATIVE_PERSONALIZED":case 10:a.kind=10;break;case"BOT_FEEDBACK_NEGATIVE_CLARITY":case 11:a.kind=11;break;case"BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON":case 12:a.kind=12;break;case"BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY":case 13:a.kind=13;break;case"BOT_FEEDBACK_NEGATIVE":case 14:a.kind=14;break}switch(e.text!=null&&(a.text=String(e.text)),e.kindNegative!=null&&(l.Long?(a.kindNegative=l.Long.fromValue(e.kindNegative)).unsigned=!0:typeof e.kindNegative=="string"?a.kindNegative=parseInt(e.kindNegative,10):typeof e.kindNegative=="number"?a.kindNegative=e.kindNegative:typeof e.kindNegative=="object"&&(a.kindNegative=new l.LongBits(e.kindNegative.low>>>0,e.kindNegative.high>>>0).toNumber(!0))),e.kindPositive!=null&&(l.Long?(a.kindPositive=l.Long.fromValue(e.kindPositive)).unsigned=!0:typeof e.kindPositive=="string"?a.kindPositive=parseInt(e.kindPositive,10):typeof e.kindPositive=="number"?a.kindPositive=e.kindPositive:typeof e.kindPositive=="object"&&(a.kindPositive=new l.LongBits(e.kindPositive.low>>>0,e.kindPositive.high>>>0).toNumber(!0))),e.kindReport){default:if(typeof e.kindReport=="number"){a.kindReport=e.kindReport;break}break;case"NONE":case 0:a.kindReport=0;break;case"GENERIC":case 1:a.kindReport=1;break}if(e.sideBySideSurveyMetadata!=null){if(typeof e.sideBySideSurveyMetadata!="object")throw TypeError(".proto.BotFeedbackMessage.sideBySideSurveyMetadata: object expected");a.sideBySideSurveyMetadata=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.fromObject(e.sideBySideSurveyMetadata)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=p.proto.MessageKey.toObject(e.messageKey,a),a.oneofs&&(A._messageKey="messageKey")),e.kind!=null&&e.hasOwnProperty("kind")&&(A.kind=a.enums===String?p.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]===void 0?e.kind:p.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]:e.kind,a.oneofs&&(A._kind="kind")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,a.oneofs&&(A._text="text")),e.kindNegative!=null&&e.hasOwnProperty("kindNegative")&&(typeof e.kindNegative=="number"?A.kindNegative=a.longs===String?String(e.kindNegative):e.kindNegative:A.kindNegative=a.longs===String?oe(e.kindNegative,!0):a.longs===Number?ne(e.kindNegative,!0):e.kindNegative,a.oneofs&&(A._kindNegative="kindNegative")),e.kindPositive!=null&&e.hasOwnProperty("kindPositive")&&(typeof e.kindPositive=="number"?A.kindPositive=a.longs===String?String(e.kindPositive):e.kindPositive:A.kindPositive=a.longs===String?oe(e.kindPositive,!0):a.longs===Number?ne(e.kindPositive,!0):e.kindPositive,a.oneofs&&(A._kindPositive="kindPositive")),e.kindReport!=null&&e.hasOwnProperty("kindReport")&&(A.kindReport=a.enums===String?p.proto.BotFeedbackMessage.ReportKind[e.kindReport]===void 0?e.kindReport:p.proto.BotFeedbackMessage.ReportKind[e.kindReport]:e.kindReport,a.oneofs&&(A._kindReport="kindReport")),e.sideBySideSurveyMetadata!=null&&e.hasOwnProperty("sideBySideSurveyMetadata")&&(A.sideBySideSurveyMetadata=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.toObject(e.sideBySideSurveyMetadata,a),a.oneofs&&(A._sideBySideSurveyMetadata="sideBySideSurveyMetadata")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotFeedbackMessage"},r.BotFeedbackKind=(function(){let i={},e=Object.create(i);return e[i[0]="BOT_FEEDBACK_POSITIVE"]=0,e[i[1]="BOT_FEEDBACK_NEGATIVE_GENERIC"]=1,e[i[2]="BOT_FEEDBACK_NEGATIVE_HELPFUL"]=2,e[i[3]="BOT_FEEDBACK_NEGATIVE_INTERESTING"]=3,e[i[4]="BOT_FEEDBACK_NEGATIVE_ACCURATE"]=4,e[i[5]="BOT_FEEDBACK_NEGATIVE_SAFE"]=5,e[i[6]="BOT_FEEDBACK_NEGATIVE_OTHER"]=6,e[i[7]="BOT_FEEDBACK_NEGATIVE_REFUSED"]=7,e[i[8]="BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING"]=8,e[i[9]="BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=9,e[i[10]="BOT_FEEDBACK_NEGATIVE_PERSONALIZED"]=10,e[i[11]="BOT_FEEDBACK_NEGATIVE_CLARITY"]=11,e[i[12]="BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON"]=12,e[i[13]="BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY"]=13,e[i[14]="BOT_FEEDBACK_NEGATIVE"]=14,e})(),r.BotFeedbackKindMultipleNegative=(function(){let i={},e=Object.create(i);return e[i[1]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_GENERIC"]=1,e[i[2]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_HELPFUL"]=2,e[i[4]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_INTERESTING"]=4,e[i[8]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_ACCURATE"]=8,e[i[16]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_SAFE"]=16,e[i[32]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_OTHER"]=32,e[i[64]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_REFUSED"]=64,e[i[128]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_VISUALLY_APPEALING"]=128,e[i[256]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=256,e})(),r.BotFeedbackKindMultiplePositive=(function(){let i={},e=Object.create(i);return e[i[1]="BOT_FEEDBACK_MULTIPLE_POSITIVE_GENERIC"]=1,e})(),r.ReportKind=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="GENERIC"]=1,e})(),r.SideBySideSurveyMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.selectedRequestId=A.string();break}case 2:{c.surveyId=A.uint32();break}case 3:{c.simonSessionFbid=A.string();break}case 4:{c.responseOtid=A.string();break}case 5:{c.responseTimestampMsString=A.string();break}case 6:{c.isSelectedResponsePrimary=A.bool();break}case 7:{c.messageIdToEdit=A.string();break}case 8:{c.analyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.decode(A,A.uint32());break}case 9:{c.metaAiAnalyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata)return A;var t=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata;if(A.selectedRequestId!=null&&(t.selectedRequestId=String(A.selectedRequestId)),A.surveyId!=null&&(t.surveyId=A.surveyId>>>0),A.simonSessionFbid!=null&&(t.simonSessionFbid=String(A.simonSessionFbid)),A.responseOtid!=null&&(t.responseOtid=String(A.responseOtid)),A.responseTimestampMsString!=null&&(t.responseTimestampMsString=String(A.responseTimestampMsString)),A.isSelectedResponsePrimary!=null&&(t.isSelectedResponsePrimary=!!A.isSelectedResponsePrimary),A.messageIdToEdit!=null&&(t.messageIdToEdit=String(A.messageIdToEdit)),A.analyticsData!=null){if(typeof A.analyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.analyticsData: object expected");t.analyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.fromObject(A.analyticsData)}if(A.metaAiAnalyticsData!=null){if(typeof A.metaAiAnalyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.metaAiAnalyticsData: object expected");t.metaAiAnalyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.fromObject(A.metaAiAnalyticsData)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.selectedRequestId!=null&&A.hasOwnProperty("selectedRequestId")&&(s.selectedRequestId=A.selectedRequestId,t.oneofs&&(s._selectedRequestId="selectedRequestId")),A.surveyId!=null&&A.hasOwnProperty("surveyId")&&(s.surveyId=A.surveyId,t.oneofs&&(s._surveyId="surveyId")),A.simonSessionFbid!=null&&A.hasOwnProperty("simonSessionFbid")&&(s.simonSessionFbid=A.simonSessionFbid,t.oneofs&&(s._simonSessionFbid="simonSessionFbid")),A.responseOtid!=null&&A.hasOwnProperty("responseOtid")&&(s.responseOtid=A.responseOtid,t.oneofs&&(s._responseOtid="responseOtid")),A.responseTimestampMsString!=null&&A.hasOwnProperty("responseTimestampMsString")&&(s.responseTimestampMsString=A.responseTimestampMsString,t.oneofs&&(s._responseTimestampMsString="responseTimestampMsString")),A.isSelectedResponsePrimary!=null&&A.hasOwnProperty("isSelectedResponsePrimary")&&(s.isSelectedResponsePrimary=A.isSelectedResponsePrimary,t.oneofs&&(s._isSelectedResponsePrimary="isSelectedResponsePrimary")),A.messageIdToEdit!=null&&A.hasOwnProperty("messageIdToEdit")&&(s.messageIdToEdit=A.messageIdToEdit,t.oneofs&&(s._messageIdToEdit="messageIdToEdit")),A.analyticsData!=null&&A.hasOwnProperty("analyticsData")&&(s.analyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.toObject(A.analyticsData,t),t.oneofs&&(s._analyticsData="analyticsData")),A.metaAiAnalyticsData!=null&&A.hasOwnProperty("metaAiAnalyticsData")&&(s.metaAiAnalyticsData=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.toObject(A.metaAiAnalyticsData,t),t.oneofs&&(s._metaAiAnalyticsData="metaAiAnalyticsData")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata"},i.SideBySideSurveyAnalyticsData=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.tessaEvent=s.string();break}case 2:{d.tessaSessionFbid=s.string();break}case 3:{d.simonSessionFbid=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData)return s;var g=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData;return s.tessaEvent!=null&&(g.tessaEvent=String(s.tessaEvent)),s.tessaSessionFbid!=null&&(g.tessaSessionFbid=String(s.tessaSessionFbid)),s.simonSessionFbid!=null&&(g.simonSessionFbid=String(s.simonSessionFbid)),g},a.toObject=function(s,g){g||(g={});var c={};return s.tessaEvent!=null&&s.hasOwnProperty("tessaEvent")&&(c.tessaEvent=s.tessaEvent,g.oneofs&&(c._tessaEvent="tessaEvent")),s.tessaSessionFbid!=null&&s.hasOwnProperty("tessaSessionFbid")&&(c.tessaSessionFbid=s.tessaSessionFbid,g.oneofs&&(c._tessaSessionFbid="tessaSessionFbid")),s.simonSessionFbid!=null&&s.hasOwnProperty("simonSessionFbid")&&(c.simonSessionFbid=s.simonSessionFbid,g.oneofs&&(c._simonSessionFbid="simonSessionFbid")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData"},a})(),i.SidebySideSurveyMetaAiAnalyticsData=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.surveyId=s.uint32();break}case 2:{d.primaryResponseId=s.string();break}case 3:{d.testArmName=s.string();break}case 4:{d.timestampMsString=s.string();break}case 5:{d.ctaImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.decode(s,s.uint32());break}case 6:{d.ctaClickEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.decode(s,s.uint32());break}case 7:{d.cardImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.decode(s,s.uint32());break}case 8:{d.responseEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.decode(s,s.uint32());break}case 9:{d.abandonEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData)return s;var g=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData;if(s.surveyId!=null&&(g.surveyId=s.surveyId>>>0),s.primaryResponseId!=null&&(g.primaryResponseId=String(s.primaryResponseId)),s.testArmName!=null&&(g.testArmName=String(s.testArmName)),s.timestampMsString!=null&&(g.timestampMsString=String(s.timestampMsString)),s.ctaImpressionEvent!=null){if(typeof s.ctaImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaImpressionEvent: object expected");g.ctaImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.fromObject(s.ctaImpressionEvent)}if(s.ctaClickEvent!=null){if(typeof s.ctaClickEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaClickEvent: object expected");g.ctaClickEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.fromObject(s.ctaClickEvent)}if(s.cardImpressionEvent!=null){if(typeof s.cardImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.cardImpressionEvent: object expected");g.cardImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.fromObject(s.cardImpressionEvent)}if(s.responseEvent!=null){if(typeof s.responseEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.responseEvent: object expected");g.responseEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.fromObject(s.responseEvent)}if(s.abandonEvent!=null){if(typeof s.abandonEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.abandonEvent: object expected");g.abandonEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.fromObject(s.abandonEvent)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.surveyId!=null&&s.hasOwnProperty("surveyId")&&(c.surveyId=s.surveyId,g.oneofs&&(c._surveyId="surveyId")),s.primaryResponseId!=null&&s.hasOwnProperty("primaryResponseId")&&(c.primaryResponseId=s.primaryResponseId,g.oneofs&&(c._primaryResponseId="primaryResponseId")),s.testArmName!=null&&s.hasOwnProperty("testArmName")&&(c.testArmName=s.testArmName,g.oneofs&&(c._testArmName="testArmName")),s.timestampMsString!=null&&s.hasOwnProperty("timestampMsString")&&(c.timestampMsString=s.timestampMsString,g.oneofs&&(c._timestampMsString="timestampMsString")),s.ctaImpressionEvent!=null&&s.hasOwnProperty("ctaImpressionEvent")&&(c.ctaImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.toObject(s.ctaImpressionEvent,g),g.oneofs&&(c._ctaImpressionEvent="ctaImpressionEvent")),s.ctaClickEvent!=null&&s.hasOwnProperty("ctaClickEvent")&&(c.ctaClickEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.toObject(s.ctaClickEvent,g),g.oneofs&&(c._ctaClickEvent="ctaClickEvent")),s.cardImpressionEvent!=null&&s.hasOwnProperty("cardImpressionEvent")&&(c.cardImpressionEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.toObject(s.cardImpressionEvent,g),g.oneofs&&(c._cardImpressionEvent="cardImpressionEvent")),s.responseEvent!=null&&s.hasOwnProperty("responseEvent")&&(c.responseEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.toObject(s.responseEvent,g),g.oneofs&&(c._responseEvent="responseEvent")),s.abandonEvent!=null&&s.hasOwnProperty("abandonEvent")&&(c.abandonEvent=p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.toObject(s.abandonEvent,g),g.oneofs&&(c._abandonEvent="abandonEvent")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData"},a.SideBySideSurveyAbandonEventData=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.abandonDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData;return c.abandonDwellTimeMsString!=null&&(I.abandonDwellTimeMsString=String(c.abandonDwellTimeMsString)),I},t.toObject=function(c,I){I||(I={});var d={};return c.abandonDwellTimeMsString!=null&&c.hasOwnProperty("abandonDwellTimeMsString")&&(d.abandonDwellTimeMsString=c.abandonDwellTimeMsString,I.oneofs&&(d._abandonDwellTimeMsString="abandonDwellTimeMsString")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData"},t})(),a.SideBySideSurveyCTAClickEventData=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}case 2:{f.clickDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),c.clickDwellTimeMsString!=null&&(I.clickDwellTimeMsString=String(c.clickDwellTimeMsString)),I},t.toObject=function(c,I){I||(I={});var d={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(d.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(d._isSurveyExpired="isSurveyExpired")),c.clickDwellTimeMsString!=null&&c.hasOwnProperty("clickDwellTimeMsString")&&(d.clickDwellTimeMsString=c.clickDwellTimeMsString,I.oneofs&&(d._clickDwellTimeMsString="clickDwellTimeMsString")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData"},t})(),a.SideBySideSurveyCTAImpressionEventData=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),I},t.toObject=function(c,I){I||(I={});var d={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(d.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(d._isSurveyExpired="isSurveyExpired")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData"},t})(),a.SideBySideSurveyCardImpressionEventData=(function(){function t(s){if(s)for(var g=Object.keys(s),c=0;c>>3){default:g.skipType(f&7);break}}return B},t.fromObject=function(g){return g instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData?g:new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData},t.toObject=function(){return{}},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(g){return g===void 0&&(g="type.googleapis.com"),g+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData"},t})(),a.SideBySideSurveyResponseEventData=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.responseDwellTimeMsString=c.string();break}case 2:{f.selectedResponseId=c.string();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData)return c;var I=new p.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData;return c.responseDwellTimeMsString!=null&&(I.responseDwellTimeMsString=String(c.responseDwellTimeMsString)),c.selectedResponseId!=null&&(I.selectedResponseId=String(c.selectedResponseId)),I},t.toObject=function(c,I){I||(I={});var d={};return c.responseDwellTimeMsString!=null&&c.hasOwnProperty("responseDwellTimeMsString")&&(d.responseDwellTimeMsString=c.responseDwellTimeMsString,I.oneofs&&(d._responseDwellTimeMsString="responseDwellTimeMsString")),c.selectedResponseId!=null&&c.hasOwnProperty("selectedResponseId")&&(d.selectedResponseId=c.selectedResponseId,I.oneofs&&(d._selectedResponseId="selectedResponseId")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData"},t})(),a})(),i})(),r})(),n.BotImagineMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.imagineType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotImagineMetadata)return e;var a=new p.proto.BotImagineMetadata;switch(e.imagineType){default:if(typeof e.imagineType=="number"){a.imagineType=e.imagineType;break}break;case"UNKNOWN":case 0:a.imagineType=0;break;case"IMAGINE":case 1:a.imagineType=1;break;case"MEMU":case 2:a.imagineType=2;break;case"FLASH":case 3:a.imagineType=3;break;case"EDIT":case 4:a.imagineType=4;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.imagineType!=null&&e.hasOwnProperty("imagineType")&&(A.imagineType=a.enums===String?p.proto.BotImagineMetadata.ImagineType[e.imagineType]===void 0?e.imagineType:p.proto.BotImagineMetadata.ImagineType[e.imagineType]:e.imagineType,a.oneofs&&(A._imagineType="imagineType")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotImagineMetadata"},r.ImagineType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="IMAGINE"]=1,e[i[2]="MEMU"]=2,e[i[3]="FLASH"]=3,e[i[4]="EDIT"]=4,e})(),r})(),n.BotLinkedAccount=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotLinkedAccount)return e;var a=new p.proto.BotLinkedAccount;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"BOT_LINKED_ACCOUNT_TYPE_1P":case 0:a.type=0;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.BotLinkedAccount.BotLinkedAccountType[e.type]===void 0?e.type:p.proto.BotLinkedAccount.BotLinkedAccountType[e.type]:e.type,a.oneofs&&(A._type="type")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotLinkedAccount"},r.BotLinkedAccountType=(function(){let i={},e=Object.create(i);return e[i[0]="BOT_LINKED_ACCOUNT_TYPE_1P"]=0,e})(),r})(),n.BotLinkedAccountsMetadata=(function(){function r(i){if(this.accounts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(p.proto.BotLinkedAccount.decode(e,e.uint32()));break}case 2:{s.acAuthTokens=e.bytes();break}case 3:{s.acErrorCode=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotLinkedAccountsMetadata)return e;var a=new p.proto.BotLinkedAccountsMetadata;if(e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: array expected");a.accounts=[];for(var A=0;A=0&&(a.acAuthTokens=e.acAuthTokens)),e.acErrorCode!=null&&(a.acErrorCode=e.acErrorCode|0),a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.accounts=[]),e.accounts&&e.accounts.length){A.accounts=[];for(var t=0;t>>3){case 1:{s.fileSha256=e.string();break}case 2:{s.mediaKey=e.string();break}case 3:{s.fileEncSha256=e.string();break}case 4:{s.directPath=e.string();break}case 5:{s.mediaKeyTimestamp=e.int64();break}case 6:{s.mimetype=e.string();break}case 7:{s.orientationType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotMediaMetadata)return e;var a=new p.proto.BotMediaMetadata;switch(e.fileSha256!=null&&(a.fileSha256=String(e.fileSha256)),e.mediaKey!=null&&(a.mediaKey=String(e.mediaKey)),e.fileEncSha256!=null&&(a.fileEncSha256=String(e.fileEncSha256)),e.directPath!=null&&(a.directPath=String(e.directPath)),e.mediaKeyTimestamp!=null&&(l.Long?(a.mediaKeyTimestamp=l.Long.fromValue(e.mediaKeyTimestamp)).unsigned=!1:typeof e.mediaKeyTimestamp=="string"?a.mediaKeyTimestamp=parseInt(e.mediaKeyTimestamp,10):typeof e.mediaKeyTimestamp=="number"?a.mediaKeyTimestamp=e.mediaKeyTimestamp:typeof e.mediaKeyTimestamp=="object"&&(a.mediaKeyTimestamp=new l.LongBits(e.mediaKeyTimestamp.low>>>0,e.mediaKeyTimestamp.high>>>0).toNumber())),e.mimetype!=null&&(a.mimetype=String(e.mimetype)),e.orientationType){default:if(typeof e.orientationType=="number"){a.orientationType=e.orientationType;break}break;case"CENTER":case 1:a.orientationType=1;break;case"LEFT":case 2:a.orientationType=2;break;case"RIGHT":case 3:a.orientationType=3;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=e.fileSha256,a.oneofs&&(A._fileSha256="fileSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=e.mediaKey,a.oneofs&&(A._mediaKey="mediaKey")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.mediaKeyTimestamp!=null&&e.hasOwnProperty("mediaKeyTimestamp")&&(typeof e.mediaKeyTimestamp=="number"?A.mediaKeyTimestamp=a.longs===String?String(e.mediaKeyTimestamp):e.mediaKeyTimestamp:A.mediaKeyTimestamp=a.longs===String?oe(e.mediaKeyTimestamp):a.longs===Number?ne(e.mediaKeyTimestamp):e.mediaKeyTimestamp,a.oneofs&&(A._mediaKeyTimestamp="mediaKeyTimestamp")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,a.oneofs&&(A._mimetype="mimetype")),e.orientationType!=null&&e.hasOwnProperty("orientationType")&&(A.orientationType=a.enums===String?p.proto.BotMediaMetadata.OrientationType[e.orientationType]===void 0?e.orientationType:p.proto.BotMediaMetadata.OrientationType[e.orientationType]:e.orientationType,a.oneofs&&(A._orientationType="orientationType")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMediaMetadata"},r.OrientationType=(function(){let i={},e=Object.create(i);return e[i[1]="CENTER"]=1,e[i[2]="LEFT"]=2,e[i[3]="RIGHT"]=3,e})(),r})(),n.BotMemoryFact=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.fact=e.string();break}case 2:{s.factId=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotMemoryFact)return e;var a=new p.proto.BotMemoryFact;return e.fact!=null&&(a.fact=String(e.fact)),e.factId!=null&&(a.factId=String(e.factId)),a},r.toObject=function(e,a){a||(a={});var A={};return e.fact!=null&&e.hasOwnProperty("fact")&&(A.fact=e.fact,a.oneofs&&(A._fact="fact")),e.factId!=null&&e.hasOwnProperty("factId")&&(A.factId=e.factId,a.oneofs&&(A._factId="factId")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMemoryFact"},r})(),n.BotMemoryMetadata=(function(){function r(i){if(this.addedFacts=[],this.removedFacts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.addedFacts&&s.addedFacts.length||(s.addedFacts=[]),s.addedFacts.push(p.proto.BotMemoryFact.decode(e,e.uint32()));break}case 2:{s.removedFacts&&s.removedFacts.length||(s.removedFacts=[]),s.removedFacts.push(p.proto.BotMemoryFact.decode(e,e.uint32()));break}case 3:{s.disclaimer=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotMemoryMetadata)return e;var a=new p.proto.BotMemoryMetadata;if(e.addedFacts){if(!Array.isArray(e.addedFacts))throw TypeError(".proto.BotMemoryMetadata.addedFacts: array expected");a.addedFacts=[];for(var A=0;A>>3){case 1:{t.faceImages&&t.faceImages.length||(t.faceImages=[]),t.faceImages.push(p.proto.BotMediaMetadata.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.BotMemuMetadata)return i;var e=new p.proto.BotMemuMetadata;if(i.faceImages){if(!Array.isArray(i.faceImages))throw TypeError(".proto.BotMemuMetadata.faceImages: array expected");e.faceImages=[];for(var a=0;a>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotMessageOrigin)return e;var a=new p.proto.BotMessageOrigin;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED":case 0:a.type=0;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.BotMessageOrigin.BotMessageOriginType[e.type]===void 0?e.type:p.proto.BotMessageOrigin.BotMessageOriginType[e.type]:e.type,a.oneofs&&(A._type="type")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageOrigin"},r.BotMessageOriginType=(function(){let i={},e=Object.create(i);return e[i[0]="BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED"]=0,e})(),r})(),n.BotMessageOriginMetadata=(function(){function r(o){if(this.origins=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{t.origins&&t.origins.length||(t.origins=[]),t.origins.push(p.proto.BotMessageOrigin.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.BotMessageOriginMetadata)return i;var e=new p.proto.BotMessageOriginMetadata;if(i.origins){if(!Array.isArray(i.origins))throw TypeError(".proto.BotMessageOriginMetadata.origins: array expected");e.origins=[];for(var a=0;a>>3){case 1:{s.botEntryPointOrigin=e.int32();break}case 2:{s.forwardScore=e.uint32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotMessageSharingInfo)return e;var a=new p.proto.BotMessageSharingInfo;switch(e.botEntryPointOrigin){default:if(typeof e.botEntryPointOrigin=="number"){a.botEntryPointOrigin=e.botEntryPointOrigin;break}break;case"UNDEFINED_ENTRY_POINT":case 0:a.botEntryPointOrigin=0;break;case"FAVICON":case 1:a.botEntryPointOrigin=1;break;case"CHATLIST":case 2:a.botEntryPointOrigin=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:a.botEntryPointOrigin=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:a.botEntryPointOrigin=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:a.botEntryPointOrigin=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:a.botEntryPointOrigin=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:a.botEntryPointOrigin=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:a.botEntryPointOrigin=8;break;case"AIVOICE_SEARCH_BAR":case 9:a.botEntryPointOrigin=9;break;case"AIVOICE_FAVICON":case 10:a.botEntryPointOrigin=10;break;case"AISTUDIO":case 11:a.botEntryPointOrigin=11;break;case"DEEPLINK":case 12:a.botEntryPointOrigin=12;break;case"NOTIFICATION":case 13:a.botEntryPointOrigin=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:a.botEntryPointOrigin=14;break;case"FORWARD":case 15:a.botEntryPointOrigin=15;break;case"APP_SHORTCUT":case 16:a.botEntryPointOrigin=16;break;case"FF_FAMILY":case 17:a.botEntryPointOrigin=17;break;case"AI_TAB":case 18:a.botEntryPointOrigin=18;break;case"AI_HOME":case 19:a.botEntryPointOrigin=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:a.botEntryPointOrigin=20;break;case"AI_DEEPLINK":case 21:a.botEntryPointOrigin=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:a.botEntryPointOrigin=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:a.botEntryPointOrigin=23;break;case"NEW_CHAT_AI_STUDIO":case 24:a.botEntryPointOrigin=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:a.botEntryPointOrigin=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:a.botEntryPointOrigin=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:a.botEntryPointOrigin=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:a.botEntryPointOrigin=28;break;case"INVOKE_META_AI_1ON1":case 29:a.botEntryPointOrigin=29;break;case"INVOKE_META_AI_GROUP":case 30:a.botEntryPointOrigin=30;break;case"META_AI_FORWARD":case 31:a.botEntryPointOrigin=31;break;case"NEW_CHAT_AI_CONTACT":case 32:a.botEntryPointOrigin=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:a.botEntryPointOrigin=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:a.botEntryPointOrigin=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:a.botEntryPointOrigin=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:a.botEntryPointOrigin=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:a.botEntryPointOrigin=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:a.botEntryPointOrigin=38;break}return e.forwardScore!=null&&(a.forwardScore=e.forwardScore>>>0),a},r.toObject=function(e,a){a||(a={});var A={};return e.botEntryPointOrigin!=null&&e.hasOwnProperty("botEntryPointOrigin")&&(A.botEntryPointOrigin=a.enums===String?p.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]===void 0?e.botEntryPointOrigin:p.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]:e.botEntryPointOrigin,a.oneofs&&(A._botEntryPointOrigin="botEntryPointOrigin")),e.forwardScore!=null&&e.hasOwnProperty("forwardScore")&&(A.forwardScore=e.forwardScore,a.oneofs&&(A._forwardScore="forwardScore")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageSharingInfo"},r})(),n.BotMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.avatarMetadata=p.proto.BotAvatarMetadata.decode(e,e.uint32());break}case 2:{s.personaId=e.string();break}case 3:{s.pluginMetadata=p.proto.BotPluginMetadata.decode(e,e.uint32());break}case 4:{s.suggestedPromptMetadata=p.proto.BotSuggestedPromptMetadata.decode(e,e.uint32());break}case 5:{s.invokerJid=e.string();break}case 6:{s.sessionMetadata=p.proto.BotSessionMetadata.decode(e,e.uint32());break}case 7:{s.memuMetadata=p.proto.BotMemuMetadata.decode(e,e.uint32());break}case 8:{s.timezone=e.string();break}case 9:{s.reminderMetadata=p.proto.BotReminderMetadata.decode(e,e.uint32());break}case 10:{s.modelMetadata=p.proto.BotModelMetadata.decode(e,e.uint32());break}case 11:{s.messageDisclaimerText=e.string();break}case 12:{s.progressIndicatorMetadata=p.proto.BotProgressIndicatorMetadata.decode(e,e.uint32());break}case 13:{s.capabilityMetadata=p.proto.BotCapabilityMetadata.decode(e,e.uint32());break}case 14:{s.imagineMetadata=p.proto.BotImagineMetadata.decode(e,e.uint32());break}case 15:{s.memoryMetadata=p.proto.BotMemoryMetadata.decode(e,e.uint32());break}case 16:{s.renderingMetadata=p.proto.BotRenderingMetadata.decode(e,e.uint32());break}case 17:{s.botMetricsMetadata=p.proto.BotMetricsMetadata.decode(e,e.uint32());break}case 18:{s.botLinkedAccountsMetadata=p.proto.BotLinkedAccountsMetadata.decode(e,e.uint32());break}case 19:{s.richResponseSourcesMetadata=p.proto.BotSourcesMetadata.decode(e,e.uint32());break}case 20:{s.aiConversationContext=e.bytes();break}case 21:{s.botPromotionMessageMetadata=p.proto.BotPromotionMessageMetadata.decode(e,e.uint32());break}case 22:{s.botModeSelectionMetadata=p.proto.BotModeSelectionMetadata.decode(e,e.uint32());break}case 23:{s.botQuotaMetadata=p.proto.BotQuotaMetadata.decode(e,e.uint32());break}case 24:{s.botAgeCollectionMetadata=p.proto.BotAgeCollectionMetadata.decode(e,e.uint32());break}case 25:{s.conversationStarterPromptId=e.string();break}case 26:{s.botResponseId=e.string();break}case 27:{s.verificationMetadata=p.proto.BotSignatureVerificationMetadata.decode(e,e.uint32());break}case 28:{s.unifiedResponseMutation=p.proto.BotUnifiedResponseMutation.decode(e,e.uint32());break}case 29:{s.botMessageOriginMetadata=p.proto.BotMessageOriginMetadata.decode(e,e.uint32());break}case 30:{s.inThreadSurveyMetadata=p.proto.InThreadSurveyMetadata.decode(e,e.uint32());break}case 31:{s.botThreadInfo=p.proto.AIThreadInfo.decode(e,e.uint32());break}case 32:{s.regenerateMetadata=p.proto.AIRegenerateMetadata.decode(e,e.uint32());break}case 33:{s.sessionTransparencyMetadata=p.proto.SessionTransparencyMetadata.decode(e,e.uint32());break}case 999:{s.internalMetadata=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotMetadata)return e;var a=new p.proto.BotMetadata;if(e.avatarMetadata!=null){if(typeof e.avatarMetadata!="object")throw TypeError(".proto.BotMetadata.avatarMetadata: object expected");a.avatarMetadata=p.proto.BotAvatarMetadata.fromObject(e.avatarMetadata)}if(e.personaId!=null&&(a.personaId=String(e.personaId)),e.pluginMetadata!=null){if(typeof e.pluginMetadata!="object")throw TypeError(".proto.BotMetadata.pluginMetadata: object expected");a.pluginMetadata=p.proto.BotPluginMetadata.fromObject(e.pluginMetadata)}if(e.suggestedPromptMetadata!=null){if(typeof e.suggestedPromptMetadata!="object")throw TypeError(".proto.BotMetadata.suggestedPromptMetadata: object expected");a.suggestedPromptMetadata=p.proto.BotSuggestedPromptMetadata.fromObject(e.suggestedPromptMetadata)}if(e.invokerJid!=null&&(a.invokerJid=String(e.invokerJid)),e.sessionMetadata!=null){if(typeof e.sessionMetadata!="object")throw TypeError(".proto.BotMetadata.sessionMetadata: object expected");a.sessionMetadata=p.proto.BotSessionMetadata.fromObject(e.sessionMetadata)}if(e.memuMetadata!=null){if(typeof e.memuMetadata!="object")throw TypeError(".proto.BotMetadata.memuMetadata: object expected");a.memuMetadata=p.proto.BotMemuMetadata.fromObject(e.memuMetadata)}if(e.timezone!=null&&(a.timezone=String(e.timezone)),e.reminderMetadata!=null){if(typeof e.reminderMetadata!="object")throw TypeError(".proto.BotMetadata.reminderMetadata: object expected");a.reminderMetadata=p.proto.BotReminderMetadata.fromObject(e.reminderMetadata)}if(e.modelMetadata!=null){if(typeof e.modelMetadata!="object")throw TypeError(".proto.BotMetadata.modelMetadata: object expected");a.modelMetadata=p.proto.BotModelMetadata.fromObject(e.modelMetadata)}if(e.messageDisclaimerText!=null&&(a.messageDisclaimerText=String(e.messageDisclaimerText)),e.progressIndicatorMetadata!=null){if(typeof e.progressIndicatorMetadata!="object")throw TypeError(".proto.BotMetadata.progressIndicatorMetadata: object expected");a.progressIndicatorMetadata=p.proto.BotProgressIndicatorMetadata.fromObject(e.progressIndicatorMetadata)}if(e.capabilityMetadata!=null){if(typeof e.capabilityMetadata!="object")throw TypeError(".proto.BotMetadata.capabilityMetadata: object expected");a.capabilityMetadata=p.proto.BotCapabilityMetadata.fromObject(e.capabilityMetadata)}if(e.imagineMetadata!=null){if(typeof e.imagineMetadata!="object")throw TypeError(".proto.BotMetadata.imagineMetadata: object expected");a.imagineMetadata=p.proto.BotImagineMetadata.fromObject(e.imagineMetadata)}if(e.memoryMetadata!=null){if(typeof e.memoryMetadata!="object")throw TypeError(".proto.BotMetadata.memoryMetadata: object expected");a.memoryMetadata=p.proto.BotMemoryMetadata.fromObject(e.memoryMetadata)}if(e.renderingMetadata!=null){if(typeof e.renderingMetadata!="object")throw TypeError(".proto.BotMetadata.renderingMetadata: object expected");a.renderingMetadata=p.proto.BotRenderingMetadata.fromObject(e.renderingMetadata)}if(e.botMetricsMetadata!=null){if(typeof e.botMetricsMetadata!="object")throw TypeError(".proto.BotMetadata.botMetricsMetadata: object expected");a.botMetricsMetadata=p.proto.BotMetricsMetadata.fromObject(e.botMetricsMetadata)}if(e.botLinkedAccountsMetadata!=null){if(typeof e.botLinkedAccountsMetadata!="object")throw TypeError(".proto.BotMetadata.botLinkedAccountsMetadata: object expected");a.botLinkedAccountsMetadata=p.proto.BotLinkedAccountsMetadata.fromObject(e.botLinkedAccountsMetadata)}if(e.richResponseSourcesMetadata!=null){if(typeof e.richResponseSourcesMetadata!="object")throw TypeError(".proto.BotMetadata.richResponseSourcesMetadata: object expected");a.richResponseSourcesMetadata=p.proto.BotSourcesMetadata.fromObject(e.richResponseSourcesMetadata)}if(e.aiConversationContext!=null&&(typeof e.aiConversationContext=="string"?l.base64.decode(e.aiConversationContext,a.aiConversationContext=l.newBuffer(l.base64.length(e.aiConversationContext)),0):e.aiConversationContext.length>=0&&(a.aiConversationContext=e.aiConversationContext)),e.botPromotionMessageMetadata!=null){if(typeof e.botPromotionMessageMetadata!="object")throw TypeError(".proto.BotMetadata.botPromotionMessageMetadata: object expected");a.botPromotionMessageMetadata=p.proto.BotPromotionMessageMetadata.fromObject(e.botPromotionMessageMetadata)}if(e.botModeSelectionMetadata!=null){if(typeof e.botModeSelectionMetadata!="object")throw TypeError(".proto.BotMetadata.botModeSelectionMetadata: object expected");a.botModeSelectionMetadata=p.proto.BotModeSelectionMetadata.fromObject(e.botModeSelectionMetadata)}if(e.botQuotaMetadata!=null){if(typeof e.botQuotaMetadata!="object")throw TypeError(".proto.BotMetadata.botQuotaMetadata: object expected");a.botQuotaMetadata=p.proto.BotQuotaMetadata.fromObject(e.botQuotaMetadata)}if(e.botAgeCollectionMetadata!=null){if(typeof e.botAgeCollectionMetadata!="object")throw TypeError(".proto.BotMetadata.botAgeCollectionMetadata: object expected");a.botAgeCollectionMetadata=p.proto.BotAgeCollectionMetadata.fromObject(e.botAgeCollectionMetadata)}if(e.conversationStarterPromptId!=null&&(a.conversationStarterPromptId=String(e.conversationStarterPromptId)),e.botResponseId!=null&&(a.botResponseId=String(e.botResponseId)),e.verificationMetadata!=null){if(typeof e.verificationMetadata!="object")throw TypeError(".proto.BotMetadata.verificationMetadata: object expected");a.verificationMetadata=p.proto.BotSignatureVerificationMetadata.fromObject(e.verificationMetadata)}if(e.unifiedResponseMutation!=null){if(typeof e.unifiedResponseMutation!="object")throw TypeError(".proto.BotMetadata.unifiedResponseMutation: object expected");a.unifiedResponseMutation=p.proto.BotUnifiedResponseMutation.fromObject(e.unifiedResponseMutation)}if(e.botMessageOriginMetadata!=null){if(typeof e.botMessageOriginMetadata!="object")throw TypeError(".proto.BotMetadata.botMessageOriginMetadata: object expected");a.botMessageOriginMetadata=p.proto.BotMessageOriginMetadata.fromObject(e.botMessageOriginMetadata)}if(e.inThreadSurveyMetadata!=null){if(typeof e.inThreadSurveyMetadata!="object")throw TypeError(".proto.BotMetadata.inThreadSurveyMetadata: object expected");a.inThreadSurveyMetadata=p.proto.InThreadSurveyMetadata.fromObject(e.inThreadSurveyMetadata)}if(e.botThreadInfo!=null){if(typeof e.botThreadInfo!="object")throw TypeError(".proto.BotMetadata.botThreadInfo: object expected");a.botThreadInfo=p.proto.AIThreadInfo.fromObject(e.botThreadInfo)}if(e.regenerateMetadata!=null){if(typeof e.regenerateMetadata!="object")throw TypeError(".proto.BotMetadata.regenerateMetadata: object expected");a.regenerateMetadata=p.proto.AIRegenerateMetadata.fromObject(e.regenerateMetadata)}if(e.sessionTransparencyMetadata!=null){if(typeof e.sessionTransparencyMetadata!="object")throw TypeError(".proto.BotMetadata.sessionTransparencyMetadata: object expected");a.sessionTransparencyMetadata=p.proto.SessionTransparencyMetadata.fromObject(e.sessionTransparencyMetadata)}return e.internalMetadata!=null&&(typeof e.internalMetadata=="string"?l.base64.decode(e.internalMetadata,a.internalMetadata=l.newBuffer(l.base64.length(e.internalMetadata)),0):e.internalMetadata.length>=0&&(a.internalMetadata=e.internalMetadata)),a},r.toObject=function(e,a){a||(a={});var A={};return e.avatarMetadata!=null&&e.hasOwnProperty("avatarMetadata")&&(A.avatarMetadata=p.proto.BotAvatarMetadata.toObject(e.avatarMetadata,a),a.oneofs&&(A._avatarMetadata="avatarMetadata")),e.personaId!=null&&e.hasOwnProperty("personaId")&&(A.personaId=e.personaId,a.oneofs&&(A._personaId="personaId")),e.pluginMetadata!=null&&e.hasOwnProperty("pluginMetadata")&&(A.pluginMetadata=p.proto.BotPluginMetadata.toObject(e.pluginMetadata,a),a.oneofs&&(A._pluginMetadata="pluginMetadata")),e.suggestedPromptMetadata!=null&&e.hasOwnProperty("suggestedPromptMetadata")&&(A.suggestedPromptMetadata=p.proto.BotSuggestedPromptMetadata.toObject(e.suggestedPromptMetadata,a),a.oneofs&&(A._suggestedPromptMetadata="suggestedPromptMetadata")),e.invokerJid!=null&&e.hasOwnProperty("invokerJid")&&(A.invokerJid=e.invokerJid,a.oneofs&&(A._invokerJid="invokerJid")),e.sessionMetadata!=null&&e.hasOwnProperty("sessionMetadata")&&(A.sessionMetadata=p.proto.BotSessionMetadata.toObject(e.sessionMetadata,a),a.oneofs&&(A._sessionMetadata="sessionMetadata")),e.memuMetadata!=null&&e.hasOwnProperty("memuMetadata")&&(A.memuMetadata=p.proto.BotMemuMetadata.toObject(e.memuMetadata,a),a.oneofs&&(A._memuMetadata="memuMetadata")),e.timezone!=null&&e.hasOwnProperty("timezone")&&(A.timezone=e.timezone,a.oneofs&&(A._timezone="timezone")),e.reminderMetadata!=null&&e.hasOwnProperty("reminderMetadata")&&(A.reminderMetadata=p.proto.BotReminderMetadata.toObject(e.reminderMetadata,a),a.oneofs&&(A._reminderMetadata="reminderMetadata")),e.modelMetadata!=null&&e.hasOwnProperty("modelMetadata")&&(A.modelMetadata=p.proto.BotModelMetadata.toObject(e.modelMetadata,a),a.oneofs&&(A._modelMetadata="modelMetadata")),e.messageDisclaimerText!=null&&e.hasOwnProperty("messageDisclaimerText")&&(A.messageDisclaimerText=e.messageDisclaimerText,a.oneofs&&(A._messageDisclaimerText="messageDisclaimerText")),e.progressIndicatorMetadata!=null&&e.hasOwnProperty("progressIndicatorMetadata")&&(A.progressIndicatorMetadata=p.proto.BotProgressIndicatorMetadata.toObject(e.progressIndicatorMetadata,a),a.oneofs&&(A._progressIndicatorMetadata="progressIndicatorMetadata")),e.capabilityMetadata!=null&&e.hasOwnProperty("capabilityMetadata")&&(A.capabilityMetadata=p.proto.BotCapabilityMetadata.toObject(e.capabilityMetadata,a),a.oneofs&&(A._capabilityMetadata="capabilityMetadata")),e.imagineMetadata!=null&&e.hasOwnProperty("imagineMetadata")&&(A.imagineMetadata=p.proto.BotImagineMetadata.toObject(e.imagineMetadata,a),a.oneofs&&(A._imagineMetadata="imagineMetadata")),e.memoryMetadata!=null&&e.hasOwnProperty("memoryMetadata")&&(A.memoryMetadata=p.proto.BotMemoryMetadata.toObject(e.memoryMetadata,a),a.oneofs&&(A._memoryMetadata="memoryMetadata")),e.renderingMetadata!=null&&e.hasOwnProperty("renderingMetadata")&&(A.renderingMetadata=p.proto.BotRenderingMetadata.toObject(e.renderingMetadata,a),a.oneofs&&(A._renderingMetadata="renderingMetadata")),e.botMetricsMetadata!=null&&e.hasOwnProperty("botMetricsMetadata")&&(A.botMetricsMetadata=p.proto.BotMetricsMetadata.toObject(e.botMetricsMetadata,a),a.oneofs&&(A._botMetricsMetadata="botMetricsMetadata")),e.botLinkedAccountsMetadata!=null&&e.hasOwnProperty("botLinkedAccountsMetadata")&&(A.botLinkedAccountsMetadata=p.proto.BotLinkedAccountsMetadata.toObject(e.botLinkedAccountsMetadata,a),a.oneofs&&(A._botLinkedAccountsMetadata="botLinkedAccountsMetadata")),e.richResponseSourcesMetadata!=null&&e.hasOwnProperty("richResponseSourcesMetadata")&&(A.richResponseSourcesMetadata=p.proto.BotSourcesMetadata.toObject(e.richResponseSourcesMetadata,a),a.oneofs&&(A._richResponseSourcesMetadata="richResponseSourcesMetadata")),e.aiConversationContext!=null&&e.hasOwnProperty("aiConversationContext")&&(A.aiConversationContext=a.bytes===String?l.base64.encode(e.aiConversationContext,0,e.aiConversationContext.length):a.bytes===Array?Array.prototype.slice.call(e.aiConversationContext):e.aiConversationContext,a.oneofs&&(A._aiConversationContext="aiConversationContext")),e.botPromotionMessageMetadata!=null&&e.hasOwnProperty("botPromotionMessageMetadata")&&(A.botPromotionMessageMetadata=p.proto.BotPromotionMessageMetadata.toObject(e.botPromotionMessageMetadata,a),a.oneofs&&(A._botPromotionMessageMetadata="botPromotionMessageMetadata")),e.botModeSelectionMetadata!=null&&e.hasOwnProperty("botModeSelectionMetadata")&&(A.botModeSelectionMetadata=p.proto.BotModeSelectionMetadata.toObject(e.botModeSelectionMetadata,a),a.oneofs&&(A._botModeSelectionMetadata="botModeSelectionMetadata")),e.botQuotaMetadata!=null&&e.hasOwnProperty("botQuotaMetadata")&&(A.botQuotaMetadata=p.proto.BotQuotaMetadata.toObject(e.botQuotaMetadata,a),a.oneofs&&(A._botQuotaMetadata="botQuotaMetadata")),e.botAgeCollectionMetadata!=null&&e.hasOwnProperty("botAgeCollectionMetadata")&&(A.botAgeCollectionMetadata=p.proto.BotAgeCollectionMetadata.toObject(e.botAgeCollectionMetadata,a),a.oneofs&&(A._botAgeCollectionMetadata="botAgeCollectionMetadata")),e.conversationStarterPromptId!=null&&e.hasOwnProperty("conversationStarterPromptId")&&(A.conversationStarterPromptId=e.conversationStarterPromptId,a.oneofs&&(A._conversationStarterPromptId="conversationStarterPromptId")),e.botResponseId!=null&&e.hasOwnProperty("botResponseId")&&(A.botResponseId=e.botResponseId,a.oneofs&&(A._botResponseId="botResponseId")),e.verificationMetadata!=null&&e.hasOwnProperty("verificationMetadata")&&(A.verificationMetadata=p.proto.BotSignatureVerificationMetadata.toObject(e.verificationMetadata,a),a.oneofs&&(A._verificationMetadata="verificationMetadata")),e.unifiedResponseMutation!=null&&e.hasOwnProperty("unifiedResponseMutation")&&(A.unifiedResponseMutation=p.proto.BotUnifiedResponseMutation.toObject(e.unifiedResponseMutation,a),a.oneofs&&(A._unifiedResponseMutation="unifiedResponseMutation")),e.botMessageOriginMetadata!=null&&e.hasOwnProperty("botMessageOriginMetadata")&&(A.botMessageOriginMetadata=p.proto.BotMessageOriginMetadata.toObject(e.botMessageOriginMetadata,a),a.oneofs&&(A._botMessageOriginMetadata="botMessageOriginMetadata")),e.inThreadSurveyMetadata!=null&&e.hasOwnProperty("inThreadSurveyMetadata")&&(A.inThreadSurveyMetadata=p.proto.InThreadSurveyMetadata.toObject(e.inThreadSurveyMetadata,a),a.oneofs&&(A._inThreadSurveyMetadata="inThreadSurveyMetadata")),e.botThreadInfo!=null&&e.hasOwnProperty("botThreadInfo")&&(A.botThreadInfo=p.proto.AIThreadInfo.toObject(e.botThreadInfo,a),a.oneofs&&(A._botThreadInfo="botThreadInfo")),e.regenerateMetadata!=null&&e.hasOwnProperty("regenerateMetadata")&&(A.regenerateMetadata=p.proto.AIRegenerateMetadata.toObject(e.regenerateMetadata,a),a.oneofs&&(A._regenerateMetadata="regenerateMetadata")),e.sessionTransparencyMetadata!=null&&e.hasOwnProperty("sessionTransparencyMetadata")&&(A.sessionTransparencyMetadata=p.proto.SessionTransparencyMetadata.toObject(e.sessionTransparencyMetadata,a),a.oneofs&&(A._sessionTransparencyMetadata="sessionTransparencyMetadata")),e.internalMetadata!=null&&e.hasOwnProperty("internalMetadata")&&(A.internalMetadata=a.bytes===String?l.base64.encode(e.internalMetadata,0,e.internalMetadata.length):a.bytes===Array?Array.prototype.slice.call(e.internalMetadata):e.internalMetadata,a.oneofs&&(A._internalMetadata="internalMetadata")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetadata"},r})(),n.BotMetricsEntryPoint=(function(){let r={},o=Object.create(r);return o[r[0]="UNDEFINED_ENTRY_POINT"]=0,o[r[1]="FAVICON"]=1,o[r[2]="CHATLIST"]=2,o[r[3]="AISEARCH_NULL_STATE_PAPER_PLANE"]=3,o[r[4]="AISEARCH_NULL_STATE_SUGGESTION"]=4,o[r[5]="AISEARCH_TYPE_AHEAD_SUGGESTION"]=5,o[r[6]="AISEARCH_TYPE_AHEAD_PAPER_PLANE"]=6,o[r[7]="AISEARCH_TYPE_AHEAD_RESULT_CHATLIST"]=7,o[r[8]="AISEARCH_TYPE_AHEAD_RESULT_MESSAGES"]=8,o[r[9]="AIVOICE_SEARCH_BAR"]=9,o[r[10]="AIVOICE_FAVICON"]=10,o[r[11]="AISTUDIO"]=11,o[r[12]="DEEPLINK"]=12,o[r[13]="NOTIFICATION"]=13,o[r[14]="PROFILE_MESSAGE_BUTTON"]=14,o[r[15]="FORWARD"]=15,o[r[16]="APP_SHORTCUT"]=16,o[r[17]="FF_FAMILY"]=17,o[r[18]="AI_TAB"]=18,o[r[19]="AI_HOME"]=19,o[r[20]="AI_DEEPLINK_IMMERSIVE"]=20,o[r[21]="AI_DEEPLINK"]=21,o[r[22]="META_AI_CHAT_SHORTCUT_AI_STUDIO"]=22,o[r[23]="UGC_CHAT_SHORTCUT_AI_STUDIO"]=23,o[r[24]="NEW_CHAT_AI_STUDIO"]=24,o[r[25]="AIVOICE_FAVICON_CALL_HISTORY"]=25,o[r[26]="ASK_META_AI_CONTEXT_MENU"]=26,o[r[27]="ASK_META_AI_CONTEXT_MENU_1ON1"]=27,o[r[28]="ASK_META_AI_CONTEXT_MENU_GROUP"]=28,o[r[29]="INVOKE_META_AI_1ON1"]=29,o[r[30]="INVOKE_META_AI_GROUP"]=30,o[r[31]="META_AI_FORWARD"]=31,o[r[32]="NEW_CHAT_AI_CONTACT"]=32,o[r[33]="MESSAGE_QUICK_ACTION_1_ON_1_CHAT"]=33,o[r[34]="MESSAGE_QUICK_ACTION_GROUP_CHAT"]=34,o[r[35]="ATTACHMENT_TRAY_1_ON_1_CHAT"]=35,o[r[36]="ATTACHMENT_TRAY_GROUP_CHAT"]=36,o[r[37]="ASK_META_AI_MEDIA_VIEWER_1ON1"]=37,o[r[38]="ASK_META_AI_MEDIA_VIEWER_GROUP"]=38,o})(),n.BotMetricsMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.destinationId=e.string();break}case 2:{s.destinationEntryPoint=e.int32();break}case 3:{s.threadOrigin=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotMetricsMetadata)return e;var a=new p.proto.BotMetricsMetadata;switch(e.destinationId!=null&&(a.destinationId=String(e.destinationId)),e.destinationEntryPoint){default:if(typeof e.destinationEntryPoint=="number"){a.destinationEntryPoint=e.destinationEntryPoint;break}break;case"UNDEFINED_ENTRY_POINT":case 0:a.destinationEntryPoint=0;break;case"FAVICON":case 1:a.destinationEntryPoint=1;break;case"CHATLIST":case 2:a.destinationEntryPoint=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:a.destinationEntryPoint=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:a.destinationEntryPoint=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:a.destinationEntryPoint=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:a.destinationEntryPoint=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:a.destinationEntryPoint=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:a.destinationEntryPoint=8;break;case"AIVOICE_SEARCH_BAR":case 9:a.destinationEntryPoint=9;break;case"AIVOICE_FAVICON":case 10:a.destinationEntryPoint=10;break;case"AISTUDIO":case 11:a.destinationEntryPoint=11;break;case"DEEPLINK":case 12:a.destinationEntryPoint=12;break;case"NOTIFICATION":case 13:a.destinationEntryPoint=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:a.destinationEntryPoint=14;break;case"FORWARD":case 15:a.destinationEntryPoint=15;break;case"APP_SHORTCUT":case 16:a.destinationEntryPoint=16;break;case"FF_FAMILY":case 17:a.destinationEntryPoint=17;break;case"AI_TAB":case 18:a.destinationEntryPoint=18;break;case"AI_HOME":case 19:a.destinationEntryPoint=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:a.destinationEntryPoint=20;break;case"AI_DEEPLINK":case 21:a.destinationEntryPoint=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:a.destinationEntryPoint=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:a.destinationEntryPoint=23;break;case"NEW_CHAT_AI_STUDIO":case 24:a.destinationEntryPoint=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:a.destinationEntryPoint=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:a.destinationEntryPoint=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:a.destinationEntryPoint=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:a.destinationEntryPoint=28;break;case"INVOKE_META_AI_1ON1":case 29:a.destinationEntryPoint=29;break;case"INVOKE_META_AI_GROUP":case 30:a.destinationEntryPoint=30;break;case"META_AI_FORWARD":case 31:a.destinationEntryPoint=31;break;case"NEW_CHAT_AI_CONTACT":case 32:a.destinationEntryPoint=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:a.destinationEntryPoint=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:a.destinationEntryPoint=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:a.destinationEntryPoint=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:a.destinationEntryPoint=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:a.destinationEntryPoint=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:a.destinationEntryPoint=38;break}switch(e.threadOrigin){default:if(typeof e.threadOrigin=="number"){a.threadOrigin=e.threadOrigin;break}break;case"AI_TAB_THREAD":case 1:a.threadOrigin=1;break;case"AI_HOME_THREAD":case 2:a.threadOrigin=2;break;case"AI_DEEPLINK_IMMERSIVE_THREAD":case 3:a.threadOrigin=3;break;case"AI_DEEPLINK_THREAD":case 4:a.threadOrigin=4;break;case"ASK_META_AI_CONTEXT_MENU_THREAD":case 5:a.threadOrigin=5;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.destinationId!=null&&e.hasOwnProperty("destinationId")&&(A.destinationId=e.destinationId,a.oneofs&&(A._destinationId="destinationId")),e.destinationEntryPoint!=null&&e.hasOwnProperty("destinationEntryPoint")&&(A.destinationEntryPoint=a.enums===String?p.proto.BotMetricsEntryPoint[e.destinationEntryPoint]===void 0?e.destinationEntryPoint:p.proto.BotMetricsEntryPoint[e.destinationEntryPoint]:e.destinationEntryPoint,a.oneofs&&(A._destinationEntryPoint="destinationEntryPoint")),e.threadOrigin!=null&&e.hasOwnProperty("threadOrigin")&&(A.threadOrigin=a.enums===String?p.proto.BotMetricsThreadEntryPoint[e.threadOrigin]===void 0?e.threadOrigin:p.proto.BotMetricsThreadEntryPoint[e.threadOrigin]:e.threadOrigin,a.oneofs&&(A._threadOrigin="threadOrigin")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetricsMetadata"},r})(),n.BotMetricsThreadEntryPoint=(function(){let r={},o=Object.create(r);return o[r[1]="AI_TAB_THREAD"]=1,o[r[2]="AI_HOME_THREAD"]=2,o[r[3]="AI_DEEPLINK_IMMERSIVE_THREAD"]=3,o[r[4]="AI_DEEPLINK_THREAD"]=4,o[r[5]="ASK_META_AI_CONTEXT_MENU_THREAD"]=5,o})(),n.BotModeSelectionMetadata=(function(){function r(o){if(this.mode=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{if(t.mode&&t.mode.length||(t.mode=[]),(s&7)===2)for(var g=i.uint32()+i.pos;i.pos>>3){case 1:{s.modelType=e.int32();break}case 2:{s.premiumModelStatus=e.int32();break}case 3:{s.modelNameOverride=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotModelMetadata)return e;var a=new p.proto.BotModelMetadata;switch(e.modelType){default:if(typeof e.modelType=="number"){a.modelType=e.modelType;break}break;case"UNKNOWN_TYPE":case 0:a.modelType=0;break;case"LLAMA_PROD":case 1:a.modelType=1;break;case"LLAMA_PROD_PREMIUM":case 2:a.modelType=2;break}switch(e.premiumModelStatus){default:if(typeof e.premiumModelStatus=="number"){a.premiumModelStatus=e.premiumModelStatus;break}break;case"UNKNOWN_STATUS":case 0:a.premiumModelStatus=0;break;case"AVAILABLE":case 1:a.premiumModelStatus=1;break;case"QUOTA_EXCEED_LIMIT":case 2:a.premiumModelStatus=2;break}return e.modelNameOverride!=null&&(a.modelNameOverride=String(e.modelNameOverride)),a},r.toObject=function(e,a){a||(a={});var A={};return e.modelType!=null&&e.hasOwnProperty("modelType")&&(A.modelType=a.enums===String?p.proto.BotModelMetadata.ModelType[e.modelType]===void 0?e.modelType:p.proto.BotModelMetadata.ModelType[e.modelType]:e.modelType,a.oneofs&&(A._modelType="modelType")),e.premiumModelStatus!=null&&e.hasOwnProperty("premiumModelStatus")&&(A.premiumModelStatus=a.enums===String?p.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]===void 0?e.premiumModelStatus:p.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]:e.premiumModelStatus,a.oneofs&&(A._premiumModelStatus="premiumModelStatus")),e.modelNameOverride!=null&&e.hasOwnProperty("modelNameOverride")&&(A.modelNameOverride=e.modelNameOverride,a.oneofs&&(A._modelNameOverride="modelNameOverride")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotModelMetadata"},r.ModelType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_TYPE"]=0,e[i[1]="LLAMA_PROD"]=1,e[i[2]="LLAMA_PROD_PREMIUM"]=2,e})(),r.PremiumModelStatus=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_STATUS"]=0,e[i[1]="AVAILABLE"]=1,e[i[2]="QUOTA_EXCEED_LIMIT"]=2,e})(),r})(),n.BotPluginMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.provider=e.int32();break}case 2:{s.pluginType=e.int32();break}case 3:{s.thumbnailCdnUrl=e.string();break}case 4:{s.profilePhotoCdnUrl=e.string();break}case 5:{s.searchProviderUrl=e.string();break}case 6:{s.referenceIndex=e.uint32();break}case 7:{s.expectedLinksCount=e.uint32();break}case 9:{s.searchQuery=e.string();break}case 10:{s.parentPluginMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 11:{s.deprecatedField=e.int32();break}case 12:{s.parentPluginType=e.int32();break}case 13:{s.faviconCdnUrl=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotPluginMetadata)return e;var a=new p.proto.BotPluginMetadata;switch(e.provider){default:if(typeof e.provider=="number"){a.provider=e.provider;break}break;case"UNKNOWN":case 0:a.provider=0;break;case"BING":case 1:a.provider=1;break;case"GOOGLE":case 2:a.provider=2;break;case"SUPPORT":case 3:a.provider=3;break}switch(e.pluginType){default:if(typeof e.pluginType=="number"){a.pluginType=e.pluginType;break}break;case"UNKNOWN_PLUGIN":case 0:a.pluginType=0;break;case"REELS":case 1:a.pluginType=1;break;case"SEARCH":case 2:a.pluginType=2;break}if(e.thumbnailCdnUrl!=null&&(a.thumbnailCdnUrl=String(e.thumbnailCdnUrl)),e.profilePhotoCdnUrl!=null&&(a.profilePhotoCdnUrl=String(e.profilePhotoCdnUrl)),e.searchProviderUrl!=null&&(a.searchProviderUrl=String(e.searchProviderUrl)),e.referenceIndex!=null&&(a.referenceIndex=e.referenceIndex>>>0),e.expectedLinksCount!=null&&(a.expectedLinksCount=e.expectedLinksCount>>>0),e.searchQuery!=null&&(a.searchQuery=String(e.searchQuery)),e.parentPluginMessageKey!=null){if(typeof e.parentPluginMessageKey!="object")throw TypeError(".proto.BotPluginMetadata.parentPluginMessageKey: object expected");a.parentPluginMessageKey=p.proto.MessageKey.fromObject(e.parentPluginMessageKey)}switch(e.deprecatedField){default:if(typeof e.deprecatedField=="number"){a.deprecatedField=e.deprecatedField;break}break;case"UNKNOWN_PLUGIN":case 0:a.deprecatedField=0;break;case"REELS":case 1:a.deprecatedField=1;break;case"SEARCH":case 2:a.deprecatedField=2;break}switch(e.parentPluginType){default:if(typeof e.parentPluginType=="number"){a.parentPluginType=e.parentPluginType;break}break;case"UNKNOWN_PLUGIN":case 0:a.parentPluginType=0;break;case"REELS":case 1:a.parentPluginType=1;break;case"SEARCH":case 2:a.parentPluginType=2;break}return e.faviconCdnUrl!=null&&(a.faviconCdnUrl=String(e.faviconCdnUrl)),a},r.toObject=function(e,a){a||(a={});var A={};return e.provider!=null&&e.hasOwnProperty("provider")&&(A.provider=a.enums===String?p.proto.BotPluginMetadata.SearchProvider[e.provider]===void 0?e.provider:p.proto.BotPluginMetadata.SearchProvider[e.provider]:e.provider,a.oneofs&&(A._provider="provider")),e.pluginType!=null&&e.hasOwnProperty("pluginType")&&(A.pluginType=a.enums===String?p.proto.BotPluginMetadata.PluginType[e.pluginType]===void 0?e.pluginType:p.proto.BotPluginMetadata.PluginType[e.pluginType]:e.pluginType,a.oneofs&&(A._pluginType="pluginType")),e.thumbnailCdnUrl!=null&&e.hasOwnProperty("thumbnailCdnUrl")&&(A.thumbnailCdnUrl=e.thumbnailCdnUrl,a.oneofs&&(A._thumbnailCdnUrl="thumbnailCdnUrl")),e.profilePhotoCdnUrl!=null&&e.hasOwnProperty("profilePhotoCdnUrl")&&(A.profilePhotoCdnUrl=e.profilePhotoCdnUrl,a.oneofs&&(A._profilePhotoCdnUrl="profilePhotoCdnUrl")),e.searchProviderUrl!=null&&e.hasOwnProperty("searchProviderUrl")&&(A.searchProviderUrl=e.searchProviderUrl,a.oneofs&&(A._searchProviderUrl="searchProviderUrl")),e.referenceIndex!=null&&e.hasOwnProperty("referenceIndex")&&(A.referenceIndex=e.referenceIndex,a.oneofs&&(A._referenceIndex="referenceIndex")),e.expectedLinksCount!=null&&e.hasOwnProperty("expectedLinksCount")&&(A.expectedLinksCount=e.expectedLinksCount,a.oneofs&&(A._expectedLinksCount="expectedLinksCount")),e.searchQuery!=null&&e.hasOwnProperty("searchQuery")&&(A.searchQuery=e.searchQuery,a.oneofs&&(A._searchQuery="searchQuery")),e.parentPluginMessageKey!=null&&e.hasOwnProperty("parentPluginMessageKey")&&(A.parentPluginMessageKey=p.proto.MessageKey.toObject(e.parentPluginMessageKey,a),a.oneofs&&(A._parentPluginMessageKey="parentPluginMessageKey")),e.deprecatedField!=null&&e.hasOwnProperty("deprecatedField")&&(A.deprecatedField=a.enums===String?p.proto.BotPluginMetadata.PluginType[e.deprecatedField]===void 0?e.deprecatedField:p.proto.BotPluginMetadata.PluginType[e.deprecatedField]:e.deprecatedField,a.oneofs&&(A._deprecatedField="deprecatedField")),e.parentPluginType!=null&&e.hasOwnProperty("parentPluginType")&&(A.parentPluginType=a.enums===String?p.proto.BotPluginMetadata.PluginType[e.parentPluginType]===void 0?e.parentPluginType:p.proto.BotPluginMetadata.PluginType[e.parentPluginType]:e.parentPluginType,a.oneofs&&(A._parentPluginType="parentPluginType")),e.faviconCdnUrl!=null&&e.hasOwnProperty("faviconCdnUrl")&&(A.faviconCdnUrl=e.faviconCdnUrl,a.oneofs&&(A._faviconCdnUrl="faviconCdnUrl")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPluginMetadata"},r.PluginType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_PLUGIN"]=0,e[i[1]="REELS"]=1,e[i[2]="SEARCH"]=2,e})(),r.SearchProvider=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="BING"]=1,e[i[2]="GOOGLE"]=2,e[i[3]="SUPPORT"]=3,e})(),r})(),n.BotProgressIndicatorMetadata=(function(){function r(i){if(this.stepsMetadata=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.progressDescription=e.string();break}case 2:{s.stepsMetadata&&s.stepsMetadata.length||(s.stepsMetadata=[]),s.stepsMetadata.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotProgressIndicatorMetadata)return e;var a=new p.proto.BotProgressIndicatorMetadata;if(e.progressDescription!=null&&(a.progressDescription=String(e.progressDescription)),e.stepsMetadata){if(!Array.isArray(e.stepsMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.stepsMetadata: array expected");a.stepsMetadata=[];for(var A=0;A>>3){case 1:{c.statusTitle=A.string();break}case 2:{c.statusBody=A.string();break}case 3:{c.sourcesMetadata&&c.sourcesMetadata.length||(c.sourcesMetadata=[]),c.sourcesMetadata.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.decode(A,A.uint32()));break}case 4:{c.status=A.int32();break}case 5:{c.isReasoning=A.bool();break}case 6:{c.isEnhancedSearch=A.bool();break}case 7:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata)return A;var t=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata;if(A.statusTitle!=null&&(t.statusTitle=String(A.statusTitle)),A.statusBody!=null&&(t.statusBody=String(A.statusBody)),A.sourcesMetadata){if(!Array.isArray(A.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sourcesMetadata: array expected");t.sourcesMetadata=[];for(var s=0;s>>3){case 1:{d.title=s.string();break}case 2:{d.provider=s.int32();break}case 3:{d.sourceUrl=s.string();break}case 4:{d.favIconUrl=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata)return s;var g=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata;switch(s.title!=null&&(g.title=String(s.title)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN_PROVIDER":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.favIconUrl!=null&&(g.favIconUrl=String(s.favIconUrl)),g},a.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]===void 0?s.provider:p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.favIconUrl!=null&&s.hasOwnProperty("favIconUrl")&&(c.favIconUrl=s.favIconUrl,g.oneofs&&(c._favIconUrl="favIconUrl")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata"},a})(),i.BotPlanningSearchSourcesMetadata=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.sourceTitle=s.string();break}case 2:{d.provider=s.int32();break}case 3:{d.sourceUrl=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata)return s;var g=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata;switch(s.sourceTitle!=null&&(g.sourceTitle=String(s.sourceTitle)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),g},a.toObject=function(s,g){g||(g={});var c={};return s.sourceTitle!=null&&s.hasOwnProperty("sourceTitle")&&(c.sourceTitle=s.sourceTitle,g.oneofs&&(c._sourceTitle="sourceTitle")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]===void 0?s.provider:p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata"},a.BotPlanningSearchSourceProvider=(function(){let t={},s=Object.create(t);return s[t[0]="UNKNOWN"]=0,s[t[1]="OTHER"]=1,s[t[2]="GOOGLE"]=2,s[t[3]="BING"]=3,s})(),a})(),i.BotPlanningStepSectionMetadata=(function(){function a(t){if(this.sourcesMetadata=[],t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.sectionTitle=s.string();break}case 2:{d.sectionBody=s.string();break}case 3:{d.sourcesMetadata&&d.sourcesMetadata.length||(d.sourcesMetadata=[]),d.sourcesMetadata.push(p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata)return s;var g=new p.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata;if(s.sectionTitle!=null&&(g.sectionTitle=String(s.sectionTitle)),s.sectionBody!=null&&(g.sectionBody=String(s.sectionBody)),s.sourcesMetadata){if(!Array.isArray(s.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.sourcesMetadata: array expected");g.sourcesMetadata=[];for(var c=0;c>>3){case 1:{s.promotionType=e.int32();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotPromotionMessageMetadata)return e;var a=new p.proto.BotPromotionMessageMetadata;switch(e.promotionType){default:if(typeof e.promotionType=="number"){a.promotionType=e.promotionType;break}break;case"UNKNOWN_TYPE":case 0:a.promotionType=0;break;case"C50":case 1:a.promotionType=1;break;case"SURVEY_PLATFORM":case 2:a.promotionType=2;break}return e.buttonTitle!=null&&(a.buttonTitle=String(e.buttonTitle)),a},r.toObject=function(e,a){a||(a={});var A={};return e.promotionType!=null&&e.hasOwnProperty("promotionType")&&(A.promotionType=a.enums===String?p.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]===void 0?e.promotionType:p.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]:e.promotionType,a.oneofs&&(A._promotionType="promotionType")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,a.oneofs&&(A._buttonTitle="buttonTitle")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromotionMessageMetadata"},r.BotPromotionType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_TYPE"]=0,e[i[1]="C50"]=1,e[i[2]="SURVEY_PLATFORM"]=2,e})(),r})(),n.BotPromptSuggestion=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.prompt=e.string();break}case 2:{s.promptId=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotPromptSuggestion)return e;var a=new p.proto.BotPromptSuggestion;return e.prompt!=null&&(a.prompt=String(e.prompt)),e.promptId!=null&&(a.promptId=String(e.promptId)),a},r.toObject=function(e,a){a||(a={});var A={};return e.prompt!=null&&e.hasOwnProperty("prompt")&&(A.prompt=e.prompt,a.oneofs&&(A._prompt="prompt")),e.promptId!=null&&e.hasOwnProperty("promptId")&&(A.promptId=e.promptId,a.oneofs&&(A._promptId="promptId")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromptSuggestion"},r})(),n.BotPromptSuggestions=(function(){function r(o){if(this.suggestions=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{t.suggestions&&t.suggestions.length||(t.suggestions=[]),t.suggestions.push(p.proto.BotPromptSuggestion.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.BotPromptSuggestions)return i;var e=new p.proto.BotPromptSuggestions;if(i.suggestions){if(!Array.isArray(i.suggestions))throw TypeError(".proto.BotPromptSuggestions.suggestions: array expected");e.suggestions=[];for(var a=0;a>>3){case 1:{t.botFeatureQuotaMetadata&&t.botFeatureQuotaMetadata.length||(t.botFeatureQuotaMetadata=[]),t.botFeatureQuotaMetadata.push(p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.BotQuotaMetadata)return i;var e=new p.proto.BotQuotaMetadata;if(i.botFeatureQuotaMetadata){if(!Array.isArray(i.botFeatureQuotaMetadata))throw TypeError(".proto.BotQuotaMetadata.botFeatureQuotaMetadata: array expected");e.botFeatureQuotaMetadata=[];for(var a=0;a>>3){case 1:{g.featureType=a.int32();break}case 2:{g.remainingQuota=a.uint32();break}case 3:{g.expirationTimestamp=a.uint64();break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata)return a;var A=new p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata;switch(a.featureType){default:if(typeof a.featureType=="number"){A.featureType=a.featureType;break}break;case"UNKNOWN_FEATURE":case 0:A.featureType=0;break;case"REASONING_FEATURE":case 1:A.featureType=1;break}return a.remainingQuota!=null&&(A.remainingQuota=a.remainingQuota>>>0),a.expirationTimestamp!=null&&(l.Long?(A.expirationTimestamp=l.Long.fromValue(a.expirationTimestamp)).unsigned=!0:typeof a.expirationTimestamp=="string"?A.expirationTimestamp=parseInt(a.expirationTimestamp,10):typeof a.expirationTimestamp=="number"?A.expirationTimestamp=a.expirationTimestamp:typeof a.expirationTimestamp=="object"&&(A.expirationTimestamp=new l.LongBits(a.expirationTimestamp.low>>>0,a.expirationTimestamp.high>>>0).toNumber(!0))),A},o.toObject=function(a,A){A||(A={});var t={};return a.featureType!=null&&a.hasOwnProperty("featureType")&&(t.featureType=A.enums===String?p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[a.featureType]===void 0?a.featureType:p.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[a.featureType]:a.featureType,A.oneofs&&(t._featureType="featureType")),a.remainingQuota!=null&&a.hasOwnProperty("remainingQuota")&&(t.remainingQuota=a.remainingQuota,A.oneofs&&(t._remainingQuota="remainingQuota")),a.expirationTimestamp!=null&&a.hasOwnProperty("expirationTimestamp")&&(typeof a.expirationTimestamp=="number"?t.expirationTimestamp=A.longs===String?String(a.expirationTimestamp):a.expirationTimestamp:t.expirationTimestamp=A.longs===String?oe(a.expirationTimestamp,!0):A.longs===Number?ne(a.expirationTimestamp,!0):a.expirationTimestamp,A.oneofs&&(t._expirationTimestamp="expirationTimestamp")),t},o.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.BotQuotaMetadata.BotFeatureQuotaMetadata"},o.BotFeatureType=(function(){let e={},a=Object.create(e);return a[e[0]="UNKNOWN_FEATURE"]=0,a[e[1]="REASONING_FEATURE"]=1,a})(),o})(),r})(),n.BotReminderMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.requestMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.action=e.int32();break}case 3:{s.name=e.string();break}case 4:{s.nextTriggerTimestamp=e.uint64();break}case 5:{s.frequency=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotReminderMetadata)return e;var a=new p.proto.BotReminderMetadata;if(e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.BotReminderMetadata.requestMessageKey: object expected");a.requestMessageKey=p.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.action){default:if(typeof e.action=="number"){a.action=e.action;break}break;case"NOTIFY":case 1:a.action=1;break;case"CREATE":case 2:a.action=2;break;case"DELETE":case 3:a.action=3;break;case"UPDATE":case 4:a.action=4;break}switch(e.name!=null&&(a.name=String(e.name)),e.nextTriggerTimestamp!=null&&(l.Long?(a.nextTriggerTimestamp=l.Long.fromValue(e.nextTriggerTimestamp)).unsigned=!0:typeof e.nextTriggerTimestamp=="string"?a.nextTriggerTimestamp=parseInt(e.nextTriggerTimestamp,10):typeof e.nextTriggerTimestamp=="number"?a.nextTriggerTimestamp=e.nextTriggerTimestamp:typeof e.nextTriggerTimestamp=="object"&&(a.nextTriggerTimestamp=new l.LongBits(e.nextTriggerTimestamp.low>>>0,e.nextTriggerTimestamp.high>>>0).toNumber(!0))),e.frequency){default:if(typeof e.frequency=="number"){a.frequency=e.frequency;break}break;case"ONCE":case 1:a.frequency=1;break;case"DAILY":case 2:a.frequency=2;break;case"WEEKLY":case 3:a.frequency=3;break;case"BIWEEKLY":case 4:a.frequency=4;break;case"MONTHLY":case 5:a.frequency=5;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=p.proto.MessageKey.toObject(e.requestMessageKey,a),a.oneofs&&(A._requestMessageKey="requestMessageKey")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=a.enums===String?p.proto.BotReminderMetadata.ReminderAction[e.action]===void 0?e.action:p.proto.BotReminderMetadata.ReminderAction[e.action]:e.action,a.oneofs&&(A._action="action")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,a.oneofs&&(A._name="name")),e.nextTriggerTimestamp!=null&&e.hasOwnProperty("nextTriggerTimestamp")&&(typeof e.nextTriggerTimestamp=="number"?A.nextTriggerTimestamp=a.longs===String?String(e.nextTriggerTimestamp):e.nextTriggerTimestamp:A.nextTriggerTimestamp=a.longs===String?oe(e.nextTriggerTimestamp,!0):a.longs===Number?ne(e.nextTriggerTimestamp,!0):e.nextTriggerTimestamp,a.oneofs&&(A._nextTriggerTimestamp="nextTriggerTimestamp")),e.frequency!=null&&e.hasOwnProperty("frequency")&&(A.frequency=a.enums===String?p.proto.BotReminderMetadata.ReminderFrequency[e.frequency]===void 0?e.frequency:p.proto.BotReminderMetadata.ReminderFrequency[e.frequency]:e.frequency,a.oneofs&&(A._frequency="frequency")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotReminderMetadata"},r.ReminderAction=(function(){let i={},e=Object.create(i);return e[i[1]="NOTIFY"]=1,e[i[2]="CREATE"]=2,e[i[3]="DELETE"]=3,e[i[4]="UPDATE"]=4,e})(),r.ReminderFrequency=(function(){let i={},e=Object.create(i);return e[i[1]="ONCE"]=1,e[i[2]="DAILY"]=2,e[i[3]="WEEKLY"]=3,e[i[4]="BIWEEKLY"]=4,e[i[5]="MONTHLY"]=5,e})(),r})(),n.BotRenderingMetadata=(function(){function r(o){if(this.keywords=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{t.keywords&&t.keywords.length||(t.keywords=[]),t.keywords.push(p.proto.BotRenderingMetadata.Keyword.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.BotRenderingMetadata)return i;var e=new p.proto.BotRenderingMetadata;if(i.keywords){if(!Array.isArray(i.keywords))throw TypeError(".proto.BotRenderingMetadata.keywords: array expected");e.keywords=[];for(var a=0;a>>3){case 1:{g.value=a.string();break}case 2:{g.associatedPrompts&&g.associatedPrompts.length||(g.associatedPrompts=[]),g.associatedPrompts.push(a.string());break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.BotRenderingMetadata.Keyword)return a;var A=new p.proto.BotRenderingMetadata.Keyword;if(a.value!=null&&(A.value=String(a.value)),a.associatedPrompts){if(!Array.isArray(a.associatedPrompts))throw TypeError(".proto.BotRenderingMetadata.Keyword.associatedPrompts: array expected");A.associatedPrompts=[];for(var t=0;t>>3){case 1:{s.sessionId=e.string();break}case 2:{s.sessionSource=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotSessionMetadata)return e;var a=new p.proto.BotSessionMetadata;switch(e.sessionId!=null&&(a.sessionId=String(e.sessionId)),e.sessionSource){default:if(typeof e.sessionSource=="number"){a.sessionSource=e.sessionSource;break}break;case"NONE":case 0:a.sessionSource=0;break;case"NULL_STATE":case 1:a.sessionSource=1;break;case"TYPEAHEAD":case 2:a.sessionSource=2;break;case"USER_INPUT":case 3:a.sessionSource=3;break;case"EMU_FLASH":case 4:a.sessionSource=4;break;case"EMU_FLASH_FOLLOWUP":case 5:a.sessionSource=5;break;case"VOICE":case 6:a.sessionSource=6;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,a.oneofs&&(A._sessionId="sessionId")),e.sessionSource!=null&&e.hasOwnProperty("sessionSource")&&(A.sessionSource=a.enums===String?p.proto.BotSessionSource[e.sessionSource]===void 0?e.sessionSource:p.proto.BotSessionSource[e.sessionSource]:e.sessionSource,a.oneofs&&(A._sessionSource="sessionSource")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotSessionMetadata"},r})(),n.BotSessionSource=(function(){let r={},o=Object.create(r);return o[r[0]="NONE"]=0,o[r[1]="NULL_STATE"]=1,o[r[2]="TYPEAHEAD"]=2,o[r[3]="USER_INPUT"]=3,o[r[4]="EMU_FLASH"]=4,o[r[5]="EMU_FLASH_FOLLOWUP"]=5,o[r[6]="VOICE"]=6,o})(),n.BotSignatureVerificationMetadata=(function(){function r(o){if(this.proofs=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{t.proofs&&t.proofs.length||(t.proofs=[]),t.proofs.push(p.proto.BotSignatureVerificationUseCaseProof.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.BotSignatureVerificationMetadata)return i;var e=new p.proto.BotSignatureVerificationMetadata;if(i.proofs){if(!Array.isArray(i.proofs))throw TypeError(".proto.BotSignatureVerificationMetadata.proofs: array expected");e.proofs=[];for(var a=0;a>>3){case 1:{s.version=e.int32();break}case 2:{s.useCase=e.int32();break}case 3:{s.signature=e.bytes();break}case 4:{s.certificateChain&&s.certificateChain.length||(s.certificateChain=[]),s.certificateChain.push(e.bytes());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotSignatureVerificationUseCaseProof)return e;var a=new p.proto.BotSignatureVerificationUseCaseProof;switch(e.version!=null&&(a.version=e.version|0),e.useCase){default:if(typeof e.useCase=="number"){a.useCase=e.useCase;break}break;case"UNSPECIFIED":case 0:a.useCase=0;break;case"WA_BOT_MSG":case 1:a.useCase=1;break}if(e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),e.certificateChain){if(!Array.isArray(e.certificateChain))throw TypeError(".proto.BotSignatureVerificationUseCaseProof.certificateChain: array expected");a.certificateChain=[];for(var A=0;A=0&&(a.certificateChain[A]=e.certificateChain[A])}return a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.certificateChain=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,a.oneofs&&(A._version="version")),e.useCase!=null&&e.hasOwnProperty("useCase")&&(A.useCase=a.enums===String?p.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]===void 0?e.useCase:p.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]:e.useCase,a.oneofs&&(A._useCase="useCase")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),e.certificateChain&&e.certificateChain.length){A.certificateChain=[];for(var t=0;t>>3){case 1:{t.sources&&t.sources.length||(t.sources=[]),t.sources.push(p.proto.BotSourcesMetadata.BotSourceItem.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.BotSourcesMetadata)return i;var e=new p.proto.BotSourcesMetadata;if(i.sources){if(!Array.isArray(i.sources))throw TypeError(".proto.BotSourcesMetadata.sources: array expected");e.sources=[];for(var a=0;a>>3){case 1:{g.provider=a.int32();break}case 2:{g.thumbnailCdnUrl=a.string();break}case 3:{g.sourceProviderUrl=a.string();break}case 4:{g.sourceQuery=a.string();break}case 5:{g.faviconCdnUrl=a.string();break}case 6:{g.citationNumber=a.uint32();break}case 7:{g.sourceTitle=a.string();break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.BotSourcesMetadata.BotSourceItem)return a;var A=new p.proto.BotSourcesMetadata.BotSourceItem;switch(a.provider){default:if(typeof a.provider=="number"){A.provider=a.provider;break}break;case"UNKNOWN":case 0:A.provider=0;break;case"BING":case 1:A.provider=1;break;case"GOOGLE":case 2:A.provider=2;break;case"SUPPORT":case 3:A.provider=3;break;case"OTHER":case 4:A.provider=4;break}return a.thumbnailCdnUrl!=null&&(A.thumbnailCdnUrl=String(a.thumbnailCdnUrl)),a.sourceProviderUrl!=null&&(A.sourceProviderUrl=String(a.sourceProviderUrl)),a.sourceQuery!=null&&(A.sourceQuery=String(a.sourceQuery)),a.faviconCdnUrl!=null&&(A.faviconCdnUrl=String(a.faviconCdnUrl)),a.citationNumber!=null&&(A.citationNumber=a.citationNumber>>>0),a.sourceTitle!=null&&(A.sourceTitle=String(a.sourceTitle)),A},o.toObject=function(a,A){A||(A={});var t={};return a.provider!=null&&a.hasOwnProperty("provider")&&(t.provider=A.enums===String?p.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[a.provider]===void 0?a.provider:p.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[a.provider]:a.provider,A.oneofs&&(t._provider="provider")),a.thumbnailCdnUrl!=null&&a.hasOwnProperty("thumbnailCdnUrl")&&(t.thumbnailCdnUrl=a.thumbnailCdnUrl,A.oneofs&&(t._thumbnailCdnUrl="thumbnailCdnUrl")),a.sourceProviderUrl!=null&&a.hasOwnProperty("sourceProviderUrl")&&(t.sourceProviderUrl=a.sourceProviderUrl,A.oneofs&&(t._sourceProviderUrl="sourceProviderUrl")),a.sourceQuery!=null&&a.hasOwnProperty("sourceQuery")&&(t.sourceQuery=a.sourceQuery,A.oneofs&&(t._sourceQuery="sourceQuery")),a.faviconCdnUrl!=null&&a.hasOwnProperty("faviconCdnUrl")&&(t.faviconCdnUrl=a.faviconCdnUrl,A.oneofs&&(t._faviconCdnUrl="faviconCdnUrl")),a.citationNumber!=null&&a.hasOwnProperty("citationNumber")&&(t.citationNumber=a.citationNumber,A.oneofs&&(t._citationNumber="citationNumber")),a.sourceTitle!=null&&a.hasOwnProperty("sourceTitle")&&(t.sourceTitle=a.sourceTitle,A.oneofs&&(t._sourceTitle="sourceTitle")),t},o.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.BotSourcesMetadata.BotSourceItem"},o.SourceProvider=(function(){let e={},a=Object.create(e);return a[e[0]="UNKNOWN"]=0,a[e[1]="BING"]=1,a[e[2]="GOOGLE"]=2,a[e[3]="SUPPORT"]=3,a[e[4]="OTHER"]=4,a})(),o})(),r})(),n.BotSuggestedPromptMetadata=(function(){function r(i){if(this.suggestedPrompts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.suggestedPrompts&&s.suggestedPrompts.length||(s.suggestedPrompts=[]),s.suggestedPrompts.push(e.string());break}case 2:{s.selectedPromptIndex=e.uint32();break}case 3:{s.promptSuggestions=p.proto.BotPromptSuggestions.decode(e,e.uint32());break}case 4:{s.selectedPromptId=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotSuggestedPromptMetadata)return e;var a=new p.proto.BotSuggestedPromptMetadata;if(e.suggestedPrompts){if(!Array.isArray(e.suggestedPrompts))throw TypeError(".proto.BotSuggestedPromptMetadata.suggestedPrompts: array expected");a.suggestedPrompts=[];for(var A=0;A>>0),e.promptSuggestions!=null){if(typeof e.promptSuggestions!="object")throw TypeError(".proto.BotSuggestedPromptMetadata.promptSuggestions: object expected");a.promptSuggestions=p.proto.BotPromptSuggestions.fromObject(e.promptSuggestions)}return e.selectedPromptId!=null&&(a.selectedPromptId=String(e.selectedPromptId)),a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.suggestedPrompts=[]),e.suggestedPrompts&&e.suggestedPrompts.length){A.suggestedPrompts=[];for(var t=0;t>>3){case 1:{s.sbsMetadata=p.proto.BotUnifiedResponseMutation.SideBySideMetadata.decode(e,e.uint32());break}case 2:{s.mediaDetailsMetadataList&&s.mediaDetailsMetadataList.length||(s.mediaDetailsMetadataList=[]),s.mediaDetailsMetadataList.push(p.proto.BotUnifiedResponseMutation.MediaDetailsMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.BotUnifiedResponseMutation)return e;var a=new p.proto.BotUnifiedResponseMutation;if(e.sbsMetadata!=null){if(typeof e.sbsMetadata!="object")throw TypeError(".proto.BotUnifiedResponseMutation.sbsMetadata: object expected");a.sbsMetadata=p.proto.BotUnifiedResponseMutation.SideBySideMetadata.fromObject(e.sbsMetadata)}if(e.mediaDetailsMetadataList){if(!Array.isArray(e.mediaDetailsMetadataList))throw TypeError(".proto.BotUnifiedResponseMutation.mediaDetailsMetadataList: array expected");a.mediaDetailsMetadataList=[];for(var A=0;A>>3){case 1:{c.id=A.string();break}case 2:{c.highResMedia=p.proto.BotMediaMetadata.decode(A,A.uint32());break}case 3:{c.previewMedia=p.proto.BotMediaMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotUnifiedResponseMutation.MediaDetailsMetadata)return A;var t=new p.proto.BotUnifiedResponseMutation.MediaDetailsMetadata;if(A.id!=null&&(t.id=String(A.id)),A.highResMedia!=null){if(typeof A.highResMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.highResMedia: object expected");t.highResMedia=p.proto.BotMediaMetadata.fromObject(A.highResMedia)}if(A.previewMedia!=null){if(typeof A.previewMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.previewMedia: object expected");t.previewMedia=p.proto.BotMediaMetadata.fromObject(A.previewMedia)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,t.oneofs&&(s._id="id")),A.highResMedia!=null&&A.hasOwnProperty("highResMedia")&&(s.highResMedia=p.proto.BotMediaMetadata.toObject(A.highResMedia,t),t.oneofs&&(s._highResMedia="highResMedia")),A.previewMedia!=null&&A.hasOwnProperty("previewMedia")&&(s.previewMedia=p.proto.BotMediaMetadata.toObject(A.previewMedia,t),t.oneofs&&(s._previewMedia="previewMedia")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.MediaDetailsMetadata"},i})(),r.SideBySideMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.primaryResponseId=A.string();break}case 2:{c.surveyCtaHasRendered=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.BotUnifiedResponseMutation.SideBySideMetadata)return A;var t=new p.proto.BotUnifiedResponseMutation.SideBySideMetadata;return A.primaryResponseId!=null&&(t.primaryResponseId=String(A.primaryResponseId)),A.surveyCtaHasRendered!=null&&(t.surveyCtaHasRendered=!!A.surveyCtaHasRendered),t},i.toObject=function(A,t){t||(t={});var s={};return A.primaryResponseId!=null&&A.hasOwnProperty("primaryResponseId")&&(s.primaryResponseId=A.primaryResponseId,t.oneofs&&(s._primaryResponseId="primaryResponseId")),A.surveyCtaHasRendered!=null&&A.hasOwnProperty("surveyCtaHasRendered")&&(s.surveyCtaHasRendered=A.surveyCtaHasRendered,t.oneofs&&(s._surveyCtaHasRendered="surveyCtaHasRendered")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.SideBySideMetadata"},i})(),r})(),n.CallLogRecord=(function(){function r(i){if(this.participants=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.callResult=e.int32();break}case 2:{s.isDndMode=e.bool();break}case 3:{s.silenceReason=e.int32();break}case 4:{s.duration=e.int64();break}case 5:{s.startTime=e.int64();break}case 6:{s.isIncoming=e.bool();break}case 7:{s.isVideo=e.bool();break}case 8:{s.isCallLink=e.bool();break}case 9:{s.callLinkToken=e.string();break}case 10:{s.scheduledCallId=e.string();break}case 11:{s.callId=e.string();break}case 12:{s.callCreatorJid=e.string();break}case 13:{s.groupJid=e.string();break}case 14:{s.participants&&s.participants.length||(s.participants=[]),s.participants.push(p.proto.CallLogRecord.ParticipantInfo.decode(e,e.uint32()));break}case 15:{s.callType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.CallLogRecord)return e;var a=new p.proto.CallLogRecord;switch(e.callResult){default:if(typeof e.callResult=="number"){a.callResult=e.callResult;break}break;case"CONNECTED":case 0:a.callResult=0;break;case"REJECTED":case 1:a.callResult=1;break;case"CANCELLED":case 2:a.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:a.callResult=3;break;case"MISSED":case 4:a.callResult=4;break;case"INVALID":case 5:a.callResult=5;break;case"UNAVAILABLE":case 6:a.callResult=6;break;case"UPCOMING":case 7:a.callResult=7;break;case"FAILED":case 8:a.callResult=8;break;case"ABANDONED":case 9:a.callResult=9;break;case"ONGOING":case 10:a.callResult=10;break}switch(e.isDndMode!=null&&(a.isDndMode=!!e.isDndMode),e.silenceReason){default:if(typeof e.silenceReason=="number"){a.silenceReason=e.silenceReason;break}break;case"NONE":case 0:a.silenceReason=0;break;case"SCHEDULED":case 1:a.silenceReason=1;break;case"PRIVACY":case 2:a.silenceReason=2;break;case"LIGHTWEIGHT":case 3:a.silenceReason=3;break}if(e.duration!=null&&(l.Long?(a.duration=l.Long.fromValue(e.duration)).unsigned=!1:typeof e.duration=="string"?a.duration=parseInt(e.duration,10):typeof e.duration=="number"?a.duration=e.duration:typeof e.duration=="object"&&(a.duration=new l.LongBits(e.duration.low>>>0,e.duration.high>>>0).toNumber())),e.startTime!=null&&(l.Long?(a.startTime=l.Long.fromValue(e.startTime)).unsigned=!1:typeof e.startTime=="string"?a.startTime=parseInt(e.startTime,10):typeof e.startTime=="number"?a.startTime=e.startTime:typeof e.startTime=="object"&&(a.startTime=new l.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber())),e.isIncoming!=null&&(a.isIncoming=!!e.isIncoming),e.isVideo!=null&&(a.isVideo=!!e.isVideo),e.isCallLink!=null&&(a.isCallLink=!!e.isCallLink),e.callLinkToken!=null&&(a.callLinkToken=String(e.callLinkToken)),e.scheduledCallId!=null&&(a.scheduledCallId=String(e.scheduledCallId)),e.callId!=null&&(a.callId=String(e.callId)),e.callCreatorJid!=null&&(a.callCreatorJid=String(e.callCreatorJid)),e.groupJid!=null&&(a.groupJid=String(e.groupJid)),e.participants){if(!Array.isArray(e.participants))throw TypeError(".proto.CallLogRecord.participants: array expected");a.participants=[];for(var A=0;A>>3){case 1:{c.userJid=A.string();break}case 2:{c.callResult=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.CallLogRecord.ParticipantInfo)return A;var t=new p.proto.CallLogRecord.ParticipantInfo;switch(A.userJid!=null&&(t.userJid=String(A.userJid)),A.callResult){default:if(typeof A.callResult=="number"){t.callResult=A.callResult;break}break;case"CONNECTED":case 0:t.callResult=0;break;case"REJECTED":case 1:t.callResult=1;break;case"CANCELLED":case 2:t.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:t.callResult=3;break;case"MISSED":case 4:t.callResult=4;break;case"INVALID":case 5:t.callResult=5;break;case"UNAVAILABLE":case 6:t.callResult=6;break;case"UPCOMING":case 7:t.callResult=7;break;case"FAILED":case 8:t.callResult=8;break;case"ABANDONED":case 9:t.callResult=9;break;case"ONGOING":case 10:t.callResult=10;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.userJid!=null&&A.hasOwnProperty("userJid")&&(s.userJid=A.userJid,t.oneofs&&(s._userJid="userJid")),A.callResult!=null&&A.hasOwnProperty("callResult")&&(s.callResult=t.enums===String?p.proto.CallLogRecord.CallResult[A.callResult]===void 0?A.callResult:p.proto.CallLogRecord.CallResult[A.callResult]:A.callResult,t.oneofs&&(s._callResult="callResult")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CallLogRecord.ParticipantInfo"},i})(),r.SilenceReason=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="SCHEDULED"]=1,e[i[2]="PRIVACY"]=2,e[i[3]="LIGHTWEIGHT"]=3,e})(),r})(),n.CertChain=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.leaf=p.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}case 2:{s.intermediate=p.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.CertChain)return e;var a=new p.proto.CertChain;if(e.leaf!=null){if(typeof e.leaf!="object")throw TypeError(".proto.CertChain.leaf: object expected");a.leaf=p.proto.CertChain.NoiseCertificate.fromObject(e.leaf)}if(e.intermediate!=null){if(typeof e.intermediate!="object")throw TypeError(".proto.CertChain.intermediate: object expected");a.intermediate=p.proto.CertChain.NoiseCertificate.fromObject(e.intermediate)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.leaf!=null&&e.hasOwnProperty("leaf")&&(A.leaf=p.proto.CertChain.NoiseCertificate.toObject(e.leaf,a),a.oneofs&&(A._leaf="leaf")),e.intermediate!=null&&e.hasOwnProperty("intermediate")&&(A.intermediate=p.proto.CertChain.NoiseCertificate.toObject(e.intermediate,a),a.oneofs&&(A._intermediate="intermediate")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CertChain"},r.NoiseCertificate=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.details=A.bytes();break}case 2:{c.signature=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.CertChain.NoiseCertificate)return A;var t=new p.proto.CertChain.NoiseCertificate;return A.details!=null&&(typeof A.details=="string"?l.base64.decode(A.details,t.details=l.newBuffer(l.base64.length(A.details)),0):A.details.length>=0&&(t.details=A.details)),A.signature!=null&&(typeof A.signature=="string"?l.base64.decode(A.signature,t.signature=l.newBuffer(l.base64.length(A.signature)),0):A.signature.length>=0&&(t.signature=A.signature)),t},i.toObject=function(A,t){t||(t={});var s={};return A.details!=null&&A.hasOwnProperty("details")&&(s.details=t.bytes===String?l.base64.encode(A.details,0,A.details.length):t.bytes===Array?Array.prototype.slice.call(A.details):A.details,t.oneofs&&(s._details="details")),A.signature!=null&&A.hasOwnProperty("signature")&&(s.signature=t.bytes===String?l.base64.encode(A.signature,0,A.signature.length):t.bytes===Array?Array.prototype.slice.call(A.signature):A.signature,t.oneofs&&(s._signature="signature")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CertChain.NoiseCertificate"},i.Details=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.serial=s.uint32();break}case 2:{d.issuerSerial=s.uint32();break}case 3:{d.key=s.bytes();break}case 4:{d.notBefore=s.uint64();break}case 5:{d.notAfter=s.uint64();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.CertChain.NoiseCertificate.Details)return s;var g=new p.proto.CertChain.NoiseCertificate.Details;return s.serial!=null&&(g.serial=s.serial>>>0),s.issuerSerial!=null&&(g.issuerSerial=s.issuerSerial>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),s.notBefore!=null&&(l.Long?(g.notBefore=l.Long.fromValue(s.notBefore)).unsigned=!0:typeof s.notBefore=="string"?g.notBefore=parseInt(s.notBefore,10):typeof s.notBefore=="number"?g.notBefore=s.notBefore:typeof s.notBefore=="object"&&(g.notBefore=new l.LongBits(s.notBefore.low>>>0,s.notBefore.high>>>0).toNumber(!0))),s.notAfter!=null&&(l.Long?(g.notAfter=l.Long.fromValue(s.notAfter)).unsigned=!0:typeof s.notAfter=="string"?g.notAfter=parseInt(s.notAfter,10):typeof s.notAfter=="number"?g.notAfter=s.notAfter:typeof s.notAfter=="object"&&(g.notAfter=new l.LongBits(s.notAfter.low>>>0,s.notAfter.high>>>0).toNumber(!0))),g},a.toObject=function(s,g){g||(g={});var c={};return s.serial!=null&&s.hasOwnProperty("serial")&&(c.serial=s.serial,g.oneofs&&(c._serial="serial")),s.issuerSerial!=null&&s.hasOwnProperty("issuerSerial")&&(c.issuerSerial=s.issuerSerial,g.oneofs&&(c._issuerSerial="issuerSerial")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),s.notBefore!=null&&s.hasOwnProperty("notBefore")&&(typeof s.notBefore=="number"?c.notBefore=g.longs===String?String(s.notBefore):s.notBefore:c.notBefore=g.longs===String?oe(s.notBefore,!0):g.longs===Number?ne(s.notBefore,!0):s.notBefore,g.oneofs&&(c._notBefore="notBefore")),s.notAfter!=null&&s.hasOwnProperty("notAfter")&&(typeof s.notAfter=="number"?c.notAfter=g.longs===String?String(s.notAfter):s.notAfter:c.notAfter=g.longs===String?oe(s.notAfter,!0):g.longs===Number?ne(s.notAfter,!0):s.notAfter,g.oneofs&&(c._notAfter="notAfter")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.CertChain.NoiseCertificate.Details"},a})(),i})(),r})(),n.ChatLockSettings=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.hideLockedChats=e.bool();break}case 2:{s.secretCode=p.proto.UserPassword.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ChatLockSettings)return e;var a=new p.proto.ChatLockSettings;if(e.hideLockedChats!=null&&(a.hideLockedChats=!!e.hideLockedChats),e.secretCode!=null){if(typeof e.secretCode!="object")throw TypeError(".proto.ChatLockSettings.secretCode: object expected");a.secretCode=p.proto.UserPassword.fromObject(e.secretCode)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.hideLockedChats!=null&&e.hasOwnProperty("hideLockedChats")&&(A.hideLockedChats=e.hideLockedChats,a.oneofs&&(A._hideLockedChats="hideLockedChats")),e.secretCode!=null&&e.hasOwnProperty("secretCode")&&(A.secretCode=p.proto.UserPassword.toObject(e.secretCode,a),a.oneofs&&(A._secretCode="secretCode")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatLockSettings"},r})(),n.ChatRowOpaqueData=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.draftMessage=p.proto.ChatRowOpaqueData.DraftMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ChatRowOpaqueData)return e;var a=new p.proto.ChatRowOpaqueData;if(e.draftMessage!=null){if(typeof e.draftMessage!="object")throw TypeError(".proto.ChatRowOpaqueData.draftMessage: object expected");a.draftMessage=p.proto.ChatRowOpaqueData.DraftMessage.fromObject(e.draftMessage)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.draftMessage!=null&&e.hasOwnProperty("draftMessage")&&(A.draftMessage=p.proto.ChatRowOpaqueData.DraftMessage.toObject(e.draftMessage,a),a.oneofs&&(A._draftMessage="draftMessage")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatRowOpaqueData"},r.DraftMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.text=A.string();break}case 2:{c.omittedUrl=A.string();break}case 3:{c.ctwaContextLinkData=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.decode(A,A.uint32());break}case 4:{c.ctwaContext=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.decode(A,A.uint32());break}case 5:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ChatRowOpaqueData.DraftMessage)return A;var t=new p.proto.ChatRowOpaqueData.DraftMessage;if(A.text!=null&&(t.text=String(A.text)),A.omittedUrl!=null&&(t.omittedUrl=String(A.omittedUrl)),A.ctwaContextLinkData!=null){if(typeof A.ctwaContextLinkData!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContextLinkData: object expected");t.ctwaContextLinkData=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.fromObject(A.ctwaContextLinkData)}if(A.ctwaContext!=null){if(typeof A.ctwaContext!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContext: object expected");t.ctwaContext=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.fromObject(A.ctwaContext)}return A.timestamp!=null&&(l.Long?(t.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?t.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?t.timestamp=A.timestamp:typeof A.timestamp=="object"&&(t.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,t.oneofs&&(s._text="text")),A.omittedUrl!=null&&A.hasOwnProperty("omittedUrl")&&(s.omittedUrl=A.omittedUrl,t.oneofs&&(s._omittedUrl="omittedUrl")),A.ctwaContextLinkData!=null&&A.hasOwnProperty("ctwaContextLinkData")&&(s.ctwaContextLinkData=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.toObject(A.ctwaContextLinkData,t),t.oneofs&&(s._ctwaContextLinkData="ctwaContextLinkData")),A.ctwaContext!=null&&A.hasOwnProperty("ctwaContext")&&(s.ctwaContext=p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.toObject(A.ctwaContext,t),t.oneofs&&(s._ctwaContext="ctwaContext")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=t.longs===String?String(A.timestamp):A.timestamp:s.timestamp=t.longs===String?oe(A.timestamp):t.longs===Number?ne(A.timestamp):A.timestamp,t.oneofs&&(s._timestamp="timestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ChatRowOpaqueData.DraftMessage"},i.CtwaContextData=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.conversionSource=s.string();break}case 2:{d.conversionData=s.bytes();break}case 3:{d.sourceUrl=s.string();break}case 4:{d.sourceId=s.string();break}case 5:{d.sourceType=s.string();break}case 6:{d.title=s.string();break}case 7:{d.description=s.string();break}case 8:{d.thumbnail=s.string();break}case 9:{d.thumbnailUrl=s.string();break}case 10:{d.mediaType=s.int32();break}case 11:{d.mediaUrl=s.string();break}case 12:{d.isSuspiciousLink=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData)return s;var g=new p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData;switch(s.conversionSource!=null&&(g.conversionSource=String(s.conversionSource)),s.conversionData!=null&&(typeof s.conversionData=="string"?l.base64.decode(s.conversionData,g.conversionData=l.newBuffer(l.base64.length(s.conversionData)),0):s.conversionData.length>=0&&(g.conversionData=s.conversionData)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.sourceId!=null&&(g.sourceId=String(s.sourceId)),s.sourceType!=null&&(g.sourceType=String(s.sourceType)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.thumbnail!=null&&(g.thumbnail=String(s.thumbnail)),s.thumbnailUrl!=null&&(g.thumbnailUrl=String(s.thumbnailUrl)),s.mediaType){default:if(typeof s.mediaType=="number"){g.mediaType=s.mediaType;break}break;case"NONE":case 0:g.mediaType=0;break;case"IMAGE":case 1:g.mediaType=1;break;case"VIDEO":case 2:g.mediaType=2;break}return s.mediaUrl!=null&&(g.mediaUrl=String(s.mediaUrl)),s.isSuspiciousLink!=null&&(g.isSuspiciousLink=!!s.isSuspiciousLink),g},a.toObject=function(s,g){g||(g={});var c={};return s.conversionSource!=null&&s.hasOwnProperty("conversionSource")&&(c.conversionSource=s.conversionSource,g.oneofs&&(c._conversionSource="conversionSource")),s.conversionData!=null&&s.hasOwnProperty("conversionData")&&(c.conversionData=g.bytes===String?l.base64.encode(s.conversionData,0,s.conversionData.length):g.bytes===Array?Array.prototype.slice.call(s.conversionData):s.conversionData,g.oneofs&&(c._conversionData="conversionData")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.sourceId!=null&&s.hasOwnProperty("sourceId")&&(c.sourceId=s.sourceId,g.oneofs&&(c._sourceId="sourceId")),s.sourceType!=null&&s.hasOwnProperty("sourceType")&&(c.sourceType=s.sourceType,g.oneofs&&(c._sourceType="sourceType")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.thumbnail!=null&&s.hasOwnProperty("thumbnail")&&(c.thumbnail=s.thumbnail,g.oneofs&&(c._thumbnail="thumbnail")),s.thumbnailUrl!=null&&s.hasOwnProperty("thumbnailUrl")&&(c.thumbnailUrl=s.thumbnailUrl,g.oneofs&&(c._thumbnailUrl="thumbnailUrl")),s.mediaType!=null&&s.hasOwnProperty("mediaType")&&(c.mediaType=g.enums===String?p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]===void 0?s.mediaType:p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]:s.mediaType,g.oneofs&&(c._mediaType="mediaType")),s.mediaUrl!=null&&s.hasOwnProperty("mediaUrl")&&(c.mediaUrl=s.mediaUrl,g.oneofs&&(c._mediaUrl="mediaUrl")),s.isSuspiciousLink!=null&&s.hasOwnProperty("isSuspiciousLink")&&(c.isSuspiciousLink=s.isSuspiciousLink,g.oneofs&&(c._isSuspiciousLink="isSuspiciousLink")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextData"},a.ContextInfoExternalAdReplyInfoMediaType=(function(){let t={},s=Object.create(t);return s[t[0]="NONE"]=0,s[t[1]="IMAGE"]=1,s[t[2]="VIDEO"]=2,s})(),a})(),i.CtwaContextLinkData=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.context=s.string();break}case 2:{d.sourceUrl=s.string();break}case 3:{d.icebreaker=s.string();break}case 4:{d.phone=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData)return s;var g=new p.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData;return s.context!=null&&(g.context=String(s.context)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.icebreaker!=null&&(g.icebreaker=String(s.icebreaker)),s.phone!=null&&(g.phone=String(s.phone)),g},a.toObject=function(s,g){g||(g={});var c={};return s.context!=null&&s.hasOwnProperty("context")&&(c.context=s.context,g.oneofs&&(c._context="context")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.icebreaker!=null&&s.hasOwnProperty("icebreaker")&&(c.icebreaker=s.icebreaker,g.oneofs&&(c._icebreaker="icebreaker")),s.phone!=null&&s.hasOwnProperty("phone")&&(c.phone=s.phone,g.oneofs&&(c._phone="phone")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData"},a})(),i})(),r})(),n.Citation=(function(){function r(o){if(o)for(var i=Object.keys(o),e=0;e>>3){case 1:{t.title=i.string();break}case 2:{t.subtitle=i.string();break}case 3:{t.cmsId=i.string();break}case 4:{t.imageUrl=i.string();break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.Citation)return i;var e=new p.proto.Citation;return i.title!=null&&(e.title=String(i.title)),i.subtitle!=null&&(e.subtitle=String(i.subtitle)),i.cmsId!=null&&(e.cmsId=String(i.cmsId)),i.imageUrl!=null&&(e.imageUrl=String(i.imageUrl)),e},r.toObject=function(i,e){e||(e={});var a={};return e.defaults&&(a.title="",a.subtitle="",a.cmsId="",a.imageUrl=""),i.title!=null&&i.hasOwnProperty("title")&&(a.title=i.title),i.subtitle!=null&&i.hasOwnProperty("subtitle")&&(a.subtitle=i.subtitle),i.cmsId!=null&&i.hasOwnProperty("cmsId")&&(a.cmsId=i.cmsId),i.imageUrl!=null&&i.hasOwnProperty("imageUrl")&&(a.imageUrl=i.imageUrl),a},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.Citation"},r})(),n.ClientPairingProps=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.isChatDbLidMigrated=e.bool();break}case 2:{s.isSyncdPureLidSession=e.bool();break}case 3:{s.isSyncdSnapshotRecoveryEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ClientPairingProps)return e;var a=new p.proto.ClientPairingProps;return e.isChatDbLidMigrated!=null&&(a.isChatDbLidMigrated=!!e.isChatDbLidMigrated),e.isSyncdPureLidSession!=null&&(a.isSyncdPureLidSession=!!e.isSyncdPureLidSession),e.isSyncdSnapshotRecoveryEnabled!=null&&(a.isSyncdSnapshotRecoveryEnabled=!!e.isSyncdSnapshotRecoveryEnabled),a},r.toObject=function(e,a){a||(a={});var A={};return e.isChatDbLidMigrated!=null&&e.hasOwnProperty("isChatDbLidMigrated")&&(A.isChatDbLidMigrated=e.isChatDbLidMigrated,a.oneofs&&(A._isChatDbLidMigrated="isChatDbLidMigrated")),e.isSyncdPureLidSession!=null&&e.hasOwnProperty("isSyncdPureLidSession")&&(A.isSyncdPureLidSession=e.isSyncdPureLidSession,a.oneofs&&(A._isSyncdPureLidSession="isSyncdPureLidSession")),e.isSyncdSnapshotRecoveryEnabled!=null&&e.hasOwnProperty("isSyncdSnapshotRecoveryEnabled")&&(A.isSyncdSnapshotRecoveryEnabled=e.isSyncdSnapshotRecoveryEnabled,a.oneofs&&(A._isSyncdSnapshotRecoveryEnabled="isSyncdSnapshotRecoveryEnabled")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ClientPairingProps"},r})(),n.ClientPayload=(function(){function r(i){if(this.shards=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.username=e.uint64();break}case 3:{s.passive=e.bool();break}case 5:{s.userAgent=p.proto.ClientPayload.UserAgent.decode(e,e.uint32());break}case 6:{s.webInfo=p.proto.ClientPayload.WebInfo.decode(e,e.uint32());break}case 7:{s.pushName=e.string();break}case 9:{s.sessionId=e.sfixed32();break}case 10:{s.shortConnect=e.bool();break}case 12:{s.connectType=e.int32();break}case 13:{s.connectReason=e.int32();break}case 14:{if(s.shards&&s.shards.length||(s.shards=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0,e.username.high>>>0).toNumber(!0))),e.passive!=null&&(a.passive=!!e.passive),e.userAgent!=null){if(typeof e.userAgent!="object")throw TypeError(".proto.ClientPayload.userAgent: object expected");a.userAgent=p.proto.ClientPayload.UserAgent.fromObject(e.userAgent)}if(e.webInfo!=null){if(typeof e.webInfo!="object")throw TypeError(".proto.ClientPayload.webInfo: object expected");a.webInfo=p.proto.ClientPayload.WebInfo.fromObject(e.webInfo)}switch(e.pushName!=null&&(a.pushName=String(e.pushName)),e.sessionId!=null&&(a.sessionId=e.sessionId|0),e.shortConnect!=null&&(a.shortConnect=!!e.shortConnect),e.connectType){default:if(typeof e.connectType=="number"){a.connectType=e.connectType;break}break;case"CELLULAR_UNKNOWN":case 0:a.connectType=0;break;case"WIFI_UNKNOWN":case 1:a.connectType=1;break;case"CELLULAR_EDGE":case 100:a.connectType=100;break;case"CELLULAR_IDEN":case 101:a.connectType=101;break;case"CELLULAR_UMTS":case 102:a.connectType=102;break;case"CELLULAR_EVDO":case 103:a.connectType=103;break;case"CELLULAR_GPRS":case 104:a.connectType=104;break;case"CELLULAR_HSDPA":case 105:a.connectType=105;break;case"CELLULAR_HSUPA":case 106:a.connectType=106;break;case"CELLULAR_HSPA":case 107:a.connectType=107;break;case"CELLULAR_CDMA":case 108:a.connectType=108;break;case"CELLULAR_1XRTT":case 109:a.connectType=109;break;case"CELLULAR_EHRPD":case 110:a.connectType=110;break;case"CELLULAR_LTE":case 111:a.connectType=111;break;case"CELLULAR_HSPAP":case 112:a.connectType=112;break}switch(e.connectReason){default:if(typeof e.connectReason=="number"){a.connectReason=e.connectReason;break}break;case"PUSH":case 0:a.connectReason=0;break;case"USER_ACTIVATED":case 1:a.connectReason=1;break;case"SCHEDULED":case 2:a.connectReason=2;break;case"ERROR_RECONNECT":case 3:a.connectReason=3;break;case"NETWORK_SWITCH":case 4:a.connectReason=4;break;case"PING_RECONNECT":case 5:a.connectReason=5;break;case"UNKNOWN":case 6:a.connectReason=6;break}if(e.shards){if(!Array.isArray(e.shards))throw TypeError(".proto.ClientPayload.shards: array expected");a.shards=[];for(var A=0;A>>0),e.device!=null&&(a.device=e.device>>>0),e.devicePairingData!=null){if(typeof e.devicePairingData!="object")throw TypeError(".proto.ClientPayload.devicePairingData: object expected");a.devicePairingData=p.proto.ClientPayload.DevicePairingRegistrationData.fromObject(e.devicePairingData)}switch(e.product){default:if(typeof e.product=="number"){a.product=e.product;break}break;case"WHATSAPP":case 0:a.product=0;break;case"MESSENGER":case 1:a.product=1;break;case"INTEROP":case 2:a.product=2;break;case"INTEROP_MSGR":case 3:a.product=3;break;case"WHATSAPP_LID":case 4:a.product=4;break}switch(e.fbCat!=null&&(typeof e.fbCat=="string"?l.base64.decode(e.fbCat,a.fbCat=l.newBuffer(l.base64.length(e.fbCat)),0):e.fbCat.length>=0&&(a.fbCat=e.fbCat)),e.fbUserAgent!=null&&(typeof e.fbUserAgent=="string"?l.base64.decode(e.fbUserAgent,a.fbUserAgent=l.newBuffer(l.base64.length(e.fbUserAgent)),0):e.fbUserAgent.length>=0&&(a.fbUserAgent=e.fbUserAgent)),e.oc!=null&&(a.oc=!!e.oc),e.lc!=null&&(a.lc=e.lc|0),e.iosAppExtension){default:if(typeof e.iosAppExtension=="number"){a.iosAppExtension=e.iosAppExtension;break}break;case"SHARE_EXTENSION":case 0:a.iosAppExtension=0;break;case"SERVICE_EXTENSION":case 1:a.iosAppExtension=1;break;case"INTENTS_EXTENSION":case 2:a.iosAppExtension=2;break}if(e.fbAppId!=null&&(l.Long?(a.fbAppId=l.Long.fromValue(e.fbAppId)).unsigned=!0:typeof e.fbAppId=="string"?a.fbAppId=parseInt(e.fbAppId,10):typeof e.fbAppId=="number"?a.fbAppId=e.fbAppId:typeof e.fbAppId=="object"&&(a.fbAppId=new l.LongBits(e.fbAppId.low>>>0,e.fbAppId.high>>>0).toNumber(!0))),e.fbDeviceId!=null&&(typeof e.fbDeviceId=="string"?l.base64.decode(e.fbDeviceId,a.fbDeviceId=l.newBuffer(l.base64.length(e.fbDeviceId)),0):e.fbDeviceId.length>=0&&(a.fbDeviceId=e.fbDeviceId)),e.pull!=null&&(a.pull=!!e.pull),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,a.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(a.paddingBytes=e.paddingBytes)),e.yearClass!=null&&(a.yearClass=e.yearClass|0),e.memClass!=null&&(a.memClass=e.memClass|0),e.interopData!=null){if(typeof e.interopData!="object")throw TypeError(".proto.ClientPayload.interopData: object expected");a.interopData=p.proto.ClientPayload.InteropData.fromObject(e.interopData)}switch(e.trafficAnonymization){default:if(typeof e.trafficAnonymization=="number"){a.trafficAnonymization=e.trafficAnonymization;break}break;case"OFF":case 0:a.trafficAnonymization=0;break;case"STANDARD":case 1:a.trafficAnonymization=1;break}switch(e.lidDbMigrated!=null&&(a.lidDbMigrated=!!e.lidDbMigrated),e.accountType){default:if(typeof e.accountType=="number"){a.accountType=e.accountType;break}break;case"DEFAULT":case 0:a.accountType=0;break;case"GUEST":case 1:a.accountType=1;break}return e.connectionSequenceInfo!=null&&(a.connectionSequenceInfo=e.connectionSequenceInfo|0),e.paaLink!=null&&(a.paaLink=!!e.paaLink),e.preacksCount!=null&&(a.preacksCount=e.preacksCount|0),e.processingQueueSize!=null&&(a.processingQueueSize=e.processingQueueSize|0),a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.shards=[]),e.username!=null&&e.hasOwnProperty("username")&&(typeof e.username=="number"?A.username=a.longs===String?String(e.username):e.username:A.username=a.longs===String?oe(e.username,!0):a.longs===Number?ne(e.username,!0):e.username,a.oneofs&&(A._username="username")),e.passive!=null&&e.hasOwnProperty("passive")&&(A.passive=e.passive,a.oneofs&&(A._passive="passive")),e.userAgent!=null&&e.hasOwnProperty("userAgent")&&(A.userAgent=p.proto.ClientPayload.UserAgent.toObject(e.userAgent,a),a.oneofs&&(A._userAgent="userAgent")),e.webInfo!=null&&e.hasOwnProperty("webInfo")&&(A.webInfo=p.proto.ClientPayload.WebInfo.toObject(e.webInfo,a),a.oneofs&&(A._webInfo="webInfo")),e.pushName!=null&&e.hasOwnProperty("pushName")&&(A.pushName=e.pushName,a.oneofs&&(A._pushName="pushName")),e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,a.oneofs&&(A._sessionId="sessionId")),e.shortConnect!=null&&e.hasOwnProperty("shortConnect")&&(A.shortConnect=e.shortConnect,a.oneofs&&(A._shortConnect="shortConnect")),e.connectType!=null&&e.hasOwnProperty("connectType")&&(A.connectType=a.enums===String?p.proto.ClientPayload.ConnectType[e.connectType]===void 0?e.connectType:p.proto.ClientPayload.ConnectType[e.connectType]:e.connectType,a.oneofs&&(A._connectType="connectType")),e.connectReason!=null&&e.hasOwnProperty("connectReason")&&(A.connectReason=a.enums===String?p.proto.ClientPayload.ConnectReason[e.connectReason]===void 0?e.connectReason:p.proto.ClientPayload.ConnectReason[e.connectReason]:e.connectReason,a.oneofs&&(A._connectReason="connectReason")),e.shards&&e.shards.length){A.shards=[];for(var t=0;t>>3){case 15:{c.dnsMethod=A.int32();break}case 16:{c.appCached=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.DNSSource)return A;var t=new p.proto.ClientPayload.DNSSource;switch(A.dnsMethod){default:if(typeof A.dnsMethod=="number"){t.dnsMethod=A.dnsMethod;break}break;case"SYSTEM":case 0:t.dnsMethod=0;break;case"GOOGLE":case 1:t.dnsMethod=1;break;case"HARDCODED":case 2:t.dnsMethod=2;break;case"OVERRIDE":case 3:t.dnsMethod=3;break;case"FALLBACK":case 4:t.dnsMethod=4;break;case"MNS":case 5:t.dnsMethod=5;break}return A.appCached!=null&&(t.appCached=!!A.appCached),t},i.toObject=function(A,t){t||(t={});var s={};return A.dnsMethod!=null&&A.hasOwnProperty("dnsMethod")&&(s.dnsMethod=t.enums===String?p.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]===void 0?A.dnsMethod:p.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]:A.dnsMethod,t.oneofs&&(s._dnsMethod="dnsMethod")),A.appCached!=null&&A.hasOwnProperty("appCached")&&(s.appCached=A.appCached,t.oneofs&&(s._appCached="appCached")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DNSSource"},i.DNSResolutionMethod=(function(){let a={},A=Object.create(a);return A[a[0]="SYSTEM"]=0,A[a[1]="GOOGLE"]=1,A[a[2]="HARDCODED"]=2,A[a[3]="OVERRIDE"]=3,A[a[4]="FALLBACK"]=4,A[a[5]="MNS"]=5,A})(),i})(),r.DevicePairingRegistrationData=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.eRegid=A.bytes();break}case 2:{c.eKeytype=A.bytes();break}case 3:{c.eIdent=A.bytes();break}case 4:{c.eSkeyId=A.bytes();break}case 5:{c.eSkeyVal=A.bytes();break}case 6:{c.eSkeySig=A.bytes();break}case 7:{c.buildHash=A.bytes();break}case 8:{c.deviceProps=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.DevicePairingRegistrationData)return A;var t=new p.proto.ClientPayload.DevicePairingRegistrationData;return A.eRegid!=null&&(typeof A.eRegid=="string"?l.base64.decode(A.eRegid,t.eRegid=l.newBuffer(l.base64.length(A.eRegid)),0):A.eRegid.length>=0&&(t.eRegid=A.eRegid)),A.eKeytype!=null&&(typeof A.eKeytype=="string"?l.base64.decode(A.eKeytype,t.eKeytype=l.newBuffer(l.base64.length(A.eKeytype)),0):A.eKeytype.length>=0&&(t.eKeytype=A.eKeytype)),A.eIdent!=null&&(typeof A.eIdent=="string"?l.base64.decode(A.eIdent,t.eIdent=l.newBuffer(l.base64.length(A.eIdent)),0):A.eIdent.length>=0&&(t.eIdent=A.eIdent)),A.eSkeyId!=null&&(typeof A.eSkeyId=="string"?l.base64.decode(A.eSkeyId,t.eSkeyId=l.newBuffer(l.base64.length(A.eSkeyId)),0):A.eSkeyId.length>=0&&(t.eSkeyId=A.eSkeyId)),A.eSkeyVal!=null&&(typeof A.eSkeyVal=="string"?l.base64.decode(A.eSkeyVal,t.eSkeyVal=l.newBuffer(l.base64.length(A.eSkeyVal)),0):A.eSkeyVal.length>=0&&(t.eSkeyVal=A.eSkeyVal)),A.eSkeySig!=null&&(typeof A.eSkeySig=="string"?l.base64.decode(A.eSkeySig,t.eSkeySig=l.newBuffer(l.base64.length(A.eSkeySig)),0):A.eSkeySig.length>=0&&(t.eSkeySig=A.eSkeySig)),A.buildHash!=null&&(typeof A.buildHash=="string"?l.base64.decode(A.buildHash,t.buildHash=l.newBuffer(l.base64.length(A.buildHash)),0):A.buildHash.length>=0&&(t.buildHash=A.buildHash)),A.deviceProps!=null&&(typeof A.deviceProps=="string"?l.base64.decode(A.deviceProps,t.deviceProps=l.newBuffer(l.base64.length(A.deviceProps)),0):A.deviceProps.length>=0&&(t.deviceProps=A.deviceProps)),t},i.toObject=function(A,t){t||(t={});var s={};return A.eRegid!=null&&A.hasOwnProperty("eRegid")&&(s.eRegid=t.bytes===String?l.base64.encode(A.eRegid,0,A.eRegid.length):t.bytes===Array?Array.prototype.slice.call(A.eRegid):A.eRegid,t.oneofs&&(s._eRegid="eRegid")),A.eKeytype!=null&&A.hasOwnProperty("eKeytype")&&(s.eKeytype=t.bytes===String?l.base64.encode(A.eKeytype,0,A.eKeytype.length):t.bytes===Array?Array.prototype.slice.call(A.eKeytype):A.eKeytype,t.oneofs&&(s._eKeytype="eKeytype")),A.eIdent!=null&&A.hasOwnProperty("eIdent")&&(s.eIdent=t.bytes===String?l.base64.encode(A.eIdent,0,A.eIdent.length):t.bytes===Array?Array.prototype.slice.call(A.eIdent):A.eIdent,t.oneofs&&(s._eIdent="eIdent")),A.eSkeyId!=null&&A.hasOwnProperty("eSkeyId")&&(s.eSkeyId=t.bytes===String?l.base64.encode(A.eSkeyId,0,A.eSkeyId.length):t.bytes===Array?Array.prototype.slice.call(A.eSkeyId):A.eSkeyId,t.oneofs&&(s._eSkeyId="eSkeyId")),A.eSkeyVal!=null&&A.hasOwnProperty("eSkeyVal")&&(s.eSkeyVal=t.bytes===String?l.base64.encode(A.eSkeyVal,0,A.eSkeyVal.length):t.bytes===Array?Array.prototype.slice.call(A.eSkeyVal):A.eSkeyVal,t.oneofs&&(s._eSkeyVal="eSkeyVal")),A.eSkeySig!=null&&A.hasOwnProperty("eSkeySig")&&(s.eSkeySig=t.bytes===String?l.base64.encode(A.eSkeySig,0,A.eSkeySig.length):t.bytes===Array?Array.prototype.slice.call(A.eSkeySig):A.eSkeySig,t.oneofs&&(s._eSkeySig="eSkeySig")),A.buildHash!=null&&A.hasOwnProperty("buildHash")&&(s.buildHash=t.bytes===String?l.base64.encode(A.buildHash,0,A.buildHash.length):t.bytes===Array?Array.prototype.slice.call(A.buildHash):A.buildHash,t.oneofs&&(s._buildHash="buildHash")),A.deviceProps!=null&&A.hasOwnProperty("deviceProps")&&(s.deviceProps=t.bytes===String?l.base64.encode(A.deviceProps,0,A.deviceProps.length):t.bytes===Array?Array.prototype.slice.call(A.deviceProps):A.deviceProps,t.oneofs&&(s._deviceProps="deviceProps")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DevicePairingRegistrationData"},i})(),r.IOSAppExtension=(function(){let i={},e=Object.create(i);return e[i[0]="SHARE_EXTENSION"]=0,e[i[1]="SERVICE_EXTENSION"]=1,e[i[2]="INTENTS_EXTENSION"]=2,e})(),r.InteropData=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.accountId=A.uint64();break}case 2:{c.token=A.bytes();break}case 3:{c.enableReadReceipts=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.InteropData)return A;var t=new p.proto.ClientPayload.InteropData;return A.accountId!=null&&(l.Long?(t.accountId=l.Long.fromValue(A.accountId)).unsigned=!0:typeof A.accountId=="string"?t.accountId=parseInt(A.accountId,10):typeof A.accountId=="number"?t.accountId=A.accountId:typeof A.accountId=="object"&&(t.accountId=new l.LongBits(A.accountId.low>>>0,A.accountId.high>>>0).toNumber(!0))),A.token!=null&&(typeof A.token=="string"?l.base64.decode(A.token,t.token=l.newBuffer(l.base64.length(A.token)),0):A.token.length>=0&&(t.token=A.token)),A.enableReadReceipts!=null&&(t.enableReadReceipts=!!A.enableReadReceipts),t},i.toObject=function(A,t){t||(t={});var s={};return A.accountId!=null&&A.hasOwnProperty("accountId")&&(typeof A.accountId=="number"?s.accountId=t.longs===String?String(A.accountId):A.accountId:s.accountId=t.longs===String?oe(A.accountId,!0):t.longs===Number?ne(A.accountId,!0):A.accountId,t.oneofs&&(s._accountId="accountId")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=t.bytes===String?l.base64.encode(A.token,0,A.token.length):t.bytes===Array?Array.prototype.slice.call(A.token):A.token,t.oneofs&&(s._token="token")),A.enableReadReceipts!=null&&A.hasOwnProperty("enableReadReceipts")&&(s.enableReadReceipts=A.enableReadReceipts,t.oneofs&&(s._enableReadReceipts="enableReadReceipts")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.InteropData"},i})(),r.Product=(function(){let i={},e=Object.create(i);return e[i[0]="WHATSAPP"]=0,e[i[1]="MESSENGER"]=1,e[i[2]="INTEROP"]=2,e[i[3]="INTEROP_MSGR"]=3,e[i[4]="WHATSAPP_LID"]=4,e})(),r.TrafficAnonymization=(function(){let i={},e=Object.create(i);return e[i[0]="OFF"]=0,e[i[1]="STANDARD"]=1,e})(),r.UserAgent=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.platform=A.int32();break}case 2:{c.appVersion=p.proto.ClientPayload.UserAgent.AppVersion.decode(A,A.uint32());break}case 3:{c.mcc=A.string();break}case 4:{c.mnc=A.string();break}case 5:{c.osVersion=A.string();break}case 6:{c.manufacturer=A.string();break}case 7:{c.device=A.string();break}case 8:{c.osBuildNumber=A.string();break}case 9:{c.phoneId=A.string();break}case 10:{c.releaseChannel=A.int32();break}case 11:{c.localeLanguageIso6391=A.string();break}case 12:{c.localeCountryIso31661Alpha2=A.string();break}case 13:{c.deviceBoard=A.string();break}case 14:{c.deviceExpId=A.string();break}case 15:{c.deviceType=A.int32();break}case 16:{c.deviceModelType=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.UserAgent)return A;var t=new p.proto.ClientPayload.UserAgent;switch(A.platform){default:if(typeof A.platform=="number"){t.platform=A.platform;break}break;case"ANDROID":case 0:t.platform=0;break;case"IOS":case 1:t.platform=1;break;case"WINDOWS_PHONE":case 2:t.platform=2;break;case"BLACKBERRY":case 3:t.platform=3;break;case"BLACKBERRYX":case 4:t.platform=4;break;case"S40":case 5:t.platform=5;break;case"S60":case 6:t.platform=6;break;case"PYTHON_CLIENT":case 7:t.platform=7;break;case"TIZEN":case 8:t.platform=8;break;case"ENTERPRISE":case 9:t.platform=9;break;case"SMB_ANDROID":case 10:t.platform=10;break;case"KAIOS":case 11:t.platform=11;break;case"SMB_IOS":case 12:t.platform=12;break;case"WINDOWS":case 13:t.platform=13;break;case"WEB":case 14:t.platform=14;break;case"PORTAL":case 15:t.platform=15;break;case"GREEN_ANDROID":case 16:t.platform=16;break;case"GREEN_IPHONE":case 17:t.platform=17;break;case"BLUE_ANDROID":case 18:t.platform=18;break;case"BLUE_IPHONE":case 19:t.platform=19;break;case"FBLITE_ANDROID":case 20:t.platform=20;break;case"MLITE_ANDROID":case 21:t.platform=21;break;case"IGLITE_ANDROID":case 22:t.platform=22;break;case"PAGE":case 23:t.platform=23;break;case"MACOS":case 24:t.platform=24;break;case"OCULUS_MSG":case 25:t.platform=25;break;case"OCULUS_CALL":case 26:t.platform=26;break;case"MILAN":case 27:t.platform=27;break;case"CAPI":case 28:t.platform=28;break;case"WEAROS":case 29:t.platform=29;break;case"ARDEVICE":case 30:t.platform=30;break;case"VRDEVICE":case 31:t.platform=31;break;case"BLUE_WEB":case 32:t.platform=32;break;case"IPAD":case 33:t.platform=33;break;case"TEST":case 34:t.platform=34;break;case"SMART_GLASSES":case 35:t.platform=35;break;case"BLUE_VR":case 36:t.platform=36;break;case"AR_WRIST":case 37:t.platform=37;break}if(A.appVersion!=null){if(typeof A.appVersion!="object")throw TypeError(".proto.ClientPayload.UserAgent.appVersion: object expected");t.appVersion=p.proto.ClientPayload.UserAgent.AppVersion.fromObject(A.appVersion)}switch(A.mcc!=null&&(t.mcc=String(A.mcc)),A.mnc!=null&&(t.mnc=String(A.mnc)),A.osVersion!=null&&(t.osVersion=String(A.osVersion)),A.manufacturer!=null&&(t.manufacturer=String(A.manufacturer)),A.device!=null&&(t.device=String(A.device)),A.osBuildNumber!=null&&(t.osBuildNumber=String(A.osBuildNumber)),A.phoneId!=null&&(t.phoneId=String(A.phoneId)),A.releaseChannel){default:if(typeof A.releaseChannel=="number"){t.releaseChannel=A.releaseChannel;break}break;case"RELEASE":case 0:t.releaseChannel=0;break;case"BETA":case 1:t.releaseChannel=1;break;case"ALPHA":case 2:t.releaseChannel=2;break;case"DEBUG":case 3:t.releaseChannel=3;break}switch(A.localeLanguageIso6391!=null&&(t.localeLanguageIso6391=String(A.localeLanguageIso6391)),A.localeCountryIso31661Alpha2!=null&&(t.localeCountryIso31661Alpha2=String(A.localeCountryIso31661Alpha2)),A.deviceBoard!=null&&(t.deviceBoard=String(A.deviceBoard)),A.deviceExpId!=null&&(t.deviceExpId=String(A.deviceExpId)),A.deviceType){default:if(typeof A.deviceType=="number"){t.deviceType=A.deviceType;break}break;case"PHONE":case 0:t.deviceType=0;break;case"TABLET":case 1:t.deviceType=1;break;case"DESKTOP":case 2:t.deviceType=2;break;case"WEARABLE":case 3:t.deviceType=3;break;case"VR":case 4:t.deviceType=4;break}return A.deviceModelType!=null&&(t.deviceModelType=String(A.deviceModelType)),t},i.toObject=function(A,t){t||(t={});var s={};return A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=t.enums===String?p.proto.ClientPayload.UserAgent.Platform[A.platform]===void 0?A.platform:p.proto.ClientPayload.UserAgent.Platform[A.platform]:A.platform,t.oneofs&&(s._platform="platform")),A.appVersion!=null&&A.hasOwnProperty("appVersion")&&(s.appVersion=p.proto.ClientPayload.UserAgent.AppVersion.toObject(A.appVersion,t),t.oneofs&&(s._appVersion="appVersion")),A.mcc!=null&&A.hasOwnProperty("mcc")&&(s.mcc=A.mcc,t.oneofs&&(s._mcc="mcc")),A.mnc!=null&&A.hasOwnProperty("mnc")&&(s.mnc=A.mnc,t.oneofs&&(s._mnc="mnc")),A.osVersion!=null&&A.hasOwnProperty("osVersion")&&(s.osVersion=A.osVersion,t.oneofs&&(s._osVersion="osVersion")),A.manufacturer!=null&&A.hasOwnProperty("manufacturer")&&(s.manufacturer=A.manufacturer,t.oneofs&&(s._manufacturer="manufacturer")),A.device!=null&&A.hasOwnProperty("device")&&(s.device=A.device,t.oneofs&&(s._device="device")),A.osBuildNumber!=null&&A.hasOwnProperty("osBuildNumber")&&(s.osBuildNumber=A.osBuildNumber,t.oneofs&&(s._osBuildNumber="osBuildNumber")),A.phoneId!=null&&A.hasOwnProperty("phoneId")&&(s.phoneId=A.phoneId,t.oneofs&&(s._phoneId="phoneId")),A.releaseChannel!=null&&A.hasOwnProperty("releaseChannel")&&(s.releaseChannel=t.enums===String?p.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]===void 0?A.releaseChannel:p.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]:A.releaseChannel,t.oneofs&&(s._releaseChannel="releaseChannel")),A.localeLanguageIso6391!=null&&A.hasOwnProperty("localeLanguageIso6391")&&(s.localeLanguageIso6391=A.localeLanguageIso6391,t.oneofs&&(s._localeLanguageIso6391="localeLanguageIso6391")),A.localeCountryIso31661Alpha2!=null&&A.hasOwnProperty("localeCountryIso31661Alpha2")&&(s.localeCountryIso31661Alpha2=A.localeCountryIso31661Alpha2,t.oneofs&&(s._localeCountryIso31661Alpha2="localeCountryIso31661Alpha2")),A.deviceBoard!=null&&A.hasOwnProperty("deviceBoard")&&(s.deviceBoard=A.deviceBoard,t.oneofs&&(s._deviceBoard="deviceBoard")),A.deviceExpId!=null&&A.hasOwnProperty("deviceExpId")&&(s.deviceExpId=A.deviceExpId,t.oneofs&&(s._deviceExpId="deviceExpId")),A.deviceType!=null&&A.hasOwnProperty("deviceType")&&(s.deviceType=t.enums===String?p.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]===void 0?A.deviceType:p.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]:A.deviceType,t.oneofs&&(s._deviceType="deviceType")),A.deviceModelType!=null&&A.hasOwnProperty("deviceModelType")&&(s.deviceModelType=A.deviceModelType,t.oneofs&&(s._deviceModelType="deviceModelType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.UserAgent"},i.AppVersion=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.primary=s.uint32();break}case 2:{d.secondary=s.uint32();break}case 3:{d.tertiary=s.uint32();break}case 4:{d.quaternary=s.uint32();break}case 5:{d.quinary=s.uint32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ClientPayload.UserAgent.AppVersion)return s;var g=new p.proto.ClientPayload.UserAgent.AppVersion;return s.primary!=null&&(g.primary=s.primary>>>0),s.secondary!=null&&(g.secondary=s.secondary>>>0),s.tertiary!=null&&(g.tertiary=s.tertiary>>>0),s.quaternary!=null&&(g.quaternary=s.quaternary>>>0),s.quinary!=null&&(g.quinary=s.quinary>>>0),g},a.toObject=function(s,g){g||(g={});var c={};return s.primary!=null&&s.hasOwnProperty("primary")&&(c.primary=s.primary,g.oneofs&&(c._primary="primary")),s.secondary!=null&&s.hasOwnProperty("secondary")&&(c.secondary=s.secondary,g.oneofs&&(c._secondary="secondary")),s.tertiary!=null&&s.hasOwnProperty("tertiary")&&(c.tertiary=s.tertiary,g.oneofs&&(c._tertiary="tertiary")),s.quaternary!=null&&s.hasOwnProperty("quaternary")&&(c.quaternary=s.quaternary,g.oneofs&&(c._quaternary="quaternary")),s.quinary!=null&&s.hasOwnProperty("quinary")&&(c.quinary=s.quinary,g.oneofs&&(c._quinary="quinary")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.UserAgent.AppVersion"},a})(),i.DeviceType=(function(){let a={},A=Object.create(a);return A[a[0]="PHONE"]=0,A[a[1]="TABLET"]=1,A[a[2]="DESKTOP"]=2,A[a[3]="WEARABLE"]=3,A[a[4]="VR"]=4,A})(),i.Platform=(function(){let a={},A=Object.create(a);return A[a[0]="ANDROID"]=0,A[a[1]="IOS"]=1,A[a[2]="WINDOWS_PHONE"]=2,A[a[3]="BLACKBERRY"]=3,A[a[4]="BLACKBERRYX"]=4,A[a[5]="S40"]=5,A[a[6]="S60"]=6,A[a[7]="PYTHON_CLIENT"]=7,A[a[8]="TIZEN"]=8,A[a[9]="ENTERPRISE"]=9,A[a[10]="SMB_ANDROID"]=10,A[a[11]="KAIOS"]=11,A[a[12]="SMB_IOS"]=12,A[a[13]="WINDOWS"]=13,A[a[14]="WEB"]=14,A[a[15]="PORTAL"]=15,A[a[16]="GREEN_ANDROID"]=16,A[a[17]="GREEN_IPHONE"]=17,A[a[18]="BLUE_ANDROID"]=18,A[a[19]="BLUE_IPHONE"]=19,A[a[20]="FBLITE_ANDROID"]=20,A[a[21]="MLITE_ANDROID"]=21,A[a[22]="IGLITE_ANDROID"]=22,A[a[23]="PAGE"]=23,A[a[24]="MACOS"]=24,A[a[25]="OCULUS_MSG"]=25,A[a[26]="OCULUS_CALL"]=26,A[a[27]="MILAN"]=27,A[a[28]="CAPI"]=28,A[a[29]="WEAROS"]=29,A[a[30]="ARDEVICE"]=30,A[a[31]="VRDEVICE"]=31,A[a[32]="BLUE_WEB"]=32,A[a[33]="IPAD"]=33,A[a[34]="TEST"]=34,A[a[35]="SMART_GLASSES"]=35,A[a[36]="BLUE_VR"]=36,A[a[37]="AR_WRIST"]=37,A})(),i.ReleaseChannel=(function(){let a={},A=Object.create(a);return A[a[0]="RELEASE"]=0,A[a[1]="BETA"]=1,A[a[2]="ALPHA"]=2,A[a[3]="DEBUG"]=3,A})(),i})(),r.WebInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.refToken=A.string();break}case 2:{c.version=A.string();break}case 3:{c.webdPayload=p.proto.ClientPayload.WebInfo.WebdPayload.decode(A,A.uint32());break}case 4:{c.webSubPlatform=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ClientPayload.WebInfo)return A;var t=new p.proto.ClientPayload.WebInfo;if(A.refToken!=null&&(t.refToken=String(A.refToken)),A.version!=null&&(t.version=String(A.version)),A.webdPayload!=null){if(typeof A.webdPayload!="object")throw TypeError(".proto.ClientPayload.WebInfo.webdPayload: object expected");t.webdPayload=p.proto.ClientPayload.WebInfo.WebdPayload.fromObject(A.webdPayload)}switch(A.webSubPlatform){default:if(typeof A.webSubPlatform=="number"){t.webSubPlatform=A.webSubPlatform;break}break;case"WEB_BROWSER":case 0:t.webSubPlatform=0;break;case"APP_STORE":case 1:t.webSubPlatform=1;break;case"WIN_STORE":case 2:t.webSubPlatform=2;break;case"DARWIN":case 3:t.webSubPlatform=3;break;case"WIN32":case 4:t.webSubPlatform=4;break;case"WIN_HYBRID":case 5:t.webSubPlatform=5;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.refToken!=null&&A.hasOwnProperty("refToken")&&(s.refToken=A.refToken,t.oneofs&&(s._refToken="refToken")),A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,t.oneofs&&(s._version="version")),A.webdPayload!=null&&A.hasOwnProperty("webdPayload")&&(s.webdPayload=p.proto.ClientPayload.WebInfo.WebdPayload.toObject(A.webdPayload,t),t.oneofs&&(s._webdPayload="webdPayload")),A.webSubPlatform!=null&&A.hasOwnProperty("webSubPlatform")&&(s.webSubPlatform=t.enums===String?p.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]===void 0?A.webSubPlatform:p.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]:A.webSubPlatform,t.oneofs&&(s._webSubPlatform="webSubPlatform")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.WebInfo"},i.WebSubPlatform=(function(){let a={},A=Object.create(a);return A[a[0]="WEB_BROWSER"]=0,A[a[1]="APP_STORE"]=1,A[a[2]="WIN_STORE"]=2,A[a[3]="DARWIN"]=3,A[a[4]="WIN32"]=4,A[a[5]="WIN_HYBRID"]=5,A})(),i.WebdPayload=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.usesParticipantInKey=s.bool();break}case 2:{d.supportsStarredMessages=s.bool();break}case 3:{d.supportsDocumentMessages=s.bool();break}case 4:{d.supportsUrlMessages=s.bool();break}case 5:{d.supportsMediaRetry=s.bool();break}case 6:{d.supportsE2EImage=s.bool();break}case 7:{d.supportsE2EVideo=s.bool();break}case 8:{d.supportsE2EAudio=s.bool();break}case 9:{d.supportsE2EDocument=s.bool();break}case 10:{d.documentTypes=s.string();break}case 11:{d.features=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ClientPayload.WebInfo.WebdPayload)return s;var g=new p.proto.ClientPayload.WebInfo.WebdPayload;return s.usesParticipantInKey!=null&&(g.usesParticipantInKey=!!s.usesParticipantInKey),s.supportsStarredMessages!=null&&(g.supportsStarredMessages=!!s.supportsStarredMessages),s.supportsDocumentMessages!=null&&(g.supportsDocumentMessages=!!s.supportsDocumentMessages),s.supportsUrlMessages!=null&&(g.supportsUrlMessages=!!s.supportsUrlMessages),s.supportsMediaRetry!=null&&(g.supportsMediaRetry=!!s.supportsMediaRetry),s.supportsE2EImage!=null&&(g.supportsE2EImage=!!s.supportsE2EImage),s.supportsE2EVideo!=null&&(g.supportsE2EVideo=!!s.supportsE2EVideo),s.supportsE2EAudio!=null&&(g.supportsE2EAudio=!!s.supportsE2EAudio),s.supportsE2EDocument!=null&&(g.supportsE2EDocument=!!s.supportsE2EDocument),s.documentTypes!=null&&(g.documentTypes=String(s.documentTypes)),s.features!=null&&(typeof s.features=="string"?l.base64.decode(s.features,g.features=l.newBuffer(l.base64.length(s.features)),0):s.features.length>=0&&(g.features=s.features)),g},a.toObject=function(s,g){g||(g={});var c={};return s.usesParticipantInKey!=null&&s.hasOwnProperty("usesParticipantInKey")&&(c.usesParticipantInKey=s.usesParticipantInKey,g.oneofs&&(c._usesParticipantInKey="usesParticipantInKey")),s.supportsStarredMessages!=null&&s.hasOwnProperty("supportsStarredMessages")&&(c.supportsStarredMessages=s.supportsStarredMessages,g.oneofs&&(c._supportsStarredMessages="supportsStarredMessages")),s.supportsDocumentMessages!=null&&s.hasOwnProperty("supportsDocumentMessages")&&(c.supportsDocumentMessages=s.supportsDocumentMessages,g.oneofs&&(c._supportsDocumentMessages="supportsDocumentMessages")),s.supportsUrlMessages!=null&&s.hasOwnProperty("supportsUrlMessages")&&(c.supportsUrlMessages=s.supportsUrlMessages,g.oneofs&&(c._supportsUrlMessages="supportsUrlMessages")),s.supportsMediaRetry!=null&&s.hasOwnProperty("supportsMediaRetry")&&(c.supportsMediaRetry=s.supportsMediaRetry,g.oneofs&&(c._supportsMediaRetry="supportsMediaRetry")),s.supportsE2EImage!=null&&s.hasOwnProperty("supportsE2EImage")&&(c.supportsE2EImage=s.supportsE2EImage,g.oneofs&&(c._supportsE2EImage="supportsE2EImage")),s.supportsE2EVideo!=null&&s.hasOwnProperty("supportsE2EVideo")&&(c.supportsE2EVideo=s.supportsE2EVideo,g.oneofs&&(c._supportsE2EVideo="supportsE2EVideo")),s.supportsE2EAudio!=null&&s.hasOwnProperty("supportsE2EAudio")&&(c.supportsE2EAudio=s.supportsE2EAudio,g.oneofs&&(c._supportsE2EAudio="supportsE2EAudio")),s.supportsE2EDocument!=null&&s.hasOwnProperty("supportsE2EDocument")&&(c.supportsE2EDocument=s.supportsE2EDocument,g.oneofs&&(c._supportsE2EDocument="supportsE2EDocument")),s.documentTypes!=null&&s.hasOwnProperty("documentTypes")&&(c.documentTypes=s.documentTypes,g.oneofs&&(c._documentTypes="documentTypes")),s.features!=null&&s.hasOwnProperty("features")&&(c.features=g.bytes===String?l.base64.encode(s.features,0,s.features.length):g.bytes===Array?Array.prototype.slice.call(s.features):s.features,g.oneofs&&(c._features="features")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.WebInfo.WebdPayload"},a})(),i})(),r})(),n.CollectionName=(function(){let r={},o=Object.create(r);return o[r[0]="COLLECTION_NAME_UNKNOWN"]=0,o[r[1]="REGULAR"]=1,o[r[2]="REGULAR_LOW"]=2,o[r[3]="REGULAR_HIGH"]=3,o[r[4]="CRITICAL_BLOCK"]=4,o[r[5]="CRITICAL_UNBLOCK_LOW"]=5,o})(),n.CommentMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.commentParentKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.replyCount=e.uint32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.CommentMetadata)return e;var a=new p.proto.CommentMetadata;if(e.commentParentKey!=null){if(typeof e.commentParentKey!="object")throw TypeError(".proto.CommentMetadata.commentParentKey: object expected");a.commentParentKey=p.proto.MessageKey.fromObject(e.commentParentKey)}return e.replyCount!=null&&(a.replyCount=e.replyCount>>>0),a},r.toObject=function(e,a){a||(a={});var A={};return e.commentParentKey!=null&&e.hasOwnProperty("commentParentKey")&&(A.commentParentKey=p.proto.MessageKey.toObject(e.commentParentKey,a),a.oneofs&&(A._commentParentKey="commentParentKey")),e.replyCount!=null&&e.hasOwnProperty("replyCount")&&(A.replyCount=e.replyCount,a.oneofs&&(A._replyCount="replyCount")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CommentMetadata"},r})(),n.CompanionCommitment=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.hash=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.CompanionCommitment)return e;var a=new p.proto.CompanionCommitment;return e.hash!=null&&(typeof e.hash=="string"?l.base64.decode(e.hash,a.hash=l.newBuffer(l.base64.length(e.hash)),0):e.hash.length>=0&&(a.hash=e.hash)),a},r.toObject=function(e,a){a||(a={});var A={};return e.hash!=null&&e.hasOwnProperty("hash")&&(A.hash=a.bytes===String?l.base64.encode(e.hash,0,e.hash.length):a.bytes===Array?Array.prototype.slice.call(e.hash):e.hash,a.oneofs&&(A._hash="hash")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionCommitment"},r})(),n.CompanionEphemeralIdentity=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.deviceType=e.int32();break}case 3:{s.ref=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.CompanionEphemeralIdentity)return e;var a=new p.proto.CompanionEphemeralIdentity;switch(e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.deviceType){default:if(typeof e.deviceType=="number"){a.deviceType=e.deviceType;break}break;case"UNKNOWN":case 0:a.deviceType=0;break;case"CHROME":case 1:a.deviceType=1;break;case"FIREFOX":case 2:a.deviceType=2;break;case"IE":case 3:a.deviceType=3;break;case"OPERA":case 4:a.deviceType=4;break;case"SAFARI":case 5:a.deviceType=5;break;case"EDGE":case 6:a.deviceType=6;break;case"DESKTOP":case 7:a.deviceType=7;break;case"IPAD":case 8:a.deviceType=8;break;case"ANDROID_TABLET":case 9:a.deviceType=9;break;case"OHANA":case 10:a.deviceType=10;break;case"ALOHA":case 11:a.deviceType=11;break;case"CATALINA":case 12:a.deviceType=12;break;case"TCL_TV":case 13:a.deviceType=13;break;case"IOS_PHONE":case 14:a.deviceType=14;break;case"IOS_CATALYST":case 15:a.deviceType=15;break;case"ANDROID_PHONE":case 16:a.deviceType=16;break;case"ANDROID_AMBIGUOUS":case 17:a.deviceType=17;break;case"WEAR_OS":case 18:a.deviceType=18;break;case"AR_WRIST":case 19:a.deviceType=19;break;case"AR_DEVICE":case 20:a.deviceType=20;break;case"UWP":case 21:a.deviceType=21;break;case"VR":case 22:a.deviceType=22;break;case"CLOUD_API":case 23:a.deviceType=23;break;case"SMARTGLASSES":case 24:a.deviceType=24;break}return e.ref!=null&&(a.ref=String(e.ref)),a},r.toObject=function(e,a){a||(a={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=a.enums===String?p.proto.DeviceProps.PlatformType[e.deviceType]===void 0?e.deviceType:p.proto.DeviceProps.PlatformType[e.deviceType]:e.deviceType,a.oneofs&&(A._deviceType="deviceType")),e.ref!=null&&e.hasOwnProperty("ref")&&(A.ref=e.ref,a.oneofs&&(A._ref="ref")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionEphemeralIdentity"},r})(),n.Config=(function(){function r(i){if(this.field={},i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.field===l.emptyObject&&(s.field={});var d=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=p.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.field[g]=c;break}case 2:{s.version=e.uint32();break}default:e.skipType(I&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Config)return e;var a=new p.proto.Config;if(e.field){if(typeof e.field!="object")throw TypeError(".proto.Config.field: object expected");a.field={};for(var A=Object.keys(e.field),t=0;t>>0),a},r.toObject=function(e,a){a||(a={});var A={};(a.objects||a.defaults)&&(A.field={});var t;if(e.field&&(t=Object.keys(e.field)).length){A.field={};for(var s=0;s>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.participant=e.string();break}case 3:{s.quotedMessage=p.proto.Message.decode(e,e.uint32());break}case 4:{s.remoteJid=e.string();break}case 15:{s.mentionedJid&&s.mentionedJid.length||(s.mentionedJid=[]),s.mentionedJid.push(e.string());break}case 18:{s.conversionSource=e.string();break}case 19:{s.conversionData=e.bytes();break}case 20:{s.conversionDelaySeconds=e.uint32();break}case 21:{s.forwardingScore=e.uint32();break}case 22:{s.isForwarded=e.bool();break}case 23:{s.quotedAd=p.proto.ContextInfo.AdReplyInfo.decode(e,e.uint32());break}case 24:{s.placeholderKey=p.proto.MessageKey.decode(e,e.uint32());break}case 25:{s.expiration=e.uint32();break}case 26:{s.ephemeralSettingTimestamp=e.int64();break}case 27:{s.ephemeralSharedSecret=e.bytes();break}case 28:{s.externalAdReply=p.proto.ContextInfo.ExternalAdReplyInfo.decode(e,e.uint32());break}case 29:{s.entryPointConversionSource=e.string();break}case 30:{s.entryPointConversionApp=e.string();break}case 31:{s.entryPointConversionDelaySeconds=e.uint32();break}case 32:{s.disappearingMode=p.proto.DisappearingMode.decode(e,e.uint32());break}case 33:{s.actionLink=p.proto.ActionLink.decode(e,e.uint32());break}case 34:{s.groupSubject=e.string();break}case 35:{s.parentGroupJid=e.string();break}case 37:{s.trustBannerType=e.string();break}case 38:{s.trustBannerAction=e.uint32();break}case 39:{s.isSampled=e.bool();break}case 40:{s.groupMentions&&s.groupMentions.length||(s.groupMentions=[]),s.groupMentions.push(p.proto.GroupMention.decode(e,e.uint32()));break}case 41:{s.utm=p.proto.ContextInfo.UTMInfo.decode(e,e.uint32());break}case 43:{s.forwardedNewsletterMessageInfo=p.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 44:{s.businessMessageForwardInfo=p.proto.ContextInfo.BusinessMessageForwardInfo.decode(e,e.uint32());break}case 45:{s.smbClientCampaignId=e.string();break}case 46:{s.smbServerCampaignId=e.string();break}case 47:{s.dataSharingContext=p.proto.ContextInfo.DataSharingContext.decode(e,e.uint32());break}case 48:{s.alwaysShowAdAttribution=e.bool();break}case 49:{s.featureEligibilities=p.proto.ContextInfo.FeatureEligibilities.decode(e,e.uint32());break}case 50:{s.entryPointConversionExternalSource=e.string();break}case 51:{s.entryPointConversionExternalMedium=e.string();break}case 54:{s.ctwaSignals=e.string();break}case 55:{s.ctwaPayload=e.bytes();break}case 56:{s.forwardedAiBotMessageInfo=p.proto.ForwardedAIBotMessageInfo.decode(e,e.uint32());break}case 57:{s.statusAttributionType=e.int32();break}case 58:{s.urlTrackingMap=p.proto.UrlTrackingMap.decode(e,e.uint32());break}case 59:{s.pairedMediaType=e.int32();break}case 60:{s.rankingVersion=e.uint32();break}case 62:{s.memberLabel=p.proto.MemberLabel.decode(e,e.uint32());break}case 63:{s.isQuestion=e.bool();break}case 64:{s.statusSourceType=e.int32();break}case 65:{s.statusAttributions&&s.statusAttributions.length||(s.statusAttributions=[]),s.statusAttributions.push(p.proto.StatusAttribution.decode(e,e.uint32()));break}case 66:{s.isGroupStatus=e.bool();break}case 67:{s.forwardOrigin=e.int32();break}case 68:{s.questionReplyQuotedMessage=p.proto.ContextInfo.QuestionReplyQuotedMessage.decode(e,e.uint32());break}case 69:{s.statusAudienceMetadata=p.proto.ContextInfo.StatusAudienceMetadata.decode(e,e.uint32());break}case 70:{s.nonJidMentions=e.uint32();break}case 71:{s.quotedType=e.int32();break}case 72:{s.botMessageSharingInfo=p.proto.BotMessageSharingInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ContextInfo)return e;var a=new p.proto.ContextInfo;if(e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),e.participant!=null&&(a.participant=String(e.participant)),e.quotedMessage!=null){if(typeof e.quotedMessage!="object")throw TypeError(".proto.ContextInfo.quotedMessage: object expected");a.quotedMessage=p.proto.Message.fromObject(e.quotedMessage)}if(e.remoteJid!=null&&(a.remoteJid=String(e.remoteJid)),e.mentionedJid){if(!Array.isArray(e.mentionedJid))throw TypeError(".proto.ContextInfo.mentionedJid: array expected");a.mentionedJid=[];for(var A=0;A=0&&(a.conversionData=e.conversionData)),e.conversionDelaySeconds!=null&&(a.conversionDelaySeconds=e.conversionDelaySeconds>>>0),e.forwardingScore!=null&&(a.forwardingScore=e.forwardingScore>>>0),e.isForwarded!=null&&(a.isForwarded=!!e.isForwarded),e.quotedAd!=null){if(typeof e.quotedAd!="object")throw TypeError(".proto.ContextInfo.quotedAd: object expected");a.quotedAd=p.proto.ContextInfo.AdReplyInfo.fromObject(e.quotedAd)}if(e.placeholderKey!=null){if(typeof e.placeholderKey!="object")throw TypeError(".proto.ContextInfo.placeholderKey: object expected");a.placeholderKey=p.proto.MessageKey.fromObject(e.placeholderKey)}if(e.expiration!=null&&(a.expiration=e.expiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(a.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?a.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?a.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(a.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.ephemeralSharedSecret!=null&&(typeof e.ephemeralSharedSecret=="string"?l.base64.decode(e.ephemeralSharedSecret,a.ephemeralSharedSecret=l.newBuffer(l.base64.length(e.ephemeralSharedSecret)),0):e.ephemeralSharedSecret.length>=0&&(a.ephemeralSharedSecret=e.ephemeralSharedSecret)),e.externalAdReply!=null){if(typeof e.externalAdReply!="object")throw TypeError(".proto.ContextInfo.externalAdReply: object expected");a.externalAdReply=p.proto.ContextInfo.ExternalAdReplyInfo.fromObject(e.externalAdReply)}if(e.entryPointConversionSource!=null&&(a.entryPointConversionSource=String(e.entryPointConversionSource)),e.entryPointConversionApp!=null&&(a.entryPointConversionApp=String(e.entryPointConversionApp)),e.entryPointConversionDelaySeconds!=null&&(a.entryPointConversionDelaySeconds=e.entryPointConversionDelaySeconds>>>0),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.ContextInfo.disappearingMode: object expected");a.disappearingMode=p.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.actionLink!=null){if(typeof e.actionLink!="object")throw TypeError(".proto.ContextInfo.actionLink: object expected");a.actionLink=p.proto.ActionLink.fromObject(e.actionLink)}if(e.groupSubject!=null&&(a.groupSubject=String(e.groupSubject)),e.parentGroupJid!=null&&(a.parentGroupJid=String(e.parentGroupJid)),e.trustBannerType!=null&&(a.trustBannerType=String(e.trustBannerType)),e.trustBannerAction!=null&&(a.trustBannerAction=e.trustBannerAction>>>0),e.isSampled!=null&&(a.isSampled=!!e.isSampled),e.groupMentions){if(!Array.isArray(e.groupMentions))throw TypeError(".proto.ContextInfo.groupMentions: array expected");a.groupMentions=[];for(var A=0;A=0&&(a.ctwaPayload=e.ctwaPayload)),e.forwardedAiBotMessageInfo!=null){if(typeof e.forwardedAiBotMessageInfo!="object")throw TypeError(".proto.ContextInfo.forwardedAiBotMessageInfo: object expected");a.forwardedAiBotMessageInfo=p.proto.ForwardedAIBotMessageInfo.fromObject(e.forwardedAiBotMessageInfo)}switch(e.statusAttributionType){default:if(typeof e.statusAttributionType=="number"){a.statusAttributionType=e.statusAttributionType;break}break;case"NONE":case 0:a.statusAttributionType=0;break;case"RESHARED_FROM_MENTION":case 1:a.statusAttributionType=1;break;case"RESHARED_FROM_POST":case 2:a.statusAttributionType=2;break;case"RESHARED_FROM_POST_MANY_TIMES":case 3:a.statusAttributionType=3;break;case"FORWARDED_FROM_STATUS":case 4:a.statusAttributionType=4;break}if(e.urlTrackingMap!=null){if(typeof e.urlTrackingMap!="object")throw TypeError(".proto.ContextInfo.urlTrackingMap: object expected");a.urlTrackingMap=p.proto.UrlTrackingMap.fromObject(e.urlTrackingMap)}switch(e.pairedMediaType){default:if(typeof e.pairedMediaType=="number"){a.pairedMediaType=e.pairedMediaType;break}break;case"NOT_PAIRED_MEDIA":case 0:a.pairedMediaType=0;break;case"SD_VIDEO_PARENT":case 1:a.pairedMediaType=1;break;case"HD_VIDEO_CHILD":case 2:a.pairedMediaType=2;break;case"SD_IMAGE_PARENT":case 3:a.pairedMediaType=3;break;case"HD_IMAGE_CHILD":case 4:a.pairedMediaType=4;break;case"MOTION_PHOTO_PARENT":case 5:a.pairedMediaType=5;break;case"MOTION_PHOTO_CHILD":case 6:a.pairedMediaType=6;break;case"HEVC_VIDEO_PARENT":case 7:a.pairedMediaType=7;break;case"HEVC_VIDEO_CHILD":case 8:a.pairedMediaType=8;break}if(e.rankingVersion!=null&&(a.rankingVersion=e.rankingVersion>>>0),e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.ContextInfo.memberLabel: object expected");a.memberLabel=p.proto.MemberLabel.fromObject(e.memberLabel)}switch(e.isQuestion!=null&&(a.isQuestion=!!e.isQuestion),e.statusSourceType){default:if(typeof e.statusSourceType=="number"){a.statusSourceType=e.statusSourceType;break}break;case"IMAGE":case 0:a.statusSourceType=0;break;case"VIDEO":case 1:a.statusSourceType=1;break;case"GIF":case 2:a.statusSourceType=2;break;case"AUDIO":case 3:a.statusSourceType=3;break;case"TEXT":case 4:a.statusSourceType=4;break;case"MUSIC_STANDALONE":case 5:a.statusSourceType=5;break}if(e.statusAttributions){if(!Array.isArray(e.statusAttributions))throw TypeError(".proto.ContextInfo.statusAttributions: array expected");a.statusAttributions=[];for(var A=0;A>>0),e.quotedType){default:if(typeof e.quotedType=="number"){a.quotedType=e.quotedType;break}break;case"EXPLICIT":case 0:a.quotedType=0;break;case"AUTO":case 1:a.quotedType=1;break}if(e.botMessageSharingInfo!=null){if(typeof e.botMessageSharingInfo!="object")throw TypeError(".proto.ContextInfo.botMessageSharingInfo: object expected");a.botMessageSharingInfo=p.proto.BotMessageSharingInfo.fromObject(e.botMessageSharingInfo)}return a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.mentionedJid=[],A.groupMentions=[],A.statusAttributions=[]),e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,a.oneofs&&(A._participant="participant")),e.quotedMessage!=null&&e.hasOwnProperty("quotedMessage")&&(A.quotedMessage=p.proto.Message.toObject(e.quotedMessage,a),a.oneofs&&(A._quotedMessage="quotedMessage")),e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,a.oneofs&&(A._remoteJid="remoteJid")),e.mentionedJid&&e.mentionedJid.length){A.mentionedJid=[];for(var t=0;t>>3){case 1:{c.advertiserName=A.string();break}case 2:{c.mediaType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.AdReplyInfo)return A;var t=new p.proto.ContextInfo.AdReplyInfo;switch(A.advertiserName!=null&&(t.advertiserName=String(A.advertiserName)),A.mediaType){default:if(typeof A.mediaType=="number"){t.mediaType=A.mediaType;break}break;case"NONE":case 0:t.mediaType=0;break;case"IMAGE":case 1:t.mediaType=1;break;case"VIDEO":case 2:t.mediaType=2;break}return A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(t.caption=String(A.caption)),t},i.toObject=function(A,t){t||(t={});var s={};return A.advertiserName!=null&&A.hasOwnProperty("advertiserName")&&(s.advertiserName=A.advertiserName,t.oneofs&&(s._advertiserName="advertiserName")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=t.enums===String?p.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:p.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]:A.mediaType,t.oneofs&&(s._mediaType="mediaType")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=t.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,t.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,t.oneofs&&(s._caption="caption")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.AdReplyInfo"},i.MediaType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="IMAGE"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),r.BusinessMessageForwardInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.businessOwnerJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.BusinessMessageForwardInfo)return A;var t=new p.proto.ContextInfo.BusinessMessageForwardInfo;return A.businessOwnerJid!=null&&(t.businessOwnerJid=String(A.businessOwnerJid)),t},i.toObject=function(A,t){t||(t={});var s={};return A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,t.oneofs&&(s._businessOwnerJid="businessOwnerJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.BusinessMessageForwardInfo"},i})(),r.DataSharingContext=(function(){function i(a){if(this.parameters=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.showMmDisclosure=A.bool();break}case 2:{c.encryptedSignalTokenConsented=A.string();break}case 3:{c.parameters&&c.parameters.length||(c.parameters=[]),c.parameters.push(p.proto.ContextInfo.DataSharingContext.Parameters.decode(A,A.uint32()));break}case 4:{c.dataSharingFlags=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.DataSharingContext)return A;var t=new p.proto.ContextInfo.DataSharingContext;if(A.showMmDisclosure!=null&&(t.showMmDisclosure=!!A.showMmDisclosure),A.encryptedSignalTokenConsented!=null&&(t.encryptedSignalTokenConsented=String(A.encryptedSignalTokenConsented)),A.parameters){if(!Array.isArray(A.parameters))throw TypeError(".proto.ContextInfo.DataSharingContext.parameters: array expected");t.parameters=[];for(var s=0;s>>3){case 1:{d.key=s.string();break}case 2:{d.stringData=s.string();break}case 3:{d.intData=s.int64();break}case 4:{d.floatData=s.float();break}case 5:{d.contents=p.proto.ContextInfo.DataSharingContext.Parameters.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.ContextInfo.DataSharingContext.Parameters)return s;var g=new p.proto.ContextInfo.DataSharingContext.Parameters;if(s.key!=null&&(g.key=String(s.key)),s.stringData!=null&&(g.stringData=String(s.stringData)),s.intData!=null&&(l.Long?(g.intData=l.Long.fromValue(s.intData)).unsigned=!1:typeof s.intData=="string"?g.intData=parseInt(s.intData,10):typeof s.intData=="number"?g.intData=s.intData:typeof s.intData=="object"&&(g.intData=new l.LongBits(s.intData.low>>>0,s.intData.high>>>0).toNumber())),s.floatData!=null&&(g.floatData=Number(s.floatData)),s.contents!=null){if(typeof s.contents!="object")throw TypeError(".proto.ContextInfo.DataSharingContext.Parameters.contents: object expected");g.contents=p.proto.ContextInfo.DataSharingContext.Parameters.fromObject(s.contents)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.key!=null&&s.hasOwnProperty("key")&&(c.key=s.key,g.oneofs&&(c._key="key")),s.stringData!=null&&s.hasOwnProperty("stringData")&&(c.stringData=s.stringData,g.oneofs&&(c._stringData="stringData")),s.intData!=null&&s.hasOwnProperty("intData")&&(typeof s.intData=="number"?c.intData=g.longs===String?String(s.intData):s.intData:c.intData=g.longs===String?oe(s.intData):g.longs===Number?ne(s.intData):s.intData,g.oneofs&&(c._intData="intData")),s.floatData!=null&&s.hasOwnProperty("floatData")&&(c.floatData=g.json&&!isFinite(s.floatData)?String(s.floatData):s.floatData,g.oneofs&&(c._floatData="floatData")),s.contents!=null&&s.hasOwnProperty("contents")&&(c.contents=p.proto.ContextInfo.DataSharingContext.Parameters.toObject(s.contents,g),g.oneofs&&(c._contents="contents")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ContextInfo.DataSharingContext.Parameters"},a})(),i})(),r.ExternalAdReplyInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.title=A.string();break}case 2:{c.body=A.string();break}case 3:{c.mediaType=A.int32();break}case 4:{c.thumbnailUrl=A.string();break}case 5:{c.mediaUrl=A.string();break}case 6:{c.thumbnail=A.bytes();break}case 7:{c.sourceType=A.string();break}case 8:{c.sourceId=A.string();break}case 9:{c.sourceUrl=A.string();break}case 10:{c.containsAutoReply=A.bool();break}case 11:{c.renderLargerThumbnail=A.bool();break}case 12:{c.showAdAttribution=A.bool();break}case 13:{c.ctwaClid=A.string();break}case 14:{c.ref=A.string();break}case 15:{c.clickToWhatsappCall=A.bool();break}case 16:{c.adContextPreviewDismissed=A.bool();break}case 17:{c.sourceApp=A.string();break}case 18:{c.automatedGreetingMessageShown=A.bool();break}case 19:{c.greetingMessageBody=A.string();break}case 20:{c.ctaPayload=A.string();break}case 21:{c.disableNudge=A.bool();break}case 22:{c.originalImageUrl=A.string();break}case 23:{c.automatedGreetingMessageCtaType=A.string();break}case 24:{c.wtwaAdFormat=A.bool();break}case 25:{c.adType=A.int32();break}case 26:{c.wtwaWebsiteUrl=A.string();break}case 27:{c.adPreviewUrl=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.ExternalAdReplyInfo)return A;var t=new p.proto.ContextInfo.ExternalAdReplyInfo;switch(A.title!=null&&(t.title=String(A.title)),A.body!=null&&(t.body=String(A.body)),A.mediaType){default:if(typeof A.mediaType=="number"){t.mediaType=A.mediaType;break}break;case"NONE":case 0:t.mediaType=0;break;case"IMAGE":case 1:t.mediaType=1;break;case"VIDEO":case 2:t.mediaType=2;break}switch(A.thumbnailUrl!=null&&(t.thumbnailUrl=String(A.thumbnailUrl)),A.mediaUrl!=null&&(t.mediaUrl=String(A.mediaUrl)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,t.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(t.thumbnail=A.thumbnail)),A.sourceType!=null&&(t.sourceType=String(A.sourceType)),A.sourceId!=null&&(t.sourceId=String(A.sourceId)),A.sourceUrl!=null&&(t.sourceUrl=String(A.sourceUrl)),A.containsAutoReply!=null&&(t.containsAutoReply=!!A.containsAutoReply),A.renderLargerThumbnail!=null&&(t.renderLargerThumbnail=!!A.renderLargerThumbnail),A.showAdAttribution!=null&&(t.showAdAttribution=!!A.showAdAttribution),A.ctwaClid!=null&&(t.ctwaClid=String(A.ctwaClid)),A.ref!=null&&(t.ref=String(A.ref)),A.clickToWhatsappCall!=null&&(t.clickToWhatsappCall=!!A.clickToWhatsappCall),A.adContextPreviewDismissed!=null&&(t.adContextPreviewDismissed=!!A.adContextPreviewDismissed),A.sourceApp!=null&&(t.sourceApp=String(A.sourceApp)),A.automatedGreetingMessageShown!=null&&(t.automatedGreetingMessageShown=!!A.automatedGreetingMessageShown),A.greetingMessageBody!=null&&(t.greetingMessageBody=String(A.greetingMessageBody)),A.ctaPayload!=null&&(t.ctaPayload=String(A.ctaPayload)),A.disableNudge!=null&&(t.disableNudge=!!A.disableNudge),A.originalImageUrl!=null&&(t.originalImageUrl=String(A.originalImageUrl)),A.automatedGreetingMessageCtaType!=null&&(t.automatedGreetingMessageCtaType=String(A.automatedGreetingMessageCtaType)),A.wtwaAdFormat!=null&&(t.wtwaAdFormat=!!A.wtwaAdFormat),A.adType){default:if(typeof A.adType=="number"){t.adType=A.adType;break}break;case"CTWA":case 0:t.adType=0;break;case"CAWC":case 1:t.adType=1;break}return A.wtwaWebsiteUrl!=null&&(t.wtwaWebsiteUrl=String(A.wtwaWebsiteUrl)),A.adPreviewUrl!=null&&(t.adPreviewUrl=String(A.adPreviewUrl)),t},i.toObject=function(A,t){t||(t={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,t.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,t.oneofs&&(s._body="body")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=t.enums===String?p.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:p.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]:A.mediaType,t.oneofs&&(s._mediaType="mediaType")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,t.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.mediaUrl!=null&&A.hasOwnProperty("mediaUrl")&&(s.mediaUrl=A.mediaUrl,t.oneofs&&(s._mediaUrl="mediaUrl")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=t.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,t.oneofs&&(s._thumbnail="thumbnail")),A.sourceType!=null&&A.hasOwnProperty("sourceType")&&(s.sourceType=A.sourceType,t.oneofs&&(s._sourceType="sourceType")),A.sourceId!=null&&A.hasOwnProperty("sourceId")&&(s.sourceId=A.sourceId,t.oneofs&&(s._sourceId="sourceId")),A.sourceUrl!=null&&A.hasOwnProperty("sourceUrl")&&(s.sourceUrl=A.sourceUrl,t.oneofs&&(s._sourceUrl="sourceUrl")),A.containsAutoReply!=null&&A.hasOwnProperty("containsAutoReply")&&(s.containsAutoReply=A.containsAutoReply,t.oneofs&&(s._containsAutoReply="containsAutoReply")),A.renderLargerThumbnail!=null&&A.hasOwnProperty("renderLargerThumbnail")&&(s.renderLargerThumbnail=A.renderLargerThumbnail,t.oneofs&&(s._renderLargerThumbnail="renderLargerThumbnail")),A.showAdAttribution!=null&&A.hasOwnProperty("showAdAttribution")&&(s.showAdAttribution=A.showAdAttribution,t.oneofs&&(s._showAdAttribution="showAdAttribution")),A.ctwaClid!=null&&A.hasOwnProperty("ctwaClid")&&(s.ctwaClid=A.ctwaClid,t.oneofs&&(s._ctwaClid="ctwaClid")),A.ref!=null&&A.hasOwnProperty("ref")&&(s.ref=A.ref,t.oneofs&&(s._ref="ref")),A.clickToWhatsappCall!=null&&A.hasOwnProperty("clickToWhatsappCall")&&(s.clickToWhatsappCall=A.clickToWhatsappCall,t.oneofs&&(s._clickToWhatsappCall="clickToWhatsappCall")),A.adContextPreviewDismissed!=null&&A.hasOwnProperty("adContextPreviewDismissed")&&(s.adContextPreviewDismissed=A.adContextPreviewDismissed,t.oneofs&&(s._adContextPreviewDismissed="adContextPreviewDismissed")),A.sourceApp!=null&&A.hasOwnProperty("sourceApp")&&(s.sourceApp=A.sourceApp,t.oneofs&&(s._sourceApp="sourceApp")),A.automatedGreetingMessageShown!=null&&A.hasOwnProperty("automatedGreetingMessageShown")&&(s.automatedGreetingMessageShown=A.automatedGreetingMessageShown,t.oneofs&&(s._automatedGreetingMessageShown="automatedGreetingMessageShown")),A.greetingMessageBody!=null&&A.hasOwnProperty("greetingMessageBody")&&(s.greetingMessageBody=A.greetingMessageBody,t.oneofs&&(s._greetingMessageBody="greetingMessageBody")),A.ctaPayload!=null&&A.hasOwnProperty("ctaPayload")&&(s.ctaPayload=A.ctaPayload,t.oneofs&&(s._ctaPayload="ctaPayload")),A.disableNudge!=null&&A.hasOwnProperty("disableNudge")&&(s.disableNudge=A.disableNudge,t.oneofs&&(s._disableNudge="disableNudge")),A.originalImageUrl!=null&&A.hasOwnProperty("originalImageUrl")&&(s.originalImageUrl=A.originalImageUrl,t.oneofs&&(s._originalImageUrl="originalImageUrl")),A.automatedGreetingMessageCtaType!=null&&A.hasOwnProperty("automatedGreetingMessageCtaType")&&(s.automatedGreetingMessageCtaType=A.automatedGreetingMessageCtaType,t.oneofs&&(s._automatedGreetingMessageCtaType="automatedGreetingMessageCtaType")),A.wtwaAdFormat!=null&&A.hasOwnProperty("wtwaAdFormat")&&(s.wtwaAdFormat=A.wtwaAdFormat,t.oneofs&&(s._wtwaAdFormat="wtwaAdFormat")),A.adType!=null&&A.hasOwnProperty("adType")&&(s.adType=t.enums===String?p.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]===void 0?A.adType:p.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]:A.adType,t.oneofs&&(s._adType="adType")),A.wtwaWebsiteUrl!=null&&A.hasOwnProperty("wtwaWebsiteUrl")&&(s.wtwaWebsiteUrl=A.wtwaWebsiteUrl,t.oneofs&&(s._wtwaWebsiteUrl="wtwaWebsiteUrl")),A.adPreviewUrl!=null&&A.hasOwnProperty("adPreviewUrl")&&(s.adPreviewUrl=A.adPreviewUrl,t.oneofs&&(s._adPreviewUrl="adPreviewUrl")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ExternalAdReplyInfo"},i.AdType=(function(){let a={},A=Object.create(a);return A[a[0]="CTWA"]=0,A[a[1]="CAWC"]=1,A})(),i.MediaType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="IMAGE"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),r.FeatureEligibilities=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.cannotBeReactedTo=A.bool();break}case 2:{c.cannotBeRanked=A.bool();break}case 3:{c.canRequestFeedback=A.bool();break}case 4:{c.canBeReshared=A.bool();break}case 5:{c.canReceiveMultiReact=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.FeatureEligibilities)return A;var t=new p.proto.ContextInfo.FeatureEligibilities;return A.cannotBeReactedTo!=null&&(t.cannotBeReactedTo=!!A.cannotBeReactedTo),A.cannotBeRanked!=null&&(t.cannotBeRanked=!!A.cannotBeRanked),A.canRequestFeedback!=null&&(t.canRequestFeedback=!!A.canRequestFeedback),A.canBeReshared!=null&&(t.canBeReshared=!!A.canBeReshared),A.canReceiveMultiReact!=null&&(t.canReceiveMultiReact=!!A.canReceiveMultiReact),t},i.toObject=function(A,t){t||(t={});var s={};return A.cannotBeReactedTo!=null&&A.hasOwnProperty("cannotBeReactedTo")&&(s.cannotBeReactedTo=A.cannotBeReactedTo,t.oneofs&&(s._cannotBeReactedTo="cannotBeReactedTo")),A.cannotBeRanked!=null&&A.hasOwnProperty("cannotBeRanked")&&(s.cannotBeRanked=A.cannotBeRanked,t.oneofs&&(s._cannotBeRanked="cannotBeRanked")),A.canRequestFeedback!=null&&A.hasOwnProperty("canRequestFeedback")&&(s.canRequestFeedback=A.canRequestFeedback,t.oneofs&&(s._canRequestFeedback="canRequestFeedback")),A.canBeReshared!=null&&A.hasOwnProperty("canBeReshared")&&(s.canBeReshared=A.canBeReshared,t.oneofs&&(s._canBeReshared="canBeReshared")),A.canReceiveMultiReact!=null&&A.hasOwnProperty("canReceiveMultiReact")&&(s.canReceiveMultiReact=A.canReceiveMultiReact,t.oneofs&&(s._canReceiveMultiReact="canReceiveMultiReact")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.FeatureEligibilities"},i})(),r.ForwardOrigin=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHAT"]=1,e[i[2]="STATUS"]=2,e[i[3]="CHANNELS"]=3,e[i[4]="META_AI"]=4,e[i[5]="UGC"]=5,e})(),r.ForwardedNewsletterMessageInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.serverMessageId=A.int32();break}case 3:{c.newsletterName=A.string();break}case 4:{c.contentType=A.int32();break}case 5:{c.accessibilityText=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.ForwardedNewsletterMessageInfo)return A;var t=new p.proto.ContextInfo.ForwardedNewsletterMessageInfo;switch(A.newsletterJid!=null&&(t.newsletterJid=String(A.newsletterJid)),A.serverMessageId!=null&&(t.serverMessageId=A.serverMessageId|0),A.newsletterName!=null&&(t.newsletterName=String(A.newsletterName)),A.contentType){default:if(typeof A.contentType=="number"){t.contentType=A.contentType;break}break;case"UPDATE":case 1:t.contentType=1;break;case"UPDATE_CARD":case 2:t.contentType=2;break;case"LINK_CARD":case 3:t.contentType=3;break}return A.accessibilityText!=null&&(t.accessibilityText=String(A.accessibilityText)),t},i.toObject=function(A,t){t||(t={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,t.oneofs&&(s._newsletterJid="newsletterJid")),A.serverMessageId!=null&&A.hasOwnProperty("serverMessageId")&&(s.serverMessageId=A.serverMessageId,t.oneofs&&(s._serverMessageId="serverMessageId")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,t.oneofs&&(s._newsletterName="newsletterName")),A.contentType!=null&&A.hasOwnProperty("contentType")&&(s.contentType=t.enums===String?p.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]===void 0?A.contentType:p.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]:A.contentType,t.oneofs&&(s._contentType="contentType")),A.accessibilityText!=null&&A.hasOwnProperty("accessibilityText")&&(s.accessibilityText=A.accessibilityText,t.oneofs&&(s._accessibilityText="accessibilityText")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ForwardedNewsletterMessageInfo"},i.ContentType=(function(){let a={},A=Object.create(a);return A[a[1]="UPDATE"]=1,A[a[2]="UPDATE_CARD"]=2,A[a[3]="LINK_CARD"]=3,A})(),i})(),r.PairedMediaType=(function(){let i={},e=Object.create(i);return e[i[0]="NOT_PAIRED_MEDIA"]=0,e[i[1]="SD_VIDEO_PARENT"]=1,e[i[2]="HD_VIDEO_CHILD"]=2,e[i[3]="SD_IMAGE_PARENT"]=3,e[i[4]="HD_IMAGE_CHILD"]=4,e[i[5]="MOTION_PHOTO_PARENT"]=5,e[i[6]="MOTION_PHOTO_CHILD"]=6,e[i[7]="HEVC_VIDEO_PARENT"]=7,e[i[8]="HEVC_VIDEO_CHILD"]=8,e})(),r.QuestionReplyQuotedMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.serverQuestionId=A.int32();break}case 2:{c.quotedQuestion=p.proto.Message.decode(A,A.uint32());break}case 3:{c.quotedResponse=p.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.QuestionReplyQuotedMessage)return A;var t=new p.proto.ContextInfo.QuestionReplyQuotedMessage;if(A.serverQuestionId!=null&&(t.serverQuestionId=A.serverQuestionId|0),A.quotedQuestion!=null){if(typeof A.quotedQuestion!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedQuestion: object expected");t.quotedQuestion=p.proto.Message.fromObject(A.quotedQuestion)}if(A.quotedResponse!=null){if(typeof A.quotedResponse!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedResponse: object expected");t.quotedResponse=p.proto.Message.fromObject(A.quotedResponse)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.serverQuestionId!=null&&A.hasOwnProperty("serverQuestionId")&&(s.serverQuestionId=A.serverQuestionId,t.oneofs&&(s._serverQuestionId="serverQuestionId")),A.quotedQuestion!=null&&A.hasOwnProperty("quotedQuestion")&&(s.quotedQuestion=p.proto.Message.toObject(A.quotedQuestion,t),t.oneofs&&(s._quotedQuestion="quotedQuestion")),A.quotedResponse!=null&&A.hasOwnProperty("quotedResponse")&&(s.quotedResponse=p.proto.Message.toObject(A.quotedResponse,t),t.oneofs&&(s._quotedResponse="quotedResponse")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.QuestionReplyQuotedMessage"},i})(),r.QuotedType=(function(){let i={},e=Object.create(i);return e[i[0]="EXPLICIT"]=0,e[i[1]="AUTO"]=1,e})(),r.StatusAttributionType=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="RESHARED_FROM_MENTION"]=1,e[i[2]="RESHARED_FROM_POST"]=2,e[i[3]="RESHARED_FROM_POST_MANY_TIMES"]=3,e[i[4]="FORWARDED_FROM_STATUS"]=4,e})(),r.StatusAudienceMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.audienceType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.StatusAudienceMetadata)return A;var t=new p.proto.ContextInfo.StatusAudienceMetadata;switch(A.audienceType){default:if(typeof A.audienceType=="number"){t.audienceType=A.audienceType;break}break;case"UNKNOWN":case 0:t.audienceType=0;break;case"CLOSE_FRIENDS":case 1:t.audienceType=1;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.audienceType!=null&&A.hasOwnProperty("audienceType")&&(s.audienceType=t.enums===String?p.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]===void 0?A.audienceType:p.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]:A.audienceType,t.oneofs&&(s._audienceType="audienceType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.StatusAudienceMetadata"},i.AudienceType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="CLOSE_FRIENDS"]=1,A})(),i})(),r.StatusSourceType=(function(){let i={},e=Object.create(i);return e[i[0]="IMAGE"]=0,e[i[1]="VIDEO"]=1,e[i[2]="GIF"]=2,e[i[3]="AUDIO"]=3,e[i[4]="TEXT"]=4,e[i[5]="MUSIC_STANDALONE"]=5,e})(),r.UTMInfo=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.utmSource=A.string();break}case 2:{c.utmCampaign=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.ContextInfo.UTMInfo)return A;var t=new p.proto.ContextInfo.UTMInfo;return A.utmSource!=null&&(t.utmSource=String(A.utmSource)),A.utmCampaign!=null&&(t.utmCampaign=String(A.utmCampaign)),t},i.toObject=function(A,t){t||(t={});var s={};return A.utmSource!=null&&A.hasOwnProperty("utmSource")&&(s.utmSource=A.utmSource,t.oneofs&&(s._utmSource="utmSource")),A.utmCampaign!=null&&A.hasOwnProperty("utmCampaign")&&(s.utmCampaign=A.utmCampaign,t.oneofs&&(s._utmCampaign="utmCampaign")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.UTMInfo"},i})(),r})(),n.Conversation=(function(){function r(i){if(this.messages=[],this.participant=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.string();break}case 2:{s.messages&&s.messages.length||(s.messages=[]),s.messages.push(p.proto.HistorySyncMsg.decode(e,e.uint32()));break}case 3:{s.newJid=e.string();break}case 4:{s.oldJid=e.string();break}case 5:{s.lastMsgTimestamp=e.uint64();break}case 6:{s.unreadCount=e.uint32();break}case 7:{s.readOnly=e.bool();break}case 8:{s.endOfHistoryTransfer=e.bool();break}case 9:{s.ephemeralExpiration=e.uint32();break}case 10:{s.ephemeralSettingTimestamp=e.int64();break}case 11:{s.endOfHistoryTransferType=e.int32();break}case 12:{s.conversationTimestamp=e.uint64();break}case 13:{s.name=e.string();break}case 14:{s.pHash=e.string();break}case 15:{s.notSpam=e.bool();break}case 16:{s.archived=e.bool();break}case 17:{s.disappearingMode=p.proto.DisappearingMode.decode(e,e.uint32());break}case 18:{s.unreadMentionCount=e.uint32();break}case 19:{s.markedAsUnread=e.bool();break}case 20:{s.participant&&s.participant.length||(s.participant=[]),s.participant.push(p.proto.GroupParticipant.decode(e,e.uint32()));break}case 21:{s.tcToken=e.bytes();break}case 22:{s.tcTokenTimestamp=e.uint64();break}case 23:{s.contactPrimaryIdentityKey=e.bytes();break}case 24:{s.pinned=e.uint32();break}case 25:{s.muteEndTime=e.uint64();break}case 26:{s.wallpaper=p.proto.WallpaperSettings.decode(e,e.uint32());break}case 27:{s.mediaVisibility=e.int32();break}case 28:{s.tcTokenSenderTimestamp=e.uint64();break}case 29:{s.suspended=e.bool();break}case 30:{s.terminated=e.bool();break}case 31:{s.createdAt=e.uint64();break}case 32:{s.createdBy=e.string();break}case 33:{s.description=e.string();break}case 34:{s.support=e.bool();break}case 35:{s.isParentGroup=e.bool();break}case 37:{s.parentGroupId=e.string();break}case 36:{s.isDefaultSubgroup=e.bool();break}case 38:{s.displayName=e.string();break}case 39:{s.pnJid=e.string();break}case 40:{s.shareOwnPn=e.bool();break}case 41:{s.pnhDuplicateLidThread=e.bool();break}case 42:{s.lidJid=e.string();break}case 43:{s.username=e.string();break}case 44:{s.lidOriginType=e.string();break}case 45:{s.commentsCount=e.uint32();break}case 46:{s.locked=e.bool();break}case 47:{s.systemMessageToInsert=e.int32();break}case 48:{s.capiCreatedGroup=e.bool();break}case 49:{s.accountLid=e.string();break}case 50:{s.limitSharing=e.bool();break}case 51:{s.limitSharingSettingTimestamp=e.int64();break}case 52:{s.limitSharingTrigger=e.int32();break}case 53:{s.limitSharingInitiatedByMe=e.bool();break}case 54:{s.maibaAiThreadEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Conversation)return e;var a=new p.proto.Conversation;if(e.id!=null&&(a.id=String(e.id)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".proto.Conversation.messages: array expected");a.messages=[];for(var A=0;A>>0,e.lastMsgTimestamp.high>>>0).toNumber(!0))),e.unreadCount!=null&&(a.unreadCount=e.unreadCount>>>0),e.readOnly!=null&&(a.readOnly=!!e.readOnly),e.endOfHistoryTransfer!=null&&(a.endOfHistoryTransfer=!!e.endOfHistoryTransfer),e.ephemeralExpiration!=null&&(a.ephemeralExpiration=e.ephemeralExpiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(a.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?a.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?a.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(a.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.endOfHistoryTransferType){default:if(typeof e.endOfHistoryTransferType=="number"){a.endOfHistoryTransferType=e.endOfHistoryTransferType;break}break;case"COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY":case 0:a.endOfHistoryTransferType=0;break;case"COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY":case 1:a.endOfHistoryTransferType=1;break;case"COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY":case 2:a.endOfHistoryTransferType=2;break}if(e.conversationTimestamp!=null&&(l.Long?(a.conversationTimestamp=l.Long.fromValue(e.conversationTimestamp)).unsigned=!0:typeof e.conversationTimestamp=="string"?a.conversationTimestamp=parseInt(e.conversationTimestamp,10):typeof e.conversationTimestamp=="number"?a.conversationTimestamp=e.conversationTimestamp:typeof e.conversationTimestamp=="object"&&(a.conversationTimestamp=new l.LongBits(e.conversationTimestamp.low>>>0,e.conversationTimestamp.high>>>0).toNumber(!0))),e.name!=null&&(a.name=String(e.name)),e.pHash!=null&&(a.pHash=String(e.pHash)),e.notSpam!=null&&(a.notSpam=!!e.notSpam),e.archived!=null&&(a.archived=!!e.archived),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.Conversation.disappearingMode: object expected");a.disappearingMode=p.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.unreadMentionCount!=null&&(a.unreadMentionCount=e.unreadMentionCount>>>0),e.markedAsUnread!=null&&(a.markedAsUnread=!!e.markedAsUnread),e.participant){if(!Array.isArray(e.participant))throw TypeError(".proto.Conversation.participant: array expected");a.participant=[];for(var A=0;A=0&&(a.tcToken=e.tcToken)),e.tcTokenTimestamp!=null&&(l.Long?(a.tcTokenTimestamp=l.Long.fromValue(e.tcTokenTimestamp)).unsigned=!0:typeof e.tcTokenTimestamp=="string"?a.tcTokenTimestamp=parseInt(e.tcTokenTimestamp,10):typeof e.tcTokenTimestamp=="number"?a.tcTokenTimestamp=e.tcTokenTimestamp:typeof e.tcTokenTimestamp=="object"&&(a.tcTokenTimestamp=new l.LongBits(e.tcTokenTimestamp.low>>>0,e.tcTokenTimestamp.high>>>0).toNumber(!0))),e.contactPrimaryIdentityKey!=null&&(typeof e.contactPrimaryIdentityKey=="string"?l.base64.decode(e.contactPrimaryIdentityKey,a.contactPrimaryIdentityKey=l.newBuffer(l.base64.length(e.contactPrimaryIdentityKey)),0):e.contactPrimaryIdentityKey.length>=0&&(a.contactPrimaryIdentityKey=e.contactPrimaryIdentityKey)),e.pinned!=null&&(a.pinned=e.pinned>>>0),e.muteEndTime!=null&&(l.Long?(a.muteEndTime=l.Long.fromValue(e.muteEndTime)).unsigned=!0:typeof e.muteEndTime=="string"?a.muteEndTime=parseInt(e.muteEndTime,10):typeof e.muteEndTime=="number"?a.muteEndTime=e.muteEndTime:typeof e.muteEndTime=="object"&&(a.muteEndTime=new l.LongBits(e.muteEndTime.low>>>0,e.muteEndTime.high>>>0).toNumber(!0))),e.wallpaper!=null){if(typeof e.wallpaper!="object")throw TypeError(".proto.Conversation.wallpaper: object expected");a.wallpaper=p.proto.WallpaperSettings.fromObject(e.wallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){a.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:a.mediaVisibility=0;break;case"OFF":case 1:a.mediaVisibility=1;break;case"ON":case 2:a.mediaVisibility=2;break}switch(e.tcTokenSenderTimestamp!=null&&(l.Long?(a.tcTokenSenderTimestamp=l.Long.fromValue(e.tcTokenSenderTimestamp)).unsigned=!0:typeof e.tcTokenSenderTimestamp=="string"?a.tcTokenSenderTimestamp=parseInt(e.tcTokenSenderTimestamp,10):typeof e.tcTokenSenderTimestamp=="number"?a.tcTokenSenderTimestamp=e.tcTokenSenderTimestamp:typeof e.tcTokenSenderTimestamp=="object"&&(a.tcTokenSenderTimestamp=new l.LongBits(e.tcTokenSenderTimestamp.low>>>0,e.tcTokenSenderTimestamp.high>>>0).toNumber(!0))),e.suspended!=null&&(a.suspended=!!e.suspended),e.terminated!=null&&(a.terminated=!!e.terminated),e.createdAt!=null&&(l.Long?(a.createdAt=l.Long.fromValue(e.createdAt)).unsigned=!0:typeof e.createdAt=="string"?a.createdAt=parseInt(e.createdAt,10):typeof e.createdAt=="number"?a.createdAt=e.createdAt:typeof e.createdAt=="object"&&(a.createdAt=new l.LongBits(e.createdAt.low>>>0,e.createdAt.high>>>0).toNumber(!0))),e.createdBy!=null&&(a.createdBy=String(e.createdBy)),e.description!=null&&(a.description=String(e.description)),e.support!=null&&(a.support=!!e.support),e.isParentGroup!=null&&(a.isParentGroup=!!e.isParentGroup),e.parentGroupId!=null&&(a.parentGroupId=String(e.parentGroupId)),e.isDefaultSubgroup!=null&&(a.isDefaultSubgroup=!!e.isDefaultSubgroup),e.displayName!=null&&(a.displayName=String(e.displayName)),e.pnJid!=null&&(a.pnJid=String(e.pnJid)),e.shareOwnPn!=null&&(a.shareOwnPn=!!e.shareOwnPn),e.pnhDuplicateLidThread!=null&&(a.pnhDuplicateLidThread=!!e.pnhDuplicateLidThread),e.lidJid!=null&&(a.lidJid=String(e.lidJid)),e.username!=null&&(a.username=String(e.username)),e.lidOriginType!=null&&(a.lidOriginType=String(e.lidOriginType)),e.commentsCount!=null&&(a.commentsCount=e.commentsCount>>>0),e.locked!=null&&(a.locked=!!e.locked),e.systemMessageToInsert){default:if(typeof e.systemMessageToInsert=="number"){a.systemMessageToInsert=e.systemMessageToInsert;break}break;case"E2EE_MSG":case 1:a.systemMessageToInsert=1;break;case"NE2EE_SELF":case 2:a.systemMessageToInsert=2;break;case"NE2EE_OTHER":case 3:a.systemMessageToInsert=3;break}switch(e.capiCreatedGroup!=null&&(a.capiCreatedGroup=!!e.capiCreatedGroup),e.accountLid!=null&&(a.accountLid=String(e.accountLid)),e.limitSharing!=null&&(a.limitSharing=!!e.limitSharing),e.limitSharingSettingTimestamp!=null&&(l.Long?(a.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?a.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?a.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(a.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.limitSharingTrigger){default:if(typeof e.limitSharingTrigger=="number"){a.limitSharingTrigger=e.limitSharingTrigger;break}break;case"UNKNOWN":case 0:a.limitSharingTrigger=0;break;case"CHAT_SETTING":case 1:a.limitSharingTrigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:a.limitSharingTrigger=2;break;case"UNKNOWN_GROUP":case 3:a.limitSharingTrigger=3;break}return e.limitSharingInitiatedByMe!=null&&(a.limitSharingInitiatedByMe=!!e.limitSharingInitiatedByMe),e.maibaAiThreadEnabled!=null&&(a.maibaAiThreadEnabled=!!e.maibaAiThreadEnabled),a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.messages=[],A.participant=[]),a.defaults&&(A.id=""),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id),e.messages&&e.messages.length){A.messages=[];for(var t=0;t>>3){case 1:{s.chatLockSupportLevel=e.int32();break}case 2:{s.lidMigration=p.proto.DeviceCapabilities.LIDMigration.decode(e,e.uint32());break}case 3:{s.businessBroadcast=p.proto.DeviceCapabilities.BusinessBroadcast.decode(e,e.uint32());break}case 4:{s.userHasAvatar=p.proto.DeviceCapabilities.UserHasAvatar.decode(e,e.uint32());break}case 5:{s.memberNameTagPrimarySupport=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.DeviceCapabilities)return e;var a=new p.proto.DeviceCapabilities;switch(e.chatLockSupportLevel){default:if(typeof e.chatLockSupportLevel=="number"){a.chatLockSupportLevel=e.chatLockSupportLevel;break}break;case"NONE":case 0:a.chatLockSupportLevel=0;break;case"MINIMAL":case 1:a.chatLockSupportLevel=1;break;case"FULL":case 2:a.chatLockSupportLevel=2;break}if(e.lidMigration!=null){if(typeof e.lidMigration!="object")throw TypeError(".proto.DeviceCapabilities.lidMigration: object expected");a.lidMigration=p.proto.DeviceCapabilities.LIDMigration.fromObject(e.lidMigration)}if(e.businessBroadcast!=null){if(typeof e.businessBroadcast!="object")throw TypeError(".proto.DeviceCapabilities.businessBroadcast: object expected");a.businessBroadcast=p.proto.DeviceCapabilities.BusinessBroadcast.fromObject(e.businessBroadcast)}if(e.userHasAvatar!=null){if(typeof e.userHasAvatar!="object")throw TypeError(".proto.DeviceCapabilities.userHasAvatar: object expected");a.userHasAvatar=p.proto.DeviceCapabilities.UserHasAvatar.fromObject(e.userHasAvatar)}switch(e.memberNameTagPrimarySupport){default:if(typeof e.memberNameTagPrimarySupport=="number"){a.memberNameTagPrimarySupport=e.memberNameTagPrimarySupport;break}break;case"DISABLED":case 0:a.memberNameTagPrimarySupport=0;break;case"RECEIVER_ENABLED":case 1:a.memberNameTagPrimarySupport=1;break;case"SENDER_ENABLED":case 2:a.memberNameTagPrimarySupport=2;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.chatLockSupportLevel!=null&&e.hasOwnProperty("chatLockSupportLevel")&&(A.chatLockSupportLevel=a.enums===String?p.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]===void 0?e.chatLockSupportLevel:p.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]:e.chatLockSupportLevel,a.oneofs&&(A._chatLockSupportLevel="chatLockSupportLevel")),e.lidMigration!=null&&e.hasOwnProperty("lidMigration")&&(A.lidMigration=p.proto.DeviceCapabilities.LIDMigration.toObject(e.lidMigration,a),a.oneofs&&(A._lidMigration="lidMigration")),e.businessBroadcast!=null&&e.hasOwnProperty("businessBroadcast")&&(A.businessBroadcast=p.proto.DeviceCapabilities.BusinessBroadcast.toObject(e.businessBroadcast,a),a.oneofs&&(A._businessBroadcast="businessBroadcast")),e.userHasAvatar!=null&&e.hasOwnProperty("userHasAvatar")&&(A.userHasAvatar=p.proto.DeviceCapabilities.UserHasAvatar.toObject(e.userHasAvatar,a),a.oneofs&&(A._userHasAvatar="userHasAvatar")),e.memberNameTagPrimarySupport!=null&&e.hasOwnProperty("memberNameTagPrimarySupport")&&(A.memberNameTagPrimarySupport=a.enums===String?p.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]===void 0?e.memberNameTagPrimarySupport:p.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]:e.memberNameTagPrimarySupport,a.oneofs&&(A._memberNameTagPrimarySupport="memberNameTagPrimarySupport")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceCapabilities"},r.BusinessBroadcast=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.importListEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceCapabilities.BusinessBroadcast)return A;var t=new p.proto.DeviceCapabilities.BusinessBroadcast;return A.importListEnabled!=null&&(t.importListEnabled=!!A.importListEnabled),t},i.toObject=function(A,t){t||(t={});var s={};return A.importListEnabled!=null&&A.hasOwnProperty("importListEnabled")&&(s.importListEnabled=A.importListEnabled,t.oneofs&&(s._importListEnabled="importListEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.BusinessBroadcast"},i})(),r.ChatLockSupportLevel=(function(){let i={},e=Object.create(i);return e[i[0]="NONE"]=0,e[i[1]="MINIMAL"]=1,e[i[2]="FULL"]=2,e})(),r.LIDMigration=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.chatDbMigrationTimestamp=A.uint64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceCapabilities.LIDMigration)return A;var t=new p.proto.DeviceCapabilities.LIDMigration;return A.chatDbMigrationTimestamp!=null&&(l.Long?(t.chatDbMigrationTimestamp=l.Long.fromValue(A.chatDbMigrationTimestamp)).unsigned=!0:typeof A.chatDbMigrationTimestamp=="string"?t.chatDbMigrationTimestamp=parseInt(A.chatDbMigrationTimestamp,10):typeof A.chatDbMigrationTimestamp=="number"?t.chatDbMigrationTimestamp=A.chatDbMigrationTimestamp:typeof A.chatDbMigrationTimestamp=="object"&&(t.chatDbMigrationTimestamp=new l.LongBits(A.chatDbMigrationTimestamp.low>>>0,A.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),t},i.toObject=function(A,t){t||(t={});var s={};return A.chatDbMigrationTimestamp!=null&&A.hasOwnProperty("chatDbMigrationTimestamp")&&(typeof A.chatDbMigrationTimestamp=="number"?s.chatDbMigrationTimestamp=t.longs===String?String(A.chatDbMigrationTimestamp):A.chatDbMigrationTimestamp:s.chatDbMigrationTimestamp=t.longs===String?oe(A.chatDbMigrationTimestamp,!0):t.longs===Number?ne(A.chatDbMigrationTimestamp,!0):A.chatDbMigrationTimestamp,t.oneofs&&(s._chatDbMigrationTimestamp="chatDbMigrationTimestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.LIDMigration"},i})(),r.MemberNameTagPrimarySupport=(function(){let i={},e=Object.create(i);return e[i[0]="DISABLED"]=0,e[i[1]="RECEIVER_ENABLED"]=1,e[i[2]="SENDER_ENABLED"]=2,e})(),r.UserHasAvatar=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.userHasAvatar=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceCapabilities.UserHasAvatar)return A;var t=new p.proto.DeviceCapabilities.UserHasAvatar;return A.userHasAvatar!=null&&(t.userHasAvatar=!!A.userHasAvatar),t},i.toObject=function(A,t){t||(t={});var s={};return A.userHasAvatar!=null&&A.hasOwnProperty("userHasAvatar")&&(s.userHasAvatar=A.userHasAvatar,t.oneofs&&(s._userHasAvatar="userHasAvatar")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.UserHasAvatar"},i})(),r})(),n.DeviceConsistencyCodeMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.generation=e.uint32();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.DeviceConsistencyCodeMessage)return e;var a=new p.proto.DeviceConsistencyCodeMessage;return e.generation!=null&&(a.generation=e.generation>>>0),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),a},r.toObject=function(e,a){a||(a={});var A={};return e.generation!=null&&e.hasOwnProperty("generation")&&(A.generation=e.generation,a.oneofs&&(A._generation="generation")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceConsistencyCodeMessage"},r})(),n.DeviceListMetadata=(function(){function r(i){if(this.senderKeyIndexes=[],this.recipientKeyIndexes=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.senderKeyHash=e.bytes();break}case 2:{s.senderTimestamp=e.uint64();break}case 3:{if(s.senderKeyIndexes&&s.senderKeyIndexes.length||(s.senderKeyIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos=0&&(a.senderKeyHash=e.senderKeyHash)),e.senderTimestamp!=null&&(l.Long?(a.senderTimestamp=l.Long.fromValue(e.senderTimestamp)).unsigned=!0:typeof e.senderTimestamp=="string"?a.senderTimestamp=parseInt(e.senderTimestamp,10):typeof e.senderTimestamp=="number"?a.senderTimestamp=e.senderTimestamp:typeof e.senderTimestamp=="object"&&(a.senderTimestamp=new l.LongBits(e.senderTimestamp.low>>>0,e.senderTimestamp.high>>>0).toNumber(!0))),e.senderKeyIndexes){if(!Array.isArray(e.senderKeyIndexes))throw TypeError(".proto.DeviceListMetadata.senderKeyIndexes: array expected");a.senderKeyIndexes=[];for(var A=0;A>>0}switch(e.senderAccountType){default:if(typeof e.senderAccountType=="number"){a.senderAccountType=e.senderAccountType;break}break;case"E2EE":case 0:a.senderAccountType=0;break;case"HOSTED":case 1:a.senderAccountType=1;break}switch(e.receiverAccountType){default:if(typeof e.receiverAccountType=="number"){a.receiverAccountType=e.receiverAccountType;break}break;case"E2EE":case 0:a.receiverAccountType=0;break;case"HOSTED":case 1:a.receiverAccountType=1;break}if(e.recipientKeyHash!=null&&(typeof e.recipientKeyHash=="string"?l.base64.decode(e.recipientKeyHash,a.recipientKeyHash=l.newBuffer(l.base64.length(e.recipientKeyHash)),0):e.recipientKeyHash.length>=0&&(a.recipientKeyHash=e.recipientKeyHash)),e.recipientTimestamp!=null&&(l.Long?(a.recipientTimestamp=l.Long.fromValue(e.recipientTimestamp)).unsigned=!0:typeof e.recipientTimestamp=="string"?a.recipientTimestamp=parseInt(e.recipientTimestamp,10):typeof e.recipientTimestamp=="number"?a.recipientTimestamp=e.recipientTimestamp:typeof e.recipientTimestamp=="object"&&(a.recipientTimestamp=new l.LongBits(e.recipientTimestamp.low>>>0,e.recipientTimestamp.high>>>0).toNumber(!0))),e.recipientKeyIndexes){if(!Array.isArray(e.recipientKeyIndexes))throw TypeError(".proto.DeviceListMetadata.recipientKeyIndexes: array expected");a.recipientKeyIndexes=[];for(var A=0;A>>0}return a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.senderKeyIndexes=[],A.recipientKeyIndexes=[]),e.senderKeyHash!=null&&e.hasOwnProperty("senderKeyHash")&&(A.senderKeyHash=a.bytes===String?l.base64.encode(e.senderKeyHash,0,e.senderKeyHash.length):a.bytes===Array?Array.prototype.slice.call(e.senderKeyHash):e.senderKeyHash,a.oneofs&&(A._senderKeyHash="senderKeyHash")),e.senderTimestamp!=null&&e.hasOwnProperty("senderTimestamp")&&(typeof e.senderTimestamp=="number"?A.senderTimestamp=a.longs===String?String(e.senderTimestamp):e.senderTimestamp:A.senderTimestamp=a.longs===String?oe(e.senderTimestamp,!0):a.longs===Number?ne(e.senderTimestamp,!0):e.senderTimestamp,a.oneofs&&(A._senderTimestamp="senderTimestamp")),e.senderKeyIndexes&&e.senderKeyIndexes.length){A.senderKeyIndexes=[];for(var t=0;t>>3){case 1:{s.os=e.string();break}case 2:{s.version=p.proto.DeviceProps.AppVersion.decode(e,e.uint32());break}case 3:{s.platformType=e.int32();break}case 4:{s.requireFullSync=e.bool();break}case 5:{s.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.DeviceProps)return e;var a=new p.proto.DeviceProps;if(e.os!=null&&(a.os=String(e.os)),e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.DeviceProps.version: object expected");a.version=p.proto.DeviceProps.AppVersion.fromObject(e.version)}switch(e.platformType){default:if(typeof e.platformType=="number"){a.platformType=e.platformType;break}break;case"UNKNOWN":case 0:a.platformType=0;break;case"CHROME":case 1:a.platformType=1;break;case"FIREFOX":case 2:a.platformType=2;break;case"IE":case 3:a.platformType=3;break;case"OPERA":case 4:a.platformType=4;break;case"SAFARI":case 5:a.platformType=5;break;case"EDGE":case 6:a.platformType=6;break;case"DESKTOP":case 7:a.platformType=7;break;case"IPAD":case 8:a.platformType=8;break;case"ANDROID_TABLET":case 9:a.platformType=9;break;case"OHANA":case 10:a.platformType=10;break;case"ALOHA":case 11:a.platformType=11;break;case"CATALINA":case 12:a.platformType=12;break;case"TCL_TV":case 13:a.platformType=13;break;case"IOS_PHONE":case 14:a.platformType=14;break;case"IOS_CATALYST":case 15:a.platformType=15;break;case"ANDROID_PHONE":case 16:a.platformType=16;break;case"ANDROID_AMBIGUOUS":case 17:a.platformType=17;break;case"WEAR_OS":case 18:a.platformType=18;break;case"AR_WRIST":case 19:a.platformType=19;break;case"AR_DEVICE":case 20:a.platformType=20;break;case"UWP":case 21:a.platformType=21;break;case"VR":case 22:a.platformType=22;break;case"CLOUD_API":case 23:a.platformType=23;break;case"SMARTGLASSES":case 24:a.platformType=24;break}if(e.requireFullSync!=null&&(a.requireFullSync=!!e.requireFullSync),e.historySyncConfig!=null){if(typeof e.historySyncConfig!="object")throw TypeError(".proto.DeviceProps.historySyncConfig: object expected");a.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.fromObject(e.historySyncConfig)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.os!=null&&e.hasOwnProperty("os")&&(A.os=e.os,a.oneofs&&(A._os="os")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=p.proto.DeviceProps.AppVersion.toObject(e.version,a),a.oneofs&&(A._version="version")),e.platformType!=null&&e.hasOwnProperty("platformType")&&(A.platformType=a.enums===String?p.proto.DeviceProps.PlatformType[e.platformType]===void 0?e.platformType:p.proto.DeviceProps.PlatformType[e.platformType]:e.platformType,a.oneofs&&(A._platformType="platformType")),e.requireFullSync!=null&&e.hasOwnProperty("requireFullSync")&&(A.requireFullSync=e.requireFullSync,a.oneofs&&(A._requireFullSync="requireFullSync")),e.historySyncConfig!=null&&e.hasOwnProperty("historySyncConfig")&&(A.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.toObject(e.historySyncConfig,a),a.oneofs&&(A._historySyncConfig="historySyncConfig")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceProps"},r.AppVersion=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.primary=A.uint32();break}case 2:{c.secondary=A.uint32();break}case 3:{c.tertiary=A.uint32();break}case 4:{c.quaternary=A.uint32();break}case 5:{c.quinary=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceProps.AppVersion)return A;var t=new p.proto.DeviceProps.AppVersion;return A.primary!=null&&(t.primary=A.primary>>>0),A.secondary!=null&&(t.secondary=A.secondary>>>0),A.tertiary!=null&&(t.tertiary=A.tertiary>>>0),A.quaternary!=null&&(t.quaternary=A.quaternary>>>0),A.quinary!=null&&(t.quinary=A.quinary>>>0),t},i.toObject=function(A,t){t||(t={});var s={};return A.primary!=null&&A.hasOwnProperty("primary")&&(s.primary=A.primary,t.oneofs&&(s._primary="primary")),A.secondary!=null&&A.hasOwnProperty("secondary")&&(s.secondary=A.secondary,t.oneofs&&(s._secondary="secondary")),A.tertiary!=null&&A.hasOwnProperty("tertiary")&&(s.tertiary=A.tertiary,t.oneofs&&(s._tertiary="tertiary")),A.quaternary!=null&&A.hasOwnProperty("quaternary")&&(s.quaternary=A.quaternary,t.oneofs&&(s._quaternary="quaternary")),A.quinary!=null&&A.hasOwnProperty("quinary")&&(s.quinary=A.quinary,t.oneofs&&(s._quinary="quinary")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.AppVersion"},i})(),r.HistorySyncConfig=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.fullSyncDaysLimit=A.uint32();break}case 2:{c.fullSyncSizeMbLimit=A.uint32();break}case 3:{c.storageQuotaMb=A.uint32();break}case 4:{c.inlineInitialPayloadInE2EeMsg=A.bool();break}case 5:{c.recentSyncDaysLimit=A.uint32();break}case 6:{c.supportCallLogHistory=A.bool();break}case 7:{c.supportBotUserAgentChatHistory=A.bool();break}case 8:{c.supportCagReactionsAndPolls=A.bool();break}case 9:{c.supportBizHostedMsg=A.bool();break}case 10:{c.supportRecentSyncChunkMessageCountTuning=A.bool();break}case 11:{c.supportHostedGroupMsg=A.bool();break}case 12:{c.supportFbidBotChatHistory=A.bool();break}case 13:{c.supportAddOnHistorySyncMigration=A.bool();break}case 14:{c.supportMessageAssociation=A.bool();break}case 15:{c.supportGroupHistory=A.bool();break}case 16:{c.onDemandReady=A.bool();break}case 17:{c.supportGuestChat=A.bool();break}case 18:{c.completeOnDemandReady=A.bool();break}case 19:{c.thumbnailSyncDaysLimit=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.DeviceProps.HistorySyncConfig)return A;var t=new p.proto.DeviceProps.HistorySyncConfig;return A.fullSyncDaysLimit!=null&&(t.fullSyncDaysLimit=A.fullSyncDaysLimit>>>0),A.fullSyncSizeMbLimit!=null&&(t.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit>>>0),A.storageQuotaMb!=null&&(t.storageQuotaMb=A.storageQuotaMb>>>0),A.inlineInitialPayloadInE2EeMsg!=null&&(t.inlineInitialPayloadInE2EeMsg=!!A.inlineInitialPayloadInE2EeMsg),A.recentSyncDaysLimit!=null&&(t.recentSyncDaysLimit=A.recentSyncDaysLimit>>>0),A.supportCallLogHistory!=null&&(t.supportCallLogHistory=!!A.supportCallLogHistory),A.supportBotUserAgentChatHistory!=null&&(t.supportBotUserAgentChatHistory=!!A.supportBotUserAgentChatHistory),A.supportCagReactionsAndPolls!=null&&(t.supportCagReactionsAndPolls=!!A.supportCagReactionsAndPolls),A.supportBizHostedMsg!=null&&(t.supportBizHostedMsg=!!A.supportBizHostedMsg),A.supportRecentSyncChunkMessageCountTuning!=null&&(t.supportRecentSyncChunkMessageCountTuning=!!A.supportRecentSyncChunkMessageCountTuning),A.supportHostedGroupMsg!=null&&(t.supportHostedGroupMsg=!!A.supportHostedGroupMsg),A.supportFbidBotChatHistory!=null&&(t.supportFbidBotChatHistory=!!A.supportFbidBotChatHistory),A.supportAddOnHistorySyncMigration!=null&&(t.supportAddOnHistorySyncMigration=!!A.supportAddOnHistorySyncMigration),A.supportMessageAssociation!=null&&(t.supportMessageAssociation=!!A.supportMessageAssociation),A.supportGroupHistory!=null&&(t.supportGroupHistory=!!A.supportGroupHistory),A.onDemandReady!=null&&(t.onDemandReady=!!A.onDemandReady),A.supportGuestChat!=null&&(t.supportGuestChat=!!A.supportGuestChat),A.completeOnDemandReady!=null&&(t.completeOnDemandReady=!!A.completeOnDemandReady),A.thumbnailSyncDaysLimit!=null&&(t.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit>>>0),t},i.toObject=function(A,t){t||(t={});var s={};return A.fullSyncDaysLimit!=null&&A.hasOwnProperty("fullSyncDaysLimit")&&(s.fullSyncDaysLimit=A.fullSyncDaysLimit,t.oneofs&&(s._fullSyncDaysLimit="fullSyncDaysLimit")),A.fullSyncSizeMbLimit!=null&&A.hasOwnProperty("fullSyncSizeMbLimit")&&(s.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit,t.oneofs&&(s._fullSyncSizeMbLimit="fullSyncSizeMbLimit")),A.storageQuotaMb!=null&&A.hasOwnProperty("storageQuotaMb")&&(s.storageQuotaMb=A.storageQuotaMb,t.oneofs&&(s._storageQuotaMb="storageQuotaMb")),A.inlineInitialPayloadInE2EeMsg!=null&&A.hasOwnProperty("inlineInitialPayloadInE2EeMsg")&&(s.inlineInitialPayloadInE2EeMsg=A.inlineInitialPayloadInE2EeMsg,t.oneofs&&(s._inlineInitialPayloadInE2EeMsg="inlineInitialPayloadInE2EeMsg")),A.recentSyncDaysLimit!=null&&A.hasOwnProperty("recentSyncDaysLimit")&&(s.recentSyncDaysLimit=A.recentSyncDaysLimit,t.oneofs&&(s._recentSyncDaysLimit="recentSyncDaysLimit")),A.supportCallLogHistory!=null&&A.hasOwnProperty("supportCallLogHistory")&&(s.supportCallLogHistory=A.supportCallLogHistory,t.oneofs&&(s._supportCallLogHistory="supportCallLogHistory")),A.supportBotUserAgentChatHistory!=null&&A.hasOwnProperty("supportBotUserAgentChatHistory")&&(s.supportBotUserAgentChatHistory=A.supportBotUserAgentChatHistory,t.oneofs&&(s._supportBotUserAgentChatHistory="supportBotUserAgentChatHistory")),A.supportCagReactionsAndPolls!=null&&A.hasOwnProperty("supportCagReactionsAndPolls")&&(s.supportCagReactionsAndPolls=A.supportCagReactionsAndPolls,t.oneofs&&(s._supportCagReactionsAndPolls="supportCagReactionsAndPolls")),A.supportBizHostedMsg!=null&&A.hasOwnProperty("supportBizHostedMsg")&&(s.supportBizHostedMsg=A.supportBizHostedMsg,t.oneofs&&(s._supportBizHostedMsg="supportBizHostedMsg")),A.supportRecentSyncChunkMessageCountTuning!=null&&A.hasOwnProperty("supportRecentSyncChunkMessageCountTuning")&&(s.supportRecentSyncChunkMessageCountTuning=A.supportRecentSyncChunkMessageCountTuning,t.oneofs&&(s._supportRecentSyncChunkMessageCountTuning="supportRecentSyncChunkMessageCountTuning")),A.supportHostedGroupMsg!=null&&A.hasOwnProperty("supportHostedGroupMsg")&&(s.supportHostedGroupMsg=A.supportHostedGroupMsg,t.oneofs&&(s._supportHostedGroupMsg="supportHostedGroupMsg")),A.supportFbidBotChatHistory!=null&&A.hasOwnProperty("supportFbidBotChatHistory")&&(s.supportFbidBotChatHistory=A.supportFbidBotChatHistory,t.oneofs&&(s._supportFbidBotChatHistory="supportFbidBotChatHistory")),A.supportAddOnHistorySyncMigration!=null&&A.hasOwnProperty("supportAddOnHistorySyncMigration")&&(s.supportAddOnHistorySyncMigration=A.supportAddOnHistorySyncMigration,t.oneofs&&(s._supportAddOnHistorySyncMigration="supportAddOnHistorySyncMigration")),A.supportMessageAssociation!=null&&A.hasOwnProperty("supportMessageAssociation")&&(s.supportMessageAssociation=A.supportMessageAssociation,t.oneofs&&(s._supportMessageAssociation="supportMessageAssociation")),A.supportGroupHistory!=null&&A.hasOwnProperty("supportGroupHistory")&&(s.supportGroupHistory=A.supportGroupHistory,t.oneofs&&(s._supportGroupHistory="supportGroupHistory")),A.onDemandReady!=null&&A.hasOwnProperty("onDemandReady")&&(s.onDemandReady=A.onDemandReady,t.oneofs&&(s._onDemandReady="onDemandReady")),A.supportGuestChat!=null&&A.hasOwnProperty("supportGuestChat")&&(s.supportGuestChat=A.supportGuestChat,t.oneofs&&(s._supportGuestChat="supportGuestChat")),A.completeOnDemandReady!=null&&A.hasOwnProperty("completeOnDemandReady")&&(s.completeOnDemandReady=A.completeOnDemandReady,t.oneofs&&(s._completeOnDemandReady="completeOnDemandReady")),A.thumbnailSyncDaysLimit!=null&&A.hasOwnProperty("thumbnailSyncDaysLimit")&&(s.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit,t.oneofs&&(s._thumbnailSyncDaysLimit="thumbnailSyncDaysLimit")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.HistorySyncConfig"},i})(),r.PlatformType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHROME"]=1,e[i[2]="FIREFOX"]=2,e[i[3]="IE"]=3,e[i[4]="OPERA"]=4,e[i[5]="SAFARI"]=5,e[i[6]="EDGE"]=6,e[i[7]="DESKTOP"]=7,e[i[8]="IPAD"]=8,e[i[9]="ANDROID_TABLET"]=9,e[i[10]="OHANA"]=10,e[i[11]="ALOHA"]=11,e[i[12]="CATALINA"]=12,e[i[13]="TCL_TV"]=13,e[i[14]="IOS_PHONE"]=14,e[i[15]="IOS_CATALYST"]=15,e[i[16]="ANDROID_PHONE"]=16,e[i[17]="ANDROID_AMBIGUOUS"]=17,e[i[18]="WEAR_OS"]=18,e[i[19]="AR_WRIST"]=19,e[i[20]="AR_DEVICE"]=20,e[i[21]="UWP"]=21,e[i[22]="VR"]=22,e[i[23]="CLOUD_API"]=23,e[i[24]="SMARTGLASSES"]=24,e})(),r})(),n.DisappearingMode=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.initiator=e.int32();break}case 2:{s.trigger=e.int32();break}case 3:{s.initiatorDeviceJid=e.string();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.DisappearingMode)return e;var a=new p.proto.DisappearingMode;switch(e.initiator){default:if(typeof e.initiator=="number"){a.initiator=e.initiator;break}break;case"CHANGED_IN_CHAT":case 0:a.initiator=0;break;case"INITIATED_BY_ME":case 1:a.initiator=1;break;case"INITIATED_BY_OTHER":case 2:a.initiator=2;break;case"BIZ_UPGRADE_FB_HOSTING":case 3:a.initiator=3;break}switch(e.trigger){default:if(typeof e.trigger=="number"){a.trigger=e.trigger;break}break;case"UNKNOWN":case 0:a.trigger=0;break;case"CHAT_SETTING":case 1:a.trigger=1;break;case"ACCOUNT_SETTING":case 2:a.trigger=2;break;case"BULK_CHANGE":case 3:a.trigger=3;break;case"BIZ_SUPPORTS_FB_HOSTING":case 4:a.trigger=4;break;case"UNKNOWN_GROUPS":case 5:a.trigger=5;break}return e.initiatorDeviceJid!=null&&(a.initiatorDeviceJid=String(e.initiatorDeviceJid)),e.initiatedByMe!=null&&(a.initiatedByMe=!!e.initiatedByMe),a},r.toObject=function(e,a){a||(a={});var A={};return e.initiator!=null&&e.hasOwnProperty("initiator")&&(A.initiator=a.enums===String?p.proto.DisappearingMode.Initiator[e.initiator]===void 0?e.initiator:p.proto.DisappearingMode.Initiator[e.initiator]:e.initiator,a.oneofs&&(A._initiator="initiator")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=a.enums===String?p.proto.DisappearingMode.Trigger[e.trigger]===void 0?e.trigger:p.proto.DisappearingMode.Trigger[e.trigger]:e.trigger,a.oneofs&&(A._trigger="trigger")),e.initiatorDeviceJid!=null&&e.hasOwnProperty("initiatorDeviceJid")&&(A.initiatorDeviceJid=e.initiatorDeviceJid,a.oneofs&&(A._initiatorDeviceJid="initiatorDeviceJid")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,a.oneofs&&(A._initiatedByMe="initiatedByMe")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DisappearingMode"},r.Initiator=(function(){let i={},e=Object.create(i);return e[i[0]="CHANGED_IN_CHAT"]=0,e[i[1]="INITIATED_BY_ME"]=1,e[i[2]="INITIATED_BY_OTHER"]=2,e[i[3]="BIZ_UPGRADE_FB_HOSTING"]=3,e})(),r.Trigger=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHAT_SETTING"]=1,e[i[2]="ACCOUNT_SETTING"]=2,e[i[3]="BULK_CHANGE"]=3,e[i[4]="BIZ_SUPPORTS_FB_HOSTING"]=4,e[i[5]="UNKNOWN_GROUPS"]=5,e})(),r})(),n.EmbeddedContent=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.embeddedMessage=p.proto.EmbeddedMessage.decode(e,e.uint32());break}case 2:{s.embeddedMusic=p.proto.EmbeddedMusic.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.EmbeddedContent)return e;var a=new p.proto.EmbeddedContent;if(e.embeddedMessage!=null){if(typeof e.embeddedMessage!="object")throw TypeError(".proto.EmbeddedContent.embeddedMessage: object expected");a.embeddedMessage=p.proto.EmbeddedMessage.fromObject(e.embeddedMessage)}if(e.embeddedMusic!=null){if(typeof e.embeddedMusic!="object")throw TypeError(".proto.EmbeddedContent.embeddedMusic: object expected");a.embeddedMusic=p.proto.EmbeddedMusic.fromObject(e.embeddedMusic)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.embeddedMessage!=null&&e.hasOwnProperty("embeddedMessage")&&(A.embeddedMessage=p.proto.EmbeddedMessage.toObject(e.embeddedMessage,a),a.oneofs&&(A.content="embeddedMessage")),e.embeddedMusic!=null&&e.hasOwnProperty("embeddedMusic")&&(A.embeddedMusic=p.proto.EmbeddedMusic.toObject(e.embeddedMusic,a),a.oneofs&&(A.content="embeddedMusic")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedContent"},r})(),n.EmbeddedMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.EmbeddedMessage)return e;var a=new p.proto.EmbeddedMessage;if(e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.EmbeddedMessage.message: object expected");a.message=p.proto.Message.fromObject(e.message)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.Message.toObject(e.message,a),a.oneofs&&(A._message="message")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMessage"},r})(),n.EmbeddedMusic=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.musicContentMediaId=e.string();break}case 2:{s.songId=e.string();break}case 3:{s.author=e.string();break}case 4:{s.title=e.string();break}case 5:{s.artworkDirectPath=e.string();break}case 6:{s.artworkSha256=e.bytes();break}case 7:{s.artworkEncSha256=e.bytes();break}case 8:{s.artistAttribution=e.string();break}case 9:{s.countryBlocklist=e.bytes();break}case 10:{s.isExplicit=e.bool();break}case 11:{s.artworkMediaKey=e.bytes();break}case 12:{s.musicSongStartTimeInMs=e.int64();break}case 13:{s.derivedContentStartTimeInMs=e.int64();break}case 14:{s.overlapDurationInMs=e.int64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.EmbeddedMusic)return e;var a=new p.proto.EmbeddedMusic;return e.musicContentMediaId!=null&&(a.musicContentMediaId=String(e.musicContentMediaId)),e.songId!=null&&(a.songId=String(e.songId)),e.author!=null&&(a.author=String(e.author)),e.title!=null&&(a.title=String(e.title)),e.artworkDirectPath!=null&&(a.artworkDirectPath=String(e.artworkDirectPath)),e.artworkSha256!=null&&(typeof e.artworkSha256=="string"?l.base64.decode(e.artworkSha256,a.artworkSha256=l.newBuffer(l.base64.length(e.artworkSha256)),0):e.artworkSha256.length>=0&&(a.artworkSha256=e.artworkSha256)),e.artworkEncSha256!=null&&(typeof e.artworkEncSha256=="string"?l.base64.decode(e.artworkEncSha256,a.artworkEncSha256=l.newBuffer(l.base64.length(e.artworkEncSha256)),0):e.artworkEncSha256.length>=0&&(a.artworkEncSha256=e.artworkEncSha256)),e.artistAttribution!=null&&(a.artistAttribution=String(e.artistAttribution)),e.countryBlocklist!=null&&(typeof e.countryBlocklist=="string"?l.base64.decode(e.countryBlocklist,a.countryBlocklist=l.newBuffer(l.base64.length(e.countryBlocklist)),0):e.countryBlocklist.length>=0&&(a.countryBlocklist=e.countryBlocklist)),e.isExplicit!=null&&(a.isExplicit=!!e.isExplicit),e.artworkMediaKey!=null&&(typeof e.artworkMediaKey=="string"?l.base64.decode(e.artworkMediaKey,a.artworkMediaKey=l.newBuffer(l.base64.length(e.artworkMediaKey)),0):e.artworkMediaKey.length>=0&&(a.artworkMediaKey=e.artworkMediaKey)),e.musicSongStartTimeInMs!=null&&(l.Long?(a.musicSongStartTimeInMs=l.Long.fromValue(e.musicSongStartTimeInMs)).unsigned=!1:typeof e.musicSongStartTimeInMs=="string"?a.musicSongStartTimeInMs=parseInt(e.musicSongStartTimeInMs,10):typeof e.musicSongStartTimeInMs=="number"?a.musicSongStartTimeInMs=e.musicSongStartTimeInMs:typeof e.musicSongStartTimeInMs=="object"&&(a.musicSongStartTimeInMs=new l.LongBits(e.musicSongStartTimeInMs.low>>>0,e.musicSongStartTimeInMs.high>>>0).toNumber())),e.derivedContentStartTimeInMs!=null&&(l.Long?(a.derivedContentStartTimeInMs=l.Long.fromValue(e.derivedContentStartTimeInMs)).unsigned=!1:typeof e.derivedContentStartTimeInMs=="string"?a.derivedContentStartTimeInMs=parseInt(e.derivedContentStartTimeInMs,10):typeof e.derivedContentStartTimeInMs=="number"?a.derivedContentStartTimeInMs=e.derivedContentStartTimeInMs:typeof e.derivedContentStartTimeInMs=="object"&&(a.derivedContentStartTimeInMs=new l.LongBits(e.derivedContentStartTimeInMs.low>>>0,e.derivedContentStartTimeInMs.high>>>0).toNumber())),e.overlapDurationInMs!=null&&(l.Long?(a.overlapDurationInMs=l.Long.fromValue(e.overlapDurationInMs)).unsigned=!1:typeof e.overlapDurationInMs=="string"?a.overlapDurationInMs=parseInt(e.overlapDurationInMs,10):typeof e.overlapDurationInMs=="number"?a.overlapDurationInMs=e.overlapDurationInMs:typeof e.overlapDurationInMs=="object"&&(a.overlapDurationInMs=new l.LongBits(e.overlapDurationInMs.low>>>0,e.overlapDurationInMs.high>>>0).toNumber())),a},r.toObject=function(e,a){a||(a={});var A={};return e.musicContentMediaId!=null&&e.hasOwnProperty("musicContentMediaId")&&(A.musicContentMediaId=e.musicContentMediaId,a.oneofs&&(A._musicContentMediaId="musicContentMediaId")),e.songId!=null&&e.hasOwnProperty("songId")&&(A.songId=e.songId,a.oneofs&&(A._songId="songId")),e.author!=null&&e.hasOwnProperty("author")&&(A.author=e.author,a.oneofs&&(A._author="author")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,a.oneofs&&(A._title="title")),e.artworkDirectPath!=null&&e.hasOwnProperty("artworkDirectPath")&&(A.artworkDirectPath=e.artworkDirectPath,a.oneofs&&(A._artworkDirectPath="artworkDirectPath")),e.artworkSha256!=null&&e.hasOwnProperty("artworkSha256")&&(A.artworkSha256=a.bytes===String?l.base64.encode(e.artworkSha256,0,e.artworkSha256.length):a.bytes===Array?Array.prototype.slice.call(e.artworkSha256):e.artworkSha256,a.oneofs&&(A._artworkSha256="artworkSha256")),e.artworkEncSha256!=null&&e.hasOwnProperty("artworkEncSha256")&&(A.artworkEncSha256=a.bytes===String?l.base64.encode(e.artworkEncSha256,0,e.artworkEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.artworkEncSha256):e.artworkEncSha256,a.oneofs&&(A._artworkEncSha256="artworkEncSha256")),e.artistAttribution!=null&&e.hasOwnProperty("artistAttribution")&&(A.artistAttribution=e.artistAttribution,a.oneofs&&(A._artistAttribution="artistAttribution")),e.countryBlocklist!=null&&e.hasOwnProperty("countryBlocklist")&&(A.countryBlocklist=a.bytes===String?l.base64.encode(e.countryBlocklist,0,e.countryBlocklist.length):a.bytes===Array?Array.prototype.slice.call(e.countryBlocklist):e.countryBlocklist,a.oneofs&&(A._countryBlocklist="countryBlocklist")),e.isExplicit!=null&&e.hasOwnProperty("isExplicit")&&(A.isExplicit=e.isExplicit,a.oneofs&&(A._isExplicit="isExplicit")),e.artworkMediaKey!=null&&e.hasOwnProperty("artworkMediaKey")&&(A.artworkMediaKey=a.bytes===String?l.base64.encode(e.artworkMediaKey,0,e.artworkMediaKey.length):a.bytes===Array?Array.prototype.slice.call(e.artworkMediaKey):e.artworkMediaKey,a.oneofs&&(A._artworkMediaKey="artworkMediaKey")),e.musicSongStartTimeInMs!=null&&e.hasOwnProperty("musicSongStartTimeInMs")&&(typeof e.musicSongStartTimeInMs=="number"?A.musicSongStartTimeInMs=a.longs===String?String(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs:A.musicSongStartTimeInMs=a.longs===String?oe(e.musicSongStartTimeInMs):a.longs===Number?ne(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs,a.oneofs&&(A._musicSongStartTimeInMs="musicSongStartTimeInMs")),e.derivedContentStartTimeInMs!=null&&e.hasOwnProperty("derivedContentStartTimeInMs")&&(typeof e.derivedContentStartTimeInMs=="number"?A.derivedContentStartTimeInMs=a.longs===String?String(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs:A.derivedContentStartTimeInMs=a.longs===String?oe(e.derivedContentStartTimeInMs):a.longs===Number?ne(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs,a.oneofs&&(A._derivedContentStartTimeInMs="derivedContentStartTimeInMs")),e.overlapDurationInMs!=null&&e.hasOwnProperty("overlapDurationInMs")&&(typeof e.overlapDurationInMs=="number"?A.overlapDurationInMs=a.longs===String?String(e.overlapDurationInMs):e.overlapDurationInMs:A.overlapDurationInMs=a.longs===String?oe(e.overlapDurationInMs):a.longs===Number?ne(e.overlapDurationInMs):e.overlapDurationInMs,a.oneofs&&(A._overlapDurationInMs="overlapDurationInMs")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMusic"},r})(),n.EncryptedPairingRequest=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encryptedPayload=e.bytes();break}case 2:{s.iv=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.EncryptedPairingRequest)return e;var a=new p.proto.EncryptedPairingRequest;return e.encryptedPayload!=null&&(typeof e.encryptedPayload=="string"?l.base64.decode(e.encryptedPayload,a.encryptedPayload=l.newBuffer(l.base64.length(e.encryptedPayload)),0):e.encryptedPayload.length>=0&&(a.encryptedPayload=e.encryptedPayload)),e.iv!=null&&(typeof e.iv=="string"?l.base64.decode(e.iv,a.iv=l.newBuffer(l.base64.length(e.iv)),0):e.iv.length>=0&&(a.iv=e.iv)),a},r.toObject=function(e,a){a||(a={});var A={};return e.encryptedPayload!=null&&e.hasOwnProperty("encryptedPayload")&&(A.encryptedPayload=a.bytes===String?l.base64.encode(e.encryptedPayload,0,e.encryptedPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encryptedPayload):e.encryptedPayload,a.oneofs&&(A._encryptedPayload="encryptedPayload")),e.iv!=null&&e.hasOwnProperty("iv")&&(A.iv=a.bytes===String?l.base64.encode(e.iv,0,e.iv.length):a.bytes===Array?Array.prototype.slice.call(e.iv):e.iv,a.oneofs&&(A._iv="iv")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EncryptedPairingRequest"},r})(),n.EphemeralSetting=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.duration=e.sfixed32();break}case 2:{s.timestamp=e.sfixed64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.EphemeralSetting)return e;var a=new p.proto.EphemeralSetting;return e.duration!=null&&(a.duration=e.duration|0),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),a},r.toObject=function(e,a){a||(a={});var A={};return e.duration!=null&&e.hasOwnProperty("duration")&&(A.duration=e.duration,a.oneofs&&(A._duration="duration")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?oe(e.timestamp):a.longs===Number?ne(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EphemeralSetting"},r})(),n.EventAdditionalMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.isStale=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.EventAdditionalMetadata)return e;var a=new p.proto.EventAdditionalMetadata;return e.isStale!=null&&(a.isStale=!!e.isStale),a},r.toObject=function(e,a){a||(a={});var A={};return e.isStale!=null&&e.hasOwnProperty("isStale")&&(A.isStale=e.isStale,a.oneofs&&(A._isStale="isStale")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventAdditionalMetadata"},r})(),n.EventResponse=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.eventResponseMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.timestampMs=e.int64();break}case 3:{s.eventResponseMessage=p.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 4:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.EventResponse)return e;var a=new p.proto.EventResponse;if(e.eventResponseMessageKey!=null){if(typeof e.eventResponseMessageKey!="object")throw TypeError(".proto.EventResponse.eventResponseMessageKey: object expected");a.eventResponseMessageKey=p.proto.MessageKey.fromObject(e.eventResponseMessageKey)}if(e.timestampMs!=null&&(l.Long?(a.timestampMs=l.Long.fromValue(e.timestampMs)).unsigned=!1:typeof e.timestampMs=="string"?a.timestampMs=parseInt(e.timestampMs,10):typeof e.timestampMs=="number"?a.timestampMs=e.timestampMs:typeof e.timestampMs=="object"&&(a.timestampMs=new l.LongBits(e.timestampMs.low>>>0,e.timestampMs.high>>>0).toNumber())),e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.EventResponse.eventResponseMessage: object expected");a.eventResponseMessage=p.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}return e.unread!=null&&(a.unread=!!e.unread),a},r.toObject=function(e,a){a||(a={});var A={};return e.eventResponseMessageKey!=null&&e.hasOwnProperty("eventResponseMessageKey")&&(A.eventResponseMessageKey=p.proto.MessageKey.toObject(e.eventResponseMessageKey,a),a.oneofs&&(A._eventResponseMessageKey="eventResponseMessageKey")),e.timestampMs!=null&&e.hasOwnProperty("timestampMs")&&(typeof e.timestampMs=="number"?A.timestampMs=a.longs===String?String(e.timestampMs):e.timestampMs:A.timestampMs=a.longs===String?oe(e.timestampMs):a.longs===Number?ne(e.timestampMs):e.timestampMs,a.oneofs&&(A._timestampMs="timestampMs")),e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=p.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,a),a.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,a.oneofs&&(A._unread="unread")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventResponse"},r})(),n.ExitCode=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.code=e.uint64();break}case 2:{s.text=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ExitCode)return e;var a=new p.proto.ExitCode;return e.code!=null&&(l.Long?(a.code=l.Long.fromValue(e.code)).unsigned=!0:typeof e.code=="string"?a.code=parseInt(e.code,10):typeof e.code=="number"?a.code=e.code:typeof e.code=="object"&&(a.code=new l.LongBits(e.code.low>>>0,e.code.high>>>0).toNumber(!0))),e.text!=null&&(a.text=String(e.text)),a},r.toObject=function(e,a){a||(a={});var A={};return e.code!=null&&e.hasOwnProperty("code")&&(typeof e.code=="number"?A.code=a.longs===String?String(e.code):e.code:A.code=a.longs===String?oe(e.code,!0):a.longs===Number?ne(e.code,!0):e.code,a.oneofs&&(A._code="code")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,a.oneofs&&(A._text="text")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExitCode"},r})(),n.ExternalBlobReference=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.mediaKey=e.bytes();break}case 2:{s.directPath=e.string();break}case 3:{s.handle=e.string();break}case 4:{s.fileSizeBytes=e.uint64();break}case 5:{s.fileSha256=e.bytes();break}case 6:{s.fileEncSha256=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ExternalBlobReference)return e;var a=new p.proto.ExternalBlobReference;return e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,a.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(a.mediaKey=e.mediaKey)),e.directPath!=null&&(a.directPath=String(e.directPath)),e.handle!=null&&(a.handle=String(e.handle)),e.fileSizeBytes!=null&&(l.Long?(a.fileSizeBytes=l.Long.fromValue(e.fileSizeBytes)).unsigned=!0:typeof e.fileSizeBytes=="string"?a.fileSizeBytes=parseInt(e.fileSizeBytes,10):typeof e.fileSizeBytes=="number"?a.fileSizeBytes=e.fileSizeBytes:typeof e.fileSizeBytes=="object"&&(a.fileSizeBytes=new l.LongBits(e.fileSizeBytes.low>>>0,e.fileSizeBytes.high>>>0).toNumber(!0))),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,a.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(a.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,a.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(a.fileEncSha256=e.fileEncSha256)),a},r.toObject=function(e,a){a||(a={});var A={};return e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=a.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):a.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,a.oneofs&&(A._mediaKey="mediaKey")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.handle!=null&&e.hasOwnProperty("handle")&&(A.handle=e.handle,a.oneofs&&(A._handle="handle")),e.fileSizeBytes!=null&&e.hasOwnProperty("fileSizeBytes")&&(typeof e.fileSizeBytes=="number"?A.fileSizeBytes=a.longs===String?String(e.fileSizeBytes):e.fileSizeBytes:A.fileSizeBytes=a.longs===String?oe(e.fileSizeBytes,!0):a.longs===Number?ne(e.fileSizeBytes,!0):e.fileSizeBytes,a.oneofs&&(A._fileSizeBytes="fileSizeBytes")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=a.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,a.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=a.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExternalBlobReference"},r})(),n.Field=(function(){function r(i){if(this.subfield={},i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.isMessage=e.bool();break}case 5:{s.subfield===l.emptyObject&&(s.subfield={});var d=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=p.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.subfield[g]=c;break}default:e.skipType(I&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Field)return e;var a=new p.proto.Field;if(e.minVersion!=null&&(a.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(a.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(a.notReportableMinVersion=e.notReportableMinVersion>>>0),e.isMessage!=null&&(a.isMessage=!!e.isMessage),e.subfield){if(typeof e.subfield!="object")throw TypeError(".proto.Field.subfield: object expected");a.subfield={};for(var A=Object.keys(e.subfield),t=0;t>>3){case 1:{s.botName=e.string();break}case 2:{s.botJid=e.string();break}case 3:{s.creatorName=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ForwardedAIBotMessageInfo)return e;var a=new p.proto.ForwardedAIBotMessageInfo;return e.botName!=null&&(a.botName=String(e.botName)),e.botJid!=null&&(a.botJid=String(e.botJid)),e.creatorName!=null&&(a.creatorName=String(e.creatorName)),a},r.toObject=function(e,a){a||(a={});var A={};return e.botName!=null&&e.hasOwnProperty("botName")&&(A.botName=e.botName,a.oneofs&&(A._botName="botName")),e.botJid!=null&&e.hasOwnProperty("botJid")&&(A.botJid=e.botJid,a.oneofs&&(A._botJid="botJid")),e.creatorName!=null&&e.hasOwnProperty("creatorName")&&(A.creatorName=e.creatorName,a.oneofs&&(A._creatorName="creatorName")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ForwardedAIBotMessageInfo"},r})(),n.GlobalSettings=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lightThemeWallpaper=p.proto.WallpaperSettings.decode(e,e.uint32());break}case 2:{s.mediaVisibility=e.int32();break}case 3:{s.darkThemeWallpaper=p.proto.WallpaperSettings.decode(e,e.uint32());break}case 4:{s.autoDownloadWiFi=p.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 5:{s.autoDownloadCellular=p.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 6:{s.autoDownloadRoaming=p.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 7:{s.showIndividualNotificationsPreview=e.bool();break}case 8:{s.showGroupNotificationsPreview=e.bool();break}case 9:{s.disappearingModeDuration=e.int32();break}case 10:{s.disappearingModeTimestamp=e.int64();break}case 11:{s.avatarUserSettings=p.proto.AvatarUserSettings.decode(e,e.uint32());break}case 12:{s.fontSize=e.int32();break}case 13:{s.securityNotifications=e.bool();break}case 14:{s.autoUnarchiveChats=e.bool();break}case 15:{s.videoQualityMode=e.int32();break}case 16:{s.photoQualityMode=e.int32();break}case 17:{s.individualNotificationSettings=p.proto.NotificationSettings.decode(e,e.uint32());break}case 18:{s.groupNotificationSettings=p.proto.NotificationSettings.decode(e,e.uint32());break}case 19:{s.chatLockSettings=p.proto.ChatLockSettings.decode(e,e.uint32());break}case 20:{s.chatDbLidMigrationTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.GlobalSettings)return e;var a=new p.proto.GlobalSettings;if(e.lightThemeWallpaper!=null){if(typeof e.lightThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.lightThemeWallpaper: object expected");a.lightThemeWallpaper=p.proto.WallpaperSettings.fromObject(e.lightThemeWallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){a.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:a.mediaVisibility=0;break;case"OFF":case 1:a.mediaVisibility=1;break;case"ON":case 2:a.mediaVisibility=2;break}if(e.darkThemeWallpaper!=null){if(typeof e.darkThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.darkThemeWallpaper: object expected");a.darkThemeWallpaper=p.proto.WallpaperSettings.fromObject(e.darkThemeWallpaper)}if(e.autoDownloadWiFi!=null){if(typeof e.autoDownloadWiFi!="object")throw TypeError(".proto.GlobalSettings.autoDownloadWiFi: object expected");a.autoDownloadWiFi=p.proto.AutoDownloadSettings.fromObject(e.autoDownloadWiFi)}if(e.autoDownloadCellular!=null){if(typeof e.autoDownloadCellular!="object")throw TypeError(".proto.GlobalSettings.autoDownloadCellular: object expected");a.autoDownloadCellular=p.proto.AutoDownloadSettings.fromObject(e.autoDownloadCellular)}if(e.autoDownloadRoaming!=null){if(typeof e.autoDownloadRoaming!="object")throw TypeError(".proto.GlobalSettings.autoDownloadRoaming: object expected");a.autoDownloadRoaming=p.proto.AutoDownloadSettings.fromObject(e.autoDownloadRoaming)}if(e.showIndividualNotificationsPreview!=null&&(a.showIndividualNotificationsPreview=!!e.showIndividualNotificationsPreview),e.showGroupNotificationsPreview!=null&&(a.showGroupNotificationsPreview=!!e.showGroupNotificationsPreview),e.disappearingModeDuration!=null&&(a.disappearingModeDuration=e.disappearingModeDuration|0),e.disappearingModeTimestamp!=null&&(l.Long?(a.disappearingModeTimestamp=l.Long.fromValue(e.disappearingModeTimestamp)).unsigned=!1:typeof e.disappearingModeTimestamp=="string"?a.disappearingModeTimestamp=parseInt(e.disappearingModeTimestamp,10):typeof e.disappearingModeTimestamp=="number"?a.disappearingModeTimestamp=e.disappearingModeTimestamp:typeof e.disappearingModeTimestamp=="object"&&(a.disappearingModeTimestamp=new l.LongBits(e.disappearingModeTimestamp.low>>>0,e.disappearingModeTimestamp.high>>>0).toNumber())),e.avatarUserSettings!=null){if(typeof e.avatarUserSettings!="object")throw TypeError(".proto.GlobalSettings.avatarUserSettings: object expected");a.avatarUserSettings=p.proto.AvatarUserSettings.fromObject(e.avatarUserSettings)}if(e.fontSize!=null&&(a.fontSize=e.fontSize|0),e.securityNotifications!=null&&(a.securityNotifications=!!e.securityNotifications),e.autoUnarchiveChats!=null&&(a.autoUnarchiveChats=!!e.autoUnarchiveChats),e.videoQualityMode!=null&&(a.videoQualityMode=e.videoQualityMode|0),e.photoQualityMode!=null&&(a.photoQualityMode=e.photoQualityMode|0),e.individualNotificationSettings!=null){if(typeof e.individualNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.individualNotificationSettings: object expected");a.individualNotificationSettings=p.proto.NotificationSettings.fromObject(e.individualNotificationSettings)}if(e.groupNotificationSettings!=null){if(typeof e.groupNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.groupNotificationSettings: object expected");a.groupNotificationSettings=p.proto.NotificationSettings.fromObject(e.groupNotificationSettings)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.GlobalSettings.chatLockSettings: object expected");a.chatLockSettings=p.proto.ChatLockSettings.fromObject(e.chatLockSettings)}return e.chatDbLidMigrationTimestamp!=null&&(l.Long?(a.chatDbLidMigrationTimestamp=l.Long.fromValue(e.chatDbLidMigrationTimestamp)).unsigned=!1:typeof e.chatDbLidMigrationTimestamp=="string"?a.chatDbLidMigrationTimestamp=parseInt(e.chatDbLidMigrationTimestamp,10):typeof e.chatDbLidMigrationTimestamp=="number"?a.chatDbLidMigrationTimestamp=e.chatDbLidMigrationTimestamp:typeof e.chatDbLidMigrationTimestamp=="object"&&(a.chatDbLidMigrationTimestamp=new l.LongBits(e.chatDbLidMigrationTimestamp.low>>>0,e.chatDbLidMigrationTimestamp.high>>>0).toNumber())),a},r.toObject=function(e,a){a||(a={});var A={};return e.lightThemeWallpaper!=null&&e.hasOwnProperty("lightThemeWallpaper")&&(A.lightThemeWallpaper=p.proto.WallpaperSettings.toObject(e.lightThemeWallpaper,a),a.oneofs&&(A._lightThemeWallpaper="lightThemeWallpaper")),e.mediaVisibility!=null&&e.hasOwnProperty("mediaVisibility")&&(A.mediaVisibility=a.enums===String?p.proto.MediaVisibility[e.mediaVisibility]===void 0?e.mediaVisibility:p.proto.MediaVisibility[e.mediaVisibility]:e.mediaVisibility,a.oneofs&&(A._mediaVisibility="mediaVisibility")),e.darkThemeWallpaper!=null&&e.hasOwnProperty("darkThemeWallpaper")&&(A.darkThemeWallpaper=p.proto.WallpaperSettings.toObject(e.darkThemeWallpaper,a),a.oneofs&&(A._darkThemeWallpaper="darkThemeWallpaper")),e.autoDownloadWiFi!=null&&e.hasOwnProperty("autoDownloadWiFi")&&(A.autoDownloadWiFi=p.proto.AutoDownloadSettings.toObject(e.autoDownloadWiFi,a),a.oneofs&&(A._autoDownloadWiFi="autoDownloadWiFi")),e.autoDownloadCellular!=null&&e.hasOwnProperty("autoDownloadCellular")&&(A.autoDownloadCellular=p.proto.AutoDownloadSettings.toObject(e.autoDownloadCellular,a),a.oneofs&&(A._autoDownloadCellular="autoDownloadCellular")),e.autoDownloadRoaming!=null&&e.hasOwnProperty("autoDownloadRoaming")&&(A.autoDownloadRoaming=p.proto.AutoDownloadSettings.toObject(e.autoDownloadRoaming,a),a.oneofs&&(A._autoDownloadRoaming="autoDownloadRoaming")),e.showIndividualNotificationsPreview!=null&&e.hasOwnProperty("showIndividualNotificationsPreview")&&(A.showIndividualNotificationsPreview=e.showIndividualNotificationsPreview,a.oneofs&&(A._showIndividualNotificationsPreview="showIndividualNotificationsPreview")),e.showGroupNotificationsPreview!=null&&e.hasOwnProperty("showGroupNotificationsPreview")&&(A.showGroupNotificationsPreview=e.showGroupNotificationsPreview,a.oneofs&&(A._showGroupNotificationsPreview="showGroupNotificationsPreview")),e.disappearingModeDuration!=null&&e.hasOwnProperty("disappearingModeDuration")&&(A.disappearingModeDuration=e.disappearingModeDuration,a.oneofs&&(A._disappearingModeDuration="disappearingModeDuration")),e.disappearingModeTimestamp!=null&&e.hasOwnProperty("disappearingModeTimestamp")&&(typeof e.disappearingModeTimestamp=="number"?A.disappearingModeTimestamp=a.longs===String?String(e.disappearingModeTimestamp):e.disappearingModeTimestamp:A.disappearingModeTimestamp=a.longs===String?oe(e.disappearingModeTimestamp):a.longs===Number?ne(e.disappearingModeTimestamp):e.disappearingModeTimestamp,a.oneofs&&(A._disappearingModeTimestamp="disappearingModeTimestamp")),e.avatarUserSettings!=null&&e.hasOwnProperty("avatarUserSettings")&&(A.avatarUserSettings=p.proto.AvatarUserSettings.toObject(e.avatarUserSettings,a),a.oneofs&&(A._avatarUserSettings="avatarUserSettings")),e.fontSize!=null&&e.hasOwnProperty("fontSize")&&(A.fontSize=e.fontSize,a.oneofs&&(A._fontSize="fontSize")),e.securityNotifications!=null&&e.hasOwnProperty("securityNotifications")&&(A.securityNotifications=e.securityNotifications,a.oneofs&&(A._securityNotifications="securityNotifications")),e.autoUnarchiveChats!=null&&e.hasOwnProperty("autoUnarchiveChats")&&(A.autoUnarchiveChats=e.autoUnarchiveChats,a.oneofs&&(A._autoUnarchiveChats="autoUnarchiveChats")),e.videoQualityMode!=null&&e.hasOwnProperty("videoQualityMode")&&(A.videoQualityMode=e.videoQualityMode,a.oneofs&&(A._videoQualityMode="videoQualityMode")),e.photoQualityMode!=null&&e.hasOwnProperty("photoQualityMode")&&(A.photoQualityMode=e.photoQualityMode,a.oneofs&&(A._photoQualityMode="photoQualityMode")),e.individualNotificationSettings!=null&&e.hasOwnProperty("individualNotificationSettings")&&(A.individualNotificationSettings=p.proto.NotificationSettings.toObject(e.individualNotificationSettings,a),a.oneofs&&(A._individualNotificationSettings="individualNotificationSettings")),e.groupNotificationSettings!=null&&e.hasOwnProperty("groupNotificationSettings")&&(A.groupNotificationSettings=p.proto.NotificationSettings.toObject(e.groupNotificationSettings,a),a.oneofs&&(A._groupNotificationSettings="groupNotificationSettings")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=p.proto.ChatLockSettings.toObject(e.chatLockSettings,a),a.oneofs&&(A._chatLockSettings="chatLockSettings")),e.chatDbLidMigrationTimestamp!=null&&e.hasOwnProperty("chatDbLidMigrationTimestamp")&&(typeof e.chatDbLidMigrationTimestamp=="number"?A.chatDbLidMigrationTimestamp=a.longs===String?String(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp:A.chatDbLidMigrationTimestamp=a.longs===String?oe(e.chatDbLidMigrationTimestamp):a.longs===Number?ne(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp,a.oneofs&&(A._chatDbLidMigrationTimestamp="chatDbLidMigrationTimestamp")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GlobalSettings"},r})(),n.GroupHistoryBundleInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.deprecatedMessageHistoryBundle=p.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 2:{s.processState=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.GroupHistoryBundleInfo)return e;var a=new p.proto.GroupHistoryBundleInfo;if(e.deprecatedMessageHistoryBundle!=null){if(typeof e.deprecatedMessageHistoryBundle!="object")throw TypeError(".proto.GroupHistoryBundleInfo.deprecatedMessageHistoryBundle: object expected");a.deprecatedMessageHistoryBundle=p.proto.Message.MessageHistoryBundle.fromObject(e.deprecatedMessageHistoryBundle)}switch(e.processState){default:if(typeof e.processState=="number"){a.processState=e.processState;break}break;case"NOT_INJECTED":case 0:a.processState=0;break;case"INJECTED":case 1:a.processState=1;break;case"INJECTED_PARTIAL":case 2:a.processState=2;break;case"INJECTION_FAILED":case 3:a.processState=3;break;case"INJECTION_FAILED_NO_RETRY":case 4:a.processState=4;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.deprecatedMessageHistoryBundle!=null&&e.hasOwnProperty("deprecatedMessageHistoryBundle")&&(A.deprecatedMessageHistoryBundle=p.proto.Message.MessageHistoryBundle.toObject(e.deprecatedMessageHistoryBundle,a),a.oneofs&&(A._deprecatedMessageHistoryBundle="deprecatedMessageHistoryBundle")),e.processState!=null&&e.hasOwnProperty("processState")&&(A.processState=a.enums===String?p.proto.GroupHistoryBundleInfo.ProcessState[e.processState]===void 0?e.processState:p.proto.GroupHistoryBundleInfo.ProcessState[e.processState]:e.processState,a.oneofs&&(A._processState="processState")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryBundleInfo"},r.ProcessState=(function(){let i={},e=Object.create(i);return e[i[0]="NOT_INJECTED"]=0,e[i[1]="INJECTED"]=1,e[i[2]="INJECTED_PARTIAL"]=2,e[i[3]="INJECTION_FAILED"]=3,e[i[4]="INJECTION_FAILED_NO_RETRY"]=4,e})(),r})(),n.GroupHistoryIndividualMessageInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.bundleMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.editedAfterReceivedAsHistory=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.GroupHistoryIndividualMessageInfo)return e;var a=new p.proto.GroupHistoryIndividualMessageInfo;if(e.bundleMessageKey!=null){if(typeof e.bundleMessageKey!="object")throw TypeError(".proto.GroupHistoryIndividualMessageInfo.bundleMessageKey: object expected");a.bundleMessageKey=p.proto.MessageKey.fromObject(e.bundleMessageKey)}return e.editedAfterReceivedAsHistory!=null&&(a.editedAfterReceivedAsHistory=!!e.editedAfterReceivedAsHistory),a},r.toObject=function(e,a){a||(a={});var A={};return e.bundleMessageKey!=null&&e.hasOwnProperty("bundleMessageKey")&&(A.bundleMessageKey=p.proto.MessageKey.toObject(e.bundleMessageKey,a),a.oneofs&&(A._bundleMessageKey="bundleMessageKey")),e.editedAfterReceivedAsHistory!=null&&e.hasOwnProperty("editedAfterReceivedAsHistory")&&(A.editedAfterReceivedAsHistory=e.editedAfterReceivedAsHistory,a.oneofs&&(A._editedAfterReceivedAsHistory="editedAfterReceivedAsHistory")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryIndividualMessageInfo"},r})(),n.GroupMention=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.groupJid=e.string();break}case 2:{s.groupSubject=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.GroupMention)return e;var a=new p.proto.GroupMention;return e.groupJid!=null&&(a.groupJid=String(e.groupJid)),e.groupSubject!=null&&(a.groupSubject=String(e.groupSubject)),a},r.toObject=function(e,a){a||(a={});var A={};return e.groupJid!=null&&e.hasOwnProperty("groupJid")&&(A.groupJid=e.groupJid,a.oneofs&&(A._groupJid="groupJid")),e.groupSubject!=null&&e.hasOwnProperty("groupSubject")&&(A.groupSubject=e.groupSubject,a.oneofs&&(A._groupSubject="groupSubject")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupMention"},r})(),n.GroupParticipant=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.userJid=e.string();break}case 2:{s.rank=e.int32();break}case 3:{s.memberLabel=p.proto.MemberLabel.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.GroupParticipant)return e;var a=new p.proto.GroupParticipant;switch(e.userJid!=null&&(a.userJid=String(e.userJid)),e.rank){default:if(typeof e.rank=="number"){a.rank=e.rank;break}break;case"REGULAR":case 0:a.rank=0;break;case"ADMIN":case 1:a.rank=1;break;case"SUPERADMIN":case 2:a.rank=2;break}if(e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.GroupParticipant.memberLabel: object expected");a.memberLabel=p.proto.MemberLabel.fromObject(e.memberLabel)}return a},r.toObject=function(e,a){a||(a={});var A={};return a.defaults&&(A.userJid=""),e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid),e.rank!=null&&e.hasOwnProperty("rank")&&(A.rank=a.enums===String?p.proto.GroupParticipant.Rank[e.rank]===void 0?e.rank:p.proto.GroupParticipant.Rank[e.rank]:e.rank,a.oneofs&&(A._rank="rank")),e.memberLabel!=null&&e.hasOwnProperty("memberLabel")&&(A.memberLabel=p.proto.MemberLabel.toObject(e.memberLabel,a),a.oneofs&&(A._memberLabel="memberLabel")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupParticipant"},r.Rank=(function(){let i={},e=Object.create(i);return e[i[0]="REGULAR"]=0,e[i[1]="ADMIN"]=1,e[i[2]="SUPERADMIN"]=2,e})(),r})(),n.HandshakeMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 2:{s.clientHello=p.proto.HandshakeMessage.ClientHello.decode(e,e.uint32());break}case 3:{s.serverHello=p.proto.HandshakeMessage.ServerHello.decode(e,e.uint32());break}case 4:{s.clientFinish=p.proto.HandshakeMessage.ClientFinish.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.HandshakeMessage)return e;var a=new p.proto.HandshakeMessage;if(e.clientHello!=null){if(typeof e.clientHello!="object")throw TypeError(".proto.HandshakeMessage.clientHello: object expected");a.clientHello=p.proto.HandshakeMessage.ClientHello.fromObject(e.clientHello)}if(e.serverHello!=null){if(typeof e.serverHello!="object")throw TypeError(".proto.HandshakeMessage.serverHello: object expected");a.serverHello=p.proto.HandshakeMessage.ServerHello.fromObject(e.serverHello)}if(e.clientFinish!=null){if(typeof e.clientFinish!="object")throw TypeError(".proto.HandshakeMessage.clientFinish: object expected");a.clientFinish=p.proto.HandshakeMessage.ClientFinish.fromObject(e.clientFinish)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.clientHello!=null&&e.hasOwnProperty("clientHello")&&(A.clientHello=p.proto.HandshakeMessage.ClientHello.toObject(e.clientHello,a),a.oneofs&&(A._clientHello="clientHello")),e.serverHello!=null&&e.hasOwnProperty("serverHello")&&(A.serverHello=p.proto.HandshakeMessage.ServerHello.toObject(e.serverHello,a),a.oneofs&&(A._serverHello="serverHello")),e.clientFinish!=null&&e.hasOwnProperty("clientFinish")&&(A.clientFinish=p.proto.HandshakeMessage.ClientFinish.toObject(e.clientFinish,a),a.oneofs&&(A._clientFinish="clientFinish")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HandshakeMessage"},r.ClientFinish=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.static=A.bytes();break}case 2:{c.payload=A.bytes();break}case 3:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HandshakeMessage.ClientFinish)return A;var t=new p.proto.HandshakeMessage.ClientFinish;return A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,t.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(t.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,t.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(t.payload=A.payload)),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,t.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(t.extendedCiphertext=A.extendedCiphertext)),t},i.toObject=function(A,t){t||(t={});var s={};return A.static!=null&&A.hasOwnProperty("static")&&(s.static=t.bytes===String?l.base64.encode(A.static,0,A.static.length):t.bytes===Array?Array.prototype.slice.call(A.static):A.static,t.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=t.bytes===String?l.base64.encode(A.payload,0,A.payload.length):t.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,t.oneofs&&(s._payload="payload")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=t.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):t.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,t.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientFinish"},i})(),r.ClientHello=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.useExtended=A.bool();break}case 5:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HandshakeMessage.ClientHello)return A;var t=new p.proto.HandshakeMessage.ClientHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,t.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(t.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,t.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(t.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,t.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(t.payload=A.payload)),A.useExtended!=null&&(t.useExtended=!!A.useExtended),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,t.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(t.extendedCiphertext=A.extendedCiphertext)),t},i.toObject=function(A,t){t||(t={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=t.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):t.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,t.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=t.bytes===String?l.base64.encode(A.static,0,A.static.length):t.bytes===Array?Array.prototype.slice.call(A.static):A.static,t.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=t.bytes===String?l.base64.encode(A.payload,0,A.payload.length):t.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,t.oneofs&&(s._payload="payload")),A.useExtended!=null&&A.hasOwnProperty("useExtended")&&(s.useExtended=A.useExtended,t.oneofs&&(s._useExtended="useExtended")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=t.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):t.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,t.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientHello"},i})(),r.ServerHello=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.extendedStatic=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HandshakeMessage.ServerHello)return A;var t=new p.proto.HandshakeMessage.ServerHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,t.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(t.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,t.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(t.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,t.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(t.payload=A.payload)),A.extendedStatic!=null&&(typeof A.extendedStatic=="string"?l.base64.decode(A.extendedStatic,t.extendedStatic=l.newBuffer(l.base64.length(A.extendedStatic)),0):A.extendedStatic.length>=0&&(t.extendedStatic=A.extendedStatic)),t},i.toObject=function(A,t){t||(t={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=t.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):t.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,t.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=t.bytes===String?l.base64.encode(A.static,0,A.static.length):t.bytes===Array?Array.prototype.slice.call(A.static):A.static,t.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=t.bytes===String?l.base64.encode(A.payload,0,A.payload.length):t.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,t.oneofs&&(s._payload="payload")),A.extendedStatic!=null&&A.hasOwnProperty("extendedStatic")&&(s.extendedStatic=t.bytes===String?l.base64.encode(A.extendedStatic,0,A.extendedStatic.length):t.bytes===Array?Array.prototype.slice.call(A.extendedStatic):A.extendedStatic,t.oneofs&&(s._extendedStatic="extendedStatic")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ServerHello"},i})(),r})(),n.HistorySync=(function(){function r(i){if(this.conversations=[],this.statusV3Messages=[],this.pushnames=[],this.recentStickers=[],this.pastParticipants=[],this.callLogRecords=[],this.phoneNumberToLidMappings=[],this.accounts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.syncType=e.int32();break}case 2:{s.conversations&&s.conversations.length||(s.conversations=[]),s.conversations.push(p.proto.Conversation.decode(e,e.uint32()));break}case 3:{s.statusV3Messages&&s.statusV3Messages.length||(s.statusV3Messages=[]),s.statusV3Messages.push(p.proto.WebMessageInfo.decode(e,e.uint32()));break}case 5:{s.chunkOrder=e.uint32();break}case 6:{s.progress=e.uint32();break}case 7:{s.pushnames&&s.pushnames.length||(s.pushnames=[]),s.pushnames.push(p.proto.Pushname.decode(e,e.uint32()));break}case 8:{s.globalSettings=p.proto.GlobalSettings.decode(e,e.uint32());break}case 9:{s.threadIdUserSecret=e.bytes();break}case 10:{s.threadDsTimeframeOffset=e.uint32();break}case 11:{s.recentStickers&&s.recentStickers.length||(s.recentStickers=[]),s.recentStickers.push(p.proto.StickerMetadata.decode(e,e.uint32()));break}case 12:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(p.proto.PastParticipants.decode(e,e.uint32()));break}case 13:{s.callLogRecords&&s.callLogRecords.length||(s.callLogRecords=[]),s.callLogRecords.push(p.proto.CallLogRecord.decode(e,e.uint32()));break}case 14:{s.aiWaitListState=e.int32();break}case 15:{s.phoneNumberToLidMappings&&s.phoneNumberToLidMappings.length||(s.phoneNumberToLidMappings=[]),s.phoneNumberToLidMappings.push(p.proto.PhoneNumberToLIDMapping.decode(e,e.uint32()));break}case 16:{s.companionMetaNonce=e.string();break}case 17:{s.shareableChatIdentifierEncryptionKey=e.bytes();break}case 18:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(p.proto.Account.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.HistorySync)return e;var a=new p.proto.HistorySync;switch(e.syncType){default:if(typeof e.syncType=="number"){a.syncType=e.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:a.syncType=0;break;case"INITIAL_STATUS_V3":case 1:a.syncType=1;break;case"FULL":case 2:a.syncType=2;break;case"RECENT":case 3:a.syncType=3;break;case"PUSH_NAME":case 4:a.syncType=4;break;case"NON_BLOCKING_DATA":case 5:a.syncType=5;break;case"ON_DEMAND":case 6:a.syncType=6;break}if(e.conversations){if(!Array.isArray(e.conversations))throw TypeError(".proto.HistorySync.conversations: array expected");a.conversations=[];for(var A=0;A>>0),e.progress!=null&&(a.progress=e.progress>>>0),e.pushnames){if(!Array.isArray(e.pushnames))throw TypeError(".proto.HistorySync.pushnames: array expected");a.pushnames=[];for(var A=0;A=0&&(a.threadIdUserSecret=e.threadIdUserSecret)),e.threadDsTimeframeOffset!=null&&(a.threadDsTimeframeOffset=e.threadDsTimeframeOffset>>>0),e.recentStickers){if(!Array.isArray(e.recentStickers))throw TypeError(".proto.HistorySync.recentStickers: array expected");a.recentStickers=[];for(var A=0;A=0&&(a.shareableChatIdentifierEncryptionKey=e.shareableChatIdentifierEncryptionKey)),e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.HistorySync.accounts: array expected");a.accounts=[];for(var A=0;A>>3){case 1:{s.message=p.proto.WebMessageInfo.decode(e,e.uint32());break}case 2:{s.msgOrderId=e.uint64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.HistorySyncMsg)return e;var a=new p.proto.HistorySyncMsg;if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.HistorySyncMsg.message: object expected");a.message=p.proto.WebMessageInfo.fromObject(e.message)}return e.msgOrderId!=null&&(l.Long?(a.msgOrderId=l.Long.fromValue(e.msgOrderId)).unsigned=!0:typeof e.msgOrderId=="string"?a.msgOrderId=parseInt(e.msgOrderId,10):typeof e.msgOrderId=="number"?a.msgOrderId=e.msgOrderId:typeof e.msgOrderId=="object"&&(a.msgOrderId=new l.LongBits(e.msgOrderId.low>>>0,e.msgOrderId.high>>>0).toNumber(!0))),a},r.toObject=function(e,a){a||(a={});var A={};return e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.WebMessageInfo.toObject(e.message,a),a.oneofs&&(A._message="message")),e.msgOrderId!=null&&e.hasOwnProperty("msgOrderId")&&(typeof e.msgOrderId=="number"?A.msgOrderId=a.longs===String?String(e.msgOrderId):e.msgOrderId:A.msgOrderId=a.longs===String?oe(e.msgOrderId,!0):a.longs===Number?ne(e.msgOrderId,!0):e.msgOrderId,a.oneofs&&(A._msgOrderId="msgOrderId")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HistorySyncMsg"},r})(),n.HydratedTemplateButton=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=p.proto.HydratedTemplateButton.HydratedQuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=p.proto.HydratedTemplateButton.HydratedURLButton.decode(e,e.uint32());break}case 3:{s.callButton=p.proto.HydratedTemplateButton.HydratedCallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.HydratedTemplateButton)return e;var a=new p.proto.HydratedTemplateButton;if(e.index!=null&&(a.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected");a.quickReplyButton=p.proto.HydratedTemplateButton.HydratedQuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected");a.urlButton=p.proto.HydratedTemplateButton.HydratedURLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.HydratedTemplateButton.callButton: object expected");a.callButton=p.proto.HydratedTemplateButton.HydratedCallButton.fromObject(e.callButton)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=p.proto.HydratedTemplateButton.HydratedQuickReplyButton.toObject(e.quickReplyButton,a),a.oneofs&&(A.hydratedButton="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=p.proto.HydratedTemplateButton.HydratedURLButton.toObject(e.urlButton,a),a.oneofs&&(A.hydratedButton="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=p.proto.HydratedTemplateButton.HydratedCallButton.toObject(e.callButton,a),a.oneofs&&(A.hydratedButton="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,a.oneofs&&(A._index="index")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HydratedTemplateButton"},r.HydratedCallButton=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.displayText=A.string();break}case 2:{c.phoneNumber=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HydratedTemplateButton.HydratedCallButton)return A;var t=new p.proto.HydratedTemplateButton.HydratedCallButton;return A.displayText!=null&&(t.displayText=String(A.displayText)),A.phoneNumber!=null&&(t.phoneNumber=String(A.phoneNumber)),t},i.toObject=function(A,t){t||(t={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,t.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=A.phoneNumber,t.oneofs&&(s._phoneNumber="phoneNumber")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedCallButton"},i})(),r.HydratedQuickReplyButton=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.displayText=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HydratedTemplateButton.HydratedQuickReplyButton)return A;var t=new p.proto.HydratedTemplateButton.HydratedQuickReplyButton;return A.displayText!=null&&(t.displayText=String(A.displayText)),A.id!=null&&(t.id=String(A.id)),t},i.toObject=function(A,t){t||(t={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,t.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,t.oneofs&&(s._id="id")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedQuickReplyButton"},i})(),r.HydratedURLButton=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.displayText=A.string();break}case 2:{c.url=A.string();break}case 3:{c.consentedUsersUrl=A.string();break}case 4:{c.webviewPresentation=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.HydratedTemplateButton.HydratedURLButton)return A;var t=new p.proto.HydratedTemplateButton.HydratedURLButton;switch(A.displayText!=null&&(t.displayText=String(A.displayText)),A.url!=null&&(t.url=String(A.url)),A.consentedUsersUrl!=null&&(t.consentedUsersUrl=String(A.consentedUsersUrl)),A.webviewPresentation){default:if(typeof A.webviewPresentation=="number"){t.webviewPresentation=A.webviewPresentation;break}break;case"FULL":case 1:t.webviewPresentation=1;break;case"TALL":case 2:t.webviewPresentation=2;break;case"COMPACT":case 3:t.webviewPresentation=3;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,t.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),A.consentedUsersUrl!=null&&A.hasOwnProperty("consentedUsersUrl")&&(s.consentedUsersUrl=A.consentedUsersUrl,t.oneofs&&(s._consentedUsersUrl="consentedUsersUrl")),A.webviewPresentation!=null&&A.hasOwnProperty("webviewPresentation")&&(s.webviewPresentation=t.enums===String?p.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]===void 0?A.webviewPresentation:p.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]:A.webviewPresentation,t.oneofs&&(s._webviewPresentation="webviewPresentation")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedURLButton"},i.WebviewPresentationType=(function(){let a={},A=Object.create(a);return A[a[1]="FULL"]=1,A[a[2]="TALL"]=2,A[a[3]="COMPACT"]=3,A})(),i})(),r})(),n.IdentityKeyPairStructure=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.IdentityKeyPairStructure)return e;var a=new p.proto.IdentityKeyPairStructure;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,a.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(a.privateKey=e.privateKey)),a},r.toObject=function(e,a){a||(a={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=a.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):a.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,a.oneofs&&(A._privateKey="privateKey")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.IdentityKeyPairStructure"},r})(),n.InThreadSurveyMetadata=(function(){function r(i){if(this.questions=[],this.privacyStatementParts=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.tessaSessionId=e.string();break}case 2:{s.simonSessionId=e.string();break}case 3:{s.simonSurveyId=e.string();break}case 4:{s.tessaRootId=e.string();break}case 5:{s.requestId=e.string();break}case 6:{s.tessaEvent=e.string();break}case 7:{s.invitationHeaderText=e.string();break}case 8:{s.invitationBodyText=e.string();break}case 9:{s.invitationCtaText=e.string();break}case 10:{s.invitationCtaUrl=e.string();break}case 11:{s.surveyTitle=e.string();break}case 12:{s.questions&&s.questions.length||(s.questions=[]),s.questions.push(p.proto.InThreadSurveyMetadata.InThreadSurveyQuestion.decode(e,e.uint32()));break}case 13:{s.surveyContinueButtonText=e.string();break}case 14:{s.surveySubmitButtonText=e.string();break}case 15:{s.privacyStatementFull=e.string();break}case 16:{s.privacyStatementParts&&s.privacyStatementParts.length||(s.privacyStatementParts=[]),s.privacyStatementParts.push(p.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart.decode(e,e.uint32()));break}case 17:{s.feedbackToastText=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.InThreadSurveyMetadata)return e;var a=new p.proto.InThreadSurveyMetadata;if(e.tessaSessionId!=null&&(a.tessaSessionId=String(e.tessaSessionId)),e.simonSessionId!=null&&(a.simonSessionId=String(e.simonSessionId)),e.simonSurveyId!=null&&(a.simonSurveyId=String(e.simonSurveyId)),e.tessaRootId!=null&&(a.tessaRootId=String(e.tessaRootId)),e.requestId!=null&&(a.requestId=String(e.requestId)),e.tessaEvent!=null&&(a.tessaEvent=String(e.tessaEvent)),e.invitationHeaderText!=null&&(a.invitationHeaderText=String(e.invitationHeaderText)),e.invitationBodyText!=null&&(a.invitationBodyText=String(e.invitationBodyText)),e.invitationCtaText!=null&&(a.invitationCtaText=String(e.invitationCtaText)),e.invitationCtaUrl!=null&&(a.invitationCtaUrl=String(e.invitationCtaUrl)),e.surveyTitle!=null&&(a.surveyTitle=String(e.surveyTitle)),e.questions){if(!Array.isArray(e.questions))throw TypeError(".proto.InThreadSurveyMetadata.questions: array expected");a.questions=[];for(var A=0;A>>3){case 1:{c.stringValue=A.string();break}case 2:{c.numericValue=A.uint32();break}case 3:{c.textTranslated=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.InThreadSurveyMetadata.InThreadSurveyOption)return A;var t=new p.proto.InThreadSurveyMetadata.InThreadSurveyOption;return A.stringValue!=null&&(t.stringValue=String(A.stringValue)),A.numericValue!=null&&(t.numericValue=A.numericValue>>>0),A.textTranslated!=null&&(t.textTranslated=String(A.textTranslated)),t},i.toObject=function(A,t){t||(t={});var s={};return A.stringValue!=null&&A.hasOwnProperty("stringValue")&&(s.stringValue=A.stringValue,t.oneofs&&(s._stringValue="stringValue")),A.numericValue!=null&&A.hasOwnProperty("numericValue")&&(s.numericValue=A.numericValue,t.oneofs&&(s._numericValue="numericValue")),A.textTranslated!=null&&A.hasOwnProperty("textTranslated")&&(s.textTranslated=A.textTranslated,t.oneofs&&(s._textTranslated="textTranslated")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyOption"},i})(),r.InThreadSurveyPrivacyStatementPart=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.text=A.string();break}case 2:{c.url=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart)return A;var t=new p.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart;return A.text!=null&&(t.text=String(A.text)),A.url!=null&&(t.url=String(A.url)),t},i.toObject=function(A,t){t||(t={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,t.oneofs&&(s._text="text")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart"},i})(),r.InThreadSurveyQuestion=(function(){function i(a){if(this.questionOptions=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.questionText=A.string();break}case 2:{c.questionId=A.string();break}case 3:{c.questionOptions&&c.questionOptions.length||(c.questionOptions=[]),c.questionOptions.push(p.proto.InThreadSurveyMetadata.InThreadSurveyOption.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.InThreadSurveyMetadata.InThreadSurveyQuestion)return A;var t=new p.proto.InThreadSurveyMetadata.InThreadSurveyQuestion;if(A.questionText!=null&&(t.questionText=String(A.questionText)),A.questionId!=null&&(t.questionId=String(A.questionId)),A.questionOptions){if(!Array.isArray(A.questionOptions))throw TypeError(".proto.InThreadSurveyMetadata.InThreadSurveyQuestion.questionOptions: array expected");t.questionOptions=[];for(var s=0;s>>3){case 1:{s.polygonVertices&&s.polygonVertices.length||(s.polygonVertices=[]),s.polygonVertices.push(p.proto.Point.decode(e,e.uint32()));break}case 4:{s.shouldSkipConfirmation=e.bool();break}case 5:{s.embeddedContent=p.proto.EmbeddedContent.decode(e,e.uint32());break}case 8:{s.statusLinkType=e.int32();break}case 2:{s.location=p.proto.Location.decode(e,e.uint32());break}case 3:{s.newsletter=p.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 6:{s.embeddedAction=e.bool();break}case 7:{s.tapAction=p.proto.TapLinkAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.InteractiveAnnotation)return e;var a=new p.proto.InteractiveAnnotation;if(e.polygonVertices){if(!Array.isArray(e.polygonVertices))throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected");a.polygonVertices=[];for(var A=0;A>>3){case 1:{s.isGalaxyFlowCompleted=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.InteractiveMessageAdditionalMetadata)return e;var a=new p.proto.InteractiveMessageAdditionalMetadata;return e.isGalaxyFlowCompleted!=null&&(a.isGalaxyFlowCompleted=!!e.isGalaxyFlowCompleted),a},r.toObject=function(e,a){a||(a={});var A={};return e.isGalaxyFlowCompleted!=null&&e.hasOwnProperty("isGalaxyFlowCompleted")&&(A.isGalaxyFlowCompleted=e.isGalaxyFlowCompleted,a.oneofs&&(A._isGalaxyFlowCompleted="isGalaxyFlowCompleted")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.InteractiveMessageAdditionalMetadata"},r})(),n.KeepInChat=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.keepType=e.int32();break}case 2:{s.serverTimestamp=e.int64();break}case 3:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 4:{s.deviceJid=e.string();break}case 5:{s.clientTimestampMs=e.int64();break}case 6:{s.serverTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.KeepInChat)return e;var a=new p.proto.KeepInChat;switch(e.keepType){default:if(typeof e.keepType=="number"){a.keepType=e.keepType;break}break;case"UNKNOWN":case 0:a.keepType=0;break;case"KEEP_FOR_ALL":case 1:a.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:a.keepType=2;break}if(e.serverTimestamp!=null&&(l.Long?(a.serverTimestamp=l.Long.fromValue(e.serverTimestamp)).unsigned=!1:typeof e.serverTimestamp=="string"?a.serverTimestamp=parseInt(e.serverTimestamp,10):typeof e.serverTimestamp=="number"?a.serverTimestamp=e.serverTimestamp:typeof e.serverTimestamp=="object"&&(a.serverTimestamp=new l.LongBits(e.serverTimestamp.low>>>0,e.serverTimestamp.high>>>0).toNumber())),e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.KeepInChat.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}return e.deviceJid!=null&&(a.deviceJid=String(e.deviceJid)),e.clientTimestampMs!=null&&(l.Long?(a.clientTimestampMs=l.Long.fromValue(e.clientTimestampMs)).unsigned=!1:typeof e.clientTimestampMs=="string"?a.clientTimestampMs=parseInt(e.clientTimestampMs,10):typeof e.clientTimestampMs=="number"?a.clientTimestampMs=e.clientTimestampMs:typeof e.clientTimestampMs=="object"&&(a.clientTimestampMs=new l.LongBits(e.clientTimestampMs.low>>>0,e.clientTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),a},r.toObject=function(e,a){a||(a={});var A={};return e.keepType!=null&&e.hasOwnProperty("keepType")&&(A.keepType=a.enums===String?p.proto.KeepType[e.keepType]===void 0?e.keepType:p.proto.KeepType[e.keepType]:e.keepType,a.oneofs&&(A._keepType="keepType")),e.serverTimestamp!=null&&e.hasOwnProperty("serverTimestamp")&&(typeof e.serverTimestamp=="number"?A.serverTimestamp=a.longs===String?String(e.serverTimestamp):e.serverTimestamp:A.serverTimestamp=a.longs===String?oe(e.serverTimestamp):a.longs===Number?ne(e.serverTimestamp):e.serverTimestamp,a.oneofs&&(A._serverTimestamp="serverTimestamp")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.deviceJid!=null&&e.hasOwnProperty("deviceJid")&&(A.deviceJid=e.deviceJid,a.oneofs&&(A._deviceJid="deviceJid")),e.clientTimestampMs!=null&&e.hasOwnProperty("clientTimestampMs")&&(typeof e.clientTimestampMs=="number"?A.clientTimestampMs=a.longs===String?String(e.clientTimestampMs):e.clientTimestampMs:A.clientTimestampMs=a.longs===String?oe(e.clientTimestampMs):a.longs===Number?ne(e.clientTimestampMs):e.clientTimestampMs,a.oneofs&&(A._clientTimestampMs="clientTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?oe(e.serverTimestampMs):a.longs===Number?ne(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeepInChat"},r})(),n.KeepType=(function(){let r={},o=Object.create(r);return o[r[0]="UNKNOWN"]=0,o[r[1]="KEEP_FOR_ALL"]=1,o[r[2]="UNDO_KEEP_FOR_ALL"]=2,o})(),n.KeyExchangeMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.ratchetKey=e.bytes();break}case 4:{s.identityKey=e.bytes();break}case 5:{s.baseKeySignature=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.KeyExchangeMessage)return e;var a=new p.proto.KeyExchangeMessage;return e.id!=null&&(a.id=e.id>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,a.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(a.baseKey=e.baseKey)),e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,a.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(a.ratchetKey=e.ratchetKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,a.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(a.identityKey=e.identityKey)),e.baseKeySignature!=null&&(typeof e.baseKeySignature=="string"?l.base64.decode(e.baseKeySignature,a.baseKeySignature=l.newBuffer(l.base64.length(e.baseKeySignature)),0):e.baseKeySignature.length>=0&&(a.baseKeySignature=e.baseKeySignature)),a},r.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=a.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):a.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,a.oneofs&&(A._baseKey="baseKey")),e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=a.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):a.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,a.oneofs&&(A._ratchetKey="ratchetKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=a.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):a.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,a.oneofs&&(A._identityKey="identityKey")),e.baseKeySignature!=null&&e.hasOwnProperty("baseKeySignature")&&(A.baseKeySignature=a.bytes===String?l.base64.encode(e.baseKeySignature,0,e.baseKeySignature.length):a.bytes===Array?Array.prototype.slice.call(e.baseKeySignature):e.baseKeySignature,a.oneofs&&(A._baseKeySignature="baseKeySignature")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyExchangeMessage"},r})(),n.KeyId=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.KeyId)return e;var a=new p.proto.KeyId;return e.id!=null&&(typeof e.id=="string"?l.base64.decode(e.id,a.id=l.newBuffer(l.base64.length(e.id)),0):e.id.length>=0&&(a.id=e.id)),a},r.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=a.bytes===String?l.base64.encode(e.id,0,e.id.length):a.bytes===Array?Array.prototype.slice.call(e.id):e.id,a.oneofs&&(A._id="id")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyId"},r})(),n.LIDMigrationMapping=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pn=e.uint64();break}case 2:{s.assignedLid=e.uint64();break}case 3:{s.latestLid=e.uint64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.LIDMigrationMapping)return e;var a=new p.proto.LIDMigrationMapping;return e.pn!=null&&(l.Long?(a.pn=l.Long.fromValue(e.pn)).unsigned=!0:typeof e.pn=="string"?a.pn=parseInt(e.pn,10):typeof e.pn=="number"?a.pn=e.pn:typeof e.pn=="object"&&(a.pn=new l.LongBits(e.pn.low>>>0,e.pn.high>>>0).toNumber(!0))),e.assignedLid!=null&&(l.Long?(a.assignedLid=l.Long.fromValue(e.assignedLid)).unsigned=!0:typeof e.assignedLid=="string"?a.assignedLid=parseInt(e.assignedLid,10):typeof e.assignedLid=="number"?a.assignedLid=e.assignedLid:typeof e.assignedLid=="object"&&(a.assignedLid=new l.LongBits(e.assignedLid.low>>>0,e.assignedLid.high>>>0).toNumber(!0))),e.latestLid!=null&&(l.Long?(a.latestLid=l.Long.fromValue(e.latestLid)).unsigned=!0:typeof e.latestLid=="string"?a.latestLid=parseInt(e.latestLid,10):typeof e.latestLid=="number"?a.latestLid=e.latestLid:typeof e.latestLid=="object"&&(a.latestLid=new l.LongBits(e.latestLid.low>>>0,e.latestLid.high>>>0).toNumber(!0))),a},r.toObject=function(e,a){a||(a={});var A={};if(a.defaults){if(l.Long){var t=new l.Long(0,0,!0);A.pn=a.longs===String?t.toString():a.longs===Number?t.toNumber():t}else A.pn=a.longs===String?"0":0;if(l.Long){var t=new l.Long(0,0,!0);A.assignedLid=a.longs===String?t.toString():a.longs===Number?t.toNumber():t}else A.assignedLid=a.longs===String?"0":0}return e.pn!=null&&e.hasOwnProperty("pn")&&(typeof e.pn=="number"?A.pn=a.longs===String?String(e.pn):e.pn:A.pn=a.longs===String?oe(e.pn,!0):a.longs===Number?ne(e.pn,!0):e.pn),e.assignedLid!=null&&e.hasOwnProperty("assignedLid")&&(typeof e.assignedLid=="number"?A.assignedLid=a.longs===String?String(e.assignedLid):e.assignedLid:A.assignedLid=a.longs===String?oe(e.assignedLid,!0):a.longs===Number?ne(e.assignedLid,!0):e.assignedLid),e.latestLid!=null&&e.hasOwnProperty("latestLid")&&(typeof e.latestLid=="number"?A.latestLid=a.longs===String?String(e.latestLid):e.latestLid:A.latestLid=a.longs===String?oe(e.latestLid,!0):a.longs===Number?ne(e.latestLid,!0):e.latestLid,a.oneofs&&(A._latestLid="latestLid")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMapping"},r})(),n.LIDMigrationMappingSyncMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encodedMappingPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.LIDMigrationMappingSyncMessage)return e;var a=new p.proto.LIDMigrationMappingSyncMessage;return e.encodedMappingPayload!=null&&(typeof e.encodedMappingPayload=="string"?l.base64.decode(e.encodedMappingPayload,a.encodedMappingPayload=l.newBuffer(l.base64.length(e.encodedMappingPayload)),0):e.encodedMappingPayload.length>=0&&(a.encodedMappingPayload=e.encodedMappingPayload)),a},r.toObject=function(e,a){a||(a={});var A={};return e.encodedMappingPayload!=null&&e.hasOwnProperty("encodedMappingPayload")&&(A.encodedMappingPayload=a.bytes===String?l.base64.encode(e.encodedMappingPayload,0,e.encodedMappingPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encodedMappingPayload):e.encodedMappingPayload,a.oneofs&&(A._encodedMappingPayload="encodedMappingPayload")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMappingSyncMessage"},r})(),n.LIDMigrationMappingSyncPayload=(function(){function r(i){if(this.pnToLidMappings=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pnToLidMappings&&s.pnToLidMappings.length||(s.pnToLidMappings=[]),s.pnToLidMappings.push(p.proto.LIDMigrationMapping.decode(e,e.uint32()));break}case 2:{s.chatDbMigrationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.LIDMigrationMappingSyncPayload)return e;var a=new p.proto.LIDMigrationMappingSyncPayload;if(e.pnToLidMappings){if(!Array.isArray(e.pnToLidMappings))throw TypeError(".proto.LIDMigrationMappingSyncPayload.pnToLidMappings: array expected");a.pnToLidMappings=[];for(var A=0;A>>0,e.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.pnToLidMappings=[]),e.pnToLidMappings&&e.pnToLidMappings.length){A.pnToLidMappings=[];for(var t=0;t>>3){case 1:{s.eventResponseMessage=p.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 2:{s.pollVote=p.proto.Message.PollVoteMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.LegacyMessage)return e;var a=new p.proto.LegacyMessage;if(e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.LegacyMessage.eventResponseMessage: object expected");a.eventResponseMessage=p.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}if(e.pollVote!=null){if(typeof e.pollVote!="object")throw TypeError(".proto.LegacyMessage.pollVote: object expected");a.pollVote=p.proto.Message.PollVoteMessage.fromObject(e.pollVote)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=p.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,a),a.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.pollVote!=null&&e.hasOwnProperty("pollVote")&&(A.pollVote=p.proto.Message.PollVoteMessage.toObject(e.pollVote,a),a.oneofs&&(A._pollVote="pollVote")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LegacyMessage"},r})(),n.LimitSharing=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.sharingLimited=e.bool();break}case 2:{s.trigger=e.int32();break}case 3:{s.limitSharingSettingTimestamp=e.int64();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.LimitSharing)return e;var a=new p.proto.LimitSharing;switch(e.sharingLimited!=null&&(a.sharingLimited=!!e.sharingLimited),e.trigger){default:if(typeof e.trigger=="number"){a.trigger=e.trigger;break}break;case"UNKNOWN":case 0:a.trigger=0;break;case"CHAT_SETTING":case 1:a.trigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:a.trigger=2;break;case"UNKNOWN_GROUP":case 3:a.trigger=3;break}return e.limitSharingSettingTimestamp!=null&&(l.Long?(a.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?a.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?a.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(a.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.initiatedByMe!=null&&(a.initiatedByMe=!!e.initiatedByMe),a},r.toObject=function(e,a){a||(a={});var A={};return e.sharingLimited!=null&&e.hasOwnProperty("sharingLimited")&&(A.sharingLimited=e.sharingLimited,a.oneofs&&(A._sharingLimited="sharingLimited")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=a.enums===String?p.proto.LimitSharing.TriggerType[e.trigger]===void 0?e.trigger:p.proto.LimitSharing.TriggerType[e.trigger]:e.trigger,a.oneofs&&(A._trigger="trigger")),e.limitSharingSettingTimestamp!=null&&e.hasOwnProperty("limitSharingSettingTimestamp")&&(typeof e.limitSharingSettingTimestamp=="number"?A.limitSharingSettingTimestamp=a.longs===String?String(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp:A.limitSharingSettingTimestamp=a.longs===String?oe(e.limitSharingSettingTimestamp):a.longs===Number?ne(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp,a.oneofs&&(A._limitSharingSettingTimestamp="limitSharingSettingTimestamp")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,a.oneofs&&(A._initiatedByMe="initiatedByMe")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LimitSharing"},r.TriggerType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="CHAT_SETTING"]=1,e[i[2]="BIZ_SUPPORTS_FB_HOSTING"]=2,e[i[3]="UNKNOWN_GROUP"]=3,e})(),r})(),n.LocalizedName=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.lg=e.string();break}case 2:{s.lc=e.string();break}case 3:{s.verifiedName=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.LocalizedName)return e;var a=new p.proto.LocalizedName;return e.lg!=null&&(a.lg=String(e.lg)),e.lc!=null&&(a.lc=String(e.lc)),e.verifiedName!=null&&(a.verifiedName=String(e.verifiedName)),a},r.toObject=function(e,a){a||(a={});var A={};return e.lg!=null&&e.hasOwnProperty("lg")&&(A.lg=e.lg,a.oneofs&&(A._lg="lg")),e.lc!=null&&e.hasOwnProperty("lc")&&(A.lc=e.lc,a.oneofs&&(A._lc="lc")),e.verifiedName!=null&&e.hasOwnProperty("verifiedName")&&(A.verifiedName=e.verifiedName,a.oneofs&&(A._verifiedName="verifiedName")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LocalizedName"},r})(),n.Location=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.degreesLatitude=e.double();break}case 2:{s.degreesLongitude=e.double();break}case 3:{s.name=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Location)return e;var a=new p.proto.Location;return e.degreesLatitude!=null&&(a.degreesLatitude=Number(e.degreesLatitude)),e.degreesLongitude!=null&&(a.degreesLongitude=Number(e.degreesLongitude)),e.name!=null&&(a.name=String(e.name)),a},r.toObject=function(e,a){a||(a={});var A={};return e.degreesLatitude!=null&&e.hasOwnProperty("degreesLatitude")&&(A.degreesLatitude=a.json&&!isFinite(e.degreesLatitude)?String(e.degreesLatitude):e.degreesLatitude,a.oneofs&&(A._degreesLatitude="degreesLatitude")),e.degreesLongitude!=null&&e.hasOwnProperty("degreesLongitude")&&(A.degreesLongitude=a.json&&!isFinite(e.degreesLongitude)?String(e.degreesLongitude):e.degreesLongitude,a.oneofs&&(A._degreesLongitude="degreesLongitude")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,a.oneofs&&(A._name="name")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Location"},r})(),n.MediaData=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.localPath=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MediaData)return e;var a=new p.proto.MediaData;return e.localPath!=null&&(a.localPath=String(e.localPath)),a},r.toObject=function(e,a){a||(a={});var A={};return e.localPath!=null&&e.hasOwnProperty("localPath")&&(A.localPath=e.localPath,a.oneofs&&(A._localPath="localPath")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaData"},r})(),n.MediaNotifyMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.expressPathUrl=e.string();break}case 2:{s.fileEncSha256=e.bytes();break}case 3:{s.fileLength=e.uint64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MediaNotifyMessage)return e;var a=new p.proto.MediaNotifyMessage;return e.expressPathUrl!=null&&(a.expressPathUrl=String(e.expressPathUrl)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,a.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(a.fileEncSha256=e.fileEncSha256)),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),a},r.toObject=function(e,a){a||(a={});var A={};return e.expressPathUrl!=null&&e.hasOwnProperty("expressPathUrl")&&(A.expressPathUrl=e.expressPathUrl,a.oneofs&&(A._expressPathUrl="expressPathUrl")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=a.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=a.longs===String?String(e.fileLength):e.fileLength:A.fileLength=a.longs===String?oe(e.fileLength,!0):a.longs===Number?ne(e.fileLength,!0):e.fileLength,a.oneofs&&(A._fileLength="fileLength")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaNotifyMessage"},r})(),n.MediaRetryNotification=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.directPath=e.string();break}case 3:{s.result=e.int32();break}case 4:{s.messageSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MediaRetryNotification)return e;var a=new p.proto.MediaRetryNotification;switch(e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),e.directPath!=null&&(a.directPath=String(e.directPath)),e.result){default:if(typeof e.result=="number"){a.result=e.result;break}break;case"GENERAL_ERROR":case 0:a.result=0;break;case"SUCCESS":case 1:a.result=1;break;case"NOT_FOUND":case 2:a.result=2;break;case"DECRYPTION_ERROR":case 3:a.result=3;break}return e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,a.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(a.messageSecret=e.messageSecret)),a},r.toObject=function(e,a){a||(a={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.result!=null&&e.hasOwnProperty("result")&&(A.result=a.enums===String?p.proto.MediaRetryNotification.ResultType[e.result]===void 0?e.result:p.proto.MediaRetryNotification.ResultType[e.result]:e.result,a.oneofs&&(A._result="result")),e.messageSecret!=null&&e.hasOwnProperty("messageSecret")&&(A.messageSecret=a.bytes===String?l.base64.encode(e.messageSecret,0,e.messageSecret.length):a.bytes===Array?Array.prototype.slice.call(e.messageSecret):e.messageSecret,a.oneofs&&(A._messageSecret="messageSecret")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaRetryNotification"},r.ResultType=(function(){let i={},e=Object.create(i);return e[i[0]="GENERAL_ERROR"]=0,e[i[1]="SUCCESS"]=1,e[i[2]="NOT_FOUND"]=2,e[i[3]="DECRYPTION_ERROR"]=3,e})(),r})(),n.MediaVisibility=(function(){let r={},o=Object.create(r);return o[r[0]="DEFAULT"]=0,o[r[1]="OFF"]=1,o[r[2]="ON"]=2,o})(),n.MemberLabel=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.label=e.string();break}case 2:{s.labelTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MemberLabel)return e;var a=new p.proto.MemberLabel;return e.label!=null&&(a.label=String(e.label)),e.labelTimestamp!=null&&(l.Long?(a.labelTimestamp=l.Long.fromValue(e.labelTimestamp)).unsigned=!1:typeof e.labelTimestamp=="string"?a.labelTimestamp=parseInt(e.labelTimestamp,10):typeof e.labelTimestamp=="number"?a.labelTimestamp=e.labelTimestamp:typeof e.labelTimestamp=="object"&&(a.labelTimestamp=new l.LongBits(e.labelTimestamp.low>>>0,e.labelTimestamp.high>>>0).toNumber())),a},r.toObject=function(e,a){a||(a={});var A={};return e.label!=null&&e.hasOwnProperty("label")&&(A.label=e.label,a.oneofs&&(A._label="label")),e.labelTimestamp!=null&&e.hasOwnProperty("labelTimestamp")&&(typeof e.labelTimestamp=="number"?A.labelTimestamp=a.longs===String?String(e.labelTimestamp):e.labelTimestamp:A.labelTimestamp=a.longs===String?oe(e.labelTimestamp):a.longs===Number?ne(e.labelTimestamp):e.labelTimestamp,a.oneofs&&(A._labelTimestamp="labelTimestamp")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MemberLabel"},r})(),n.Message=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.conversation=e.string();break}case 2:{s.senderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 3:{s.imageMessage=p.proto.Message.ImageMessage.decode(e,e.uint32());break}case 4:{s.contactMessage=p.proto.Message.ContactMessage.decode(e,e.uint32());break}case 5:{s.locationMessage=p.proto.Message.LocationMessage.decode(e,e.uint32());break}case 6:{s.extendedTextMessage=p.proto.Message.ExtendedTextMessage.decode(e,e.uint32());break}case 7:{s.documentMessage=p.proto.Message.DocumentMessage.decode(e,e.uint32());break}case 8:{s.audioMessage=p.proto.Message.AudioMessage.decode(e,e.uint32());break}case 9:{s.videoMessage=p.proto.Message.VideoMessage.decode(e,e.uint32());break}case 10:{s.call=p.proto.Message.Call.decode(e,e.uint32());break}case 11:{s.chat=p.proto.Message.Chat.decode(e,e.uint32());break}case 12:{s.protocolMessage=p.proto.Message.ProtocolMessage.decode(e,e.uint32());break}case 13:{s.contactsArrayMessage=p.proto.Message.ContactsArrayMessage.decode(e,e.uint32());break}case 14:{s.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.decode(e,e.uint32());break}case 15:{s.fastRatchetKeySenderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 16:{s.sendPaymentMessage=p.proto.Message.SendPaymentMessage.decode(e,e.uint32());break}case 18:{s.liveLocationMessage=p.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 22:{s.requestPaymentMessage=p.proto.Message.RequestPaymentMessage.decode(e,e.uint32());break}case 23:{s.declinePaymentRequestMessage=p.proto.Message.DeclinePaymentRequestMessage.decode(e,e.uint32());break}case 24:{s.cancelPaymentRequestMessage=p.proto.Message.CancelPaymentRequestMessage.decode(e,e.uint32());break}case 25:{s.templateMessage=p.proto.Message.TemplateMessage.decode(e,e.uint32());break}case 26:{s.stickerMessage=p.proto.Message.StickerMessage.decode(e,e.uint32());break}case 28:{s.groupInviteMessage=p.proto.Message.GroupInviteMessage.decode(e,e.uint32());break}case 29:{s.templateButtonReplyMessage=p.proto.Message.TemplateButtonReplyMessage.decode(e,e.uint32());break}case 30:{s.productMessage=p.proto.Message.ProductMessage.decode(e,e.uint32());break}case 31:{s.deviceSentMessage=p.proto.Message.DeviceSentMessage.decode(e,e.uint32());break}case 35:{s.messageContextInfo=p.proto.MessageContextInfo.decode(e,e.uint32());break}case 36:{s.listMessage=p.proto.Message.ListMessage.decode(e,e.uint32());break}case 37:{s.viewOnceMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 38:{s.orderMessage=p.proto.Message.OrderMessage.decode(e,e.uint32());break}case 39:{s.listResponseMessage=p.proto.Message.ListResponseMessage.decode(e,e.uint32());break}case 40:{s.ephemeralMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 41:{s.invoiceMessage=p.proto.Message.InvoiceMessage.decode(e,e.uint32());break}case 42:{s.buttonsMessage=p.proto.Message.ButtonsMessage.decode(e,e.uint32());break}case 43:{s.buttonsResponseMessage=p.proto.Message.ButtonsResponseMessage.decode(e,e.uint32());break}case 44:{s.paymentInviteMessage=p.proto.Message.PaymentInviteMessage.decode(e,e.uint32());break}case 45:{s.interactiveMessage=p.proto.Message.InteractiveMessage.decode(e,e.uint32());break}case 46:{s.reactionMessage=p.proto.Message.ReactionMessage.decode(e,e.uint32());break}case 47:{s.stickerSyncRmrMessage=p.proto.Message.StickerSyncRMRMessage.decode(e,e.uint32());break}case 48:{s.interactiveResponseMessage=p.proto.Message.InteractiveResponseMessage.decode(e,e.uint32());break}case 49:{s.pollCreationMessage=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 50:{s.pollUpdateMessage=p.proto.Message.PollUpdateMessage.decode(e,e.uint32());break}case 51:{s.keepInChatMessage=p.proto.Message.KeepInChatMessage.decode(e,e.uint32());break}case 53:{s.documentWithCaptionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 54:{s.requestPhoneNumberMessage=p.proto.Message.RequestPhoneNumberMessage.decode(e,e.uint32());break}case 55:{s.viewOnceMessageV2=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 56:{s.encReactionMessage=p.proto.Message.EncReactionMessage.decode(e,e.uint32());break}case 58:{s.editedMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 59:{s.viewOnceMessageV2Extension=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 60:{s.pollCreationMessageV2=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 61:{s.scheduledCallCreationMessage=p.proto.Message.ScheduledCallCreationMessage.decode(e,e.uint32());break}case 62:{s.groupMentionedMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 63:{s.pinInChatMessage=p.proto.Message.PinInChatMessage.decode(e,e.uint32());break}case 64:{s.pollCreationMessageV3=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 65:{s.scheduledCallEditMessage=p.proto.Message.ScheduledCallEditMessage.decode(e,e.uint32());break}case 66:{s.ptvMessage=p.proto.Message.VideoMessage.decode(e,e.uint32());break}case 67:{s.botInvokeMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 69:{s.callLogMesssage=p.proto.Message.CallLogMessage.decode(e,e.uint32());break}case 70:{s.messageHistoryBundle=p.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 71:{s.encCommentMessage=p.proto.Message.EncCommentMessage.decode(e,e.uint32());break}case 72:{s.bcallMessage=p.proto.Message.BCallMessage.decode(e,e.uint32());break}case 74:{s.lottieStickerMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 75:{s.eventMessage=p.proto.Message.EventMessage.decode(e,e.uint32());break}case 76:{s.encEventResponseMessage=p.proto.Message.EncEventResponseMessage.decode(e,e.uint32());break}case 77:{s.commentMessage=p.proto.Message.CommentMessage.decode(e,e.uint32());break}case 78:{s.newsletterAdminInviteMessage=p.proto.Message.NewsletterAdminInviteMessage.decode(e,e.uint32());break}case 80:{s.placeholderMessage=p.proto.Message.PlaceholderMessage.decode(e,e.uint32());break}case 82:{s.secretEncryptedMessage=p.proto.Message.SecretEncryptedMessage.decode(e,e.uint32());break}case 83:{s.albumMessage=p.proto.Message.AlbumMessage.decode(e,e.uint32());break}case 85:{s.eventCoverImage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 86:{s.stickerPackMessage=p.proto.Message.StickerPackMessage.decode(e,e.uint32());break}case 87:{s.statusMentionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 88:{s.pollResultSnapshotMessage=p.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}case 90:{s.pollCreationOptionImageMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 91:{s.associatedChildMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 92:{s.groupStatusMentionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 93:{s.pollCreationMessageV4=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 95:{s.statusAddYours=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 96:{s.groupStatusMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 97:{s.richResponseMessage=p.proto.AIRichResponseMessage.decode(e,e.uint32());break}case 98:{s.statusNotificationMessage=p.proto.Message.StatusNotificationMessage.decode(e,e.uint32());break}case 99:{s.limitSharingMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 100:{s.botTaskMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 101:{s.questionMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 102:{s.messageHistoryNotice=p.proto.Message.MessageHistoryNotice.decode(e,e.uint32());break}case 103:{s.groupStatusMessageV2=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 104:{s.botForwardedMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 105:{s.statusQuestionAnswerMessage=p.proto.Message.StatusQuestionAnswerMessage.decode(e,e.uint32());break}case 106:{s.questionReplyMessage=p.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 107:{s.questionResponseMessage=p.proto.Message.QuestionResponseMessage.decode(e,e.uint32());break}case 109:{s.statusQuotedMessage=p.proto.Message.StatusQuotedMessage.decode(e,e.uint32());break}case 110:{s.statusStickerInteractionMessage=p.proto.Message.StatusStickerInteractionMessage.decode(e,e.uint32());break}case 111:{s.pollCreationMessageV5=p.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 113:{s.newsletterFollowerInviteMessageV2=p.proto.Message.NewsletterFollowerInviteMessage.decode(e,e.uint32());break}case 114:{s.pollResultSnapshotMessageV3=p.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Message)return e;var a=new p.proto.Message;if(e.conversation!=null&&(a.conversation=String(e.conversation)),e.senderKeyDistributionMessage!=null){if(typeof e.senderKeyDistributionMessage!="object")throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected");a.senderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.fromObject(e.senderKeyDistributionMessage)}if(e.imageMessage!=null){if(typeof e.imageMessage!="object")throw TypeError(".proto.Message.imageMessage: object expected");a.imageMessage=p.proto.Message.ImageMessage.fromObject(e.imageMessage)}if(e.contactMessage!=null){if(typeof e.contactMessage!="object")throw TypeError(".proto.Message.contactMessage: object expected");a.contactMessage=p.proto.Message.ContactMessage.fromObject(e.contactMessage)}if(e.locationMessage!=null){if(typeof e.locationMessage!="object")throw TypeError(".proto.Message.locationMessage: object expected");a.locationMessage=p.proto.Message.LocationMessage.fromObject(e.locationMessage)}if(e.extendedTextMessage!=null){if(typeof e.extendedTextMessage!="object")throw TypeError(".proto.Message.extendedTextMessage: object expected");a.extendedTextMessage=p.proto.Message.ExtendedTextMessage.fromObject(e.extendedTextMessage)}if(e.documentMessage!=null){if(typeof e.documentMessage!="object")throw TypeError(".proto.Message.documentMessage: object expected");a.documentMessage=p.proto.Message.DocumentMessage.fromObject(e.documentMessage)}if(e.audioMessage!=null){if(typeof e.audioMessage!="object")throw TypeError(".proto.Message.audioMessage: object expected");a.audioMessage=p.proto.Message.AudioMessage.fromObject(e.audioMessage)}if(e.videoMessage!=null){if(typeof e.videoMessage!="object")throw TypeError(".proto.Message.videoMessage: object expected");a.videoMessage=p.proto.Message.VideoMessage.fromObject(e.videoMessage)}if(e.call!=null){if(typeof e.call!="object")throw TypeError(".proto.Message.call: object expected");a.call=p.proto.Message.Call.fromObject(e.call)}if(e.chat!=null){if(typeof e.chat!="object")throw TypeError(".proto.Message.chat: object expected");a.chat=p.proto.Message.Chat.fromObject(e.chat)}if(e.protocolMessage!=null){if(typeof e.protocolMessage!="object")throw TypeError(".proto.Message.protocolMessage: object expected");a.protocolMessage=p.proto.Message.ProtocolMessage.fromObject(e.protocolMessage)}if(e.contactsArrayMessage!=null){if(typeof e.contactsArrayMessage!="object")throw TypeError(".proto.Message.contactsArrayMessage: object expected");a.contactsArrayMessage=p.proto.Message.ContactsArrayMessage.fromObject(e.contactsArrayMessage)}if(e.highlyStructuredMessage!=null){if(typeof e.highlyStructuredMessage!="object")throw TypeError(".proto.Message.highlyStructuredMessage: object expected");a.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.fromObject(e.highlyStructuredMessage)}if(e.fastRatchetKeySenderKeyDistributionMessage!=null){if(typeof e.fastRatchetKeySenderKeyDistributionMessage!="object")throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected");a.fastRatchetKeySenderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.fromObject(e.fastRatchetKeySenderKeyDistributionMessage)}if(e.sendPaymentMessage!=null){if(typeof e.sendPaymentMessage!="object")throw TypeError(".proto.Message.sendPaymentMessage: object expected");a.sendPaymentMessage=p.proto.Message.SendPaymentMessage.fromObject(e.sendPaymentMessage)}if(e.liveLocationMessage!=null){if(typeof e.liveLocationMessage!="object")throw TypeError(".proto.Message.liveLocationMessage: object expected");a.liveLocationMessage=p.proto.Message.LiveLocationMessage.fromObject(e.liveLocationMessage)}if(e.requestPaymentMessage!=null){if(typeof e.requestPaymentMessage!="object")throw TypeError(".proto.Message.requestPaymentMessage: object expected");a.requestPaymentMessage=p.proto.Message.RequestPaymentMessage.fromObject(e.requestPaymentMessage)}if(e.declinePaymentRequestMessage!=null){if(typeof e.declinePaymentRequestMessage!="object")throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected");a.declinePaymentRequestMessage=p.proto.Message.DeclinePaymentRequestMessage.fromObject(e.declinePaymentRequestMessage)}if(e.cancelPaymentRequestMessage!=null){if(typeof e.cancelPaymentRequestMessage!="object")throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected");a.cancelPaymentRequestMessage=p.proto.Message.CancelPaymentRequestMessage.fromObject(e.cancelPaymentRequestMessage)}if(e.templateMessage!=null){if(typeof e.templateMessage!="object")throw TypeError(".proto.Message.templateMessage: object expected");a.templateMessage=p.proto.Message.TemplateMessage.fromObject(e.templateMessage)}if(e.stickerMessage!=null){if(typeof e.stickerMessage!="object")throw TypeError(".proto.Message.stickerMessage: object expected");a.stickerMessage=p.proto.Message.StickerMessage.fromObject(e.stickerMessage)}if(e.groupInviteMessage!=null){if(typeof e.groupInviteMessage!="object")throw TypeError(".proto.Message.groupInviteMessage: object expected");a.groupInviteMessage=p.proto.Message.GroupInviteMessage.fromObject(e.groupInviteMessage)}if(e.templateButtonReplyMessage!=null){if(typeof e.templateButtonReplyMessage!="object")throw TypeError(".proto.Message.templateButtonReplyMessage: object expected");a.templateButtonReplyMessage=p.proto.Message.TemplateButtonReplyMessage.fromObject(e.templateButtonReplyMessage)}if(e.productMessage!=null){if(typeof e.productMessage!="object")throw TypeError(".proto.Message.productMessage: object expected");a.productMessage=p.proto.Message.ProductMessage.fromObject(e.productMessage)}if(e.deviceSentMessage!=null){if(typeof e.deviceSentMessage!="object")throw TypeError(".proto.Message.deviceSentMessage: object expected");a.deviceSentMessage=p.proto.Message.DeviceSentMessage.fromObject(e.deviceSentMessage)}if(e.messageContextInfo!=null){if(typeof e.messageContextInfo!="object")throw TypeError(".proto.Message.messageContextInfo: object expected");a.messageContextInfo=p.proto.MessageContextInfo.fromObject(e.messageContextInfo)}if(e.listMessage!=null){if(typeof e.listMessage!="object")throw TypeError(".proto.Message.listMessage: object expected");a.listMessage=p.proto.Message.ListMessage.fromObject(e.listMessage)}if(e.viewOnceMessage!=null){if(typeof e.viewOnceMessage!="object")throw TypeError(".proto.Message.viewOnceMessage: object expected");a.viewOnceMessage=p.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessage)}if(e.orderMessage!=null){if(typeof e.orderMessage!="object")throw TypeError(".proto.Message.orderMessage: object expected");a.orderMessage=p.proto.Message.OrderMessage.fromObject(e.orderMessage)}if(e.listResponseMessage!=null){if(typeof e.listResponseMessage!="object")throw TypeError(".proto.Message.listResponseMessage: object expected");a.listResponseMessage=p.proto.Message.ListResponseMessage.fromObject(e.listResponseMessage)}if(e.ephemeralMessage!=null){if(typeof e.ephemeralMessage!="object")throw TypeError(".proto.Message.ephemeralMessage: object expected");a.ephemeralMessage=p.proto.Message.FutureProofMessage.fromObject(e.ephemeralMessage)}if(e.invoiceMessage!=null){if(typeof e.invoiceMessage!="object")throw TypeError(".proto.Message.invoiceMessage: object expected");a.invoiceMessage=p.proto.Message.InvoiceMessage.fromObject(e.invoiceMessage)}if(e.buttonsMessage!=null){if(typeof e.buttonsMessage!="object")throw TypeError(".proto.Message.buttonsMessage: object expected");a.buttonsMessage=p.proto.Message.ButtonsMessage.fromObject(e.buttonsMessage)}if(e.buttonsResponseMessage!=null){if(typeof e.buttonsResponseMessage!="object")throw TypeError(".proto.Message.buttonsResponseMessage: object expected");a.buttonsResponseMessage=p.proto.Message.ButtonsResponseMessage.fromObject(e.buttonsResponseMessage)}if(e.paymentInviteMessage!=null){if(typeof e.paymentInviteMessage!="object")throw TypeError(".proto.Message.paymentInviteMessage: object expected");a.paymentInviteMessage=p.proto.Message.PaymentInviteMessage.fromObject(e.paymentInviteMessage)}if(e.interactiveMessage!=null){if(typeof e.interactiveMessage!="object")throw TypeError(".proto.Message.interactiveMessage: object expected");a.interactiveMessage=p.proto.Message.InteractiveMessage.fromObject(e.interactiveMessage)}if(e.reactionMessage!=null){if(typeof e.reactionMessage!="object")throw TypeError(".proto.Message.reactionMessage: object expected");a.reactionMessage=p.proto.Message.ReactionMessage.fromObject(e.reactionMessage)}if(e.stickerSyncRmrMessage!=null){if(typeof e.stickerSyncRmrMessage!="object")throw TypeError(".proto.Message.stickerSyncRmrMessage: object expected");a.stickerSyncRmrMessage=p.proto.Message.StickerSyncRMRMessage.fromObject(e.stickerSyncRmrMessage)}if(e.interactiveResponseMessage!=null){if(typeof e.interactiveResponseMessage!="object")throw TypeError(".proto.Message.interactiveResponseMessage: object expected");a.interactiveResponseMessage=p.proto.Message.InteractiveResponseMessage.fromObject(e.interactiveResponseMessage)}if(e.pollCreationMessage!=null){if(typeof e.pollCreationMessage!="object")throw TypeError(".proto.Message.pollCreationMessage: object expected");a.pollCreationMessage=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessage)}if(e.pollUpdateMessage!=null){if(typeof e.pollUpdateMessage!="object")throw TypeError(".proto.Message.pollUpdateMessage: object expected");a.pollUpdateMessage=p.proto.Message.PollUpdateMessage.fromObject(e.pollUpdateMessage)}if(e.keepInChatMessage!=null){if(typeof e.keepInChatMessage!="object")throw TypeError(".proto.Message.keepInChatMessage: object expected");a.keepInChatMessage=p.proto.Message.KeepInChatMessage.fromObject(e.keepInChatMessage)}if(e.documentWithCaptionMessage!=null){if(typeof e.documentWithCaptionMessage!="object")throw TypeError(".proto.Message.documentWithCaptionMessage: object expected");a.documentWithCaptionMessage=p.proto.Message.FutureProofMessage.fromObject(e.documentWithCaptionMessage)}if(e.requestPhoneNumberMessage!=null){if(typeof e.requestPhoneNumberMessage!="object")throw TypeError(".proto.Message.requestPhoneNumberMessage: object expected");a.requestPhoneNumberMessage=p.proto.Message.RequestPhoneNumberMessage.fromObject(e.requestPhoneNumberMessage)}if(e.viewOnceMessageV2!=null){if(typeof e.viewOnceMessageV2!="object")throw TypeError(".proto.Message.viewOnceMessageV2: object expected");a.viewOnceMessageV2=p.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2)}if(e.encReactionMessage!=null){if(typeof e.encReactionMessage!="object")throw TypeError(".proto.Message.encReactionMessage: object expected");a.encReactionMessage=p.proto.Message.EncReactionMessage.fromObject(e.encReactionMessage)}if(e.editedMessage!=null){if(typeof e.editedMessage!="object")throw TypeError(".proto.Message.editedMessage: object expected");a.editedMessage=p.proto.Message.FutureProofMessage.fromObject(e.editedMessage)}if(e.viewOnceMessageV2Extension!=null){if(typeof e.viewOnceMessageV2Extension!="object")throw TypeError(".proto.Message.viewOnceMessageV2Extension: object expected");a.viewOnceMessageV2Extension=p.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2Extension)}if(e.pollCreationMessageV2!=null){if(typeof e.pollCreationMessageV2!="object")throw TypeError(".proto.Message.pollCreationMessageV2: object expected");a.pollCreationMessageV2=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV2)}if(e.scheduledCallCreationMessage!=null){if(typeof e.scheduledCallCreationMessage!="object")throw TypeError(".proto.Message.scheduledCallCreationMessage: object expected");a.scheduledCallCreationMessage=p.proto.Message.ScheduledCallCreationMessage.fromObject(e.scheduledCallCreationMessage)}if(e.groupMentionedMessage!=null){if(typeof e.groupMentionedMessage!="object")throw TypeError(".proto.Message.groupMentionedMessage: object expected");a.groupMentionedMessage=p.proto.Message.FutureProofMessage.fromObject(e.groupMentionedMessage)}if(e.pinInChatMessage!=null){if(typeof e.pinInChatMessage!="object")throw TypeError(".proto.Message.pinInChatMessage: object expected");a.pinInChatMessage=p.proto.Message.PinInChatMessage.fromObject(e.pinInChatMessage)}if(e.pollCreationMessageV3!=null){if(typeof e.pollCreationMessageV3!="object")throw TypeError(".proto.Message.pollCreationMessageV3: object expected");a.pollCreationMessageV3=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV3)}if(e.scheduledCallEditMessage!=null){if(typeof e.scheduledCallEditMessage!="object")throw TypeError(".proto.Message.scheduledCallEditMessage: object expected");a.scheduledCallEditMessage=p.proto.Message.ScheduledCallEditMessage.fromObject(e.scheduledCallEditMessage)}if(e.ptvMessage!=null){if(typeof e.ptvMessage!="object")throw TypeError(".proto.Message.ptvMessage: object expected");a.ptvMessage=p.proto.Message.VideoMessage.fromObject(e.ptvMessage)}if(e.botInvokeMessage!=null){if(typeof e.botInvokeMessage!="object")throw TypeError(".proto.Message.botInvokeMessage: object expected");a.botInvokeMessage=p.proto.Message.FutureProofMessage.fromObject(e.botInvokeMessage)}if(e.callLogMesssage!=null){if(typeof e.callLogMesssage!="object")throw TypeError(".proto.Message.callLogMesssage: object expected");a.callLogMesssage=p.proto.Message.CallLogMessage.fromObject(e.callLogMesssage)}if(e.messageHistoryBundle!=null){if(typeof e.messageHistoryBundle!="object")throw TypeError(".proto.Message.messageHistoryBundle: object expected");a.messageHistoryBundle=p.proto.Message.MessageHistoryBundle.fromObject(e.messageHistoryBundle)}if(e.encCommentMessage!=null){if(typeof e.encCommentMessage!="object")throw TypeError(".proto.Message.encCommentMessage: object expected");a.encCommentMessage=p.proto.Message.EncCommentMessage.fromObject(e.encCommentMessage)}if(e.bcallMessage!=null){if(typeof e.bcallMessage!="object")throw TypeError(".proto.Message.bcallMessage: object expected");a.bcallMessage=p.proto.Message.BCallMessage.fromObject(e.bcallMessage)}if(e.lottieStickerMessage!=null){if(typeof e.lottieStickerMessage!="object")throw TypeError(".proto.Message.lottieStickerMessage: object expected");a.lottieStickerMessage=p.proto.Message.FutureProofMessage.fromObject(e.lottieStickerMessage)}if(e.eventMessage!=null){if(typeof e.eventMessage!="object")throw TypeError(".proto.Message.eventMessage: object expected");a.eventMessage=p.proto.Message.EventMessage.fromObject(e.eventMessage)}if(e.encEventResponseMessage!=null){if(typeof e.encEventResponseMessage!="object")throw TypeError(".proto.Message.encEventResponseMessage: object expected");a.encEventResponseMessage=p.proto.Message.EncEventResponseMessage.fromObject(e.encEventResponseMessage)}if(e.commentMessage!=null){if(typeof e.commentMessage!="object")throw TypeError(".proto.Message.commentMessage: object expected");a.commentMessage=p.proto.Message.CommentMessage.fromObject(e.commentMessage)}if(e.newsletterAdminInviteMessage!=null){if(typeof e.newsletterAdminInviteMessage!="object")throw TypeError(".proto.Message.newsletterAdminInviteMessage: object expected");a.newsletterAdminInviteMessage=p.proto.Message.NewsletterAdminInviteMessage.fromObject(e.newsletterAdminInviteMessage)}if(e.placeholderMessage!=null){if(typeof e.placeholderMessage!="object")throw TypeError(".proto.Message.placeholderMessage: object expected");a.placeholderMessage=p.proto.Message.PlaceholderMessage.fromObject(e.placeholderMessage)}if(e.secretEncryptedMessage!=null){if(typeof e.secretEncryptedMessage!="object")throw TypeError(".proto.Message.secretEncryptedMessage: object expected");a.secretEncryptedMessage=p.proto.Message.SecretEncryptedMessage.fromObject(e.secretEncryptedMessage)}if(e.albumMessage!=null){if(typeof e.albumMessage!="object")throw TypeError(".proto.Message.albumMessage: object expected");a.albumMessage=p.proto.Message.AlbumMessage.fromObject(e.albumMessage)}if(e.eventCoverImage!=null){if(typeof e.eventCoverImage!="object")throw TypeError(".proto.Message.eventCoverImage: object expected");a.eventCoverImage=p.proto.Message.FutureProofMessage.fromObject(e.eventCoverImage)}if(e.stickerPackMessage!=null){if(typeof e.stickerPackMessage!="object")throw TypeError(".proto.Message.stickerPackMessage: object expected");a.stickerPackMessage=p.proto.Message.StickerPackMessage.fromObject(e.stickerPackMessage)}if(e.statusMentionMessage!=null){if(typeof e.statusMentionMessage!="object")throw TypeError(".proto.Message.statusMentionMessage: object expected");a.statusMentionMessage=p.proto.Message.FutureProofMessage.fromObject(e.statusMentionMessage)}if(e.pollResultSnapshotMessage!=null){if(typeof e.pollResultSnapshotMessage!="object")throw TypeError(".proto.Message.pollResultSnapshotMessage: object expected");a.pollResultSnapshotMessage=p.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessage)}if(e.pollCreationOptionImageMessage!=null){if(typeof e.pollCreationOptionImageMessage!="object")throw TypeError(".proto.Message.pollCreationOptionImageMessage: object expected");a.pollCreationOptionImageMessage=p.proto.Message.FutureProofMessage.fromObject(e.pollCreationOptionImageMessage)}if(e.associatedChildMessage!=null){if(typeof e.associatedChildMessage!="object")throw TypeError(".proto.Message.associatedChildMessage: object expected");a.associatedChildMessage=p.proto.Message.FutureProofMessage.fromObject(e.associatedChildMessage)}if(e.groupStatusMentionMessage!=null){if(typeof e.groupStatusMentionMessage!="object")throw TypeError(".proto.Message.groupStatusMentionMessage: object expected");a.groupStatusMentionMessage=p.proto.Message.FutureProofMessage.fromObject(e.groupStatusMentionMessage)}if(e.pollCreationMessageV4!=null){if(typeof e.pollCreationMessageV4!="object")throw TypeError(".proto.Message.pollCreationMessageV4: object expected");a.pollCreationMessageV4=p.proto.Message.FutureProofMessage.fromObject(e.pollCreationMessageV4)}if(e.statusAddYours!=null){if(typeof e.statusAddYours!="object")throw TypeError(".proto.Message.statusAddYours: object expected");a.statusAddYours=p.proto.Message.FutureProofMessage.fromObject(e.statusAddYours)}if(e.groupStatusMessage!=null){if(typeof e.groupStatusMessage!="object")throw TypeError(".proto.Message.groupStatusMessage: object expected");a.groupStatusMessage=p.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessage)}if(e.richResponseMessage!=null){if(typeof e.richResponseMessage!="object")throw TypeError(".proto.Message.richResponseMessage: object expected");a.richResponseMessage=p.proto.AIRichResponseMessage.fromObject(e.richResponseMessage)}if(e.statusNotificationMessage!=null){if(typeof e.statusNotificationMessage!="object")throw TypeError(".proto.Message.statusNotificationMessage: object expected");a.statusNotificationMessage=p.proto.Message.StatusNotificationMessage.fromObject(e.statusNotificationMessage)}if(e.limitSharingMessage!=null){if(typeof e.limitSharingMessage!="object")throw TypeError(".proto.Message.limitSharingMessage: object expected");a.limitSharingMessage=p.proto.Message.FutureProofMessage.fromObject(e.limitSharingMessage)}if(e.botTaskMessage!=null){if(typeof e.botTaskMessage!="object")throw TypeError(".proto.Message.botTaskMessage: object expected");a.botTaskMessage=p.proto.Message.FutureProofMessage.fromObject(e.botTaskMessage)}if(e.questionMessage!=null){if(typeof e.questionMessage!="object")throw TypeError(".proto.Message.questionMessage: object expected");a.questionMessage=p.proto.Message.FutureProofMessage.fromObject(e.questionMessage)}if(e.messageHistoryNotice!=null){if(typeof e.messageHistoryNotice!="object")throw TypeError(".proto.Message.messageHistoryNotice: object expected");a.messageHistoryNotice=p.proto.Message.MessageHistoryNotice.fromObject(e.messageHistoryNotice)}if(e.groupStatusMessageV2!=null){if(typeof e.groupStatusMessageV2!="object")throw TypeError(".proto.Message.groupStatusMessageV2: object expected");a.groupStatusMessageV2=p.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessageV2)}if(e.botForwardedMessage!=null){if(typeof e.botForwardedMessage!="object")throw TypeError(".proto.Message.botForwardedMessage: object expected");a.botForwardedMessage=p.proto.Message.FutureProofMessage.fromObject(e.botForwardedMessage)}if(e.statusQuestionAnswerMessage!=null){if(typeof e.statusQuestionAnswerMessage!="object")throw TypeError(".proto.Message.statusQuestionAnswerMessage: object expected");a.statusQuestionAnswerMessage=p.proto.Message.StatusQuestionAnswerMessage.fromObject(e.statusQuestionAnswerMessage)}if(e.questionReplyMessage!=null){if(typeof e.questionReplyMessage!="object")throw TypeError(".proto.Message.questionReplyMessage: object expected");a.questionReplyMessage=p.proto.Message.FutureProofMessage.fromObject(e.questionReplyMessage)}if(e.questionResponseMessage!=null){if(typeof e.questionResponseMessage!="object")throw TypeError(".proto.Message.questionResponseMessage: object expected");a.questionResponseMessage=p.proto.Message.QuestionResponseMessage.fromObject(e.questionResponseMessage)}if(e.statusQuotedMessage!=null){if(typeof e.statusQuotedMessage!="object")throw TypeError(".proto.Message.statusQuotedMessage: object expected");a.statusQuotedMessage=p.proto.Message.StatusQuotedMessage.fromObject(e.statusQuotedMessage)}if(e.statusStickerInteractionMessage!=null){if(typeof e.statusStickerInteractionMessage!="object")throw TypeError(".proto.Message.statusStickerInteractionMessage: object expected");a.statusStickerInteractionMessage=p.proto.Message.StatusStickerInteractionMessage.fromObject(e.statusStickerInteractionMessage)}if(e.pollCreationMessageV5!=null){if(typeof e.pollCreationMessageV5!="object")throw TypeError(".proto.Message.pollCreationMessageV5: object expected");a.pollCreationMessageV5=p.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV5)}if(e.newsletterFollowerInviteMessageV2!=null){if(typeof e.newsletterFollowerInviteMessageV2!="object")throw TypeError(".proto.Message.newsletterFollowerInviteMessageV2: object expected");a.newsletterFollowerInviteMessageV2=p.proto.Message.NewsletterFollowerInviteMessage.fromObject(e.newsletterFollowerInviteMessageV2)}if(e.pollResultSnapshotMessageV3!=null){if(typeof e.pollResultSnapshotMessageV3!="object")throw TypeError(".proto.Message.pollResultSnapshotMessageV3: object expected");a.pollResultSnapshotMessageV3=p.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessageV3)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.conversation!=null&&e.hasOwnProperty("conversation")&&(A.conversation=e.conversation,a.oneofs&&(A._conversation="conversation")),e.senderKeyDistributionMessage!=null&&e.hasOwnProperty("senderKeyDistributionMessage")&&(A.senderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.toObject(e.senderKeyDistributionMessage,a),a.oneofs&&(A._senderKeyDistributionMessage="senderKeyDistributionMessage")),e.imageMessage!=null&&e.hasOwnProperty("imageMessage")&&(A.imageMessage=p.proto.Message.ImageMessage.toObject(e.imageMessage,a),a.oneofs&&(A._imageMessage="imageMessage")),e.contactMessage!=null&&e.hasOwnProperty("contactMessage")&&(A.contactMessage=p.proto.Message.ContactMessage.toObject(e.contactMessage,a),a.oneofs&&(A._contactMessage="contactMessage")),e.locationMessage!=null&&e.hasOwnProperty("locationMessage")&&(A.locationMessage=p.proto.Message.LocationMessage.toObject(e.locationMessage,a),a.oneofs&&(A._locationMessage="locationMessage")),e.extendedTextMessage!=null&&e.hasOwnProperty("extendedTextMessage")&&(A.extendedTextMessage=p.proto.Message.ExtendedTextMessage.toObject(e.extendedTextMessage,a),a.oneofs&&(A._extendedTextMessage="extendedTextMessage")),e.documentMessage!=null&&e.hasOwnProperty("documentMessage")&&(A.documentMessage=p.proto.Message.DocumentMessage.toObject(e.documentMessage,a),a.oneofs&&(A._documentMessage="documentMessage")),e.audioMessage!=null&&e.hasOwnProperty("audioMessage")&&(A.audioMessage=p.proto.Message.AudioMessage.toObject(e.audioMessage,a),a.oneofs&&(A._audioMessage="audioMessage")),e.videoMessage!=null&&e.hasOwnProperty("videoMessage")&&(A.videoMessage=p.proto.Message.VideoMessage.toObject(e.videoMessage,a),a.oneofs&&(A._videoMessage="videoMessage")),e.call!=null&&e.hasOwnProperty("call")&&(A.call=p.proto.Message.Call.toObject(e.call,a),a.oneofs&&(A._call="call")),e.chat!=null&&e.hasOwnProperty("chat")&&(A.chat=p.proto.Message.Chat.toObject(e.chat,a),a.oneofs&&(A._chat="chat")),e.protocolMessage!=null&&e.hasOwnProperty("protocolMessage")&&(A.protocolMessage=p.proto.Message.ProtocolMessage.toObject(e.protocolMessage,a),a.oneofs&&(A._protocolMessage="protocolMessage")),e.contactsArrayMessage!=null&&e.hasOwnProperty("contactsArrayMessage")&&(A.contactsArrayMessage=p.proto.Message.ContactsArrayMessage.toObject(e.contactsArrayMessage,a),a.oneofs&&(A._contactsArrayMessage="contactsArrayMessage")),e.highlyStructuredMessage!=null&&e.hasOwnProperty("highlyStructuredMessage")&&(A.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.toObject(e.highlyStructuredMessage,a),a.oneofs&&(A._highlyStructuredMessage="highlyStructuredMessage")),e.fastRatchetKeySenderKeyDistributionMessage!=null&&e.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")&&(A.fastRatchetKeySenderKeyDistributionMessage=p.proto.Message.SenderKeyDistributionMessage.toObject(e.fastRatchetKeySenderKeyDistributionMessage,a),a.oneofs&&(A._fastRatchetKeySenderKeyDistributionMessage="fastRatchetKeySenderKeyDistributionMessage")),e.sendPaymentMessage!=null&&e.hasOwnProperty("sendPaymentMessage")&&(A.sendPaymentMessage=p.proto.Message.SendPaymentMessage.toObject(e.sendPaymentMessage,a),a.oneofs&&(A._sendPaymentMessage="sendPaymentMessage")),e.liveLocationMessage!=null&&e.hasOwnProperty("liveLocationMessage")&&(A.liveLocationMessage=p.proto.Message.LiveLocationMessage.toObject(e.liveLocationMessage,a),a.oneofs&&(A._liveLocationMessage="liveLocationMessage")),e.requestPaymentMessage!=null&&e.hasOwnProperty("requestPaymentMessage")&&(A.requestPaymentMessage=p.proto.Message.RequestPaymentMessage.toObject(e.requestPaymentMessage,a),a.oneofs&&(A._requestPaymentMessage="requestPaymentMessage")),e.declinePaymentRequestMessage!=null&&e.hasOwnProperty("declinePaymentRequestMessage")&&(A.declinePaymentRequestMessage=p.proto.Message.DeclinePaymentRequestMessage.toObject(e.declinePaymentRequestMessage,a),a.oneofs&&(A._declinePaymentRequestMessage="declinePaymentRequestMessage")),e.cancelPaymentRequestMessage!=null&&e.hasOwnProperty("cancelPaymentRequestMessage")&&(A.cancelPaymentRequestMessage=p.proto.Message.CancelPaymentRequestMessage.toObject(e.cancelPaymentRequestMessage,a),a.oneofs&&(A._cancelPaymentRequestMessage="cancelPaymentRequestMessage")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=p.proto.Message.TemplateMessage.toObject(e.templateMessage,a),a.oneofs&&(A._templateMessage="templateMessage")),e.stickerMessage!=null&&e.hasOwnProperty("stickerMessage")&&(A.stickerMessage=p.proto.Message.StickerMessage.toObject(e.stickerMessage,a),a.oneofs&&(A._stickerMessage="stickerMessage")),e.groupInviteMessage!=null&&e.hasOwnProperty("groupInviteMessage")&&(A.groupInviteMessage=p.proto.Message.GroupInviteMessage.toObject(e.groupInviteMessage,a),a.oneofs&&(A._groupInviteMessage="groupInviteMessage")),e.templateButtonReplyMessage!=null&&e.hasOwnProperty("templateButtonReplyMessage")&&(A.templateButtonReplyMessage=p.proto.Message.TemplateButtonReplyMessage.toObject(e.templateButtonReplyMessage,a),a.oneofs&&(A._templateButtonReplyMessage="templateButtonReplyMessage")),e.productMessage!=null&&e.hasOwnProperty("productMessage")&&(A.productMessage=p.proto.Message.ProductMessage.toObject(e.productMessage,a),a.oneofs&&(A._productMessage="productMessage")),e.deviceSentMessage!=null&&e.hasOwnProperty("deviceSentMessage")&&(A.deviceSentMessage=p.proto.Message.DeviceSentMessage.toObject(e.deviceSentMessage,a),a.oneofs&&(A._deviceSentMessage="deviceSentMessage")),e.messageContextInfo!=null&&e.hasOwnProperty("messageContextInfo")&&(A.messageContextInfo=p.proto.MessageContextInfo.toObject(e.messageContextInfo,a),a.oneofs&&(A._messageContextInfo="messageContextInfo")),e.listMessage!=null&&e.hasOwnProperty("listMessage")&&(A.listMessage=p.proto.Message.ListMessage.toObject(e.listMessage,a),a.oneofs&&(A._listMessage="listMessage")),e.viewOnceMessage!=null&&e.hasOwnProperty("viewOnceMessage")&&(A.viewOnceMessage=p.proto.Message.FutureProofMessage.toObject(e.viewOnceMessage,a),a.oneofs&&(A._viewOnceMessage="viewOnceMessage")),e.orderMessage!=null&&e.hasOwnProperty("orderMessage")&&(A.orderMessage=p.proto.Message.OrderMessage.toObject(e.orderMessage,a),a.oneofs&&(A._orderMessage="orderMessage")),e.listResponseMessage!=null&&e.hasOwnProperty("listResponseMessage")&&(A.listResponseMessage=p.proto.Message.ListResponseMessage.toObject(e.listResponseMessage,a),a.oneofs&&(A._listResponseMessage="listResponseMessage")),e.ephemeralMessage!=null&&e.hasOwnProperty("ephemeralMessage")&&(A.ephemeralMessage=p.proto.Message.FutureProofMessage.toObject(e.ephemeralMessage,a),a.oneofs&&(A._ephemeralMessage="ephemeralMessage")),e.invoiceMessage!=null&&e.hasOwnProperty("invoiceMessage")&&(A.invoiceMessage=p.proto.Message.InvoiceMessage.toObject(e.invoiceMessage,a),a.oneofs&&(A._invoiceMessage="invoiceMessage")),e.buttonsMessage!=null&&e.hasOwnProperty("buttonsMessage")&&(A.buttonsMessage=p.proto.Message.ButtonsMessage.toObject(e.buttonsMessage,a),a.oneofs&&(A._buttonsMessage="buttonsMessage")),e.buttonsResponseMessage!=null&&e.hasOwnProperty("buttonsResponseMessage")&&(A.buttonsResponseMessage=p.proto.Message.ButtonsResponseMessage.toObject(e.buttonsResponseMessage,a),a.oneofs&&(A._buttonsResponseMessage="buttonsResponseMessage")),e.paymentInviteMessage!=null&&e.hasOwnProperty("paymentInviteMessage")&&(A.paymentInviteMessage=p.proto.Message.PaymentInviteMessage.toObject(e.paymentInviteMessage,a),a.oneofs&&(A._paymentInviteMessage="paymentInviteMessage")),e.interactiveMessage!=null&&e.hasOwnProperty("interactiveMessage")&&(A.interactiveMessage=p.proto.Message.InteractiveMessage.toObject(e.interactiveMessage,a),a.oneofs&&(A._interactiveMessage="interactiveMessage")),e.reactionMessage!=null&&e.hasOwnProperty("reactionMessage")&&(A.reactionMessage=p.proto.Message.ReactionMessage.toObject(e.reactionMessage,a),a.oneofs&&(A._reactionMessage="reactionMessage")),e.stickerSyncRmrMessage!=null&&e.hasOwnProperty("stickerSyncRmrMessage")&&(A.stickerSyncRmrMessage=p.proto.Message.StickerSyncRMRMessage.toObject(e.stickerSyncRmrMessage,a),a.oneofs&&(A._stickerSyncRmrMessage="stickerSyncRmrMessage")),e.interactiveResponseMessage!=null&&e.hasOwnProperty("interactiveResponseMessage")&&(A.interactiveResponseMessage=p.proto.Message.InteractiveResponseMessage.toObject(e.interactiveResponseMessage,a),a.oneofs&&(A._interactiveResponseMessage="interactiveResponseMessage")),e.pollCreationMessage!=null&&e.hasOwnProperty("pollCreationMessage")&&(A.pollCreationMessage=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessage,a),a.oneofs&&(A._pollCreationMessage="pollCreationMessage")),e.pollUpdateMessage!=null&&e.hasOwnProperty("pollUpdateMessage")&&(A.pollUpdateMessage=p.proto.Message.PollUpdateMessage.toObject(e.pollUpdateMessage,a),a.oneofs&&(A._pollUpdateMessage="pollUpdateMessage")),e.keepInChatMessage!=null&&e.hasOwnProperty("keepInChatMessage")&&(A.keepInChatMessage=p.proto.Message.KeepInChatMessage.toObject(e.keepInChatMessage,a),a.oneofs&&(A._keepInChatMessage="keepInChatMessage")),e.documentWithCaptionMessage!=null&&e.hasOwnProperty("documentWithCaptionMessage")&&(A.documentWithCaptionMessage=p.proto.Message.FutureProofMessage.toObject(e.documentWithCaptionMessage,a),a.oneofs&&(A._documentWithCaptionMessage="documentWithCaptionMessage")),e.requestPhoneNumberMessage!=null&&e.hasOwnProperty("requestPhoneNumberMessage")&&(A.requestPhoneNumberMessage=p.proto.Message.RequestPhoneNumberMessage.toObject(e.requestPhoneNumberMessage,a),a.oneofs&&(A._requestPhoneNumberMessage="requestPhoneNumberMessage")),e.viewOnceMessageV2!=null&&e.hasOwnProperty("viewOnceMessageV2")&&(A.viewOnceMessageV2=p.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2,a),a.oneofs&&(A._viewOnceMessageV2="viewOnceMessageV2")),e.encReactionMessage!=null&&e.hasOwnProperty("encReactionMessage")&&(A.encReactionMessage=p.proto.Message.EncReactionMessage.toObject(e.encReactionMessage,a),a.oneofs&&(A._encReactionMessage="encReactionMessage")),e.editedMessage!=null&&e.hasOwnProperty("editedMessage")&&(A.editedMessage=p.proto.Message.FutureProofMessage.toObject(e.editedMessage,a),a.oneofs&&(A._editedMessage="editedMessage")),e.viewOnceMessageV2Extension!=null&&e.hasOwnProperty("viewOnceMessageV2Extension")&&(A.viewOnceMessageV2Extension=p.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2Extension,a),a.oneofs&&(A._viewOnceMessageV2Extension="viewOnceMessageV2Extension")),e.pollCreationMessageV2!=null&&e.hasOwnProperty("pollCreationMessageV2")&&(A.pollCreationMessageV2=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV2,a),a.oneofs&&(A._pollCreationMessageV2="pollCreationMessageV2")),e.scheduledCallCreationMessage!=null&&e.hasOwnProperty("scheduledCallCreationMessage")&&(A.scheduledCallCreationMessage=p.proto.Message.ScheduledCallCreationMessage.toObject(e.scheduledCallCreationMessage,a),a.oneofs&&(A._scheduledCallCreationMessage="scheduledCallCreationMessage")),e.groupMentionedMessage!=null&&e.hasOwnProperty("groupMentionedMessage")&&(A.groupMentionedMessage=p.proto.Message.FutureProofMessage.toObject(e.groupMentionedMessage,a),a.oneofs&&(A._groupMentionedMessage="groupMentionedMessage")),e.pinInChatMessage!=null&&e.hasOwnProperty("pinInChatMessage")&&(A.pinInChatMessage=p.proto.Message.PinInChatMessage.toObject(e.pinInChatMessage,a),a.oneofs&&(A._pinInChatMessage="pinInChatMessage")),e.pollCreationMessageV3!=null&&e.hasOwnProperty("pollCreationMessageV3")&&(A.pollCreationMessageV3=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV3,a),a.oneofs&&(A._pollCreationMessageV3="pollCreationMessageV3")),e.scheduledCallEditMessage!=null&&e.hasOwnProperty("scheduledCallEditMessage")&&(A.scheduledCallEditMessage=p.proto.Message.ScheduledCallEditMessage.toObject(e.scheduledCallEditMessage,a),a.oneofs&&(A._scheduledCallEditMessage="scheduledCallEditMessage")),e.ptvMessage!=null&&e.hasOwnProperty("ptvMessage")&&(A.ptvMessage=p.proto.Message.VideoMessage.toObject(e.ptvMessage,a),a.oneofs&&(A._ptvMessage="ptvMessage")),e.botInvokeMessage!=null&&e.hasOwnProperty("botInvokeMessage")&&(A.botInvokeMessage=p.proto.Message.FutureProofMessage.toObject(e.botInvokeMessage,a),a.oneofs&&(A._botInvokeMessage="botInvokeMessage")),e.callLogMesssage!=null&&e.hasOwnProperty("callLogMesssage")&&(A.callLogMesssage=p.proto.Message.CallLogMessage.toObject(e.callLogMesssage,a),a.oneofs&&(A._callLogMesssage="callLogMesssage")),e.messageHistoryBundle!=null&&e.hasOwnProperty("messageHistoryBundle")&&(A.messageHistoryBundle=p.proto.Message.MessageHistoryBundle.toObject(e.messageHistoryBundle,a),a.oneofs&&(A._messageHistoryBundle="messageHistoryBundle")),e.encCommentMessage!=null&&e.hasOwnProperty("encCommentMessage")&&(A.encCommentMessage=p.proto.Message.EncCommentMessage.toObject(e.encCommentMessage,a),a.oneofs&&(A._encCommentMessage="encCommentMessage")),e.bcallMessage!=null&&e.hasOwnProperty("bcallMessage")&&(A.bcallMessage=p.proto.Message.BCallMessage.toObject(e.bcallMessage,a),a.oneofs&&(A._bcallMessage="bcallMessage")),e.lottieStickerMessage!=null&&e.hasOwnProperty("lottieStickerMessage")&&(A.lottieStickerMessage=p.proto.Message.FutureProofMessage.toObject(e.lottieStickerMessage,a),a.oneofs&&(A._lottieStickerMessage="lottieStickerMessage")),e.eventMessage!=null&&e.hasOwnProperty("eventMessage")&&(A.eventMessage=p.proto.Message.EventMessage.toObject(e.eventMessage,a),a.oneofs&&(A._eventMessage="eventMessage")),e.encEventResponseMessage!=null&&e.hasOwnProperty("encEventResponseMessage")&&(A.encEventResponseMessage=p.proto.Message.EncEventResponseMessage.toObject(e.encEventResponseMessage,a),a.oneofs&&(A._encEventResponseMessage="encEventResponseMessage")),e.commentMessage!=null&&e.hasOwnProperty("commentMessage")&&(A.commentMessage=p.proto.Message.CommentMessage.toObject(e.commentMessage,a),a.oneofs&&(A._commentMessage="commentMessage")),e.newsletterAdminInviteMessage!=null&&e.hasOwnProperty("newsletterAdminInviteMessage")&&(A.newsletterAdminInviteMessage=p.proto.Message.NewsletterAdminInviteMessage.toObject(e.newsletterAdminInviteMessage,a),a.oneofs&&(A._newsletterAdminInviteMessage="newsletterAdminInviteMessage")),e.placeholderMessage!=null&&e.hasOwnProperty("placeholderMessage")&&(A.placeholderMessage=p.proto.Message.PlaceholderMessage.toObject(e.placeholderMessage,a),a.oneofs&&(A._placeholderMessage="placeholderMessage")),e.secretEncryptedMessage!=null&&e.hasOwnProperty("secretEncryptedMessage")&&(A.secretEncryptedMessage=p.proto.Message.SecretEncryptedMessage.toObject(e.secretEncryptedMessage,a),a.oneofs&&(A._secretEncryptedMessage="secretEncryptedMessage")),e.albumMessage!=null&&e.hasOwnProperty("albumMessage")&&(A.albumMessage=p.proto.Message.AlbumMessage.toObject(e.albumMessage,a),a.oneofs&&(A._albumMessage="albumMessage")),e.eventCoverImage!=null&&e.hasOwnProperty("eventCoverImage")&&(A.eventCoverImage=p.proto.Message.FutureProofMessage.toObject(e.eventCoverImage,a),a.oneofs&&(A._eventCoverImage="eventCoverImage")),e.stickerPackMessage!=null&&e.hasOwnProperty("stickerPackMessage")&&(A.stickerPackMessage=p.proto.Message.StickerPackMessage.toObject(e.stickerPackMessage,a),a.oneofs&&(A._stickerPackMessage="stickerPackMessage")),e.statusMentionMessage!=null&&e.hasOwnProperty("statusMentionMessage")&&(A.statusMentionMessage=p.proto.Message.FutureProofMessage.toObject(e.statusMentionMessage,a),a.oneofs&&(A._statusMentionMessage="statusMentionMessage")),e.pollResultSnapshotMessage!=null&&e.hasOwnProperty("pollResultSnapshotMessage")&&(A.pollResultSnapshotMessage=p.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessage,a),a.oneofs&&(A._pollResultSnapshotMessage="pollResultSnapshotMessage")),e.pollCreationOptionImageMessage!=null&&e.hasOwnProperty("pollCreationOptionImageMessage")&&(A.pollCreationOptionImageMessage=p.proto.Message.FutureProofMessage.toObject(e.pollCreationOptionImageMessage,a),a.oneofs&&(A._pollCreationOptionImageMessage="pollCreationOptionImageMessage")),e.associatedChildMessage!=null&&e.hasOwnProperty("associatedChildMessage")&&(A.associatedChildMessage=p.proto.Message.FutureProofMessage.toObject(e.associatedChildMessage,a),a.oneofs&&(A._associatedChildMessage="associatedChildMessage")),e.groupStatusMentionMessage!=null&&e.hasOwnProperty("groupStatusMentionMessage")&&(A.groupStatusMentionMessage=p.proto.Message.FutureProofMessage.toObject(e.groupStatusMentionMessage,a),a.oneofs&&(A._groupStatusMentionMessage="groupStatusMentionMessage")),e.pollCreationMessageV4!=null&&e.hasOwnProperty("pollCreationMessageV4")&&(A.pollCreationMessageV4=p.proto.Message.FutureProofMessage.toObject(e.pollCreationMessageV4,a),a.oneofs&&(A._pollCreationMessageV4="pollCreationMessageV4")),e.statusAddYours!=null&&e.hasOwnProperty("statusAddYours")&&(A.statusAddYours=p.proto.Message.FutureProofMessage.toObject(e.statusAddYours,a),a.oneofs&&(A._statusAddYours="statusAddYours")),e.groupStatusMessage!=null&&e.hasOwnProperty("groupStatusMessage")&&(A.groupStatusMessage=p.proto.Message.FutureProofMessage.toObject(e.groupStatusMessage,a),a.oneofs&&(A._groupStatusMessage="groupStatusMessage")),e.richResponseMessage!=null&&e.hasOwnProperty("richResponseMessage")&&(A.richResponseMessage=p.proto.AIRichResponseMessage.toObject(e.richResponseMessage,a),a.oneofs&&(A._richResponseMessage="richResponseMessage")),e.statusNotificationMessage!=null&&e.hasOwnProperty("statusNotificationMessage")&&(A.statusNotificationMessage=p.proto.Message.StatusNotificationMessage.toObject(e.statusNotificationMessage,a),a.oneofs&&(A._statusNotificationMessage="statusNotificationMessage")),e.limitSharingMessage!=null&&e.hasOwnProperty("limitSharingMessage")&&(A.limitSharingMessage=p.proto.Message.FutureProofMessage.toObject(e.limitSharingMessage,a),a.oneofs&&(A._limitSharingMessage="limitSharingMessage")),e.botTaskMessage!=null&&e.hasOwnProperty("botTaskMessage")&&(A.botTaskMessage=p.proto.Message.FutureProofMessage.toObject(e.botTaskMessage,a),a.oneofs&&(A._botTaskMessage="botTaskMessage")),e.questionMessage!=null&&e.hasOwnProperty("questionMessage")&&(A.questionMessage=p.proto.Message.FutureProofMessage.toObject(e.questionMessage,a),a.oneofs&&(A._questionMessage="questionMessage")),e.messageHistoryNotice!=null&&e.hasOwnProperty("messageHistoryNotice")&&(A.messageHistoryNotice=p.proto.Message.MessageHistoryNotice.toObject(e.messageHistoryNotice,a),a.oneofs&&(A._messageHistoryNotice="messageHistoryNotice")),e.groupStatusMessageV2!=null&&e.hasOwnProperty("groupStatusMessageV2")&&(A.groupStatusMessageV2=p.proto.Message.FutureProofMessage.toObject(e.groupStatusMessageV2,a),a.oneofs&&(A._groupStatusMessageV2="groupStatusMessageV2")),e.botForwardedMessage!=null&&e.hasOwnProperty("botForwardedMessage")&&(A.botForwardedMessage=p.proto.Message.FutureProofMessage.toObject(e.botForwardedMessage,a),a.oneofs&&(A._botForwardedMessage="botForwardedMessage")),e.statusQuestionAnswerMessage!=null&&e.hasOwnProperty("statusQuestionAnswerMessage")&&(A.statusQuestionAnswerMessage=p.proto.Message.StatusQuestionAnswerMessage.toObject(e.statusQuestionAnswerMessage,a),a.oneofs&&(A._statusQuestionAnswerMessage="statusQuestionAnswerMessage")),e.questionReplyMessage!=null&&e.hasOwnProperty("questionReplyMessage")&&(A.questionReplyMessage=p.proto.Message.FutureProofMessage.toObject(e.questionReplyMessage,a),a.oneofs&&(A._questionReplyMessage="questionReplyMessage")),e.questionResponseMessage!=null&&e.hasOwnProperty("questionResponseMessage")&&(A.questionResponseMessage=p.proto.Message.QuestionResponseMessage.toObject(e.questionResponseMessage,a),a.oneofs&&(A._questionResponseMessage="questionResponseMessage")),e.statusQuotedMessage!=null&&e.hasOwnProperty("statusQuotedMessage")&&(A.statusQuotedMessage=p.proto.Message.StatusQuotedMessage.toObject(e.statusQuotedMessage,a),a.oneofs&&(A._statusQuotedMessage="statusQuotedMessage")),e.statusStickerInteractionMessage!=null&&e.hasOwnProperty("statusStickerInteractionMessage")&&(A.statusStickerInteractionMessage=p.proto.Message.StatusStickerInteractionMessage.toObject(e.statusStickerInteractionMessage,a),a.oneofs&&(A._statusStickerInteractionMessage="statusStickerInteractionMessage")),e.pollCreationMessageV5!=null&&e.hasOwnProperty("pollCreationMessageV5")&&(A.pollCreationMessageV5=p.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV5,a),a.oneofs&&(A._pollCreationMessageV5="pollCreationMessageV5")),e.newsletterFollowerInviteMessageV2!=null&&e.hasOwnProperty("newsletterFollowerInviteMessageV2")&&(A.newsletterFollowerInviteMessageV2=p.proto.Message.NewsletterFollowerInviteMessage.toObject(e.newsletterFollowerInviteMessageV2,a),a.oneofs&&(A._newsletterFollowerInviteMessageV2="newsletterFollowerInviteMessageV2")),e.pollResultSnapshotMessageV3!=null&&e.hasOwnProperty("pollResultSnapshotMessageV3")&&(A.pollResultSnapshotMessageV3=p.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessageV3,a),a.oneofs&&(A._pollResultSnapshotMessageV3="pollResultSnapshotMessageV3")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Message"},r.AlbumMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 2:{c.expectedImageCount=A.uint32();break}case 3:{c.expectedVideoCount=A.uint32();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AlbumMessage)return A;var t=new p.proto.Message.AlbumMessage;if(A.expectedImageCount!=null&&(t.expectedImageCount=A.expectedImageCount>>>0),A.expectedVideoCount!=null&&(t.expectedVideoCount=A.expectedVideoCount>>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AlbumMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.expectedImageCount!=null&&A.hasOwnProperty("expectedImageCount")&&(s.expectedImageCount=A.expectedImageCount,t.oneofs&&(s._expectedImageCount="expectedImageCount")),A.expectedVideoCount!=null&&A.hasOwnProperty("expectedVideoCount")&&(s.expectedVideoCount=A.expectedVideoCount,t.oneofs&&(s._expectedVideoCount="expectedVideoCount")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AlbumMessage"},i})(),r.AppStateFatalExceptionNotification=(function(){function i(a){if(this.collectionNames=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.collectionNames&&c.collectionNames.length||(c.collectionNames=[]),c.collectionNames.push(A.string());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateFatalExceptionNotification)return A;var t=new p.proto.Message.AppStateFatalExceptionNotification;if(A.collectionNames){if(!Array.isArray(A.collectionNames))throw TypeError(".proto.Message.AppStateFatalExceptionNotification.collectionNames: array expected");t.collectionNames=[];for(var s=0;s>>0,A.timestamp.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.collectionNames=[]),A.collectionNames&&A.collectionNames.length){s.collectionNames=[];for(var g=0;g>>3){case 1:{c.keyId=p.proto.Message.AppStateSyncKeyId.decode(A,A.uint32());break}case 2:{c.keyData=p.proto.Message.AppStateSyncKeyData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateSyncKey)return A;var t=new p.proto.Message.AppStateSyncKey;if(A.keyId!=null){if(typeof A.keyId!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyId: object expected");t.keyId=p.proto.Message.AppStateSyncKeyId.fromObject(A.keyId)}if(A.keyData!=null){if(typeof A.keyData!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyData: object expected");t.keyData=p.proto.Message.AppStateSyncKeyData.fromObject(A.keyData)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=p.proto.Message.AppStateSyncKeyId.toObject(A.keyId,t),t.oneofs&&(s._keyId="keyId")),A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=p.proto.Message.AppStateSyncKeyData.toObject(A.keyData,t),t.oneofs&&(s._keyData="keyData")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKey"},i})(),r.AppStateSyncKeyData=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.keyData=A.bytes();break}case 2:{c.fingerprint=p.proto.Message.AppStateSyncKeyFingerprint.decode(A,A.uint32());break}case 3:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateSyncKeyData)return A;var t=new p.proto.Message.AppStateSyncKeyData;if(A.keyData!=null&&(typeof A.keyData=="string"?l.base64.decode(A.keyData,t.keyData=l.newBuffer(l.base64.length(A.keyData)),0):A.keyData.length>=0&&(t.keyData=A.keyData)),A.fingerprint!=null){if(typeof A.fingerprint!="object")throw TypeError(".proto.Message.AppStateSyncKeyData.fingerprint: object expected");t.fingerprint=p.proto.Message.AppStateSyncKeyFingerprint.fromObject(A.fingerprint)}return A.timestamp!=null&&(l.Long?(t.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?t.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?t.timestamp=A.timestamp:typeof A.timestamp=="object"&&(t.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=t.bytes===String?l.base64.encode(A.keyData,0,A.keyData.length):t.bytes===Array?Array.prototype.slice.call(A.keyData):A.keyData,t.oneofs&&(s._keyData="keyData")),A.fingerprint!=null&&A.hasOwnProperty("fingerprint")&&(s.fingerprint=p.proto.Message.AppStateSyncKeyFingerprint.toObject(A.fingerprint,t),t.oneofs&&(s._fingerprint="fingerprint")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=t.longs===String?String(A.timestamp):A.timestamp:s.timestamp=t.longs===String?oe(A.timestamp):t.longs===Number?ne(A.timestamp):A.timestamp,t.oneofs&&(s._timestamp="timestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyData"},i})(),r.AppStateSyncKeyFingerprint=(function(){function i(a){if(this.deviceIndexes=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.rawId=A.uint32();break}case 2:{c.currentIndex=A.uint32();break}case 3:{if(c.deviceIndexes&&c.deviceIndexes.length||(c.deviceIndexes=[]),(I&7)===2)for(var d=A.uint32()+A.pos;A.pos>>0),A.currentIndex!=null&&(t.currentIndex=A.currentIndex>>>0),A.deviceIndexes){if(!Array.isArray(A.deviceIndexes))throw TypeError(".proto.Message.AppStateSyncKeyFingerprint.deviceIndexes: array expected");t.deviceIndexes=[];for(var s=0;s>>0}return t},i.toObject=function(A,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.deviceIndexes=[]),A.rawId!=null&&A.hasOwnProperty("rawId")&&(s.rawId=A.rawId,t.oneofs&&(s._rawId="rawId")),A.currentIndex!=null&&A.hasOwnProperty("currentIndex")&&(s.currentIndex=A.currentIndex,t.oneofs&&(s._currentIndex="currentIndex")),A.deviceIndexes&&A.deviceIndexes.length){s.deviceIndexes=[];for(var g=0;g>>3){case 1:{c.keyId=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AppStateSyncKeyId)return A;var t=new p.proto.Message.AppStateSyncKeyId;return A.keyId!=null&&(typeof A.keyId=="string"?l.base64.decode(A.keyId,t.keyId=l.newBuffer(l.base64.length(A.keyId)),0):A.keyId.length>=0&&(t.keyId=A.keyId)),t},i.toObject=function(A,t){t||(t={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=t.bytes===String?l.base64.encode(A.keyId,0,A.keyId.length):t.bytes===Array?Array.prototype.slice.call(A.keyId):A.keyId,t.oneofs&&(s._keyId="keyId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyId"},i})(),r.AppStateSyncKeyRequest=(function(){function i(e){if(this.keyIds=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.keyIds&&g.keyIds.length||(g.keyIds=[]),g.keyIds.push(p.proto.Message.AppStateSyncKeyId.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.AppStateSyncKeyRequest)return a;var A=new p.proto.Message.AppStateSyncKeyRequest;if(a.keyIds){if(!Array.isArray(a.keyIds))throw TypeError(".proto.Message.AppStateSyncKeyRequest.keyIds: array expected");A.keyIds=[];for(var t=0;t>>3){case 1:{g.keys&&g.keys.length||(g.keys=[]),g.keys.push(p.proto.Message.AppStateSyncKey.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.AppStateSyncKeyShare)return a;var A=new p.proto.Message.AppStateSyncKeyShare;if(a.keys){if(!Array.isArray(a.keys))throw TypeError(".proto.Message.AppStateSyncKeyShare.keys: array expected");A.keys=[];for(var t=0;t>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.ptt=A.bool();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileEncSha256=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.waveform=A.bytes();break}case 20:{c.backgroundArgb=A.fixed32();break}case 21:{c.viewOnce=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.AudioMessage)return A;var t=new p.proto.Message.AudioMessage;if(A.url!=null&&(t.url=String(A.url)),A.mimetype!=null&&(t.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,t.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(t.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(t.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?t.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?t.fileLength=A.fileLength:typeof A.fileLength=="object"&&(t.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(t.seconds=A.seconds>>>0),A.ptt!=null&&(t.ptt=!!A.ptt),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(t.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(t.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?t.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?t.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(t.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AudioMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,t.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(t.streamingSidecar=A.streamingSidecar)),A.waveform!=null&&(typeof A.waveform=="string"?l.base64.decode(A.waveform,t.waveform=l.newBuffer(l.base64.length(A.waveform)),0):A.waveform.length>=0&&(t.waveform=A.waveform)),A.backgroundArgb!=null&&(t.backgroundArgb=A.backgroundArgb>>>0),A.viewOnce!=null&&(t.viewOnce=!!A.viewOnce),A.accessibilityLabel!=null&&(t.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){t.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:t.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:t.mediaKeyDomain=1;break;case"STATUS":case 2:t.mediaKeyDomain=2;break;case"CAPI":case 3:t.mediaKeyDomain=3;break;case"BOT":case 4:t.mediaKeyDomain=4;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,t.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=t.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,t.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=t.longs===String?String(A.fileLength):A.fileLength:s.fileLength=t.longs===String?oe(A.fileLength,!0):t.longs===Number?ne(A.fileLength,!0):A.fileLength,t.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,t.oneofs&&(s._seconds="seconds")),A.ptt!=null&&A.hasOwnProperty("ptt")&&(s.ptt=A.ptt,t.oneofs&&(s._ptt="ptt")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=t.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,t.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=t.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,t.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,t.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=t.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=t.longs===String?oe(A.mediaKeyTimestamp):t.longs===Number?ne(A.mediaKeyTimestamp):A.mediaKeyTimestamp,t.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.streamingSidecar!=null&&A.hasOwnProperty("streamingSidecar")&&(s.streamingSidecar=t.bytes===String?l.base64.encode(A.streamingSidecar,0,A.streamingSidecar.length):t.bytes===Array?Array.prototype.slice.call(A.streamingSidecar):A.streamingSidecar,t.oneofs&&(s._streamingSidecar="streamingSidecar")),A.waveform!=null&&A.hasOwnProperty("waveform")&&(s.waveform=t.bytes===String?l.base64.encode(A.waveform,0,A.waveform.length):t.bytes===Array?Array.prototype.slice.call(A.waveform):A.waveform,t.oneofs&&(s._waveform="waveform")),A.backgroundArgb!=null&&A.hasOwnProperty("backgroundArgb")&&(s.backgroundArgb=A.backgroundArgb,t.oneofs&&(s._backgroundArgb="backgroundArgb")),A.viewOnce!=null&&A.hasOwnProperty("viewOnce")&&(s.viewOnce=A.viewOnce,t.oneofs&&(s._viewOnce="viewOnce")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,t.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=t.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,t.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AudioMessage"},i})(),r.BCallMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.sessionId=A.string();break}case 2:{c.mediaType=A.int32();break}case 3:{c.masterKey=A.bytes();break}case 4:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.BCallMessage)return A;var t=new p.proto.Message.BCallMessage;switch(A.sessionId!=null&&(t.sessionId=String(A.sessionId)),A.mediaType){default:if(typeof A.mediaType=="number"){t.mediaType=A.mediaType;break}break;case"UNKNOWN":case 0:t.mediaType=0;break;case"AUDIO":case 1:t.mediaType=1;break;case"VIDEO":case 2:t.mediaType=2;break}return A.masterKey!=null&&(typeof A.masterKey=="string"?l.base64.decode(A.masterKey,t.masterKey=l.newBuffer(l.base64.length(A.masterKey)),0):A.masterKey.length>=0&&(t.masterKey=A.masterKey)),A.caption!=null&&(t.caption=String(A.caption)),t},i.toObject=function(A,t){t||(t={});var s={};return A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,t.oneofs&&(s._sessionId="sessionId")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=t.enums===String?p.proto.Message.BCallMessage.MediaType[A.mediaType]===void 0?A.mediaType:p.proto.Message.BCallMessage.MediaType[A.mediaType]:A.mediaType,t.oneofs&&(s._mediaType="mediaType")),A.masterKey!=null&&A.hasOwnProperty("masterKey")&&(s.masterKey=t.bytes===String?l.base64.encode(A.masterKey,0,A.masterKey.length):t.bytes===Array?Array.prototype.slice.call(A.masterKey):A.masterKey,t.oneofs&&(s._masterKey="masterKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,t.oneofs&&(s._caption="caption")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.BCallMessage"},i.MediaType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="AUDIO"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),r.ButtonsMessage=(function(){function i(a){if(this.buttons=[],a)for(var A=Object.keys(a),t=0;t>>3){case 6:{c.contentText=A.string();break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 9:{c.buttons&&c.buttons.length||(c.buttons=[]),c.buttons.push(p.proto.Message.ButtonsMessage.Button.decode(A,A.uint32()));break}case 10:{c.headerType=A.int32();break}case 1:{c.text=A.string();break}case 2:{c.documentMessage=p.proto.Message.DocumentMessage.decode(A,A.uint32());break}case 3:{c.imageMessage=p.proto.Message.ImageMessage.decode(A,A.uint32());break}case 4:{c.videoMessage=p.proto.Message.VideoMessage.decode(A,A.uint32());break}case 5:{c.locationMessage=p.proto.Message.LocationMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ButtonsMessage)return A;var t=new p.proto.Message.ButtonsMessage;if(A.contentText!=null&&(t.contentText=String(A.contentText)),A.footerText!=null&&(t.footerText=String(A.footerText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.buttons){if(!Array.isArray(A.buttons))throw TypeError(".proto.Message.ButtonsMessage.buttons: array expected");t.buttons=[];for(var s=0;s>>3){case 1:{d.buttonId=s.string();break}case 2:{d.buttonText=p.proto.Message.ButtonsMessage.Button.ButtonText.decode(s,s.uint32());break}case 3:{d.type=s.int32();break}case 4:{d.nativeFlowInfo=p.proto.Message.ButtonsMessage.Button.NativeFlowInfo.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ButtonsMessage.Button)return s;var g=new p.proto.Message.ButtonsMessage.Button;if(s.buttonId!=null&&(g.buttonId=String(s.buttonId)),s.buttonText!=null){if(typeof s.buttonText!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.buttonText: object expected");g.buttonText=p.proto.Message.ButtonsMessage.Button.ButtonText.fromObject(s.buttonText)}switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"UNKNOWN":case 0:g.type=0;break;case"RESPONSE":case 1:g.type=1;break;case"NATIVE_FLOW":case 2:g.type=2;break}if(s.nativeFlowInfo!=null){if(typeof s.nativeFlowInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.nativeFlowInfo: object expected");g.nativeFlowInfo=p.proto.Message.ButtonsMessage.Button.NativeFlowInfo.fromObject(s.nativeFlowInfo)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.buttonId!=null&&s.hasOwnProperty("buttonId")&&(c.buttonId=s.buttonId,g.oneofs&&(c._buttonId="buttonId")),s.buttonText!=null&&s.hasOwnProperty("buttonText")&&(c.buttonText=p.proto.Message.ButtonsMessage.Button.ButtonText.toObject(s.buttonText,g),g.oneofs&&(c._buttonText="buttonText")),s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?p.proto.Message.ButtonsMessage.Button.Type[s.type]===void 0?s.type:p.proto.Message.ButtonsMessage.Button.Type[s.type]:s.type,g.oneofs&&(c._type="type")),s.nativeFlowInfo!=null&&s.hasOwnProperty("nativeFlowInfo")&&(c.nativeFlowInfo=p.proto.Message.ButtonsMessage.Button.NativeFlowInfo.toObject(s.nativeFlowInfo,g),g.oneofs&&(c._nativeFlowInfo="nativeFlowInfo")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ButtonsMessage.Button"},a.ButtonText=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.displayText=c.string();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.ButtonsMessage.Button.ButtonText)return c;var I=new p.proto.Message.ButtonsMessage.Button.ButtonText;return c.displayText!=null&&(I.displayText=String(c.displayText)),I},t.toObject=function(c,I){I||(I={});var d={};return c.displayText!=null&&c.hasOwnProperty("displayText")&&(d.displayText=c.displayText,I.oneofs&&(d._displayText="displayText")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.ButtonText"},t})(),a.NativeFlowInfo=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.name=c.string();break}case 2:{f.paramsJson=c.string();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.ButtonsMessage.Button.NativeFlowInfo)return c;var I=new p.proto.Message.ButtonsMessage.Button.NativeFlowInfo;return c.name!=null&&(I.name=String(c.name)),c.paramsJson!=null&&(I.paramsJson=String(c.paramsJson)),I},t.toObject=function(c,I){I||(I={});var d={};return c.name!=null&&c.hasOwnProperty("name")&&(d.name=c.name,I.oneofs&&(d._name="name")),c.paramsJson!=null&&c.hasOwnProperty("paramsJson")&&(d.paramsJson=c.paramsJson,I.oneofs&&(d._paramsJson="paramsJson")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.NativeFlowInfo"},t})(),a.Type=(function(){let t={},s=Object.create(t);return s[t[0]="UNKNOWN"]=0,s[t[1]="RESPONSE"]=1,s[t[2]="NATIVE_FLOW"]=2,s})(),a})(),i.HeaderType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="EMPTY"]=1,A[a[2]="TEXT"]=2,A[a[3]="DOCUMENT"]=3,A[a[4]="IMAGE"]=4,A[a[5]="VIDEO"]=5,A[a[6]="LOCATION"]=6,A})(),i})(),r.ButtonsResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.selectedButtonId=A.string();break}case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.type=A.int32();break}case 2:{c.selectedDisplayText=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ButtonsResponseMessage)return A;var t=new p.proto.Message.ButtonsResponseMessage;if(A.selectedButtonId!=null&&(t.selectedButtonId=String(A.selectedButtonId)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsResponseMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"UNKNOWN":case 0:t.type=0;break;case"DISPLAY_TEXT":case 1:t.type=1;break}return A.selectedDisplayText!=null&&(t.selectedDisplayText=String(A.selectedDisplayText)),t},i.toObject=function(A,t){t||(t={});var s={};return A.selectedButtonId!=null&&A.hasOwnProperty("selectedButtonId")&&(s.selectedButtonId=A.selectedButtonId,t.oneofs&&(s._selectedButtonId="selectedButtonId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,t.oneofs&&(s.response="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.Message.ButtonsResponseMessage.Type[A.type]===void 0?A.type:p.proto.Message.ButtonsResponseMessage.Type[A.type]:A.type,t.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ButtonsResponseMessage"},i.Type=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="DISPLAY_TEXT"]=1,A})(),i})(),r.Call=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.callKey=A.bytes();break}case 2:{c.conversionSource=A.string();break}case 3:{c.conversionData=A.bytes();break}case 4:{c.conversionDelaySeconds=A.uint32();break}case 5:{c.ctwaSignals=A.string();break}case 6:{c.ctwaPayload=A.bytes();break}case 7:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.nativeFlowCallButtonPayload=A.string();break}case 9:{c.deeplinkPayload=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.Call)return A;var t=new p.proto.Message.Call;if(A.callKey!=null&&(typeof A.callKey=="string"?l.base64.decode(A.callKey,t.callKey=l.newBuffer(l.base64.length(A.callKey)),0):A.callKey.length>=0&&(t.callKey=A.callKey)),A.conversionSource!=null&&(t.conversionSource=String(A.conversionSource)),A.conversionData!=null&&(typeof A.conversionData=="string"?l.base64.decode(A.conversionData,t.conversionData=l.newBuffer(l.base64.length(A.conversionData)),0):A.conversionData.length>=0&&(t.conversionData=A.conversionData)),A.conversionDelaySeconds!=null&&(t.conversionDelaySeconds=A.conversionDelaySeconds>>>0),A.ctwaSignals!=null&&(t.ctwaSignals=String(A.ctwaSignals)),A.ctwaPayload!=null&&(typeof A.ctwaPayload=="string"?l.base64.decode(A.ctwaPayload,t.ctwaPayload=l.newBuffer(l.base64.length(A.ctwaPayload)),0):A.ctwaPayload.length>=0&&(t.ctwaPayload=A.ctwaPayload)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.Call.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return A.nativeFlowCallButtonPayload!=null&&(t.nativeFlowCallButtonPayload=String(A.nativeFlowCallButtonPayload)),A.deeplinkPayload!=null&&(t.deeplinkPayload=String(A.deeplinkPayload)),t},i.toObject=function(A,t){t||(t={});var s={};return A.callKey!=null&&A.hasOwnProperty("callKey")&&(s.callKey=t.bytes===String?l.base64.encode(A.callKey,0,A.callKey.length):t.bytes===Array?Array.prototype.slice.call(A.callKey):A.callKey,t.oneofs&&(s._callKey="callKey")),A.conversionSource!=null&&A.hasOwnProperty("conversionSource")&&(s.conversionSource=A.conversionSource,t.oneofs&&(s._conversionSource="conversionSource")),A.conversionData!=null&&A.hasOwnProperty("conversionData")&&(s.conversionData=t.bytes===String?l.base64.encode(A.conversionData,0,A.conversionData.length):t.bytes===Array?Array.prototype.slice.call(A.conversionData):A.conversionData,t.oneofs&&(s._conversionData="conversionData")),A.conversionDelaySeconds!=null&&A.hasOwnProperty("conversionDelaySeconds")&&(s.conversionDelaySeconds=A.conversionDelaySeconds,t.oneofs&&(s._conversionDelaySeconds="conversionDelaySeconds")),A.ctwaSignals!=null&&A.hasOwnProperty("ctwaSignals")&&(s.ctwaSignals=A.ctwaSignals,t.oneofs&&(s._ctwaSignals="ctwaSignals")),A.ctwaPayload!=null&&A.hasOwnProperty("ctwaPayload")&&(s.ctwaPayload=t.bytes===String?l.base64.encode(A.ctwaPayload,0,A.ctwaPayload.length):t.bytes===Array?Array.prototype.slice.call(A.ctwaPayload):A.ctwaPayload,t.oneofs&&(s._ctwaPayload="ctwaPayload")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.nativeFlowCallButtonPayload!=null&&A.hasOwnProperty("nativeFlowCallButtonPayload")&&(s.nativeFlowCallButtonPayload=A.nativeFlowCallButtonPayload,t.oneofs&&(s._nativeFlowCallButtonPayload="nativeFlowCallButtonPayload")),A.deeplinkPayload!=null&&A.hasOwnProperty("deeplinkPayload")&&(s.deeplinkPayload=A.deeplinkPayload,t.oneofs&&(s._deeplinkPayload="deeplinkPayload")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Call"},i})(),r.CallLogMessage=(function(){function i(a){if(this.participants=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.isVideo=A.bool();break}case 2:{c.callOutcome=A.int32();break}case 3:{c.durationSecs=A.int64();break}case 4:{c.callType=A.int32();break}case 5:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(p.proto.Message.CallLogMessage.CallParticipant.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CallLogMessage)return A;var t=new p.proto.Message.CallLogMessage;switch(A.isVideo!=null&&(t.isVideo=!!A.isVideo),A.callOutcome){default:if(typeof A.callOutcome=="number"){t.callOutcome=A.callOutcome;break}break;case"CONNECTED":case 0:t.callOutcome=0;break;case"MISSED":case 1:t.callOutcome=1;break;case"FAILED":case 2:t.callOutcome=2;break;case"REJECTED":case 3:t.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:t.callOutcome=4;break;case"ONGOING":case 5:t.callOutcome=5;break;case"SILENCED_BY_DND":case 6:t.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:t.callOutcome=7;break}switch(A.durationSecs!=null&&(l.Long?(t.durationSecs=l.Long.fromValue(A.durationSecs)).unsigned=!1:typeof A.durationSecs=="string"?t.durationSecs=parseInt(A.durationSecs,10):typeof A.durationSecs=="number"?t.durationSecs=A.durationSecs:typeof A.durationSecs=="object"&&(t.durationSecs=new l.LongBits(A.durationSecs.low>>>0,A.durationSecs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){t.callType=A.callType;break}break;case"REGULAR":case 0:t.callType=0;break;case"SCHEDULED_CALL":case 1:t.callType=1;break;case"VOICE_CHAT":case 2:t.callType=2;break}if(A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.Message.CallLogMessage.participants: array expected");t.participants=[];for(var s=0;s>>3){case 1:{d.jid=s.string();break}case 2:{d.callOutcome=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.CallLogMessage.CallParticipant)return s;var g=new p.proto.Message.CallLogMessage.CallParticipant;switch(s.jid!=null&&(g.jid=String(s.jid)),s.callOutcome){default:if(typeof s.callOutcome=="number"){g.callOutcome=s.callOutcome;break}break;case"CONNECTED":case 0:g.callOutcome=0;break;case"MISSED":case 1:g.callOutcome=1;break;case"FAILED":case 2:g.callOutcome=2;break;case"REJECTED":case 3:g.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:g.callOutcome=4;break;case"ONGOING":case 5:g.callOutcome=5;break;case"SILENCED_BY_DND":case 6:g.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:g.callOutcome=7;break}return g},a.toObject=function(s,g){g||(g={});var c={};return s.jid!=null&&s.hasOwnProperty("jid")&&(c.jid=s.jid,g.oneofs&&(c._jid="jid")),s.callOutcome!=null&&s.hasOwnProperty("callOutcome")&&(c.callOutcome=g.enums===String?p.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]===void 0?s.callOutcome:p.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]:s.callOutcome,g.oneofs&&(c._callOutcome="callOutcome")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CallLogMessage.CallParticipant"},a})(),i.CallType=(function(){let a={},A=Object.create(a);return A[a[0]="REGULAR"]=0,A[a[1]="SCHEDULED_CALL"]=1,A[a[2]="VOICE_CHAT"]=2,A})(),i})(),r.CancelPaymentRequestMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CancelPaymentRequestMessage)return A;var t=new p.proto.Message.CancelPaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.CancelPaymentRequestMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CancelPaymentRequestMessage"},i})(),r.Chat=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.displayName=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.Chat)return A;var t=new p.proto.Message.Chat;return A.displayName!=null&&(t.displayName=String(A.displayName)),A.id!=null&&(t.id=String(A.id)),t},i.toObject=function(A,t){t||(t={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,t.oneofs&&(s._displayName="displayName")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,t.oneofs&&(s._id="id")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Chat"},i})(),r.CloudAPIThreadControlNotification=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.status=A.int32();break}case 2:{c.senderNotificationTimestampMs=A.int64();break}case 3:{c.consumerLid=A.string();break}case 4:{c.consumerPhoneNumber=A.string();break}case 5:{c.notificationContent=p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.decode(A,A.uint32());break}case 6:{c.shouldSuppressNotification=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CloudAPIThreadControlNotification)return A;var t=new p.proto.Message.CloudAPIThreadControlNotification;switch(A.status){default:if(typeof A.status=="number"){t.status=A.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"CONTROL_PASSED":case 1:t.status=1;break;case"CONTROL_TAKEN":case 2:t.status=2;break}if(A.senderNotificationTimestampMs!=null&&(l.Long?(t.senderNotificationTimestampMs=l.Long.fromValue(A.senderNotificationTimestampMs)).unsigned=!1:typeof A.senderNotificationTimestampMs=="string"?t.senderNotificationTimestampMs=parseInt(A.senderNotificationTimestampMs,10):typeof A.senderNotificationTimestampMs=="number"?t.senderNotificationTimestampMs=A.senderNotificationTimestampMs:typeof A.senderNotificationTimestampMs=="object"&&(t.senderNotificationTimestampMs=new l.LongBits(A.senderNotificationTimestampMs.low>>>0,A.senderNotificationTimestampMs.high>>>0).toNumber())),A.consumerLid!=null&&(t.consumerLid=String(A.consumerLid)),A.consumerPhoneNumber!=null&&(t.consumerPhoneNumber=String(A.consumerPhoneNumber)),A.notificationContent!=null){if(typeof A.notificationContent!="object")throw TypeError(".proto.Message.CloudAPIThreadControlNotification.notificationContent: object expected");t.notificationContent=p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.fromObject(A.notificationContent)}return A.shouldSuppressNotification!=null&&(t.shouldSuppressNotification=!!A.shouldSuppressNotification),t},i.toObject=function(A,t){t||(t={});var s={};return A.status!=null&&A.hasOwnProperty("status")&&(s.status=t.enums===String?p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]===void 0?A.status:p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]:A.status,t.oneofs&&(s._status="status")),A.senderNotificationTimestampMs!=null&&A.hasOwnProperty("senderNotificationTimestampMs")&&(typeof A.senderNotificationTimestampMs=="number"?s.senderNotificationTimestampMs=t.longs===String?String(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs:s.senderNotificationTimestampMs=t.longs===String?oe(A.senderNotificationTimestampMs):t.longs===Number?ne(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs,t.oneofs&&(s._senderNotificationTimestampMs="senderNotificationTimestampMs")),A.consumerLid!=null&&A.hasOwnProperty("consumerLid")&&(s.consumerLid=A.consumerLid,t.oneofs&&(s._consumerLid="consumerLid")),A.consumerPhoneNumber!=null&&A.hasOwnProperty("consumerPhoneNumber")&&(s.consumerPhoneNumber=A.consumerPhoneNumber,t.oneofs&&(s._consumerPhoneNumber="consumerPhoneNumber")),A.notificationContent!=null&&A.hasOwnProperty("notificationContent")&&(s.notificationContent=p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.toObject(A.notificationContent,t),t.oneofs&&(s._notificationContent="notificationContent")),A.shouldSuppressNotification!=null&&A.hasOwnProperty("shouldSuppressNotification")&&(s.shouldSuppressNotification=A.shouldSuppressNotification,t.oneofs&&(s._shouldSuppressNotification="shouldSuppressNotification")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CloudAPIThreadControlNotification"},i.CloudAPIThreadControl=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="CONTROL_PASSED"]=1,A[a[2]="CONTROL_TAKEN"]=2,A})(),i.CloudAPIThreadControlNotificationContent=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.handoffNotificationText=s.string();break}case 2:{d.extraJson=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent)return s;var g=new p.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent;return s.handoffNotificationText!=null&&(g.handoffNotificationText=String(s.handoffNotificationText)),s.extraJson!=null&&(g.extraJson=String(s.extraJson)),g},a.toObject=function(s,g){g||(g={});var c={};return s.handoffNotificationText!=null&&s.hasOwnProperty("handoffNotificationText")&&(c.handoffNotificationText=s.handoffNotificationText,g.oneofs&&(c._handoffNotificationText="handoffNotificationText")),s.extraJson!=null&&s.hasOwnProperty("extraJson")&&(c.extraJson=s.extraJson,g.oneofs&&(c._extraJson="extraJson")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent"},a})(),i})(),r.CommentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.message=p.proto.Message.decode(A,A.uint32());break}case 2:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.CommentMessage)return A;var t=new p.proto.Message.CommentMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.CommentMessage.message: object expected");t.message=p.proto.Message.fromObject(A.message)}if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.CommentMessage.targetMessageKey: object expected");t.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=p.proto.Message.toObject(A.message,t),t.oneofs&&(s._message="message")),A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,t),t.oneofs&&(s._targetMessageKey="targetMessageKey")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CommentMessage"},i})(),r.ContactMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.displayName=A.string();break}case 16:{c.vcard=A.string();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ContactMessage)return A;var t=new p.proto.Message.ContactMessage;if(A.displayName!=null&&(t.displayName=String(A.displayName)),A.vcard!=null&&(t.vcard=String(A.vcard)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ContactMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,t.oneofs&&(s._displayName="displayName")),A.vcard!=null&&A.hasOwnProperty("vcard")&&(s.vcard=A.vcard,t.oneofs&&(s._vcard="vcard")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ContactMessage"},i})(),r.ContactsArrayMessage=(function(){function i(a){if(this.contacts=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.displayName=A.string();break}case 2:{c.contacts&&c.contacts.length||(c.contacts=[]),c.contacts.push(p.proto.Message.ContactMessage.decode(A,A.uint32()));break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ContactsArrayMessage)return A;var t=new p.proto.Message.ContactsArrayMessage;if(A.displayName!=null&&(t.displayName=String(A.displayName)),A.contacts){if(!Array.isArray(A.contacts))throw TypeError(".proto.Message.ContactsArrayMessage.contacts: array expected");t.contacts=[];for(var s=0;s>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.DeclinePaymentRequestMessage)return A;var t=new p.proto.Message.DeclinePaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.DeclinePaymentRequestMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeclinePaymentRequestMessage"},i})(),r.DeviceSentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.destinationJid=A.string();break}case 2:{c.message=p.proto.Message.decode(A,A.uint32());break}case 3:{c.phash=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.DeviceSentMessage)return A;var t=new p.proto.Message.DeviceSentMessage;if(A.destinationJid!=null&&(t.destinationJid=String(A.destinationJid)),A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.DeviceSentMessage.message: object expected");t.message=p.proto.Message.fromObject(A.message)}return A.phash!=null&&(t.phash=String(A.phash)),t},i.toObject=function(A,t){t||(t={});var s={};return A.destinationJid!=null&&A.hasOwnProperty("destinationJid")&&(s.destinationJid=A.destinationJid,t.oneofs&&(s._destinationJid="destinationJid")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=p.proto.Message.toObject(A.message,t),t.oneofs&&(s._message="message")),A.phash!=null&&A.hasOwnProperty("phash")&&(s.phash=A.phash,t.oneofs&&(s._phash="phash")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeviceSentMessage"},i})(),r.DocumentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.title=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.pageCount=A.uint32();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileName=A.string();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.directPath=A.string();break}case 11:{c.mediaKeyTimestamp=A.int64();break}case 12:{c.contactVcard=A.bool();break}case 13:{c.thumbnailDirectPath=A.string();break}case 14:{c.thumbnailSha256=A.bytes();break}case 15:{c.thumbnailEncSha256=A.bytes();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.caption=A.string();break}case 21:{c.accessibilityLabel=A.string();break}case 22:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.DocumentMessage)return A;var t=new p.proto.Message.DocumentMessage;if(A.url!=null&&(t.url=String(A.url)),A.mimetype!=null&&(t.mimetype=String(A.mimetype)),A.title!=null&&(t.title=String(A.title)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,t.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(t.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(t.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?t.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?t.fileLength=A.fileLength:typeof A.fileLength=="object"&&(t.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.pageCount!=null&&(t.pageCount=A.pageCount>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.fileName!=null&&(t.fileName=String(A.fileName)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(t.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(t.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?t.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?t.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(t.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contactVcard!=null&&(t.contactVcard=!!A.contactVcard),A.thumbnailDirectPath!=null&&(t.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,t.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(t.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,t.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(t.thumbnailEncSha256=A.thumbnailEncSha256)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.DocumentMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.thumbnailHeight!=null&&(t.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(t.thumbnailWidth=A.thumbnailWidth>>>0),A.caption!=null&&(t.caption=String(A.caption)),A.accessibilityLabel!=null&&(t.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){t.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:t.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:t.mediaKeyDomain=1;break;case"STATUS":case 2:t.mediaKeyDomain=2;break;case"CAPI":case 3:t.mediaKeyDomain=3;break;case"BOT":case 4:t.mediaKeyDomain=4;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,t.oneofs&&(s._mimetype="mimetype")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,t.oneofs&&(s._title="title")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=t.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,t.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=t.longs===String?String(A.fileLength):A.fileLength:s.fileLength=t.longs===String?oe(A.fileLength,!0):t.longs===Number?ne(A.fileLength,!0):A.fileLength,t.oneofs&&(s._fileLength="fileLength")),A.pageCount!=null&&A.hasOwnProperty("pageCount")&&(s.pageCount=A.pageCount,t.oneofs&&(s._pageCount="pageCount")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=t.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,t.oneofs&&(s._mediaKey="mediaKey")),A.fileName!=null&&A.hasOwnProperty("fileName")&&(s.fileName=A.fileName,t.oneofs&&(s._fileName="fileName")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=t.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,t.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,t.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=t.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=t.longs===String?oe(A.mediaKeyTimestamp):t.longs===Number?ne(A.mediaKeyTimestamp):A.mediaKeyTimestamp,t.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contactVcard!=null&&A.hasOwnProperty("contactVcard")&&(s.contactVcard=A.contactVcard,t.oneofs&&(s._contactVcard="contactVcard")),A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,t.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=t.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):t.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,t.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=t.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,t.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=t.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,t.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,t.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,t.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,t.oneofs&&(s._caption="caption")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,t.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=t.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,t.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DocumentMessage"},i})(),r.EncCommentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EncCommentMessage)return A;var t=new p.proto.Message.EncCommentMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncCommentMessage.targetMessageKey: object expected");t.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,t.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(t.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,t.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(t.encIv=A.encIv)),t},i.toObject=function(A,t){t||(t={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,t),t.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=t.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):t.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,t.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=t.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):t.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,t.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncCommentMessage"},i})(),r.EncEventResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.eventCreationMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EncEventResponseMessage)return A;var t=new p.proto.Message.EncEventResponseMessage;if(A.eventCreationMessageKey!=null){if(typeof A.eventCreationMessageKey!="object")throw TypeError(".proto.Message.EncEventResponseMessage.eventCreationMessageKey: object expected");t.eventCreationMessageKey=p.proto.MessageKey.fromObject(A.eventCreationMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,t.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(t.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,t.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(t.encIv=A.encIv)),t},i.toObject=function(A,t){t||(t={});var s={};return A.eventCreationMessageKey!=null&&A.hasOwnProperty("eventCreationMessageKey")&&(s.eventCreationMessageKey=p.proto.MessageKey.toObject(A.eventCreationMessageKey,t),t.oneofs&&(s._eventCreationMessageKey="eventCreationMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=t.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):t.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,t.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=t.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):t.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,t.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncEventResponseMessage"},i})(),r.EncReactionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EncReactionMessage)return A;var t=new p.proto.Message.EncReactionMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncReactionMessage.targetMessageKey: object expected");t.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,t.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(t.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,t.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(t.encIv=A.encIv)),t},i.toObject=function(A,t){t||(t={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,t),t.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=t.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):t.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,t.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=t.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):t.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,t.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncReactionMessage"},i})(),r.EventMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.isCanceled=A.bool();break}case 3:{c.name=A.string();break}case 4:{c.description=A.string();break}case 5:{c.location=p.proto.Message.LocationMessage.decode(A,A.uint32());break}case 6:{c.joinLink=A.string();break}case 7:{c.startTime=A.int64();break}case 8:{c.endTime=A.int64();break}case 9:{c.extraGuestsAllowed=A.bool();break}case 10:{c.isScheduleCall=A.bool();break}case 11:{c.hasReminder=A.bool();break}case 12:{c.reminderOffsetSec=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EventMessage)return A;var t=new p.proto.Message.EventMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.EventMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.isCanceled!=null&&(t.isCanceled=!!A.isCanceled),A.name!=null&&(t.name=String(A.name)),A.description!=null&&(t.description=String(A.description)),A.location!=null){if(typeof A.location!="object")throw TypeError(".proto.Message.EventMessage.location: object expected");t.location=p.proto.Message.LocationMessage.fromObject(A.location)}return A.joinLink!=null&&(t.joinLink=String(A.joinLink)),A.startTime!=null&&(l.Long?(t.startTime=l.Long.fromValue(A.startTime)).unsigned=!1:typeof A.startTime=="string"?t.startTime=parseInt(A.startTime,10):typeof A.startTime=="number"?t.startTime=A.startTime:typeof A.startTime=="object"&&(t.startTime=new l.LongBits(A.startTime.low>>>0,A.startTime.high>>>0).toNumber())),A.endTime!=null&&(l.Long?(t.endTime=l.Long.fromValue(A.endTime)).unsigned=!1:typeof A.endTime=="string"?t.endTime=parseInt(A.endTime,10):typeof A.endTime=="number"?t.endTime=A.endTime:typeof A.endTime=="object"&&(t.endTime=new l.LongBits(A.endTime.low>>>0,A.endTime.high>>>0).toNumber())),A.extraGuestsAllowed!=null&&(t.extraGuestsAllowed=!!A.extraGuestsAllowed),A.isScheduleCall!=null&&(t.isScheduleCall=!!A.isScheduleCall),A.hasReminder!=null&&(t.hasReminder=!!A.hasReminder),A.reminderOffsetSec!=null&&(l.Long?(t.reminderOffsetSec=l.Long.fromValue(A.reminderOffsetSec)).unsigned=!1:typeof A.reminderOffsetSec=="string"?t.reminderOffsetSec=parseInt(A.reminderOffsetSec,10):typeof A.reminderOffsetSec=="number"?t.reminderOffsetSec=A.reminderOffsetSec:typeof A.reminderOffsetSec=="object"&&(t.reminderOffsetSec=new l.LongBits(A.reminderOffsetSec.low>>>0,A.reminderOffsetSec.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.isCanceled!=null&&A.hasOwnProperty("isCanceled")&&(s.isCanceled=A.isCanceled,t.oneofs&&(s._isCanceled="isCanceled")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,t.oneofs&&(s._description="description")),A.location!=null&&A.hasOwnProperty("location")&&(s.location=p.proto.Message.LocationMessage.toObject(A.location,t),t.oneofs&&(s._location="location")),A.joinLink!=null&&A.hasOwnProperty("joinLink")&&(s.joinLink=A.joinLink,t.oneofs&&(s._joinLink="joinLink")),A.startTime!=null&&A.hasOwnProperty("startTime")&&(typeof A.startTime=="number"?s.startTime=t.longs===String?String(A.startTime):A.startTime:s.startTime=t.longs===String?oe(A.startTime):t.longs===Number?ne(A.startTime):A.startTime,t.oneofs&&(s._startTime="startTime")),A.endTime!=null&&A.hasOwnProperty("endTime")&&(typeof A.endTime=="number"?s.endTime=t.longs===String?String(A.endTime):A.endTime:s.endTime=t.longs===String?oe(A.endTime):t.longs===Number?ne(A.endTime):A.endTime,t.oneofs&&(s._endTime="endTime")),A.extraGuestsAllowed!=null&&A.hasOwnProperty("extraGuestsAllowed")&&(s.extraGuestsAllowed=A.extraGuestsAllowed,t.oneofs&&(s._extraGuestsAllowed="extraGuestsAllowed")),A.isScheduleCall!=null&&A.hasOwnProperty("isScheduleCall")&&(s.isScheduleCall=A.isScheduleCall,t.oneofs&&(s._isScheduleCall="isScheduleCall")),A.hasReminder!=null&&A.hasOwnProperty("hasReminder")&&(s.hasReminder=A.hasReminder,t.oneofs&&(s._hasReminder="hasReminder")),A.reminderOffsetSec!=null&&A.hasOwnProperty("reminderOffsetSec")&&(typeof A.reminderOffsetSec=="number"?s.reminderOffsetSec=t.longs===String?String(A.reminderOffsetSec):A.reminderOffsetSec:s.reminderOffsetSec=t.longs===String?oe(A.reminderOffsetSec):t.longs===Number?ne(A.reminderOffsetSec):A.reminderOffsetSec,t.oneofs&&(s._reminderOffsetSec="reminderOffsetSec")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventMessage"},i})(),r.EventResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.response=A.int32();break}case 2:{c.timestampMs=A.int64();break}case 3:{c.extraGuestCount=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.EventResponseMessage)return A;var t=new p.proto.Message.EventResponseMessage;switch(A.response){default:if(typeof A.response=="number"){t.response=A.response;break}break;case"UNKNOWN":case 0:t.response=0;break;case"GOING":case 1:t.response=1;break;case"NOT_GOING":case 2:t.response=2;break;case"MAYBE":case 3:t.response=3;break}return A.timestampMs!=null&&(l.Long?(t.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?t.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?t.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(t.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.extraGuestCount!=null&&(t.extraGuestCount=A.extraGuestCount|0),t},i.toObject=function(A,t){t||(t={});var s={};return A.response!=null&&A.hasOwnProperty("response")&&(s.response=t.enums===String?p.proto.Message.EventResponseMessage.EventResponseType[A.response]===void 0?A.response:p.proto.Message.EventResponseMessage.EventResponseType[A.response]:A.response,t.oneofs&&(s._response="response")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=t.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=t.longs===String?oe(A.timestampMs):t.longs===Number?ne(A.timestampMs):A.timestampMs,t.oneofs&&(s._timestampMs="timestampMs")),A.extraGuestCount!=null&&A.hasOwnProperty("extraGuestCount")&&(s.extraGuestCount=A.extraGuestCount,t.oneofs&&(s._extraGuestCount="extraGuestCount")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventResponseMessage"},i.EventResponseType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="GOING"]=1,A[a[2]="NOT_GOING"]=2,A[a[3]="MAYBE"]=3,A})(),i})(),r.ExtendedTextMessage=(function(){function i(a){if(this.endCardTiles=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.text=A.string();break}case 2:{c.matchedText=A.string();break}case 5:{c.description=A.string();break}case 6:{c.title=A.string();break}case 7:{c.textArgb=A.fixed32();break}case 8:{c.backgroundArgb=A.fixed32();break}case 9:{c.font=A.int32();break}case 10:{c.previewType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.doNotPlayInline=A.bool();break}case 19:{c.thumbnailDirectPath=A.string();break}case 20:{c.thumbnailSha256=A.bytes();break}case 21:{c.thumbnailEncSha256=A.bytes();break}case 22:{c.mediaKey=A.bytes();break}case 23:{c.mediaKeyTimestamp=A.int64();break}case 24:{c.thumbnailHeight=A.uint32();break}case 25:{c.thumbnailWidth=A.uint32();break}case 26:{c.inviteLinkGroupType=A.int32();break}case 27:{c.inviteLinkParentGroupSubjectV2=A.string();break}case 28:{c.inviteLinkParentGroupThumbnailV2=A.bytes();break}case 29:{c.inviteLinkGroupTypeV2=A.int32();break}case 30:{c.viewOnce=A.bool();break}case 31:{c.videoHeight=A.uint32();break}case 32:{c.videoWidth=A.uint32();break}case 33:{c.faviconMMSMetadata=p.proto.Message.MMSThumbnailMetadata.decode(A,A.uint32());break}case 34:{c.linkPreviewMetadata=p.proto.Message.LinkPreviewMetadata.decode(A,A.uint32());break}case 35:{c.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 36:{c.endCardTiles&&c.endCardTiles.length||(c.endCardTiles=[]),c.endCardTiles.push(p.proto.Message.VideoEndCard.decode(A,A.uint32()));break}case 37:{c.videoContentUrl=A.string();break}case 38:{c.musicMetadata=p.proto.EmbeddedMusic.decode(A,A.uint32());break}case 39:{c.paymentExtendedMetadata=p.proto.Message.PaymentExtendedMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ExtendedTextMessage)return A;var t=new p.proto.Message.ExtendedTextMessage;switch(A.text!=null&&(t.text=String(A.text)),A.matchedText!=null&&(t.matchedText=String(A.matchedText)),A.description!=null&&(t.description=String(A.description)),A.title!=null&&(t.title=String(A.title)),A.textArgb!=null&&(t.textArgb=A.textArgb>>>0),A.backgroundArgb!=null&&(t.backgroundArgb=A.backgroundArgb>>>0),A.font){default:if(typeof A.font=="number"){t.font=A.font;break}break;case"SYSTEM":case 0:t.font=0;break;case"SYSTEM_TEXT":case 1:t.font=1;break;case"FB_SCRIPT":case 2:t.font=2;break;case"SYSTEM_BOLD":case 6:t.font=6;break;case"MORNINGBREEZE_REGULAR":case 7:t.font=7;break;case"CALISTOGA_REGULAR":case 8:t.font=8;break;case"EXO2_EXTRABOLD":case 9:t.font=9;break;case"COURIERPRIME_BOLD":case 10:t.font=10;break}switch(A.previewType){default:if(typeof A.previewType=="number"){t.previewType=A.previewType;break}break;case"NONE":case 0:t.previewType=0;break;case"VIDEO":case 1:t.previewType=1;break;case"PLACEHOLDER":case 4:t.previewType=4;break;case"IMAGE":case 5:t.previewType=5;break;case"PAYMENT_LINKS":case 6:t.previewType=6;break;case"PROFILE":case 7:t.previewType=7;break}if(A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ExtendedTextMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.doNotPlayInline!=null&&(t.doNotPlayInline=!!A.doNotPlayInline),A.thumbnailDirectPath!=null&&(t.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,t.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(t.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,t.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(t.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(t.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?t.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?t.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(t.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(t.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(t.thumbnailWidth=A.thumbnailWidth>>>0),A.inviteLinkGroupType){default:if(typeof A.inviteLinkGroupType=="number"){t.inviteLinkGroupType=A.inviteLinkGroupType;break}break;case"DEFAULT":case 0:t.inviteLinkGroupType=0;break;case"PARENT":case 1:t.inviteLinkGroupType=1;break;case"SUB":case 2:t.inviteLinkGroupType=2;break;case"DEFAULT_SUB":case 3:t.inviteLinkGroupType=3;break}switch(A.inviteLinkParentGroupSubjectV2!=null&&(t.inviteLinkParentGroupSubjectV2=String(A.inviteLinkParentGroupSubjectV2)),A.inviteLinkParentGroupThumbnailV2!=null&&(typeof A.inviteLinkParentGroupThumbnailV2=="string"?l.base64.decode(A.inviteLinkParentGroupThumbnailV2,t.inviteLinkParentGroupThumbnailV2=l.newBuffer(l.base64.length(A.inviteLinkParentGroupThumbnailV2)),0):A.inviteLinkParentGroupThumbnailV2.length>=0&&(t.inviteLinkParentGroupThumbnailV2=A.inviteLinkParentGroupThumbnailV2)),A.inviteLinkGroupTypeV2){default:if(typeof A.inviteLinkGroupTypeV2=="number"){t.inviteLinkGroupTypeV2=A.inviteLinkGroupTypeV2;break}break;case"DEFAULT":case 0:t.inviteLinkGroupTypeV2=0;break;case"PARENT":case 1:t.inviteLinkGroupTypeV2=1;break;case"SUB":case 2:t.inviteLinkGroupTypeV2=2;break;case"DEFAULT_SUB":case 3:t.inviteLinkGroupTypeV2=3;break}if(A.viewOnce!=null&&(t.viewOnce=!!A.viewOnce),A.videoHeight!=null&&(t.videoHeight=A.videoHeight>>>0),A.videoWidth!=null&&(t.videoWidth=A.videoWidth>>>0),A.faviconMMSMetadata!=null){if(typeof A.faviconMMSMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.faviconMMSMetadata: object expected");t.faviconMMSMetadata=p.proto.Message.MMSThumbnailMetadata.fromObject(A.faviconMMSMetadata)}if(A.linkPreviewMetadata!=null){if(typeof A.linkPreviewMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.linkPreviewMetadata: object expected");t.linkPreviewMetadata=p.proto.Message.LinkPreviewMetadata.fromObject(A.linkPreviewMetadata)}if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.paymentLinkMetadata: object expected");t.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.endCardTiles){if(!Array.isArray(A.endCardTiles))throw TypeError(".proto.Message.ExtendedTextMessage.endCardTiles: array expected");t.endCardTiles=[];for(var s=0;s>>3){case 1:{c.requestId=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.FullHistorySyncOnDemandRequestMetadata)return A;var t=new p.proto.Message.FullHistorySyncOnDemandRequestMetadata;return A.requestId!=null&&(t.requestId=String(A.requestId)),t},i.toObject=function(A,t){t||(t={});var s={};return A.requestId!=null&&A.hasOwnProperty("requestId")&&(s.requestId=A.requestId,t.oneofs&&(s._requestId="requestId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FullHistorySyncOnDemandRequestMetadata"},i})(),r.FutureProofMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.message=p.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.FutureProofMessage)return A;var t=new p.proto.Message.FutureProofMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.FutureProofMessage.message: object expected");t.message=p.proto.Message.fromObject(A.message)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=p.proto.Message.toObject(A.message,t),t.oneofs&&(s._message="message")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FutureProofMessage"},i})(),r.GroupInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.groupJid=A.string();break}case 2:{c.inviteCode=A.string();break}case 3:{c.inviteExpiration=A.int64();break}case 4:{c.groupName=A.string();break}case 5:{c.jpegThumbnail=A.bytes();break}case 6:{c.caption=A.string();break}case 7:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.groupType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.GroupInviteMessage)return A;var t=new p.proto.Message.GroupInviteMessage;if(A.groupJid!=null&&(t.groupJid=String(A.groupJid)),A.inviteCode!=null&&(t.inviteCode=String(A.inviteCode)),A.inviteExpiration!=null&&(l.Long?(t.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?t.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?t.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(t.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.groupName!=null&&(t.groupName=String(A.groupName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(t.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.GroupInviteMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.groupType){default:if(typeof A.groupType=="number"){t.groupType=A.groupType;break}break;case"DEFAULT":case 0:t.groupType=0;break;case"PARENT":case 1:t.groupType=1;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.groupJid!=null&&A.hasOwnProperty("groupJid")&&(s.groupJid=A.groupJid,t.oneofs&&(s._groupJid="groupJid")),A.inviteCode!=null&&A.hasOwnProperty("inviteCode")&&(s.inviteCode=A.inviteCode,t.oneofs&&(s._inviteCode="inviteCode")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=t.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=t.longs===String?oe(A.inviteExpiration):t.longs===Number?ne(A.inviteExpiration):A.inviteExpiration,t.oneofs&&(s._inviteExpiration="inviteExpiration")),A.groupName!=null&&A.hasOwnProperty("groupName")&&(s.groupName=A.groupName,t.oneofs&&(s._groupName="groupName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=t.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,t.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,t.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.groupType!=null&&A.hasOwnProperty("groupType")&&(s.groupType=t.enums===String?p.proto.Message.GroupInviteMessage.GroupType[A.groupType]===void 0?A.groupType:p.proto.Message.GroupInviteMessage.GroupType[A.groupType]:A.groupType,t.oneofs&&(s._groupType="groupType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.GroupInviteMessage"},i.GroupType=(function(){let a={},A=Object.create(a);return A[a[0]="DEFAULT"]=0,A[a[1]="PARENT"]=1,A})(),i})(),r.HighlyStructuredMessage=(function(){function i(a){if(this.params=[],this.localizableParams=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.namespace=A.string();break}case 2:{c.elementName=A.string();break}case 3:{c.params&&c.params.length||(c.params=[]),c.params.push(A.string());break}case 4:{c.fallbackLg=A.string();break}case 5:{c.fallbackLc=A.string();break}case 6:{c.localizableParams&&c.localizableParams.length||(c.localizableParams=[]),c.localizableParams.push(p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.decode(A,A.uint32()));break}case 7:{c.deterministicLg=A.string();break}case 8:{c.deterministicLc=A.string();break}case 9:{c.hydratedHsm=p.proto.Message.TemplateMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.HighlyStructuredMessage)return A;var t=new p.proto.Message.HighlyStructuredMessage;if(A.namespace!=null&&(t.namespace=String(A.namespace)),A.elementName!=null&&(t.elementName=String(A.elementName)),A.params){if(!Array.isArray(A.params))throw TypeError(".proto.Message.HighlyStructuredMessage.params: array expected");t.params=[];for(var s=0;s>>3){case 1:{d.default=s.string();break}case 2:{d.currency=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.decode(s,s.uint32());break}case 3:{d.dateTime=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter)return s;var g=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter;if(s.default!=null&&(g.default=String(s.default)),s.currency!=null){if(typeof s.currency!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.currency: object expected");g.currency=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.fromObject(s.currency)}if(s.dateTime!=null){if(typeof s.dateTime!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.dateTime: object expected");g.dateTime=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.fromObject(s.dateTime)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.default!=null&&s.hasOwnProperty("default")&&(c.default=s.default,g.oneofs&&(c._default="default")),s.currency!=null&&s.hasOwnProperty("currency")&&(c.currency=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.toObject(s.currency,g),g.oneofs&&(c.paramOneof="currency")),s.dateTime!=null&&s.hasOwnProperty("dateTime")&&(c.dateTime=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.toObject(s.dateTime,g),g.oneofs&&(c.paramOneof="dateTime")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter"},a.HSMCurrency=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.currencyCode=c.string();break}case 2:{f.amount1000=c.int64();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency)return c;var I=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency;return c.currencyCode!=null&&(I.currencyCode=String(c.currencyCode)),c.amount1000!=null&&(l.Long?(I.amount1000=l.Long.fromValue(c.amount1000)).unsigned=!1:typeof c.amount1000=="string"?I.amount1000=parseInt(c.amount1000,10):typeof c.amount1000=="number"?I.amount1000=c.amount1000:typeof c.amount1000=="object"&&(I.amount1000=new l.LongBits(c.amount1000.low>>>0,c.amount1000.high>>>0).toNumber())),I},t.toObject=function(c,I){I||(I={});var d={};return c.currencyCode!=null&&c.hasOwnProperty("currencyCode")&&(d.currencyCode=c.currencyCode,I.oneofs&&(d._currencyCode="currencyCode")),c.amount1000!=null&&c.hasOwnProperty("amount1000")&&(typeof c.amount1000=="number"?d.amount1000=I.longs===String?String(c.amount1000):c.amount1000:d.amount1000=I.longs===String?oe(c.amount1000):I.longs===Number?ne(c.amount1000):c.amount1000,I.oneofs&&(d._amount1000="amount1000")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency"},t})(),a.HSMDateTime=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.component=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.decode(c,c.uint32());break}case 2:{f.unixEpoch=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime)return c;var I=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime;if(c.component!=null){if(typeof c.component!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component: object expected");I.component=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.fromObject(c.component)}if(c.unixEpoch!=null){if(typeof c.unixEpoch!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch: object expected");I.unixEpoch=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.fromObject(c.unixEpoch)}return I},t.toObject=function(c,I){I||(I={});var d={};return c.component!=null&&c.hasOwnProperty("component")&&(d.component=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.toObject(c.component,I),I.oneofs&&(d.datetimeOneof="component")),c.unixEpoch!=null&&c.hasOwnProperty("unixEpoch")&&(d.unixEpoch=p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.toObject(c.unixEpoch,I),I.oneofs&&(d.datetimeOneof="unixEpoch")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime"},t.HSMDateTimeComponent=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.dayOfWeek=d.int32();break}case 2:{y.year=d.uint32();break}case 3:{y.month=d.uint32();break}case 4:{y.dayOfMonth=d.uint32();break}case 5:{y.hour=d.uint32();break}case 6:{y.minute=d.uint32();break}case 7:{y.calendar=d.int32();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent)return d;var B=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent;switch(d.dayOfWeek){default:if(typeof d.dayOfWeek=="number"){B.dayOfWeek=d.dayOfWeek;break}break;case"MONDAY":case 1:B.dayOfWeek=1;break;case"TUESDAY":case 2:B.dayOfWeek=2;break;case"WEDNESDAY":case 3:B.dayOfWeek=3;break;case"THURSDAY":case 4:B.dayOfWeek=4;break;case"FRIDAY":case 5:B.dayOfWeek=5;break;case"SATURDAY":case 6:B.dayOfWeek=6;break;case"SUNDAY":case 7:B.dayOfWeek=7;break}switch(d.year!=null&&(B.year=d.year>>>0),d.month!=null&&(B.month=d.month>>>0),d.dayOfMonth!=null&&(B.dayOfMonth=d.dayOfMonth>>>0),d.hour!=null&&(B.hour=d.hour>>>0),d.minute!=null&&(B.minute=d.minute>>>0),d.calendar){default:if(typeof d.calendar=="number"){B.calendar=d.calendar;break}break;case"GREGORIAN":case 1:B.calendar=1;break;case"SOLAR_HIJRI":case 2:B.calendar=2;break}return B},g.toObject=function(d,B){B||(B={});var f={};return d.dayOfWeek!=null&&d.hasOwnProperty("dayOfWeek")&&(f.dayOfWeek=B.enums===String?p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[d.dayOfWeek]===void 0?d.dayOfWeek:p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[d.dayOfWeek]:d.dayOfWeek,B.oneofs&&(f._dayOfWeek="dayOfWeek")),d.year!=null&&d.hasOwnProperty("year")&&(f.year=d.year,B.oneofs&&(f._year="year")),d.month!=null&&d.hasOwnProperty("month")&&(f.month=d.month,B.oneofs&&(f._month="month")),d.dayOfMonth!=null&&d.hasOwnProperty("dayOfMonth")&&(f.dayOfMonth=d.dayOfMonth,B.oneofs&&(f._dayOfMonth="dayOfMonth")),d.hour!=null&&d.hasOwnProperty("hour")&&(f.hour=d.hour,B.oneofs&&(f._hour="hour")),d.minute!=null&&d.hasOwnProperty("minute")&&(f.minute=d.minute,B.oneofs&&(f._minute="minute")),d.calendar!=null&&d.hasOwnProperty("calendar")&&(f.calendar=B.enums===String?p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[d.calendar]===void 0?d.calendar:p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[d.calendar]:d.calendar,B.oneofs&&(f._calendar="calendar")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent"},g.CalendarType=(function(){let I={},d=Object.create(I);return d[I[1]="GREGORIAN"]=1,d[I[2]="SOLAR_HIJRI"]=2,d})(),g.DayOfWeekType=(function(){let I={},d=Object.create(I);return d[I[1]="MONDAY"]=1,d[I[2]="TUESDAY"]=2,d[I[3]="WEDNESDAY"]=3,d[I[4]="THURSDAY"]=4,d[I[5]="FRIDAY"]=5,d[I[6]="SATURDAY"]=6,d[I[7]="SUNDAY"]=7,d})(),g})(),t.HSMDateTimeUnixEpoch=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.timestamp=d.int64();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch)return d;var B=new p.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch;return d.timestamp!=null&&(l.Long?(B.timestamp=l.Long.fromValue(d.timestamp)).unsigned=!1:typeof d.timestamp=="string"?B.timestamp=parseInt(d.timestamp,10):typeof d.timestamp=="number"?B.timestamp=d.timestamp:typeof d.timestamp=="object"&&(B.timestamp=new l.LongBits(d.timestamp.low>>>0,d.timestamp.high>>>0).toNumber())),B},g.toObject=function(d,B){B||(B={});var f={};return d.timestamp!=null&&d.hasOwnProperty("timestamp")&&(typeof d.timestamp=="number"?f.timestamp=B.longs===String?String(d.timestamp):d.timestamp:f.timestamp=B.longs===String?oe(d.timestamp):B.longs===Number?ne(d.timestamp):d.timestamp,B.oneofs&&(f._timestamp="timestamp")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch"},g})(),t})(),a})(),i})(),r.HistorySyncMessageAccessStatus=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.completeAccessGranted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.HistorySyncMessageAccessStatus)return A;var t=new p.proto.Message.HistorySyncMessageAccessStatus;return A.completeAccessGranted!=null&&(t.completeAccessGranted=!!A.completeAccessGranted),t},i.toObject=function(A,t){t||(t={});var s={};return A.completeAccessGranted!=null&&A.hasOwnProperty("completeAccessGranted")&&(s.completeAccessGranted=A.completeAccessGranted,t.oneofs&&(s._completeAccessGranted="completeAccessGranted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncMessageAccessStatus"},i})(),r.HistorySyncNotification=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.fileSha256=A.bytes();break}case 2:{c.fileLength=A.uint64();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.syncType=A.int32();break}case 7:{c.chunkOrder=A.uint32();break}case 8:{c.originalMessageId=A.string();break}case 9:{c.progress=A.uint32();break}case 10:{c.oldestMsgInChunkTimestampSec=A.int64();break}case 11:{c.initialHistBootstrapInlinePayload=A.bytes();break}case 12:{c.peerDataRequestSessionId=A.string();break}case 13:{c.fullHistorySyncOnDemandRequestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(A,A.uint32());break}case 14:{c.encHandle=A.string();break}case 15:{c.messageAccessStatus=p.proto.Message.HistorySyncMessageAccessStatus.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.HistorySyncNotification)return A;var t=new p.proto.Message.HistorySyncNotification;switch(A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,t.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(t.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(t.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?t.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?t.fileLength=A.fileLength:typeof A.fileLength=="object"&&(t.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(t.directPath=String(A.directPath)),A.syncType){default:if(typeof A.syncType=="number"){t.syncType=A.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:t.syncType=0;break;case"INITIAL_STATUS_V3":case 1:t.syncType=1;break;case"FULL":case 2:t.syncType=2;break;case"RECENT":case 3:t.syncType=3;break;case"PUSH_NAME":case 4:t.syncType=4;break;case"NON_BLOCKING_DATA":case 5:t.syncType=5;break;case"ON_DEMAND":case 6:t.syncType=6;break;case"NO_HISTORY":case 7:t.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:t.syncType=8;break}if(A.chunkOrder!=null&&(t.chunkOrder=A.chunkOrder>>>0),A.originalMessageId!=null&&(t.originalMessageId=String(A.originalMessageId)),A.progress!=null&&(t.progress=A.progress>>>0),A.oldestMsgInChunkTimestampSec!=null&&(l.Long?(t.oldestMsgInChunkTimestampSec=l.Long.fromValue(A.oldestMsgInChunkTimestampSec)).unsigned=!1:typeof A.oldestMsgInChunkTimestampSec=="string"?t.oldestMsgInChunkTimestampSec=parseInt(A.oldestMsgInChunkTimestampSec,10):typeof A.oldestMsgInChunkTimestampSec=="number"?t.oldestMsgInChunkTimestampSec=A.oldestMsgInChunkTimestampSec:typeof A.oldestMsgInChunkTimestampSec=="object"&&(t.oldestMsgInChunkTimestampSec=new l.LongBits(A.oldestMsgInChunkTimestampSec.low>>>0,A.oldestMsgInChunkTimestampSec.high>>>0).toNumber())),A.initialHistBootstrapInlinePayload!=null&&(typeof A.initialHistBootstrapInlinePayload=="string"?l.base64.decode(A.initialHistBootstrapInlinePayload,t.initialHistBootstrapInlinePayload=l.newBuffer(l.base64.length(A.initialHistBootstrapInlinePayload)),0):A.initialHistBootstrapInlinePayload.length>=0&&(t.initialHistBootstrapInlinePayload=A.initialHistBootstrapInlinePayload)),A.peerDataRequestSessionId!=null&&(t.peerDataRequestSessionId=String(A.peerDataRequestSessionId)),A.fullHistorySyncOnDemandRequestMetadata!=null){if(typeof A.fullHistorySyncOnDemandRequestMetadata!="object")throw TypeError(".proto.Message.HistorySyncNotification.fullHistorySyncOnDemandRequestMetadata: object expected");t.fullHistorySyncOnDemandRequestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(A.fullHistorySyncOnDemandRequestMetadata)}if(A.encHandle!=null&&(t.encHandle=String(A.encHandle)),A.messageAccessStatus!=null){if(typeof A.messageAccessStatus!="object")throw TypeError(".proto.Message.HistorySyncNotification.messageAccessStatus: object expected");t.messageAccessStatus=p.proto.Message.HistorySyncMessageAccessStatus.fromObject(A.messageAccessStatus)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=t.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,t.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=t.longs===String?String(A.fileLength):A.fileLength:s.fileLength=t.longs===String?oe(A.fileLength,!0):t.longs===Number?ne(A.fileLength,!0):A.fileLength,t.oneofs&&(s._fileLength="fileLength")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=t.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,t.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=t.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,t.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,t.oneofs&&(s._directPath="directPath")),A.syncType!=null&&A.hasOwnProperty("syncType")&&(s.syncType=t.enums===String?p.proto.Message.HistorySyncType[A.syncType]===void 0?A.syncType:p.proto.Message.HistorySyncType[A.syncType]:A.syncType,t.oneofs&&(s._syncType="syncType")),A.chunkOrder!=null&&A.hasOwnProperty("chunkOrder")&&(s.chunkOrder=A.chunkOrder,t.oneofs&&(s._chunkOrder="chunkOrder")),A.originalMessageId!=null&&A.hasOwnProperty("originalMessageId")&&(s.originalMessageId=A.originalMessageId,t.oneofs&&(s._originalMessageId="originalMessageId")),A.progress!=null&&A.hasOwnProperty("progress")&&(s.progress=A.progress,t.oneofs&&(s._progress="progress")),A.oldestMsgInChunkTimestampSec!=null&&A.hasOwnProperty("oldestMsgInChunkTimestampSec")&&(typeof A.oldestMsgInChunkTimestampSec=="number"?s.oldestMsgInChunkTimestampSec=t.longs===String?String(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec:s.oldestMsgInChunkTimestampSec=t.longs===String?oe(A.oldestMsgInChunkTimestampSec):t.longs===Number?ne(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec,t.oneofs&&(s._oldestMsgInChunkTimestampSec="oldestMsgInChunkTimestampSec")),A.initialHistBootstrapInlinePayload!=null&&A.hasOwnProperty("initialHistBootstrapInlinePayload")&&(s.initialHistBootstrapInlinePayload=t.bytes===String?l.base64.encode(A.initialHistBootstrapInlinePayload,0,A.initialHistBootstrapInlinePayload.length):t.bytes===Array?Array.prototype.slice.call(A.initialHistBootstrapInlinePayload):A.initialHistBootstrapInlinePayload,t.oneofs&&(s._initialHistBootstrapInlinePayload="initialHistBootstrapInlinePayload")),A.peerDataRequestSessionId!=null&&A.hasOwnProperty("peerDataRequestSessionId")&&(s.peerDataRequestSessionId=A.peerDataRequestSessionId,t.oneofs&&(s._peerDataRequestSessionId="peerDataRequestSessionId")),A.fullHistorySyncOnDemandRequestMetadata!=null&&A.hasOwnProperty("fullHistorySyncOnDemandRequestMetadata")&&(s.fullHistorySyncOnDemandRequestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(A.fullHistorySyncOnDemandRequestMetadata,t),t.oneofs&&(s._fullHistorySyncOnDemandRequestMetadata="fullHistorySyncOnDemandRequestMetadata")),A.encHandle!=null&&A.hasOwnProperty("encHandle")&&(s.encHandle=A.encHandle,t.oneofs&&(s._encHandle="encHandle")),A.messageAccessStatus!=null&&A.hasOwnProperty("messageAccessStatus")&&(s.messageAccessStatus=p.proto.Message.HistorySyncMessageAccessStatus.toObject(A.messageAccessStatus,t),t.oneofs&&(s._messageAccessStatus="messageAccessStatus")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncNotification"},i})(),r.HistorySyncType=(function(){let i={},e=Object.create(i);return e[i[0]="INITIAL_BOOTSTRAP"]=0,e[i[1]="INITIAL_STATUS_V3"]=1,e[i[2]="FULL"]=2,e[i[3]="RECENT"]=3,e[i[4]="PUSH_NAME"]=4,e[i[5]="NON_BLOCKING_DATA"]=5,e[i[6]="ON_DEMAND"]=6,e[i[7]="NO_HISTORY"]=7,e[i[8]="MESSAGE_ACCESS_STATUS"]=8,e})(),r.ImageMessage=(function(){function i(a){if(this.interactiveAnnotations=[],this.scanLengths=[],this.annotations=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.caption=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(p.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 11:{c.directPath=A.string();break}case 12:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.firstScanSidecar=A.bytes();break}case 19:{c.firstScanLength=A.uint32();break}case 20:{c.experimentGroupId=A.uint32();break}case 21:{c.scansSidecar=A.bytes();break}case 22:{if(c.scanLengths&&c.scanLengths.length||(c.scanLengths=[]),(I&7)===2)for(var d=A.uint32()+A.pos;A.pos=0&&(t.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(t.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?t.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?t.fileLength=A.fileLength:typeof A.fileLength=="object"&&(t.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.height!=null&&(t.height=A.height>>>0),A.width!=null&&(t.width=A.width>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.ImageMessage.interactiveAnnotations: array expected");t.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ImageMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.firstScanSidecar!=null&&(typeof A.firstScanSidecar=="string"?l.base64.decode(A.firstScanSidecar,t.firstScanSidecar=l.newBuffer(l.base64.length(A.firstScanSidecar)),0):A.firstScanSidecar.length>=0&&(t.firstScanSidecar=A.firstScanSidecar)),A.firstScanLength!=null&&(t.firstScanLength=A.firstScanLength>>>0),A.experimentGroupId!=null&&(t.experimentGroupId=A.experimentGroupId>>>0),A.scansSidecar!=null&&(typeof A.scansSidecar=="string"?l.base64.decode(A.scansSidecar,t.scansSidecar=l.newBuffer(l.base64.length(A.scansSidecar)),0):A.scansSidecar.length>=0&&(t.scansSidecar=A.scansSidecar)),A.scanLengths){if(!Array.isArray(A.scanLengths))throw TypeError(".proto.Message.ImageMessage.scanLengths: array expected");t.scanLengths=[];for(var s=0;s>>0}if(A.midQualityFileSha256!=null&&(typeof A.midQualityFileSha256=="string"?l.base64.decode(A.midQualityFileSha256,t.midQualityFileSha256=l.newBuffer(l.base64.length(A.midQualityFileSha256)),0):A.midQualityFileSha256.length>=0&&(t.midQualityFileSha256=A.midQualityFileSha256)),A.midQualityFileEncSha256!=null&&(typeof A.midQualityFileEncSha256=="string"?l.base64.decode(A.midQualityFileEncSha256,t.midQualityFileEncSha256=l.newBuffer(l.base64.length(A.midQualityFileEncSha256)),0):A.midQualityFileEncSha256.length>=0&&(t.midQualityFileEncSha256=A.midQualityFileEncSha256)),A.viewOnce!=null&&(t.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(t.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,t.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(t.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,t.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(t.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(t.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.ImageMessage.annotations: array expected");t.annotations=[];for(var s=0;s>>3){case 1:{c.securityNotificationEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InitialSecurityNotificationSettingSync)return A;var t=new p.proto.Message.InitialSecurityNotificationSettingSync;return A.securityNotificationEnabled!=null&&(t.securityNotificationEnabled=!!A.securityNotificationEnabled),t},i.toObject=function(A,t){t||(t={});var s={};return A.securityNotificationEnabled!=null&&A.hasOwnProperty("securityNotificationEnabled")&&(s.securityNotificationEnabled=A.securityNotificationEnabled,t.oneofs&&(s._securityNotificationEnabled="securityNotificationEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InitialSecurityNotificationSettingSync"},i})(),r.InteractiveMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.header=p.proto.Message.InteractiveMessage.Header.decode(A,A.uint32());break}case 2:{c.body=p.proto.Message.InteractiveMessage.Body.decode(A,A.uint32());break}case 3:{c.footer=p.proto.Message.InteractiveMessage.Footer.decode(A,A.uint32());break}case 15:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 16:{c.urlTrackingMap=p.proto.UrlTrackingMap.decode(A,A.uint32());break}case 4:{c.shopStorefrontMessage=p.proto.Message.InteractiveMessage.ShopMessage.decode(A,A.uint32());break}case 5:{c.collectionMessage=p.proto.Message.InteractiveMessage.CollectionMessage.decode(A,A.uint32());break}case 6:{c.nativeFlowMessage=p.proto.Message.InteractiveMessage.NativeFlowMessage.decode(A,A.uint32());break}case 7:{c.carouselMessage=p.proto.Message.InteractiveMessage.CarouselMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InteractiveMessage)return A;var t=new p.proto.Message.InteractiveMessage;if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.InteractiveMessage.header: object expected");t.header=p.proto.Message.InteractiveMessage.Header.fromObject(A.header)}if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveMessage.body: object expected");t.body=p.proto.Message.InteractiveMessage.Body.fromObject(A.body)}if(A.footer!=null){if(typeof A.footer!="object")throw TypeError(".proto.Message.InteractiveMessage.footer: object expected");t.footer=p.proto.Message.InteractiveMessage.Footer.fromObject(A.footer)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.urlTrackingMap!=null){if(typeof A.urlTrackingMap!="object")throw TypeError(".proto.Message.InteractiveMessage.urlTrackingMap: object expected");t.urlTrackingMap=p.proto.UrlTrackingMap.fromObject(A.urlTrackingMap)}if(A.shopStorefrontMessage!=null){if(typeof A.shopStorefrontMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.shopStorefrontMessage: object expected");t.shopStorefrontMessage=p.proto.Message.InteractiveMessage.ShopMessage.fromObject(A.shopStorefrontMessage)}if(A.collectionMessage!=null){if(typeof A.collectionMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.collectionMessage: object expected");t.collectionMessage=p.proto.Message.InteractiveMessage.CollectionMessage.fromObject(A.collectionMessage)}if(A.nativeFlowMessage!=null){if(typeof A.nativeFlowMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.nativeFlowMessage: object expected");t.nativeFlowMessage=p.proto.Message.InteractiveMessage.NativeFlowMessage.fromObject(A.nativeFlowMessage)}if(A.carouselMessage!=null){if(typeof A.carouselMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.carouselMessage: object expected");t.carouselMessage=p.proto.Message.InteractiveMessage.CarouselMessage.fromObject(A.carouselMessage)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.header!=null&&A.hasOwnProperty("header")&&(s.header=p.proto.Message.InteractiveMessage.Header.toObject(A.header,t),t.oneofs&&(s._header="header")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=p.proto.Message.InteractiveMessage.Body.toObject(A.body,t),t.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=p.proto.Message.InteractiveMessage.Footer.toObject(A.footer,t),t.oneofs&&(s._footer="footer")),A.shopStorefrontMessage!=null&&A.hasOwnProperty("shopStorefrontMessage")&&(s.shopStorefrontMessage=p.proto.Message.InteractiveMessage.ShopMessage.toObject(A.shopStorefrontMessage,t),t.oneofs&&(s.interactiveMessage="shopStorefrontMessage")),A.collectionMessage!=null&&A.hasOwnProperty("collectionMessage")&&(s.collectionMessage=p.proto.Message.InteractiveMessage.CollectionMessage.toObject(A.collectionMessage,t),t.oneofs&&(s.interactiveMessage="collectionMessage")),A.nativeFlowMessage!=null&&A.hasOwnProperty("nativeFlowMessage")&&(s.nativeFlowMessage=p.proto.Message.InteractiveMessage.NativeFlowMessage.toObject(A.nativeFlowMessage,t),t.oneofs&&(s.interactiveMessage="nativeFlowMessage")),A.carouselMessage!=null&&A.hasOwnProperty("carouselMessage")&&(s.carouselMessage=p.proto.Message.InteractiveMessage.CarouselMessage.toObject(A.carouselMessage,t),t.oneofs&&(s.interactiveMessage="carouselMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.urlTrackingMap!=null&&A.hasOwnProperty("urlTrackingMap")&&(s.urlTrackingMap=p.proto.UrlTrackingMap.toObject(A.urlTrackingMap,t),t.oneofs&&(s._urlTrackingMap="urlTrackingMap")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveMessage"},i.Body=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.text=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.Body)return s;var g=new p.proto.Message.InteractiveMessage.Body;return s.text!=null&&(g.text=String(s.text)),g},a.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Body"},a})(),i.CarouselMessage=(function(){function a(t){if(this.cards=[],t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.cards&&d.cards.length||(d.cards=[]),d.cards.push(p.proto.Message.InteractiveMessage.decode(s,s.uint32()));break}case 2:{d.messageVersion=s.int32();break}case 3:{d.carouselCardType=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.CarouselMessage)return s;var g=new p.proto.Message.InteractiveMessage.CarouselMessage;if(s.cards){if(!Array.isArray(s.cards))throw TypeError(".proto.Message.InteractiveMessage.CarouselMessage.cards: array expected");g.cards=[];for(var c=0;c>>3){case 1:{d.bizJid=s.string();break}case 2:{d.id=s.string();break}case 3:{d.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.CollectionMessage)return s;var g=new p.proto.Message.InteractiveMessage.CollectionMessage;return s.bizJid!=null&&(g.bizJid=String(s.bizJid)),s.id!=null&&(g.id=String(s.id)),s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},a.toObject=function(s,g){g||(g={});var c={};return s.bizJid!=null&&s.hasOwnProperty("bizJid")&&(c.bizJid=s.bizJid,g.oneofs&&(c._bizJid="bizJid")),s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.CollectionMessage"},a})(),i.Footer=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.text=s.string();break}case 3:{d.hasMediaAttachment=s.bool();break}case 2:{d.audioMessage=p.proto.Message.AudioMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.Footer)return s;var g=new p.proto.Message.InteractiveMessage.Footer;if(s.text!=null&&(g.text=String(s.text)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.audioMessage!=null){if(typeof s.audioMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Footer.audioMessage: object expected");g.audioMessage=p.proto.Message.AudioMessage.fromObject(s.audioMessage)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.audioMessage!=null&&s.hasOwnProperty("audioMessage")&&(c.audioMessage=p.proto.Message.AudioMessage.toObject(s.audioMessage,g),g.oneofs&&(c.media="audioMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Footer"},a})(),i.Header=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.title=s.string();break}case 2:{d.subtitle=s.string();break}case 5:{d.hasMediaAttachment=s.bool();break}case 3:{d.documentMessage=p.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 4:{d.imageMessage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 6:{d.jpegThumbnail=s.bytes();break}case 7:{d.videoMessage=p.proto.Message.VideoMessage.decode(s,s.uint32());break}case 8:{d.locationMessage=p.proto.Message.LocationMessage.decode(s,s.uint32());break}case 9:{d.productMessage=p.proto.Message.ProductMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.Header)return s;var g=new p.proto.Message.InteractiveMessage.Header;if(s.title!=null&&(g.title=String(s.title)),s.subtitle!=null&&(g.subtitle=String(s.subtitle)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.documentMessage!=null){if(typeof s.documentMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.documentMessage: object expected");g.documentMessage=p.proto.Message.DocumentMessage.fromObject(s.documentMessage)}if(s.imageMessage!=null){if(typeof s.imageMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.imageMessage: object expected");g.imageMessage=p.proto.Message.ImageMessage.fromObject(s.imageMessage)}if(s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),s.videoMessage!=null){if(typeof s.videoMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.videoMessage: object expected");g.videoMessage=p.proto.Message.VideoMessage.fromObject(s.videoMessage)}if(s.locationMessage!=null){if(typeof s.locationMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.locationMessage: object expected");g.locationMessage=p.proto.Message.LocationMessage.fromObject(s.locationMessage)}if(s.productMessage!=null){if(typeof s.productMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.productMessage: object expected");g.productMessage=p.proto.Message.ProductMessage.fromObject(s.productMessage)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.subtitle!=null&&s.hasOwnProperty("subtitle")&&(c.subtitle=s.subtitle,g.oneofs&&(c._subtitle="subtitle")),s.documentMessage!=null&&s.hasOwnProperty("documentMessage")&&(c.documentMessage=p.proto.Message.DocumentMessage.toObject(s.documentMessage,g),g.oneofs&&(c.media="documentMessage")),s.imageMessage!=null&&s.hasOwnProperty("imageMessage")&&(c.imageMessage=p.proto.Message.ImageMessage.toObject(s.imageMessage,g),g.oneofs&&(c.media="imageMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c.media="jpegThumbnail")),s.videoMessage!=null&&s.hasOwnProperty("videoMessage")&&(c.videoMessage=p.proto.Message.VideoMessage.toObject(s.videoMessage,g),g.oneofs&&(c.media="videoMessage")),s.locationMessage!=null&&s.hasOwnProperty("locationMessage")&&(c.locationMessage=p.proto.Message.LocationMessage.toObject(s.locationMessage,g),g.oneofs&&(c.media="locationMessage")),s.productMessage!=null&&s.hasOwnProperty("productMessage")&&(c.productMessage=p.proto.Message.ProductMessage.toObject(s.productMessage,g),g.oneofs&&(c.media="productMessage")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Header"},a})(),i.NativeFlowMessage=(function(){function a(t){if(this.buttons=[],t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.buttons&&d.buttons.length||(d.buttons=[]),d.buttons.push(p.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.decode(s,s.uint32()));break}case 2:{d.messageParamsJson=s.string();break}case 3:{d.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.NativeFlowMessage)return s;var g=new p.proto.Message.InteractiveMessage.NativeFlowMessage;if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.InteractiveMessage.NativeFlowMessage.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 1:{f.name=c.string();break}case 2:{f.buttonParamsJson=c.string();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton)return c;var I=new p.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton;return c.name!=null&&(I.name=String(c.name)),c.buttonParamsJson!=null&&(I.buttonParamsJson=String(c.buttonParamsJson)),I},t.toObject=function(c,I){I||(I={});var d={};return c.name!=null&&c.hasOwnProperty("name")&&(d.name=c.name,I.oneofs&&(d._name="name")),c.buttonParamsJson!=null&&c.hasOwnProperty("buttonParamsJson")&&(d.buttonParamsJson=c.buttonParamsJson,I.oneofs&&(d._buttonParamsJson="buttonParamsJson")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton"},t})(),a})(),i.ShopMessage=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.id=s.string();break}case 2:{d.surface=s.int32();break}case 3:{d.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveMessage.ShopMessage)return s;var g=new p.proto.Message.InteractiveMessage.ShopMessage;switch(s.id!=null&&(g.id=String(s.id)),s.surface){default:if(typeof s.surface=="number"){g.surface=s.surface;break}break;case"UNKNOWN_SURFACE":case 0:g.surface=0;break;case"FB":case 1:g.surface=1;break;case"IG":case 2:g.surface=2;break;case"WA":case 3:g.surface=3;break}return s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},a.toObject=function(s,g){g||(g={});var c={};return s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.surface!=null&&s.hasOwnProperty("surface")&&(c.surface=g.enums===String?p.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]===void 0?s.surface:p.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]:s.surface,g.oneofs&&(c._surface="surface")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.ShopMessage"},a.Surface=(function(){let t={},s=Object.create(t);return s[t[0]="UNKNOWN_SURFACE"]=0,s[t[1]="FB"]=1,s[t[2]="IG"]=2,s[t[3]="WA"]=3,s})(),a})(),i})(),r.InteractiveResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.body=p.proto.Message.InteractiveResponseMessage.Body.decode(A,A.uint32());break}case 15:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.nativeFlowResponseMessage=p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InteractiveResponseMessage)return A;var t=new p.proto.Message.InteractiveResponseMessage;if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.body: object expected");t.body=p.proto.Message.InteractiveResponseMessage.Body.fromObject(A.body)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.nativeFlowResponseMessage!=null){if(typeof A.nativeFlowResponseMessage!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.nativeFlowResponseMessage: object expected");t.nativeFlowResponseMessage=p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.fromObject(A.nativeFlowResponseMessage)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.body!=null&&A.hasOwnProperty("body")&&(s.body=p.proto.Message.InteractiveResponseMessage.Body.toObject(A.body,t),t.oneofs&&(s._body="body")),A.nativeFlowResponseMessage!=null&&A.hasOwnProperty("nativeFlowResponseMessage")&&(s.nativeFlowResponseMessage=p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.toObject(A.nativeFlowResponseMessage,t),t.oneofs&&(s.interactiveResponseMessage="nativeFlowResponseMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveResponseMessage"},i.Body=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.text=s.string();break}case 2:{d.format=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveResponseMessage.Body)return s;var g=new p.proto.Message.InteractiveResponseMessage.Body;switch(s.text!=null&&(g.text=String(s.text)),s.format){default:if(typeof s.format=="number"){g.format=s.format;break}break;case"DEFAULT":case 0:g.format=0;break;case"EXTENSIONS_1":case 1:g.format=1;break}return g},a.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.format!=null&&s.hasOwnProperty("format")&&(c.format=g.enums===String?p.proto.Message.InteractiveResponseMessage.Body.Format[s.format]===void 0?s.format:p.proto.Message.InteractiveResponseMessage.Body.Format[s.format]:s.format,g.oneofs&&(c._format="format")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.Body"},a.Format=(function(){let t={},s=Object.create(t);return s[t[0]="DEFAULT"]=0,s[t[1]="EXTENSIONS_1"]=1,s})(),a})(),i.NativeFlowResponseMessage=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.name=s.string();break}case 2:{d.paramsJson=s.string();break}case 3:{d.version=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage)return s;var g=new p.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage;return s.name!=null&&(g.name=String(s.name)),s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),s.version!=null&&(g.version=s.version|0),g},a.toObject=function(s,g){g||(g={});var c={};return s.name!=null&&s.hasOwnProperty("name")&&(c.name=s.name,g.oneofs&&(c._name="name")),s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),s.version!=null&&s.hasOwnProperty("version")&&(c.version=s.version,g.oneofs&&(c._version="version")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage"},a})(),i})(),r.InvoiceMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.note=A.string();break}case 2:{c.token=A.string();break}case 3:{c.attachmentType=A.int32();break}case 4:{c.attachmentMimetype=A.string();break}case 5:{c.attachmentMediaKey=A.bytes();break}case 6:{c.attachmentMediaKeyTimestamp=A.int64();break}case 7:{c.attachmentFileSha256=A.bytes();break}case 8:{c.attachmentFileEncSha256=A.bytes();break}case 9:{c.attachmentDirectPath=A.string();break}case 10:{c.attachmentJpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.InvoiceMessage)return A;var t=new p.proto.Message.InvoiceMessage;switch(A.note!=null&&(t.note=String(A.note)),A.token!=null&&(t.token=String(A.token)),A.attachmentType){default:if(typeof A.attachmentType=="number"){t.attachmentType=A.attachmentType;break}break;case"IMAGE":case 0:t.attachmentType=0;break;case"PDF":case 1:t.attachmentType=1;break}return A.attachmentMimetype!=null&&(t.attachmentMimetype=String(A.attachmentMimetype)),A.attachmentMediaKey!=null&&(typeof A.attachmentMediaKey=="string"?l.base64.decode(A.attachmentMediaKey,t.attachmentMediaKey=l.newBuffer(l.base64.length(A.attachmentMediaKey)),0):A.attachmentMediaKey.length>=0&&(t.attachmentMediaKey=A.attachmentMediaKey)),A.attachmentMediaKeyTimestamp!=null&&(l.Long?(t.attachmentMediaKeyTimestamp=l.Long.fromValue(A.attachmentMediaKeyTimestamp)).unsigned=!1:typeof A.attachmentMediaKeyTimestamp=="string"?t.attachmentMediaKeyTimestamp=parseInt(A.attachmentMediaKeyTimestamp,10):typeof A.attachmentMediaKeyTimestamp=="number"?t.attachmentMediaKeyTimestamp=A.attachmentMediaKeyTimestamp:typeof A.attachmentMediaKeyTimestamp=="object"&&(t.attachmentMediaKeyTimestamp=new l.LongBits(A.attachmentMediaKeyTimestamp.low>>>0,A.attachmentMediaKeyTimestamp.high>>>0).toNumber())),A.attachmentFileSha256!=null&&(typeof A.attachmentFileSha256=="string"?l.base64.decode(A.attachmentFileSha256,t.attachmentFileSha256=l.newBuffer(l.base64.length(A.attachmentFileSha256)),0):A.attachmentFileSha256.length>=0&&(t.attachmentFileSha256=A.attachmentFileSha256)),A.attachmentFileEncSha256!=null&&(typeof A.attachmentFileEncSha256=="string"?l.base64.decode(A.attachmentFileEncSha256,t.attachmentFileEncSha256=l.newBuffer(l.base64.length(A.attachmentFileEncSha256)),0):A.attachmentFileEncSha256.length>=0&&(t.attachmentFileEncSha256=A.attachmentFileEncSha256)),A.attachmentDirectPath!=null&&(t.attachmentDirectPath=String(A.attachmentDirectPath)),A.attachmentJpegThumbnail!=null&&(typeof A.attachmentJpegThumbnail=="string"?l.base64.decode(A.attachmentJpegThumbnail,t.attachmentJpegThumbnail=l.newBuffer(l.base64.length(A.attachmentJpegThumbnail)),0):A.attachmentJpegThumbnail.length>=0&&(t.attachmentJpegThumbnail=A.attachmentJpegThumbnail)),t},i.toObject=function(A,t){t||(t={});var s={};return A.note!=null&&A.hasOwnProperty("note")&&(s.note=A.note,t.oneofs&&(s._note="note")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,t.oneofs&&(s._token="token")),A.attachmentType!=null&&A.hasOwnProperty("attachmentType")&&(s.attachmentType=t.enums===String?p.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]===void 0?A.attachmentType:p.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]:A.attachmentType,t.oneofs&&(s._attachmentType="attachmentType")),A.attachmentMimetype!=null&&A.hasOwnProperty("attachmentMimetype")&&(s.attachmentMimetype=A.attachmentMimetype,t.oneofs&&(s._attachmentMimetype="attachmentMimetype")),A.attachmentMediaKey!=null&&A.hasOwnProperty("attachmentMediaKey")&&(s.attachmentMediaKey=t.bytes===String?l.base64.encode(A.attachmentMediaKey,0,A.attachmentMediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.attachmentMediaKey):A.attachmentMediaKey,t.oneofs&&(s._attachmentMediaKey="attachmentMediaKey")),A.attachmentMediaKeyTimestamp!=null&&A.hasOwnProperty("attachmentMediaKeyTimestamp")&&(typeof A.attachmentMediaKeyTimestamp=="number"?s.attachmentMediaKeyTimestamp=t.longs===String?String(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp:s.attachmentMediaKeyTimestamp=t.longs===String?oe(A.attachmentMediaKeyTimestamp):t.longs===Number?ne(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp,t.oneofs&&(s._attachmentMediaKeyTimestamp="attachmentMediaKeyTimestamp")),A.attachmentFileSha256!=null&&A.hasOwnProperty("attachmentFileSha256")&&(s.attachmentFileSha256=t.bytes===String?l.base64.encode(A.attachmentFileSha256,0,A.attachmentFileSha256.length):t.bytes===Array?Array.prototype.slice.call(A.attachmentFileSha256):A.attachmentFileSha256,t.oneofs&&(s._attachmentFileSha256="attachmentFileSha256")),A.attachmentFileEncSha256!=null&&A.hasOwnProperty("attachmentFileEncSha256")&&(s.attachmentFileEncSha256=t.bytes===String?l.base64.encode(A.attachmentFileEncSha256,0,A.attachmentFileEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.attachmentFileEncSha256):A.attachmentFileEncSha256,t.oneofs&&(s._attachmentFileEncSha256="attachmentFileEncSha256")),A.attachmentDirectPath!=null&&A.hasOwnProperty("attachmentDirectPath")&&(s.attachmentDirectPath=A.attachmentDirectPath,t.oneofs&&(s._attachmentDirectPath="attachmentDirectPath")),A.attachmentJpegThumbnail!=null&&A.hasOwnProperty("attachmentJpegThumbnail")&&(s.attachmentJpegThumbnail=t.bytes===String?l.base64.encode(A.attachmentJpegThumbnail,0,A.attachmentJpegThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.attachmentJpegThumbnail):A.attachmentJpegThumbnail,t.oneofs&&(s._attachmentJpegThumbnail="attachmentJpegThumbnail")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InvoiceMessage"},i.AttachmentType=(function(){let a={},A=Object.create(a);return A[a[0]="IMAGE"]=0,A[a[1]="PDF"]=1,A})(),i})(),r.KeepInChatMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.keepType=A.int32();break}case 3:{c.timestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.KeepInChatMessage)return A;var t=new p.proto.Message.KeepInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.KeepInChatMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}switch(A.keepType){default:if(typeof A.keepType=="number"){t.keepType=A.keepType;break}break;case"UNKNOWN":case 0:t.keepType=0;break;case"KEEP_FOR_ALL":case 1:t.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:t.keepType=2;break}return A.timestampMs!=null&&(l.Long?(t.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?t.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?t.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(t.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),A.keepType!=null&&A.hasOwnProperty("keepType")&&(s.keepType=t.enums===String?p.proto.KeepType[A.keepType]===void 0?A.keepType:p.proto.KeepType[A.keepType]:A.keepType,t.oneofs&&(s._keepType="keepType")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=t.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=t.longs===String?oe(A.timestampMs):t.longs===Number?ne(A.timestampMs):A.timestampMs,t.oneofs&&(s._timestampMs="timestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.KeepInChatMessage"},i})(),r.LinkPreviewMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 2:{c.urlMetadata=p.proto.Message.URLMetadata.decode(A,A.uint32());break}case 3:{c.fbExperimentId=A.uint32();break}case 4:{c.linkMediaDuration=A.uint32();break}case 5:{c.socialMediaPostType=A.int32();break}case 6:{c.linkInlineVideoMuted=A.bool();break}case 7:{c.videoContentUrl=A.string();break}case 8:{c.musicMetadata=p.proto.EmbeddedMusic.decode(A,A.uint32());break}case 9:{c.videoContentCaption=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.LinkPreviewMetadata)return A;var t=new p.proto.Message.LinkPreviewMetadata;if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.paymentLinkMetadata: object expected");t.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.urlMetadata!=null){if(typeof A.urlMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.urlMetadata: object expected");t.urlMetadata=p.proto.Message.URLMetadata.fromObject(A.urlMetadata)}switch(A.fbExperimentId!=null&&(t.fbExperimentId=A.fbExperimentId>>>0),A.linkMediaDuration!=null&&(t.linkMediaDuration=A.linkMediaDuration>>>0),A.socialMediaPostType){default:if(typeof A.socialMediaPostType=="number"){t.socialMediaPostType=A.socialMediaPostType;break}break;case"NONE":case 0:t.socialMediaPostType=0;break;case"REEL":case 1:t.socialMediaPostType=1;break;case"LIVE_VIDEO":case 2:t.socialMediaPostType=2;break;case"LONG_VIDEO":case 3:t.socialMediaPostType=3;break;case"SINGLE_IMAGE":case 4:t.socialMediaPostType=4;break;case"CAROUSEL":case 5:t.socialMediaPostType=5;break}if(A.linkInlineVideoMuted!=null&&(t.linkInlineVideoMuted=!!A.linkInlineVideoMuted),A.videoContentUrl!=null&&(t.videoContentUrl=String(A.videoContentUrl)),A.musicMetadata!=null){if(typeof A.musicMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.musicMetadata: object expected");t.musicMetadata=p.proto.EmbeddedMusic.fromObject(A.musicMetadata)}return A.videoContentCaption!=null&&(t.videoContentCaption=String(A.videoContentCaption)),t},i.toObject=function(A,t){t||(t={});var s={};return A.paymentLinkMetadata!=null&&A.hasOwnProperty("paymentLinkMetadata")&&(s.paymentLinkMetadata=p.proto.Message.PaymentLinkMetadata.toObject(A.paymentLinkMetadata,t),t.oneofs&&(s._paymentLinkMetadata="paymentLinkMetadata")),A.urlMetadata!=null&&A.hasOwnProperty("urlMetadata")&&(s.urlMetadata=p.proto.Message.URLMetadata.toObject(A.urlMetadata,t),t.oneofs&&(s._urlMetadata="urlMetadata")),A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,t.oneofs&&(s._fbExperimentId="fbExperimentId")),A.linkMediaDuration!=null&&A.hasOwnProperty("linkMediaDuration")&&(s.linkMediaDuration=A.linkMediaDuration,t.oneofs&&(s._linkMediaDuration="linkMediaDuration")),A.socialMediaPostType!=null&&A.hasOwnProperty("socialMediaPostType")&&(s.socialMediaPostType=t.enums===String?p.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]===void 0?A.socialMediaPostType:p.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]:A.socialMediaPostType,t.oneofs&&(s._socialMediaPostType="socialMediaPostType")),A.linkInlineVideoMuted!=null&&A.hasOwnProperty("linkInlineVideoMuted")&&(s.linkInlineVideoMuted=A.linkInlineVideoMuted,t.oneofs&&(s._linkInlineVideoMuted="linkInlineVideoMuted")),A.videoContentUrl!=null&&A.hasOwnProperty("videoContentUrl")&&(s.videoContentUrl=A.videoContentUrl,t.oneofs&&(s._videoContentUrl="videoContentUrl")),A.musicMetadata!=null&&A.hasOwnProperty("musicMetadata")&&(s.musicMetadata=p.proto.EmbeddedMusic.toObject(A.musicMetadata,t),t.oneofs&&(s._musicMetadata="musicMetadata")),A.videoContentCaption!=null&&A.hasOwnProperty("videoContentCaption")&&(s.videoContentCaption=A.videoContentCaption,t.oneofs&&(s._videoContentCaption="videoContentCaption")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LinkPreviewMetadata"},i.SocialMediaPostType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="REEL"]=1,A[a[2]="LIVE_VIDEO"]=2,A[a[3]="LONG_VIDEO"]=3,A[a[4]="SINGLE_IMAGE"]=4,A[a[5]="CAROUSEL"]=5,A})(),i})(),r.ListMessage=(function(){function i(a){if(this.sections=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.title=A.string();break}case 2:{c.description=A.string();break}case 3:{c.buttonText=A.string();break}case 4:{c.listType=A.int32();break}case 5:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(p.proto.Message.ListMessage.Section.decode(A,A.uint32()));break}case 6:{c.productListInfo=p.proto.Message.ListMessage.ProductListInfo.decode(A,A.uint32());break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ListMessage)return A;var t=new p.proto.Message.ListMessage;switch(A.title!=null&&(t.title=String(A.title)),A.description!=null&&(t.description=String(A.description)),A.buttonText!=null&&(t.buttonText=String(A.buttonText)),A.listType){default:if(typeof A.listType=="number"){t.listType=A.listType;break}break;case"UNKNOWN":case 0:t.listType=0;break;case"SINGLE_SELECT":case 1:t.listType=1;break;case"PRODUCT_LIST":case 2:t.listType=2;break}if(A.sections){if(!Array.isArray(A.sections))throw TypeError(".proto.Message.ListMessage.sections: array expected");t.sections=[];for(var s=0;s>>3){case 1:{d.productId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.Product)return s;var g=new p.proto.Message.ListMessage.Product;return s.productId!=null&&(g.productId=String(s.productId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Product"},a})(),i.ProductListHeaderImage=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.productId=s.string();break}case 2:{d.jpegThumbnail=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.ProductListHeaderImage)return s;var g=new p.proto.Message.ListMessage.ProductListHeaderImage;return s.productId!=null&&(g.productId=String(s.productId)),s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),g},a.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c._jpegThumbnail="jpegThumbnail")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.ProductListHeaderImage"},a})(),i.ProductListInfo=(function(){function a(t){if(this.productSections=[],t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.productSections&&d.productSections.length||(d.productSections=[]),d.productSections.push(p.proto.Message.ListMessage.ProductSection.decode(s,s.uint32()));break}case 2:{d.headerImage=p.proto.Message.ListMessage.ProductListHeaderImage.decode(s,s.uint32());break}case 3:{d.businessOwnerJid=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.ProductListInfo)return s;var g=new p.proto.Message.ListMessage.ProductListInfo;if(s.productSections){if(!Array.isArray(s.productSections))throw TypeError(".proto.Message.ListMessage.ProductListInfo.productSections: array expected");g.productSections=[];for(var c=0;c>>3){case 1:{d.title=s.string();break}case 2:{d.products&&d.products.length||(d.products=[]),d.products.push(p.proto.Message.ListMessage.Product.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.ProductSection)return s;var g=new p.proto.Message.ListMessage.ProductSection;if(s.title!=null&&(g.title=String(s.title)),s.products){if(!Array.isArray(s.products))throw TypeError(".proto.Message.ListMessage.ProductSection.products: array expected");g.products=[];for(var c=0;c>>3){case 1:{d.title=s.string();break}case 2:{d.description=s.string();break}case 3:{d.rowId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.Row)return s;var g=new p.proto.Message.ListMessage.Row;return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.rowId!=null&&(g.rowId=String(s.rowId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.rowId!=null&&s.hasOwnProperty("rowId")&&(c.rowId=s.rowId,g.oneofs&&(c._rowId="rowId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Row"},a})(),i.Section=(function(){function a(t){if(this.rows=[],t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.title=s.string();break}case 2:{d.rows&&d.rows.length||(d.rows=[]),d.rows.push(p.proto.Message.ListMessage.Row.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListMessage.Section)return s;var g=new p.proto.Message.ListMessage.Section;if(s.title!=null&&(g.title=String(s.title)),s.rows){if(!Array.isArray(s.rows))throw TypeError(".proto.Message.ListMessage.Section.rows: array expected");g.rows=[];for(var c=0;c>>3){case 1:{c.title=A.string();break}case 2:{c.listType=A.int32();break}case 3:{c.singleSelectReply=p.proto.Message.ListResponseMessage.SingleSelectReply.decode(A,A.uint32());break}case 4:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 5:{c.description=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ListResponseMessage)return A;var t=new p.proto.Message.ListResponseMessage;switch(A.title!=null&&(t.title=String(A.title)),A.listType){default:if(typeof A.listType=="number"){t.listType=A.listType;break}break;case"UNKNOWN":case 0:t.listType=0;break;case"SINGLE_SELECT":case 1:t.listType=1;break}if(A.singleSelectReply!=null){if(typeof A.singleSelectReply!="object")throw TypeError(".proto.Message.ListResponseMessage.singleSelectReply: object expected");t.singleSelectReply=p.proto.Message.ListResponseMessage.SingleSelectReply.fromObject(A.singleSelectReply)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ListResponseMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return A.description!=null&&(t.description=String(A.description)),t},i.toObject=function(A,t){t||(t={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,t.oneofs&&(s._title="title")),A.listType!=null&&A.hasOwnProperty("listType")&&(s.listType=t.enums===String?p.proto.Message.ListResponseMessage.ListType[A.listType]===void 0?A.listType:p.proto.Message.ListResponseMessage.ListType[A.listType]:A.listType,t.oneofs&&(s._listType="listType")),A.singleSelectReply!=null&&A.hasOwnProperty("singleSelectReply")&&(s.singleSelectReply=p.proto.Message.ListResponseMessage.SingleSelectReply.toObject(A.singleSelectReply,t),t.oneofs&&(s._singleSelectReply="singleSelectReply")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,t.oneofs&&(s._description="description")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ListResponseMessage"},i.ListType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="SINGLE_SELECT"]=1,A})(),i.SingleSelectReply=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.selectedRowId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ListResponseMessage.SingleSelectReply)return s;var g=new p.proto.Message.ListResponseMessage.SingleSelectReply;return s.selectedRowId!=null&&(g.selectedRowId=String(s.selectedRowId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.selectedRowId!=null&&s.hasOwnProperty("selectedRowId")&&(c.selectedRowId=s.selectedRowId,g.oneofs&&(c._selectedRowId="selectedRowId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListResponseMessage.SingleSelectReply"},a})(),i})(),r.LiveLocationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.accuracyInMeters=A.uint32();break}case 4:{c.speedInMps=A.float();break}case 5:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 6:{c.caption=A.string();break}case 7:{c.sequenceNumber=A.int64();break}case 8:{c.timeOffset=A.uint32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.LiveLocationMessage)return A;var t=new p.proto.Message.LiveLocationMessage;if(A.degreesLatitude!=null&&(t.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(t.degreesLongitude=Number(A.degreesLongitude)),A.accuracyInMeters!=null&&(t.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(t.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(t.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.caption!=null&&(t.caption=String(A.caption)),A.sequenceNumber!=null&&(l.Long?(t.sequenceNumber=l.Long.fromValue(A.sequenceNumber)).unsigned=!1:typeof A.sequenceNumber=="string"?t.sequenceNumber=parseInt(A.sequenceNumber,10):typeof A.sequenceNumber=="number"?t.sequenceNumber=A.sequenceNumber:typeof A.sequenceNumber=="object"&&(t.sequenceNumber=new l.LongBits(A.sequenceNumber.low>>>0,A.sequenceNumber.high>>>0).toNumber())),A.timeOffset!=null&&(t.timeOffset=A.timeOffset>>>0),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LiveLocationMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=t.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,t.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=t.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,t.oneofs&&(s._degreesLongitude="degreesLongitude")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,t.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=t.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,t.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,t.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,t.oneofs&&(s._caption="caption")),A.sequenceNumber!=null&&A.hasOwnProperty("sequenceNumber")&&(typeof A.sequenceNumber=="number"?s.sequenceNumber=t.longs===String?String(A.sequenceNumber):A.sequenceNumber:s.sequenceNumber=t.longs===String?oe(A.sequenceNumber):t.longs===Number?ne(A.sequenceNumber):A.sequenceNumber,t.oneofs&&(s._sequenceNumber="sequenceNumber")),A.timeOffset!=null&&A.hasOwnProperty("timeOffset")&&(s.timeOffset=A.timeOffset,t.oneofs&&(s._timeOffset="timeOffset")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=t.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,t.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LiveLocationMessage"},i})(),r.LocationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.isLive=A.bool();break}case 7:{c.accuracyInMeters=A.uint32();break}case 8:{c.speedInMps=A.float();break}case 9:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 11:{c.comment=A.string();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.LocationMessage)return A;var t=new p.proto.Message.LocationMessage;if(A.degreesLatitude!=null&&(t.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(t.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(t.name=String(A.name)),A.address!=null&&(t.address=String(A.address)),A.url!=null&&(t.url=String(A.url)),A.isLive!=null&&(t.isLive=!!A.isLive),A.accuracyInMeters!=null&&(t.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(t.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(t.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.comment!=null&&(t.comment=String(A.comment)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LocationMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=t.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,t.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=t.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,t.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,t.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),A.isLive!=null&&A.hasOwnProperty("isLive")&&(s.isLive=A.isLive,t.oneofs&&(s._isLive="isLive")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,t.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=t.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,t.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,t.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.comment!=null&&A.hasOwnProperty("comment")&&(s.comment=A.comment,t.oneofs&&(s._comment="comment")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=t.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,t.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LocationMessage"},i})(),r.MMSThumbnailMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.thumbnailDirectPath=A.string();break}case 2:{c.thumbnailSha256=A.bytes();break}case 3:{c.thumbnailEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mediaKeyTimestamp=A.int64();break}case 6:{c.thumbnailHeight=A.uint32();break}case 7:{c.thumbnailWidth=A.uint32();break}case 8:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MMSThumbnailMetadata)return A;var t=new p.proto.Message.MMSThumbnailMetadata;switch(A.thumbnailDirectPath!=null&&(t.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,t.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(t.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,t.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(t.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(t.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?t.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?t.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(t.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(t.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(t.thumbnailWidth=A.thumbnailWidth>>>0),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){t.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:t.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:t.mediaKeyDomain=1;break;case"STATUS":case 2:t.mediaKeyDomain=2;break;case"CAPI":case 3:t.mediaKeyDomain=3;break;case"BOT":case 4:t.mediaKeyDomain=4;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,t.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=t.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):t.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,t.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=t.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,t.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=t.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,t.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=t.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=t.longs===String?oe(A.mediaKeyTimestamp):t.longs===Number?ne(A.mediaKeyTimestamp):A.mediaKeyTimestamp,t.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,t.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,t.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=t.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,t.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MMSThumbnailMetadata"},i})(),r.MediaKeyDomain=(function(){let i={},e=Object.create(i);return e[i[0]="UNSET"]=0,e[i[1]="E2EE_CHAT"]=1,e[i[2]="STATUS"]=2,e[i[3]="CAPI"]=3,e[i[4]="BOT"]=4,e})(),r.MessageHistoryBundle=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.mimetype=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.mediaKeyTimestamp=A.int64();break}case 7:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MessageHistoryBundle)return A;var t=new p.proto.Message.MessageHistoryBundle;if(A.mimetype!=null&&(t.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,t.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(t.fileSha256=A.fileSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(t.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(t.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?t.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?t.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(t.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryBundle.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryBundle.messageHistoryMetadata: object expected");t.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,t.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=t.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,t.oneofs&&(s._fileSha256="fileSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=t.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,t.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=t.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,t.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,t.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=t.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=t.longs===String?oe(A.mediaKeyTimestamp):t.longs===Number?ne(A.mediaKeyTimestamp):A.mediaKeyTimestamp,t.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,t),t.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryBundle"},i})(),r.MessageHistoryMetadata=(function(){function i(a){if(this.historyReceivers=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.historyReceivers&&c.historyReceivers.length||(c.historyReceivers=[]),c.historyReceivers.push(A.string());break}case 2:{c.oldestMessageTimestamp=A.int64();break}case 3:{c.messageCount=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MessageHistoryMetadata)return A;var t=new p.proto.Message.MessageHistoryMetadata;if(A.historyReceivers){if(!Array.isArray(A.historyReceivers))throw TypeError(".proto.Message.MessageHistoryMetadata.historyReceivers: array expected");t.historyReceivers=[];for(var s=0;s>>0,A.oldestMessageTimestamp.high>>>0).toNumber())),A.messageCount!=null&&(l.Long?(t.messageCount=l.Long.fromValue(A.messageCount)).unsigned=!1:typeof A.messageCount=="string"?t.messageCount=parseInt(A.messageCount,10):typeof A.messageCount=="number"?t.messageCount=A.messageCount:typeof A.messageCount=="object"&&(t.messageCount=new l.LongBits(A.messageCount.low>>>0,A.messageCount.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.historyReceivers=[]),A.historyReceivers&&A.historyReceivers.length){s.historyReceivers=[];for(var g=0;g>>3){case 1:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.MessageHistoryNotice)return A;var t=new p.proto.Message.MessageHistoryNotice;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryNotice.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryNotice.messageHistoryMetadata: object expected");t.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=p.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,t),t.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryNotice"},i})(),r.NewsletterAdminInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.inviteExpiration=A.int64();break}case 6:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.NewsletterAdminInviteMessage)return A;var t=new p.proto.Message.NewsletterAdminInviteMessage;if(A.newsletterJid!=null&&(t.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(t.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(t.caption=String(A.caption)),A.inviteExpiration!=null&&(l.Long?(t.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?t.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?t.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(t.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterAdminInviteMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,t.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,t.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=t.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,t.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,t.oneofs&&(s._caption="caption")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=t.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=t.longs===String?oe(A.inviteExpiration):t.longs===Number?ne(A.inviteExpiration):A.inviteExpiration,t.oneofs&&(s._inviteExpiration="inviteExpiration")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterAdminInviteMessage"},i})(),r.NewsletterFollowerInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.NewsletterFollowerInviteMessage)return A;var t=new p.proto.Message.NewsletterFollowerInviteMessage;if(A.newsletterJid!=null&&(t.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(t.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(t.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterFollowerInviteMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,t.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,t.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=t.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,t.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,t.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterFollowerInviteMessage"},i})(),r.OrderMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.orderId=A.string();break}case 2:{c.thumbnail=A.bytes();break}case 3:{c.itemCount=A.int32();break}case 4:{c.status=A.int32();break}case 5:{c.surface=A.int32();break}case 6:{c.message=A.string();break}case 7:{c.orderTitle=A.string();break}case 8:{c.sellerJid=A.string();break}case 9:{c.token=A.string();break}case 10:{c.totalAmount1000=A.int64();break}case 11:{c.totalCurrencyCode=A.string();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.messageVersion=A.int32();break}case 13:{c.orderRequestMessageId=p.proto.MessageKey.decode(A,A.uint32());break}case 15:{c.catalogType=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.OrderMessage)return A;var t=new p.proto.Message.OrderMessage;switch(A.orderId!=null&&(t.orderId=String(A.orderId)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,t.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(t.thumbnail=A.thumbnail)),A.itemCount!=null&&(t.itemCount=A.itemCount|0),A.status){default:if(typeof A.status=="number"){t.status=A.status;break}break;case"INQUIRY":case 1:t.status=1;break;case"ACCEPTED":case 2:t.status=2;break;case"DECLINED":case 3:t.status=3;break}switch(A.surface){default:if(typeof A.surface=="number"){t.surface=A.surface;break}break;case"CATALOG":case 1:t.surface=1;break}if(A.message!=null&&(t.message=String(A.message)),A.orderTitle!=null&&(t.orderTitle=String(A.orderTitle)),A.sellerJid!=null&&(t.sellerJid=String(A.sellerJid)),A.token!=null&&(t.token=String(A.token)),A.totalAmount1000!=null&&(l.Long?(t.totalAmount1000=l.Long.fromValue(A.totalAmount1000)).unsigned=!1:typeof A.totalAmount1000=="string"?t.totalAmount1000=parseInt(A.totalAmount1000,10):typeof A.totalAmount1000=="number"?t.totalAmount1000=A.totalAmount1000:typeof A.totalAmount1000=="object"&&(t.totalAmount1000=new l.LongBits(A.totalAmount1000.low>>>0,A.totalAmount1000.high>>>0).toNumber())),A.totalCurrencyCode!=null&&(t.totalCurrencyCode=String(A.totalCurrencyCode)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.OrderMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageVersion!=null&&(t.messageVersion=A.messageVersion|0),A.orderRequestMessageId!=null){if(typeof A.orderRequestMessageId!="object")throw TypeError(".proto.Message.OrderMessage.orderRequestMessageId: object expected");t.orderRequestMessageId=p.proto.MessageKey.fromObject(A.orderRequestMessageId)}return A.catalogType!=null&&(t.catalogType=String(A.catalogType)),t},i.toObject=function(A,t){t||(t={});var s={};return A.orderId!=null&&A.hasOwnProperty("orderId")&&(s.orderId=A.orderId,t.oneofs&&(s._orderId="orderId")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=t.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,t.oneofs&&(s._thumbnail="thumbnail")),A.itemCount!=null&&A.hasOwnProperty("itemCount")&&(s.itemCount=A.itemCount,t.oneofs&&(s._itemCount="itemCount")),A.status!=null&&A.hasOwnProperty("status")&&(s.status=t.enums===String?p.proto.Message.OrderMessage.OrderStatus[A.status]===void 0?A.status:p.proto.Message.OrderMessage.OrderStatus[A.status]:A.status,t.oneofs&&(s._status="status")),A.surface!=null&&A.hasOwnProperty("surface")&&(s.surface=t.enums===String?p.proto.Message.OrderMessage.OrderSurface[A.surface]===void 0?A.surface:p.proto.Message.OrderMessage.OrderSurface[A.surface]:A.surface,t.oneofs&&(s._surface="surface")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,t.oneofs&&(s._message="message")),A.orderTitle!=null&&A.hasOwnProperty("orderTitle")&&(s.orderTitle=A.orderTitle,t.oneofs&&(s._orderTitle="orderTitle")),A.sellerJid!=null&&A.hasOwnProperty("sellerJid")&&(s.sellerJid=A.sellerJid,t.oneofs&&(s._sellerJid="sellerJid")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,t.oneofs&&(s._token="token")),A.totalAmount1000!=null&&A.hasOwnProperty("totalAmount1000")&&(typeof A.totalAmount1000=="number"?s.totalAmount1000=t.longs===String?String(A.totalAmount1000):A.totalAmount1000:s.totalAmount1000=t.longs===String?oe(A.totalAmount1000):t.longs===Number?ne(A.totalAmount1000):A.totalAmount1000,t.oneofs&&(s._totalAmount1000="totalAmount1000")),A.totalCurrencyCode!=null&&A.hasOwnProperty("totalCurrencyCode")&&(s.totalCurrencyCode=A.totalCurrencyCode,t.oneofs&&(s._totalCurrencyCode="totalCurrencyCode")),A.messageVersion!=null&&A.hasOwnProperty("messageVersion")&&(s.messageVersion=A.messageVersion,t.oneofs&&(s._messageVersion="messageVersion")),A.orderRequestMessageId!=null&&A.hasOwnProperty("orderRequestMessageId")&&(s.orderRequestMessageId=p.proto.MessageKey.toObject(A.orderRequestMessageId,t),t.oneofs&&(s._orderRequestMessageId="orderRequestMessageId")),A.catalogType!=null&&A.hasOwnProperty("catalogType")&&(s.catalogType=A.catalogType,t.oneofs&&(s._catalogType="catalogType")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.OrderMessage"},i.OrderStatus=(function(){let a={},A=Object.create(a);return A[a[1]="INQUIRY"]=1,A[a[2]="ACCEPTED"]=2,A[a[3]="DECLINED"]=3,A})(),i.OrderSurface=(function(){let a={},A=Object.create(a);return A[a[1]="CATALOG"]=1,A})(),i})(),r.PaymentExtendedMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.type=A.uint32();break}case 2:{c.platform=A.string();break}case 3:{c.messageParamsJson=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PaymentExtendedMetadata)return A;var t=new p.proto.Message.PaymentExtendedMetadata;return A.type!=null&&(t.type=A.type>>>0),A.platform!=null&&(t.platform=String(A.platform)),A.messageParamsJson!=null&&(t.messageParamsJson=String(A.messageParamsJson)),t},i.toObject=function(A,t){t||(t={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=A.type,t.oneofs&&(s._type="type")),A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=A.platform,t.oneofs&&(s._platform="platform")),A.messageParamsJson!=null&&A.hasOwnProperty("messageParamsJson")&&(s.messageParamsJson=A.messageParamsJson,t.oneofs&&(s._messageParamsJson="messageParamsJson")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentExtendedMetadata"},i})(),r.PaymentInviteMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.serviceType=A.int32();break}case 2:{c.expiryTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PaymentInviteMessage)return A;var t=new p.proto.Message.PaymentInviteMessage;switch(A.serviceType){default:if(typeof A.serviceType=="number"){t.serviceType=A.serviceType;break}break;case"UNKNOWN":case 0:t.serviceType=0;break;case"FBPAY":case 1:t.serviceType=1;break;case"NOVI":case 2:t.serviceType=2;break;case"UPI":case 3:t.serviceType=3;break}return A.expiryTimestamp!=null&&(l.Long?(t.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?t.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?t.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(t.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.serviceType!=null&&A.hasOwnProperty("serviceType")&&(s.serviceType=t.enums===String?p.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]===void 0?A.serviceType:p.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]:A.serviceType,t.oneofs&&(s._serviceType="serviceType")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=t.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=t.longs===String?oe(A.expiryTimestamp):t.longs===Number?ne(A.expiryTimestamp):A.expiryTimestamp,t.oneofs&&(s._expiryTimestamp="expiryTimestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentInviteMessage"},i.ServiceType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="FBPAY"]=1,A[a[2]="NOVI"]=2,A[a[3]="UPI"]=3,A})(),i})(),r.PaymentLinkMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.button=p.proto.Message.PaymentLinkMetadata.PaymentLinkButton.decode(A,A.uint32());break}case 2:{c.header=p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.decode(A,A.uint32());break}case 3:{c.provider=p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PaymentLinkMetadata)return A;var t=new p.proto.Message.PaymentLinkMetadata;if(A.button!=null){if(typeof A.button!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.button: object expected");t.button=p.proto.Message.PaymentLinkMetadata.PaymentLinkButton.fromObject(A.button)}if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.header: object expected");t.header=p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.fromObject(A.header)}if(A.provider!=null){if(typeof A.provider!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.provider: object expected");t.provider=p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.fromObject(A.provider)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.button!=null&&A.hasOwnProperty("button")&&(s.button=p.proto.Message.PaymentLinkMetadata.PaymentLinkButton.toObject(A.button,t),t.oneofs&&(s._button="button")),A.header!=null&&A.hasOwnProperty("header")&&(s.header=p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.toObject(A.header,t),t.oneofs&&(s._header="header")),A.provider!=null&&A.hasOwnProperty("provider")&&(s.provider=p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.toObject(A.provider,t),t.oneofs&&(s._provider="provider")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentLinkMetadata"},i.PaymentLinkButton=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.displayText=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PaymentLinkMetadata.PaymentLinkButton)return s;var g=new p.proto.Message.PaymentLinkMetadata.PaymentLinkButton;return s.displayText!=null&&(g.displayText=String(s.displayText)),g},a.toObject=function(s,g){g||(g={});var c={};return s.displayText!=null&&s.hasOwnProperty("displayText")&&(c.displayText=s.displayText,g.oneofs&&(c._displayText="displayText")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkButton"},a})(),i.PaymentLinkHeader=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.headerType=s.int32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader)return s;var g=new p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader;switch(s.headerType){default:if(typeof s.headerType=="number"){g.headerType=s.headerType;break}break;case"LINK_PREVIEW":case 0:g.headerType=0;break;case"ORDER":case 1:g.headerType=1;break}return g},a.toObject=function(s,g){g||(g={});var c={};return s.headerType!=null&&s.hasOwnProperty("headerType")&&(c.headerType=g.enums===String?p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]===void 0?s.headerType:p.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]:s.headerType,g.oneofs&&(c._headerType="headerType")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkHeader"},a.PaymentLinkHeaderType=(function(){let t={},s=Object.create(t);return s[t[0]="LINK_PREVIEW"]=0,s[t[1]="ORDER"]=1,s})(),a})(),i.PaymentLinkProvider=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.paramsJson=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider)return s;var g=new p.proto.Message.PaymentLinkMetadata.PaymentLinkProvider;return s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),g},a.toObject=function(s,g){g||(g={});var c={};return s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkProvider"},a})(),i})(),r.PeerDataOperationRequestMessage=(function(){function i(a){if(this.requestStickerReupload=[],this.requestUrlPreview=[],this.placeholderMessageResendRequest=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.requestStickerReupload&&c.requestStickerReupload.length||(c.requestStickerReupload=[]),c.requestStickerReupload.push(p.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.decode(A,A.uint32()));break}case 3:{c.requestUrlPreview&&c.requestUrlPreview.length||(c.requestUrlPreview=[]),c.requestUrlPreview.push(p.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.decode(A,A.uint32()));break}case 4:{c.historySyncOnDemandRequest=p.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.decode(A,A.uint32());break}case 5:{c.placeholderMessageResendRequest&&c.placeholderMessageResendRequest.length||(c.placeholderMessageResendRequest=[]),c.placeholderMessageResendRequest.push(p.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.decode(A,A.uint32()));break}case 6:{c.fullHistorySyncOnDemandRequest=p.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.decode(A,A.uint32());break}case 7:{c.syncdCollectionFatalRecoveryRequest=p.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.decode(A,A.uint32());break}case 8:{c.historySyncChunkRetryRequest=p.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest.decode(A,A.uint32());break}case 9:{c.galaxyFlowAction=p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PeerDataOperationRequestMessage)return A;var t=new p.proto.Message.PeerDataOperationRequestMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){t.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:t.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:t.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:t.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:t.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:t.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:t.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:t.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:t.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:t.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:t.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:t.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:t.peerDataOperationRequestType=11;break}if(A.requestStickerReupload){if(!Array.isArray(A.requestStickerReupload))throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestStickerReupload: array expected");t.requestStickerReupload=[];for(var s=0;s>>3){case 1:{d.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(s,s.uint32());break}case 2:{d.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest;if(s.requestMetadata!=null){if(typeof s.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.requestMetadata: object expected");g.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(s.requestMetadata)}if(s.historySyncConfig!=null){if(typeof s.historySyncConfig!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.historySyncConfig: object expected");g.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.fromObject(s.historySyncConfig)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.requestMetadata!=null&&s.hasOwnProperty("requestMetadata")&&(c.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(s.requestMetadata,g),g.oneofs&&(c._requestMetadata="requestMetadata")),s.historySyncConfig!=null&&s.hasOwnProperty("historySyncConfig")&&(c.historySyncConfig=p.proto.DeviceProps.HistorySyncConfig.toObject(s.historySyncConfig,g),g.oneofs&&(c._historySyncConfig="historySyncConfig")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest"},a})(),i.GalaxyFlowAction=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.type=s.int32();break}case 2:{d.flowId=s.string();break}case 3:{d.stanzaId=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction;switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"NOTIFY_LAUNCH":case 1:g.type=1;break}return s.flowId!=null&&(g.flowId=String(s.flowId)),s.stanzaId!=null&&(g.stanzaId=String(s.stanzaId)),g},a.toObject=function(s,g){g||(g={});var c={};return s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]===void 0?s.type:p.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]:s.type,g.oneofs&&(c._type="type")),s.flowId!=null&&s.hasOwnProperty("flowId")&&(c.flowId=s.flowId,g.oneofs&&(c._flowId="flowId")),s.stanzaId!=null&&s.hasOwnProperty("stanzaId")&&(c.stanzaId=s.stanzaId,g.oneofs&&(c._stanzaId="stanzaId")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction"},a.GalaxyFlowActionType=(function(){let t={},s=Object.create(t);return s[t[1]="NOTIFY_LAUNCH"]=1,s})(),a})(),i.HistorySyncChunkRetryRequest=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.syncType=s.int32();break}case 2:{d.chunkOrder=s.uint32();break}case 3:{d.chunkNotificationId=s.string();break}case 4:{d.regenerateChunk=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest;switch(s.syncType){default:if(typeof s.syncType=="number"){g.syncType=s.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:g.syncType=0;break;case"INITIAL_STATUS_V3":case 1:g.syncType=1;break;case"FULL":case 2:g.syncType=2;break;case"RECENT":case 3:g.syncType=3;break;case"PUSH_NAME":case 4:g.syncType=4;break;case"NON_BLOCKING_DATA":case 5:g.syncType=5;break;case"ON_DEMAND":case 6:g.syncType=6;break;case"NO_HISTORY":case 7:g.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:g.syncType=8;break}return s.chunkOrder!=null&&(g.chunkOrder=s.chunkOrder>>>0),s.chunkNotificationId!=null&&(g.chunkNotificationId=String(s.chunkNotificationId)),s.regenerateChunk!=null&&(g.regenerateChunk=!!s.regenerateChunk),g},a.toObject=function(s,g){g||(g={});var c={};return s.syncType!=null&&s.hasOwnProperty("syncType")&&(c.syncType=g.enums===String?p.proto.Message.HistorySyncType[s.syncType]===void 0?s.syncType:p.proto.Message.HistorySyncType[s.syncType]:s.syncType,g.oneofs&&(c._syncType="syncType")),s.chunkOrder!=null&&s.hasOwnProperty("chunkOrder")&&(c.chunkOrder=s.chunkOrder,g.oneofs&&(c._chunkOrder="chunkOrder")),s.chunkNotificationId!=null&&s.hasOwnProperty("chunkNotificationId")&&(c.chunkNotificationId=s.chunkNotificationId,g.oneofs&&(c._chunkNotificationId="chunkNotificationId")),s.regenerateChunk!=null&&s.hasOwnProperty("regenerateChunk")&&(c.regenerateChunk=s.regenerateChunk,g.oneofs&&(c._regenerateChunk="regenerateChunk")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest"},a})(),i.HistorySyncOnDemandRequest=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.chatJid=s.string();break}case 2:{d.oldestMsgId=s.string();break}case 3:{d.oldestMsgFromMe=s.bool();break}case 4:{d.onDemandMsgCount=s.int32();break}case 5:{d.oldestMsgTimestampMs=s.int64();break}case 6:{d.accountLid=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest;return s.chatJid!=null&&(g.chatJid=String(s.chatJid)),s.oldestMsgId!=null&&(g.oldestMsgId=String(s.oldestMsgId)),s.oldestMsgFromMe!=null&&(g.oldestMsgFromMe=!!s.oldestMsgFromMe),s.onDemandMsgCount!=null&&(g.onDemandMsgCount=s.onDemandMsgCount|0),s.oldestMsgTimestampMs!=null&&(l.Long?(g.oldestMsgTimestampMs=l.Long.fromValue(s.oldestMsgTimestampMs)).unsigned=!1:typeof s.oldestMsgTimestampMs=="string"?g.oldestMsgTimestampMs=parseInt(s.oldestMsgTimestampMs,10):typeof s.oldestMsgTimestampMs=="number"?g.oldestMsgTimestampMs=s.oldestMsgTimestampMs:typeof s.oldestMsgTimestampMs=="object"&&(g.oldestMsgTimestampMs=new l.LongBits(s.oldestMsgTimestampMs.low>>>0,s.oldestMsgTimestampMs.high>>>0).toNumber())),s.accountLid!=null&&(g.accountLid=String(s.accountLid)),g},a.toObject=function(s,g){g||(g={});var c={};return s.chatJid!=null&&s.hasOwnProperty("chatJid")&&(c.chatJid=s.chatJid,g.oneofs&&(c._chatJid="chatJid")),s.oldestMsgId!=null&&s.hasOwnProperty("oldestMsgId")&&(c.oldestMsgId=s.oldestMsgId,g.oneofs&&(c._oldestMsgId="oldestMsgId")),s.oldestMsgFromMe!=null&&s.hasOwnProperty("oldestMsgFromMe")&&(c.oldestMsgFromMe=s.oldestMsgFromMe,g.oneofs&&(c._oldestMsgFromMe="oldestMsgFromMe")),s.onDemandMsgCount!=null&&s.hasOwnProperty("onDemandMsgCount")&&(c.onDemandMsgCount=s.onDemandMsgCount,g.oneofs&&(c._onDemandMsgCount="onDemandMsgCount")),s.oldestMsgTimestampMs!=null&&s.hasOwnProperty("oldestMsgTimestampMs")&&(typeof s.oldestMsgTimestampMs=="number"?c.oldestMsgTimestampMs=g.longs===String?String(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs:c.oldestMsgTimestampMs=g.longs===String?oe(s.oldestMsgTimestampMs):g.longs===Number?ne(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs,g.oneofs&&(c._oldestMsgTimestampMs="oldestMsgTimestampMs")),s.accountLid!=null&&s.hasOwnProperty("accountLid")&&(c.accountLid=s.accountLid,g.oneofs&&(c._accountLid="accountLid")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest"},a})(),i.PlaceholderMessageResendRequest=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.messageKey=p.proto.MessageKey.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest;if(s.messageKey!=null){if(typeof s.messageKey!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey: object expected");g.messageKey=p.proto.MessageKey.fromObject(s.messageKey)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.messageKey!=null&&s.hasOwnProperty("messageKey")&&(c.messageKey=p.proto.MessageKey.toObject(s.messageKey,g),g.oneofs&&(c._messageKey="messageKey")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest"},a})(),i.RequestStickerReupload=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.fileSha256=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload;return s.fileSha256!=null&&(g.fileSha256=String(s.fileSha256)),g},a.toObject=function(s,g){g||(g={});var c={};return s.fileSha256!=null&&s.hasOwnProperty("fileSha256")&&(c.fileSha256=s.fileSha256,g.oneofs&&(c._fileSha256="fileSha256")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload"},a})(),i.RequestUrlPreview=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.url=s.string();break}case 2:{d.includeHqThumbnail=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview;return s.url!=null&&(g.url=String(s.url)),s.includeHqThumbnail!=null&&(g.includeHqThumbnail=!!s.includeHqThumbnail),g},a.toObject=function(s,g){g||(g={});var c={};return s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.includeHqThumbnail!=null&&s.hasOwnProperty("includeHqThumbnail")&&(c.includeHqThumbnail=s.includeHqThumbnail,g.oneofs&&(c._includeHqThumbnail="includeHqThumbnail")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview"},a})(),i.SyncDCollectionFatalRecoveryRequest=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.collectionName=s.string();break}case 2:{d.timestamp=s.int64();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest)return s;var g=new p.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest;return s.collectionName!=null&&(g.collectionName=String(s.collectionName)),s.timestamp!=null&&(l.Long?(g.timestamp=l.Long.fromValue(s.timestamp)).unsigned=!1:typeof s.timestamp=="string"?g.timestamp=parseInt(s.timestamp,10):typeof s.timestamp=="number"?g.timestamp=s.timestamp:typeof s.timestamp=="object"&&(g.timestamp=new l.LongBits(s.timestamp.low>>>0,s.timestamp.high>>>0).toNumber())),g},a.toObject=function(s,g){g||(g={});var c={};return s.collectionName!=null&&s.hasOwnProperty("collectionName")&&(c.collectionName=s.collectionName,g.oneofs&&(c._collectionName="collectionName")),s.timestamp!=null&&s.hasOwnProperty("timestamp")&&(typeof s.timestamp=="number"?c.timestamp=g.longs===String?String(s.timestamp):s.timestamp:c.timestamp=g.longs===String?oe(s.timestamp):g.longs===Number?ne(s.timestamp):s.timestamp,g.oneofs&&(c._timestamp="timestamp")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest"},a})(),i})(),r.PeerDataOperationRequestResponseMessage=(function(){function i(a){if(this.peerDataOperationResult=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.stanzaId=A.string();break}case 3:{c.peerDataOperationResult&&c.peerDataOperationResult.length||(c.peerDataOperationResult=[]),c.peerDataOperationResult.push(p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PeerDataOperationRequestResponseMessage)return A;var t=new p.proto.Message.PeerDataOperationRequestResponseMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){t.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:t.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:t.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:t.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:t.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:t.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:t.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:t.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:t.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:t.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:t.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:t.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:t.peerDataOperationRequestType=11;break}if(A.stanzaId!=null&&(t.stanzaId=String(A.stanzaId)),A.peerDataOperationResult){if(!Array.isArray(A.peerDataOperationResult))throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.peerDataOperationResult: array expected");t.peerDataOperationResult=[];for(var s=0;s>>3){case 1:{d.mediaUploadResult=s.int32();break}case 2:{d.stickerMessage=p.proto.Message.StickerMessage.decode(s,s.uint32());break}case 3:{d.linkPreviewResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.decode(s,s.uint32());break}case 4:{d.placeholderMessageResendResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.decode(s,s.uint32());break}case 5:{d.waffleNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.decode(s,s.uint32());break}case 6:{d.fullHistorySyncOnDemandRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.decode(s,s.uint32());break}case 7:{d.companionMetaNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.decode(s,s.uint32());break}case 8:{d.syncdSnapshotFatalRecoveryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.decode(s,s.uint32());break}case 9:{d.companionCanonicalUserNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.decode(s,s.uint32());break}case 10:{d.historySyncChunkRetryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult)return s;var g=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult;switch(s.mediaUploadResult){default:if(typeof s.mediaUploadResult=="number"){g.mediaUploadResult=s.mediaUploadResult;break}break;case"GENERAL_ERROR":case 0:g.mediaUploadResult=0;break;case"SUCCESS":case 1:g.mediaUploadResult=1;break;case"NOT_FOUND":case 2:g.mediaUploadResult=2;break;case"DECRYPTION_ERROR":case 3:g.mediaUploadResult=3;break}if(s.stickerMessage!=null){if(typeof s.stickerMessage!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage: object expected");g.stickerMessage=p.proto.Message.StickerMessage.fromObject(s.stickerMessage)}if(s.linkPreviewResponse!=null){if(typeof s.linkPreviewResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse: object expected");g.linkPreviewResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.fromObject(s.linkPreviewResponse)}if(s.placeholderMessageResendResponse!=null){if(typeof s.placeholderMessageResendResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse: object expected");g.placeholderMessageResendResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.fromObject(s.placeholderMessageResendResponse)}if(s.waffleNonceFetchRequestResponse!=null){if(typeof s.waffleNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.waffleNonceFetchRequestResponse: object expected");g.waffleNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.fromObject(s.waffleNonceFetchRequestResponse)}if(s.fullHistorySyncOnDemandRequestResponse!=null){if(typeof s.fullHistorySyncOnDemandRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.fullHistorySyncOnDemandRequestResponse: object expected");g.fullHistorySyncOnDemandRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.fromObject(s.fullHistorySyncOnDemandRequestResponse)}if(s.companionMetaNonceFetchRequestResponse!=null){if(typeof s.companionMetaNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionMetaNonceFetchRequestResponse: object expected");g.companionMetaNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.fromObject(s.companionMetaNonceFetchRequestResponse)}if(s.syncdSnapshotFatalRecoveryResponse!=null){if(typeof s.syncdSnapshotFatalRecoveryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.syncdSnapshotFatalRecoveryResponse: object expected");g.syncdSnapshotFatalRecoveryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.fromObject(s.syncdSnapshotFatalRecoveryResponse)}if(s.companionCanonicalUserNonceFetchRequestResponse!=null){if(typeof s.companionCanonicalUserNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionCanonicalUserNonceFetchRequestResponse: object expected");g.companionCanonicalUserNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.fromObject(s.companionCanonicalUserNonceFetchRequestResponse)}if(s.historySyncChunkRetryResponse!=null){if(typeof s.historySyncChunkRetryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.historySyncChunkRetryResponse: object expected");g.historySyncChunkRetryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.fromObject(s.historySyncChunkRetryResponse)}return g},a.toObject=function(s,g){g||(g={});var c={};return s.mediaUploadResult!=null&&s.hasOwnProperty("mediaUploadResult")&&(c.mediaUploadResult=g.enums===String?p.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]===void 0?s.mediaUploadResult:p.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]:s.mediaUploadResult,g.oneofs&&(c._mediaUploadResult="mediaUploadResult")),s.stickerMessage!=null&&s.hasOwnProperty("stickerMessage")&&(c.stickerMessage=p.proto.Message.StickerMessage.toObject(s.stickerMessage,g),g.oneofs&&(c._stickerMessage="stickerMessage")),s.linkPreviewResponse!=null&&s.hasOwnProperty("linkPreviewResponse")&&(c.linkPreviewResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.toObject(s.linkPreviewResponse,g),g.oneofs&&(c._linkPreviewResponse="linkPreviewResponse")),s.placeholderMessageResendResponse!=null&&s.hasOwnProperty("placeholderMessageResendResponse")&&(c.placeholderMessageResendResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.toObject(s.placeholderMessageResendResponse,g),g.oneofs&&(c._placeholderMessageResendResponse="placeholderMessageResendResponse")),s.waffleNonceFetchRequestResponse!=null&&s.hasOwnProperty("waffleNonceFetchRequestResponse")&&(c.waffleNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.toObject(s.waffleNonceFetchRequestResponse,g),g.oneofs&&(c._waffleNonceFetchRequestResponse="waffleNonceFetchRequestResponse")),s.fullHistorySyncOnDemandRequestResponse!=null&&s.hasOwnProperty("fullHistorySyncOnDemandRequestResponse")&&(c.fullHistorySyncOnDemandRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.toObject(s.fullHistorySyncOnDemandRequestResponse,g),g.oneofs&&(c._fullHistorySyncOnDemandRequestResponse="fullHistorySyncOnDemandRequestResponse")),s.companionMetaNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionMetaNonceFetchRequestResponse")&&(c.companionMetaNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.toObject(s.companionMetaNonceFetchRequestResponse,g),g.oneofs&&(c._companionMetaNonceFetchRequestResponse="companionMetaNonceFetchRequestResponse")),s.syncdSnapshotFatalRecoveryResponse!=null&&s.hasOwnProperty("syncdSnapshotFatalRecoveryResponse")&&(c.syncdSnapshotFatalRecoveryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.toObject(s.syncdSnapshotFatalRecoveryResponse,g),g.oneofs&&(c._syncdSnapshotFatalRecoveryResponse="syncdSnapshotFatalRecoveryResponse")),s.companionCanonicalUserNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionCanonicalUserNonceFetchRequestResponse")&&(c.companionCanonicalUserNonceFetchRequestResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.toObject(s.companionCanonicalUserNonceFetchRequestResponse,g),g.oneofs&&(c._companionCanonicalUserNonceFetchRequestResponse="companionCanonicalUserNonceFetchRequestResponse")),s.historySyncChunkRetryResponse!=null&&s.hasOwnProperty("historySyncChunkRetryResponse")&&(c.historySyncChunkRetryResponse=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.toObject(s.historySyncChunkRetryResponse,g),g.oneofs&&(c._historySyncChunkRetryResponse="historySyncChunkRetryResponse")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult"},a.CompanionCanonicalUserNonceFetchResponse=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waFbid=c.string();break}case 3:{f.forceRefresh=c.bool();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waFbid!=null&&(I.waFbid=String(c.waFbid)),c.forceRefresh!=null&&(I.forceRefresh=!!c.forceRefresh),I},t.toObject=function(c,I){I||(I={});var d={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(d.nonce=c.nonce,I.oneofs&&(d._nonce="nonce")),c.waFbid!=null&&c.hasOwnProperty("waFbid")&&(d.waFbid=c.waFbid,I.oneofs&&(d._waFbid="waFbid")),c.forceRefresh!=null&&c.hasOwnProperty("forceRefresh")&&(d.forceRefresh=c.forceRefresh,I.oneofs&&(d._forceRefresh="forceRefresh")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse"},t})(),a.CompanionMetaNonceFetchResponse=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),I},t.toObject=function(c,I){I||(I={});var d={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(d.nonce=c.nonce,I.oneofs&&(d._nonce="nonce")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse"},t})(),a.FullHistorySyncOnDemandRequestResponse=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(c,c.uint32());break}case 2:{f.responseCode=c.int32();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse;if(c.requestMetadata!=null){if(typeof c.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.requestMetadata: object expected");I.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(c.requestMetadata)}switch(c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"REQUEST_SUCCESS":case 0:I.responseCode=0;break;case"REQUEST_TIME_EXPIRED":case 1:I.responseCode=1;break;case"DECLINED_SHARING_HISTORY":case 2:I.responseCode=2;break;case"GENERIC_ERROR":case 3:I.responseCode=3;break;case"ERROR_REQUEST_ON_NON_SMB_PRIMARY":case 4:I.responseCode=4;break;case"ERROR_HOSTED_DEVICE_NOT_CONNECTED":case 5:I.responseCode=5;break;case"ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET":case 6:I.responseCode=6;break}return I},t.toObject=function(c,I){I||(I={});var d={};return c.requestMetadata!=null&&c.hasOwnProperty("requestMetadata")&&(d.requestMetadata=p.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(c.requestMetadata,I),I.oneofs&&(d._requestMetadata="requestMetadata")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(d.responseCode=I.enums===String?p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]===void 0?c.responseCode:p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(d._responseCode="responseCode")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse"},t})(),a.FullHistorySyncOnDemandResponseCode=(function(){let t={},s=Object.create(t);return s[t[0]="REQUEST_SUCCESS"]=0,s[t[1]="REQUEST_TIME_EXPIRED"]=1,s[t[2]="DECLINED_SHARING_HISTORY"]=2,s[t[3]="GENERIC_ERROR"]=3,s[t[4]="ERROR_REQUEST_ON_NON_SMB_PRIMARY"]=4,s[t[5]="ERROR_HOSTED_DEVICE_NOT_CONNECTED"]=5,s[t[6]="ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET"]=6,s})(),a.HistorySyncChunkRetryResponse=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.syncType=c.int32();break}case 2:{f.chunkOrder=c.uint32();break}case 3:{f.requestId=c.string();break}case 4:{f.responseCode=c.int32();break}case 5:{f.canRecover=c.bool();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse;switch(c.syncType){default:if(typeof c.syncType=="number"){I.syncType=c.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:I.syncType=0;break;case"INITIAL_STATUS_V3":case 1:I.syncType=1;break;case"FULL":case 2:I.syncType=2;break;case"RECENT":case 3:I.syncType=3;break;case"PUSH_NAME":case 4:I.syncType=4;break;case"NON_BLOCKING_DATA":case 5:I.syncType=5;break;case"ON_DEMAND":case 6:I.syncType=6;break;case"NO_HISTORY":case 7:I.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:I.syncType=8;break}switch(c.chunkOrder!=null&&(I.chunkOrder=c.chunkOrder>>>0),c.requestId!=null&&(I.requestId=String(c.requestId)),c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"GENERATION_ERROR":case 1:I.responseCode=1;break;case"CHUNK_CONSUMED":case 2:I.responseCode=2;break;case"TIMEOUT":case 3:I.responseCode=3;break;case"SESSION_EXHAUSTED":case 4:I.responseCode=4;break;case"CHUNK_EXHAUSTED":case 5:I.responseCode=5;break;case"DUPLICATED_REQUEST":case 6:I.responseCode=6;break}return c.canRecover!=null&&(I.canRecover=!!c.canRecover),I},t.toObject=function(c,I){I||(I={});var d={};return c.syncType!=null&&c.hasOwnProperty("syncType")&&(d.syncType=I.enums===String?p.proto.Message.HistorySyncType[c.syncType]===void 0?c.syncType:p.proto.Message.HistorySyncType[c.syncType]:c.syncType,I.oneofs&&(d._syncType="syncType")),c.chunkOrder!=null&&c.hasOwnProperty("chunkOrder")&&(d.chunkOrder=c.chunkOrder,I.oneofs&&(d._chunkOrder="chunkOrder")),c.requestId!=null&&c.hasOwnProperty("requestId")&&(d.requestId=c.requestId,I.oneofs&&(d._requestId="requestId")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(d.responseCode=I.enums===String?p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]===void 0?c.responseCode:p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(d._responseCode="responseCode")),c.canRecover!=null&&c.hasOwnProperty("canRecover")&&(d.canRecover=c.canRecover,I.oneofs&&(d._canRecover="canRecover")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse"},t})(),a.HistorySyncChunkRetryResponseCode=(function(){let t={},s=Object.create(t);return s[t[1]="GENERATION_ERROR"]=1,s[t[2]="CHUNK_CONSUMED"]=2,s[t[3]="TIMEOUT"]=3,s[t[4]="SESSION_EXHAUSTED"]=4,s[t[5]="CHUNK_EXHAUSTED"]=5,s[t[6]="DUPLICATED_REQUEST"]=6,s})(),a.LinkPreviewResponse=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.url=c.string();break}case 2:{f.title=c.string();break}case 3:{f.description=c.string();break}case 4:{f.thumbData=c.bytes();break}case 6:{f.matchText=c.string();break}case 7:{f.previewType=c.string();break}case 8:{f.hqThumbnail=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.decode(c,c.uint32());break}case 9:{f.previewMetadata=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse;if(c.url!=null&&(I.url=String(c.url)),c.title!=null&&(I.title=String(c.title)),c.description!=null&&(I.description=String(c.description)),c.thumbData!=null&&(typeof c.thumbData=="string"?l.base64.decode(c.thumbData,I.thumbData=l.newBuffer(l.base64.length(c.thumbData)),0):c.thumbData.length>=0&&(I.thumbData=c.thumbData)),c.matchText!=null&&(I.matchText=String(c.matchText)),c.previewType!=null&&(I.previewType=String(c.previewType)),c.hqThumbnail!=null){if(typeof c.hqThumbnail!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail: object expected");I.hqThumbnail=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.fromObject(c.hqThumbnail)}if(c.previewMetadata!=null){if(typeof c.previewMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.previewMetadata: object expected");I.previewMetadata=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.fromObject(c.previewMetadata)}return I},t.toObject=function(c,I){I||(I={});var d={};return c.url!=null&&c.hasOwnProperty("url")&&(d.url=c.url,I.oneofs&&(d._url="url")),c.title!=null&&c.hasOwnProperty("title")&&(d.title=c.title,I.oneofs&&(d._title="title")),c.description!=null&&c.hasOwnProperty("description")&&(d.description=c.description,I.oneofs&&(d._description="description")),c.thumbData!=null&&c.hasOwnProperty("thumbData")&&(d.thumbData=I.bytes===String?l.base64.encode(c.thumbData,0,c.thumbData.length):I.bytes===Array?Array.prototype.slice.call(c.thumbData):c.thumbData,I.oneofs&&(d._thumbData="thumbData")),c.matchText!=null&&c.hasOwnProperty("matchText")&&(d.matchText=c.matchText,I.oneofs&&(d._matchText="matchText")),c.previewType!=null&&c.hasOwnProperty("previewType")&&(d.previewType=c.previewType,I.oneofs&&(d._previewType="previewType")),c.hqThumbnail!=null&&c.hasOwnProperty("hqThumbnail")&&(d.hqThumbnail=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.toObject(c.hqThumbnail,I),I.oneofs&&(d._hqThumbnail="hqThumbnail")),c.previewMetadata!=null&&c.hasOwnProperty("previewMetadata")&&(d.previewMetadata=p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.toObject(c.previewMetadata,I),I.oneofs&&(d._previewMetadata="previewMetadata")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse"},t.LinkPreviewHighQualityThumbnail=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.directPath=d.string();break}case 2:{y.thumbHash=d.string();break}case 3:{y.encThumbHash=d.string();break}case 4:{y.mediaKey=d.bytes();break}case 5:{y.mediaKeyTimestampMs=d.int64();break}case 6:{y.thumbWidth=d.int32();break}case 7:{y.thumbHeight=d.int32();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail)return d;var B=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail;return d.directPath!=null&&(B.directPath=String(d.directPath)),d.thumbHash!=null&&(B.thumbHash=String(d.thumbHash)),d.encThumbHash!=null&&(B.encThumbHash=String(d.encThumbHash)),d.mediaKey!=null&&(typeof d.mediaKey=="string"?l.base64.decode(d.mediaKey,B.mediaKey=l.newBuffer(l.base64.length(d.mediaKey)),0):d.mediaKey.length>=0&&(B.mediaKey=d.mediaKey)),d.mediaKeyTimestampMs!=null&&(l.Long?(B.mediaKeyTimestampMs=l.Long.fromValue(d.mediaKeyTimestampMs)).unsigned=!1:typeof d.mediaKeyTimestampMs=="string"?B.mediaKeyTimestampMs=parseInt(d.mediaKeyTimestampMs,10):typeof d.mediaKeyTimestampMs=="number"?B.mediaKeyTimestampMs=d.mediaKeyTimestampMs:typeof d.mediaKeyTimestampMs=="object"&&(B.mediaKeyTimestampMs=new l.LongBits(d.mediaKeyTimestampMs.low>>>0,d.mediaKeyTimestampMs.high>>>0).toNumber())),d.thumbWidth!=null&&(B.thumbWidth=d.thumbWidth|0),d.thumbHeight!=null&&(B.thumbHeight=d.thumbHeight|0),B},g.toObject=function(d,B){B||(B={});var f={};return d.directPath!=null&&d.hasOwnProperty("directPath")&&(f.directPath=d.directPath,B.oneofs&&(f._directPath="directPath")),d.thumbHash!=null&&d.hasOwnProperty("thumbHash")&&(f.thumbHash=d.thumbHash,B.oneofs&&(f._thumbHash="thumbHash")),d.encThumbHash!=null&&d.hasOwnProperty("encThumbHash")&&(f.encThumbHash=d.encThumbHash,B.oneofs&&(f._encThumbHash="encThumbHash")),d.mediaKey!=null&&d.hasOwnProperty("mediaKey")&&(f.mediaKey=B.bytes===String?l.base64.encode(d.mediaKey,0,d.mediaKey.length):B.bytes===Array?Array.prototype.slice.call(d.mediaKey):d.mediaKey,B.oneofs&&(f._mediaKey="mediaKey")),d.mediaKeyTimestampMs!=null&&d.hasOwnProperty("mediaKeyTimestampMs")&&(typeof d.mediaKeyTimestampMs=="number"?f.mediaKeyTimestampMs=B.longs===String?String(d.mediaKeyTimestampMs):d.mediaKeyTimestampMs:f.mediaKeyTimestampMs=B.longs===String?oe(d.mediaKeyTimestampMs):B.longs===Number?ne(d.mediaKeyTimestampMs):d.mediaKeyTimestampMs,B.oneofs&&(f._mediaKeyTimestampMs="mediaKeyTimestampMs")),d.thumbWidth!=null&&d.hasOwnProperty("thumbWidth")&&(f.thumbWidth=d.thumbWidth,B.oneofs&&(f._thumbWidth="thumbWidth")),d.thumbHeight!=null&&d.hasOwnProperty("thumbHeight")&&(f.thumbHeight=d.thumbHeight,B.oneofs&&(f._thumbHeight="thumbHeight")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail"},g})(),t.PaymentLinkPreviewMetadata=(function(){function g(I){if(I)for(var d=Object.keys(I),B=0;B>>3){case 1:{y.isBusinessVerified=d.bool();break}case 2:{y.providerName=d.string();break}default:d.skipType(m&7);break}}return y},g.fromObject=function(d){if(d instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata)return d;var B=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata;return d.isBusinessVerified!=null&&(B.isBusinessVerified=!!d.isBusinessVerified),d.providerName!=null&&(B.providerName=String(d.providerName)),B},g.toObject=function(d,B){B||(B={});var f={};return d.isBusinessVerified!=null&&d.hasOwnProperty("isBusinessVerified")&&(f.isBusinessVerified=d.isBusinessVerified,B.oneofs&&(f._isBusinessVerified="isBusinessVerified")),d.providerName!=null&&d.hasOwnProperty("providerName")&&(f.providerName=d.providerName,B.oneofs&&(f._providerName="providerName")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},g.getTypeUrl=function(d){return d===void 0&&(d="type.googleapis.com"),d+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata"},g})(),t})(),a.PlaceholderMessageResendResponse=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.webMessageInfoBytes=c.bytes();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse;return c.webMessageInfoBytes!=null&&(typeof c.webMessageInfoBytes=="string"?l.base64.decode(c.webMessageInfoBytes,I.webMessageInfoBytes=l.newBuffer(l.base64.length(c.webMessageInfoBytes)),0):c.webMessageInfoBytes.length>=0&&(I.webMessageInfoBytes=c.webMessageInfoBytes)),I},t.toObject=function(c,I){I||(I={});var d={};return c.webMessageInfoBytes!=null&&c.hasOwnProperty("webMessageInfoBytes")&&(d.webMessageInfoBytes=I.bytes===String?l.base64.encode(c.webMessageInfoBytes,0,c.webMessageInfoBytes.length):I.bytes===Array?Array.prototype.slice.call(c.webMessageInfoBytes):c.webMessageInfoBytes,I.oneofs&&(d._webMessageInfoBytes="webMessageInfoBytes")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse"},t})(),a.SyncDSnapshotFatalRecoveryResponse=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.collectionSnapshot=c.bytes();break}case 2:{f.isCompressed=c.bool();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse;return c.collectionSnapshot!=null&&(typeof c.collectionSnapshot=="string"?l.base64.decode(c.collectionSnapshot,I.collectionSnapshot=l.newBuffer(l.base64.length(c.collectionSnapshot)),0):c.collectionSnapshot.length>=0&&(I.collectionSnapshot=c.collectionSnapshot)),c.isCompressed!=null&&(I.isCompressed=!!c.isCompressed),I},t.toObject=function(c,I){I||(I={});var d={};return c.collectionSnapshot!=null&&c.hasOwnProperty("collectionSnapshot")&&(d.collectionSnapshot=I.bytes===String?l.base64.encode(c.collectionSnapshot,0,c.collectionSnapshot.length):I.bytes===Array?Array.prototype.slice.call(c.collectionSnapshot):c.collectionSnapshot,I.oneofs&&(d._collectionSnapshot="collectionSnapshot")),c.isCompressed!=null&&c.hasOwnProperty("isCompressed")&&(d.isCompressed=c.isCompressed,I.oneofs&&(d._isCompressed="isCompressed")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse"},t})(),a.WaffleNonceFetchResponse=(function(){function t(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waEntFbid=c.string();break}default:c.skipType(Q&7);break}}return f},t.fromObject=function(c){if(c instanceof p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse)return c;var I=new p.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waEntFbid!=null&&(I.waEntFbid=String(c.waEntFbid)),I},t.toObject=function(c,I){I||(I={});var d={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(d.nonce=c.nonce,I.oneofs&&(d._nonce="nonce")),c.waEntFbid!=null&&c.hasOwnProperty("waEntFbid")&&(d.waEntFbid=c.waEntFbid,I.oneofs&&(d._waEntFbid="waEntFbid")),d},t.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},t.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse"},t})(),a})(),i})(),r.PeerDataOperationRequestType=(function(){let i={},e=Object.create(i);return e[i[0]="UPLOAD_STICKER"]=0,e[i[1]="SEND_RECENT_STICKER_BOOTSTRAP"]=1,e[i[2]="GENERATE_LINK_PREVIEW"]=2,e[i[3]="HISTORY_SYNC_ON_DEMAND"]=3,e[i[4]="PLACEHOLDER_MESSAGE_RESEND"]=4,e[i[5]="WAFFLE_LINKING_NONCE_FETCH"]=5,e[i[6]="FULL_HISTORY_SYNC_ON_DEMAND"]=6,e[i[7]="COMPANION_META_NONCE_FETCH"]=7,e[i[8]="COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY"]=8,e[i[9]="COMPANION_CANONICAL_USER_NONCE_FETCH"]=9,e[i[10]="HISTORY_SYNC_CHUNK_RETRY"]=10,e[i[11]="GALAXY_FLOW_ACTION"]=11,e})(),r.PinInChatMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 3:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PinInChatMessage)return A;var t=new p.proto.Message.PinInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.PinInChatMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"UNKNOWN_TYPE":case 0:t.type=0;break;case"PIN_FOR_ALL":case 1:t.type=1;break;case"UNPIN_FOR_ALL":case 2:t.type=2;break}return A.senderTimestampMs!=null&&(l.Long?(t.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?t.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?t.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(t.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.Message.PinInChatMessage.Type[A.type]===void 0?A.type:p.proto.Message.PinInChatMessage.Type[A.type]:A.type,t.oneofs&&(s._type="type")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=t.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=t.longs===String?oe(A.senderTimestampMs):t.longs===Number?ne(A.senderTimestampMs):A.senderTimestampMs,t.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PinInChatMessage"},i.Type=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN_TYPE"]=0,A[a[1]="PIN_FOR_ALL"]=1,A[a[2]="UNPIN_FOR_ALL"]=2,A})(),i})(),r.PlaceholderMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PlaceholderMessage)return A;var t=new p.proto.Message.PlaceholderMessage;switch(A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"MASK_LINKED_DEVICES":case 0:t.type=0;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.Message.PlaceholderMessage.PlaceholderType[A.type]===void 0?A.type:p.proto.Message.PlaceholderMessage.PlaceholderType[A.type]:A.type,t.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PlaceholderMessage"},i.PlaceholderType=(function(){let a={},A=Object.create(a);return A[a[0]="MASK_LINKED_DEVICES"]=0,A})(),i})(),r.PollContentType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="TEXT"]=1,e[i[2]="IMAGE"]=2,e})(),r.PollCreationMessage=(function(){function i(a){if(this.options=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.encKey=A.bytes();break}case 2:{c.name=A.string();break}case 3:{c.options&&c.options.length||(c.options=[]),c.options.push(p.proto.Message.PollCreationMessage.Option.decode(A,A.uint32()));break}case 4:{c.selectableOptionsCount=A.uint32();break}case 5:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 6:{c.pollContentType=A.int32();break}case 7:{c.pollType=A.int32();break}case 8:{c.correctAnswer=p.proto.Message.PollCreationMessage.Option.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollCreationMessage)return A;var t=new p.proto.Message.PollCreationMessage;if(A.encKey!=null&&(typeof A.encKey=="string"?l.base64.decode(A.encKey,t.encKey=l.newBuffer(l.base64.length(A.encKey)),0):A.encKey.length>=0&&(t.encKey=A.encKey)),A.name!=null&&(t.name=String(A.name)),A.options){if(!Array.isArray(A.options))throw TypeError(".proto.Message.PollCreationMessage.options: array expected");t.options=[];for(var s=0;s>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.PollCreationMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.pollContentType){default:if(typeof A.pollContentType=="number"){t.pollContentType=A.pollContentType;break}break;case"UNKNOWN":case 0:t.pollContentType=0;break;case"TEXT":case 1:t.pollContentType=1;break;case"IMAGE":case 2:t.pollContentType=2;break}switch(A.pollType){default:if(typeof A.pollType=="number"){t.pollType=A.pollType;break}break;case"POLL":case 0:t.pollType=0;break;case"QUIZ":case 1:t.pollType=1;break}if(A.correctAnswer!=null){if(typeof A.correctAnswer!="object")throw TypeError(".proto.Message.PollCreationMessage.correctAnswer: object expected");t.correctAnswer=p.proto.Message.PollCreationMessage.Option.fromObject(A.correctAnswer)}return t},i.toObject=function(A,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.options=[]),A.encKey!=null&&A.hasOwnProperty("encKey")&&(s.encKey=t.bytes===String?l.base64.encode(A.encKey,0,A.encKey.length):t.bytes===Array?Array.prototype.slice.call(A.encKey):A.encKey,t.oneofs&&(s._encKey="encKey")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),A.options&&A.options.length){s.options=[];for(var g=0;g>>3){case 1:{d.optionName=s.string();break}case 2:{d.optionHash=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PollCreationMessage.Option)return s;var g=new p.proto.Message.PollCreationMessage.Option;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionHash!=null&&(g.optionHash=String(s.optionHash)),g},a.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionHash!=null&&s.hasOwnProperty("optionHash")&&(c.optionHash=s.optionHash,g.oneofs&&(c._optionHash="optionHash")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollCreationMessage.Option"},a})(),i})(),r.PollEncValue=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.encPayload=A.bytes();break}case 2:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollEncValue)return A;var t=new p.proto.Message.PollEncValue;return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,t.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(t.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,t.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(t.encIv=A.encIv)),t},i.toObject=function(A,t){t||(t={});var s={};return A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=t.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):t.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,t.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=t.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):t.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,t.oneofs&&(s._encIv="encIv")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollEncValue"},i})(),r.PollResultSnapshotMessage=(function(){function i(a){if(this.pollVotes=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.name=A.string();break}case 2:{c.pollVotes&&c.pollVotes.length||(c.pollVotes=[]),c.pollVotes.push(p.proto.Message.PollResultSnapshotMessage.PollVote.decode(A,A.uint32()));break}case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.pollType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollResultSnapshotMessage)return A;var t=new p.proto.Message.PollResultSnapshotMessage;if(A.name!=null&&(t.name=String(A.name)),A.pollVotes){if(!Array.isArray(A.pollVotes))throw TypeError(".proto.Message.PollResultSnapshotMessage.pollVotes: array expected");t.pollVotes=[];for(var s=0;s>>3){case 1:{d.optionName=s.string();break}case 2:{d.optionVoteCount=s.int64();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.PollResultSnapshotMessage.PollVote)return s;var g=new p.proto.Message.PollResultSnapshotMessage.PollVote;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionVoteCount!=null&&(l.Long?(g.optionVoteCount=l.Long.fromValue(s.optionVoteCount)).unsigned=!1:typeof s.optionVoteCount=="string"?g.optionVoteCount=parseInt(s.optionVoteCount,10):typeof s.optionVoteCount=="number"?g.optionVoteCount=s.optionVoteCount:typeof s.optionVoteCount=="object"&&(g.optionVoteCount=new l.LongBits(s.optionVoteCount.low>>>0,s.optionVoteCount.high>>>0).toNumber())),g},a.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionVoteCount!=null&&s.hasOwnProperty("optionVoteCount")&&(typeof s.optionVoteCount=="number"?c.optionVoteCount=g.longs===String?String(s.optionVoteCount):s.optionVoteCount:c.optionVoteCount=g.longs===String?oe(s.optionVoteCount):g.longs===Number?ne(s.optionVoteCount):s.optionVoteCount,g.oneofs&&(c._optionVoteCount="optionVoteCount")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollResultSnapshotMessage.PollVote"},a})(),i})(),r.PollType=(function(){let i={},e=Object.create(i);return e[i[0]="POLL"]=0,e[i[1]="QUIZ"]=1,e})(),r.PollUpdateMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.pollCreationMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.vote=p.proto.Message.PollEncValue.decode(A,A.uint32());break}case 3:{c.metadata=p.proto.Message.PollUpdateMessageMetadata.decode(A,A.uint32());break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.PollUpdateMessage)return A;var t=new p.proto.Message.PollUpdateMessage;if(A.pollCreationMessageKey!=null){if(typeof A.pollCreationMessageKey!="object")throw TypeError(".proto.Message.PollUpdateMessage.pollCreationMessageKey: object expected");t.pollCreationMessageKey=p.proto.MessageKey.fromObject(A.pollCreationMessageKey)}if(A.vote!=null){if(typeof A.vote!="object")throw TypeError(".proto.Message.PollUpdateMessage.vote: object expected");t.vote=p.proto.Message.PollEncValue.fromObject(A.vote)}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.Message.PollUpdateMessage.metadata: object expected");t.metadata=p.proto.Message.PollUpdateMessageMetadata.fromObject(A.metadata)}return A.senderTimestampMs!=null&&(l.Long?(t.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?t.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?t.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(t.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.pollCreationMessageKey!=null&&A.hasOwnProperty("pollCreationMessageKey")&&(s.pollCreationMessageKey=p.proto.MessageKey.toObject(A.pollCreationMessageKey,t),t.oneofs&&(s._pollCreationMessageKey="pollCreationMessageKey")),A.vote!=null&&A.hasOwnProperty("vote")&&(s.vote=p.proto.Message.PollEncValue.toObject(A.vote,t),t.oneofs&&(s._vote="vote")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=p.proto.Message.PollUpdateMessageMetadata.toObject(A.metadata,t),t.oneofs&&(s._metadata="metadata")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=t.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=t.longs===String?oe(A.senderTimestampMs):t.longs===Number?ne(A.senderTimestampMs):A.senderTimestampMs,t.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollUpdateMessage"},i})(),r.PollUpdateMessageMetadata=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){default:a.skipType(c&7);break}}return g},i.fromObject=function(a){return a instanceof p.proto.Message.PollUpdateMessageMetadata?a:new p.proto.Message.PollUpdateMessageMetadata},i.toObject=function(){return{}},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.Message.PollUpdateMessageMetadata"},i})(),r.PollVoteMessage=(function(){function i(e){if(this.selectedOptions=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.selectedOptions&&g.selectedOptions.length||(g.selectedOptions=[]),g.selectedOptions.push(a.bytes());break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.PollVoteMessage)return a;var A=new p.proto.Message.PollVoteMessage;if(a.selectedOptions){if(!Array.isArray(a.selectedOptions))throw TypeError(".proto.Message.PollVoteMessage.selectedOptions: array expected");A.selectedOptions=[];for(var t=0;t=0&&(A.selectedOptions[t]=a.selectedOptions[t])}return A},i.toObject=function(a,A){A||(A={});var t={};if((A.arrays||A.defaults)&&(t.selectedOptions=[]),a.selectedOptions&&a.selectedOptions.length){t.selectedOptions=[];for(var s=0;s>>3){case 1:{c.product=p.proto.Message.ProductMessage.ProductSnapshot.decode(A,A.uint32());break}case 2:{c.businessOwnerJid=A.string();break}case 4:{c.catalog=p.proto.Message.ProductMessage.CatalogSnapshot.decode(A,A.uint32());break}case 5:{c.body=A.string();break}case 6:{c.footer=A.string();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ProductMessage)return A;var t=new p.proto.Message.ProductMessage;if(A.product!=null){if(typeof A.product!="object")throw TypeError(".proto.Message.ProductMessage.product: object expected");t.product=p.proto.Message.ProductMessage.ProductSnapshot.fromObject(A.product)}if(A.businessOwnerJid!=null&&(t.businessOwnerJid=String(A.businessOwnerJid)),A.catalog!=null){if(typeof A.catalog!="object")throw TypeError(".proto.Message.ProductMessage.catalog: object expected");t.catalog=p.proto.Message.ProductMessage.CatalogSnapshot.fromObject(A.catalog)}if(A.body!=null&&(t.body=String(A.body)),A.footer!=null&&(t.footer=String(A.footer)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ProductMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.product!=null&&A.hasOwnProperty("product")&&(s.product=p.proto.Message.ProductMessage.ProductSnapshot.toObject(A.product,t),t.oneofs&&(s._product="product")),A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,t.oneofs&&(s._businessOwnerJid="businessOwnerJid")),A.catalog!=null&&A.hasOwnProperty("catalog")&&(s.catalog=p.proto.Message.ProductMessage.CatalogSnapshot.toObject(A.catalog,t),t.oneofs&&(s._catalog="catalog")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,t.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=A.footer,t.oneofs&&(s._footer="footer")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProductMessage"},i.CatalogSnapshot=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.catalogImage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{d.title=s.string();break}case 3:{d.description=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ProductMessage.CatalogSnapshot)return s;var g=new p.proto.Message.ProductMessage.CatalogSnapshot;if(s.catalogImage!=null){if(typeof s.catalogImage!="object")throw TypeError(".proto.Message.ProductMessage.CatalogSnapshot.catalogImage: object expected");g.catalogImage=p.proto.Message.ImageMessage.fromObject(s.catalogImage)}return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),g},a.toObject=function(s,g){g||(g={});var c={};return s.catalogImage!=null&&s.hasOwnProperty("catalogImage")&&(c.catalogImage=p.proto.Message.ImageMessage.toObject(s.catalogImage,g),g.oneofs&&(c._catalogImage="catalogImage")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.CatalogSnapshot"},a})(),i.ProductSnapshot=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.productImage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{d.productId=s.string();break}case 3:{d.title=s.string();break}case 4:{d.description=s.string();break}case 5:{d.currencyCode=s.string();break}case 6:{d.priceAmount1000=s.int64();break}case 7:{d.retailerId=s.string();break}case 8:{d.url=s.string();break}case 9:{d.productImageCount=s.uint32();break}case 11:{d.firstImageId=s.string();break}case 12:{d.salePriceAmount1000=s.int64();break}case 13:{d.signedUrl=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.ProductMessage.ProductSnapshot)return s;var g=new p.proto.Message.ProductMessage.ProductSnapshot;if(s.productImage!=null){if(typeof s.productImage!="object")throw TypeError(".proto.Message.ProductMessage.ProductSnapshot.productImage: object expected");g.productImage=p.proto.Message.ImageMessage.fromObject(s.productImage)}return s.productId!=null&&(g.productId=String(s.productId)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.currencyCode!=null&&(g.currencyCode=String(s.currencyCode)),s.priceAmount1000!=null&&(l.Long?(g.priceAmount1000=l.Long.fromValue(s.priceAmount1000)).unsigned=!1:typeof s.priceAmount1000=="string"?g.priceAmount1000=parseInt(s.priceAmount1000,10):typeof s.priceAmount1000=="number"?g.priceAmount1000=s.priceAmount1000:typeof s.priceAmount1000=="object"&&(g.priceAmount1000=new l.LongBits(s.priceAmount1000.low>>>0,s.priceAmount1000.high>>>0).toNumber())),s.retailerId!=null&&(g.retailerId=String(s.retailerId)),s.url!=null&&(g.url=String(s.url)),s.productImageCount!=null&&(g.productImageCount=s.productImageCount>>>0),s.firstImageId!=null&&(g.firstImageId=String(s.firstImageId)),s.salePriceAmount1000!=null&&(l.Long?(g.salePriceAmount1000=l.Long.fromValue(s.salePriceAmount1000)).unsigned=!1:typeof s.salePriceAmount1000=="string"?g.salePriceAmount1000=parseInt(s.salePriceAmount1000,10):typeof s.salePriceAmount1000=="number"?g.salePriceAmount1000=s.salePriceAmount1000:typeof s.salePriceAmount1000=="object"&&(g.salePriceAmount1000=new l.LongBits(s.salePriceAmount1000.low>>>0,s.salePriceAmount1000.high>>>0).toNumber())),s.signedUrl!=null&&(g.signedUrl=String(s.signedUrl)),g},a.toObject=function(s,g){g||(g={});var c={};return s.productImage!=null&&s.hasOwnProperty("productImage")&&(c.productImage=p.proto.Message.ImageMessage.toObject(s.productImage,g),g.oneofs&&(c._productImage="productImage")),s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.currencyCode!=null&&s.hasOwnProperty("currencyCode")&&(c.currencyCode=s.currencyCode,g.oneofs&&(c._currencyCode="currencyCode")),s.priceAmount1000!=null&&s.hasOwnProperty("priceAmount1000")&&(typeof s.priceAmount1000=="number"?c.priceAmount1000=g.longs===String?String(s.priceAmount1000):s.priceAmount1000:c.priceAmount1000=g.longs===String?oe(s.priceAmount1000):g.longs===Number?ne(s.priceAmount1000):s.priceAmount1000,g.oneofs&&(c._priceAmount1000="priceAmount1000")),s.retailerId!=null&&s.hasOwnProperty("retailerId")&&(c.retailerId=s.retailerId,g.oneofs&&(c._retailerId="retailerId")),s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.productImageCount!=null&&s.hasOwnProperty("productImageCount")&&(c.productImageCount=s.productImageCount,g.oneofs&&(c._productImageCount="productImageCount")),s.firstImageId!=null&&s.hasOwnProperty("firstImageId")&&(c.firstImageId=s.firstImageId,g.oneofs&&(c._firstImageId="firstImageId")),s.salePriceAmount1000!=null&&s.hasOwnProperty("salePriceAmount1000")&&(typeof s.salePriceAmount1000=="number"?c.salePriceAmount1000=g.longs===String?String(s.salePriceAmount1000):s.salePriceAmount1000:c.salePriceAmount1000=g.longs===String?oe(s.salePriceAmount1000):g.longs===Number?ne(s.salePriceAmount1000):s.salePriceAmount1000,g.oneofs&&(c._salePriceAmount1000="salePriceAmount1000")),s.signedUrl!=null&&s.hasOwnProperty("signedUrl")&&(c.signedUrl=s.signedUrl,g.oneofs&&(c._signedUrl="signedUrl")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.ProductSnapshot"},a})(),i})(),r.ProtocolMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 4:{c.ephemeralExpiration=A.uint32();break}case 5:{c.ephemeralSettingTimestamp=A.int64();break}case 6:{c.historySyncNotification=p.proto.Message.HistorySyncNotification.decode(A,A.uint32());break}case 7:{c.appStateSyncKeyShare=p.proto.Message.AppStateSyncKeyShare.decode(A,A.uint32());break}case 8:{c.appStateSyncKeyRequest=p.proto.Message.AppStateSyncKeyRequest.decode(A,A.uint32());break}case 9:{c.initialSecurityNotificationSettingSync=p.proto.Message.InitialSecurityNotificationSettingSync.decode(A,A.uint32());break}case 10:{c.appStateFatalExceptionNotification=p.proto.Message.AppStateFatalExceptionNotification.decode(A,A.uint32());break}case 11:{c.disappearingMode=p.proto.DisappearingMode.decode(A,A.uint32());break}case 14:{c.editedMessage=p.proto.Message.decode(A,A.uint32());break}case 15:{c.timestampMs=A.int64();break}case 16:{c.peerDataOperationRequestMessage=p.proto.Message.PeerDataOperationRequestMessage.decode(A,A.uint32());break}case 17:{c.peerDataOperationRequestResponseMessage=p.proto.Message.PeerDataOperationRequestResponseMessage.decode(A,A.uint32());break}case 18:{c.botFeedbackMessage=p.proto.BotFeedbackMessage.decode(A,A.uint32());break}case 19:{c.invokerJid=A.string();break}case 20:{c.requestWelcomeMessageMetadata=p.proto.Message.RequestWelcomeMessageMetadata.decode(A,A.uint32());break}case 21:{c.mediaNotifyMessage=p.proto.MediaNotifyMessage.decode(A,A.uint32());break}case 22:{c.cloudApiThreadControlNotification=p.proto.Message.CloudAPIThreadControlNotification.decode(A,A.uint32());break}case 23:{c.lidMigrationMappingSyncMessage=p.proto.LIDMigrationMappingSyncMessage.decode(A,A.uint32());break}case 24:{c.limitSharing=p.proto.LimitSharing.decode(A,A.uint32());break}case 25:{c.aiPsiMetadata=A.bytes();break}case 26:{c.aiQueryFanout=p.proto.AIQueryFanout.decode(A,A.uint32());break}case 27:{c.memberLabel=p.proto.MemberLabel.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ProtocolMessage)return A;var t=new p.proto.Message.ProtocolMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ProtocolMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"REVOKE":case 0:t.type=0;break;case"EPHEMERAL_SETTING":case 3:t.type=3;break;case"EPHEMERAL_SYNC_RESPONSE":case 4:t.type=4;break;case"HISTORY_SYNC_NOTIFICATION":case 5:t.type=5;break;case"APP_STATE_SYNC_KEY_SHARE":case 6:t.type=6;break;case"APP_STATE_SYNC_KEY_REQUEST":case 7:t.type=7;break;case"MSG_FANOUT_BACKFILL_REQUEST":case 8:t.type=8;break;case"INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC":case 9:t.type=9;break;case"APP_STATE_FATAL_EXCEPTION_NOTIFICATION":case 10:t.type=10;break;case"SHARE_PHONE_NUMBER":case 11:t.type=11;break;case"MESSAGE_EDIT":case 14:t.type=14;break;case"PEER_DATA_OPERATION_REQUEST_MESSAGE":case 16:t.type=16;break;case"PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE":case 17:t.type=17;break;case"REQUEST_WELCOME_MESSAGE":case 18:t.type=18;break;case"BOT_FEEDBACK_MESSAGE":case 19:t.type=19;break;case"MEDIA_NOTIFY_MESSAGE":case 20:t.type=20;break;case"CLOUD_API_THREAD_CONTROL_NOTIFICATION":case 21:t.type=21;break;case"LID_MIGRATION_MAPPING_SYNC":case 22:t.type=22;break;case"REMINDER_MESSAGE":case 23:t.type=23;break;case"BOT_MEMU_ONBOARDING_MESSAGE":case 24:t.type=24;break;case"STATUS_MENTION_MESSAGE":case 25:t.type=25;break;case"STOP_GENERATION_MESSAGE":case 26:t.type=26;break;case"LIMIT_SHARING":case 27:t.type=27;break;case"AI_PSI_METADATA":case 28:t.type=28;break;case"AI_QUERY_FANOUT":case 29:t.type=29;break;case"GROUP_MEMBER_LABEL_CHANGE":case 30:t.type=30;break}if(A.ephemeralExpiration!=null&&(t.ephemeralExpiration=A.ephemeralExpiration>>>0),A.ephemeralSettingTimestamp!=null&&(l.Long?(t.ephemeralSettingTimestamp=l.Long.fromValue(A.ephemeralSettingTimestamp)).unsigned=!1:typeof A.ephemeralSettingTimestamp=="string"?t.ephemeralSettingTimestamp=parseInt(A.ephemeralSettingTimestamp,10):typeof A.ephemeralSettingTimestamp=="number"?t.ephemeralSettingTimestamp=A.ephemeralSettingTimestamp:typeof A.ephemeralSettingTimestamp=="object"&&(t.ephemeralSettingTimestamp=new l.LongBits(A.ephemeralSettingTimestamp.low>>>0,A.ephemeralSettingTimestamp.high>>>0).toNumber())),A.historySyncNotification!=null){if(typeof A.historySyncNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.historySyncNotification: object expected");t.historySyncNotification=p.proto.Message.HistorySyncNotification.fromObject(A.historySyncNotification)}if(A.appStateSyncKeyShare!=null){if(typeof A.appStateSyncKeyShare!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyShare: object expected");t.appStateSyncKeyShare=p.proto.Message.AppStateSyncKeyShare.fromObject(A.appStateSyncKeyShare)}if(A.appStateSyncKeyRequest!=null){if(typeof A.appStateSyncKeyRequest!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyRequest: object expected");t.appStateSyncKeyRequest=p.proto.Message.AppStateSyncKeyRequest.fromObject(A.appStateSyncKeyRequest)}if(A.initialSecurityNotificationSettingSync!=null){if(typeof A.initialSecurityNotificationSettingSync!="object")throw TypeError(".proto.Message.ProtocolMessage.initialSecurityNotificationSettingSync: object expected");t.initialSecurityNotificationSettingSync=p.proto.Message.InitialSecurityNotificationSettingSync.fromObject(A.initialSecurityNotificationSettingSync)}if(A.appStateFatalExceptionNotification!=null){if(typeof A.appStateFatalExceptionNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateFatalExceptionNotification: object expected");t.appStateFatalExceptionNotification=p.proto.Message.AppStateFatalExceptionNotification.fromObject(A.appStateFatalExceptionNotification)}if(A.disappearingMode!=null){if(typeof A.disappearingMode!="object")throw TypeError(".proto.Message.ProtocolMessage.disappearingMode: object expected");t.disappearingMode=p.proto.DisappearingMode.fromObject(A.disappearingMode)}if(A.editedMessage!=null){if(typeof A.editedMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.editedMessage: object expected");t.editedMessage=p.proto.Message.fromObject(A.editedMessage)}if(A.timestampMs!=null&&(l.Long?(t.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?t.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?t.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(t.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.peerDataOperationRequestMessage!=null){if(typeof A.peerDataOperationRequestMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestMessage: object expected");t.peerDataOperationRequestMessage=p.proto.Message.PeerDataOperationRequestMessage.fromObject(A.peerDataOperationRequestMessage)}if(A.peerDataOperationRequestResponseMessage!=null){if(typeof A.peerDataOperationRequestResponseMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestResponseMessage: object expected");t.peerDataOperationRequestResponseMessage=p.proto.Message.PeerDataOperationRequestResponseMessage.fromObject(A.peerDataOperationRequestResponseMessage)}if(A.botFeedbackMessage!=null){if(typeof A.botFeedbackMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.botFeedbackMessage: object expected");t.botFeedbackMessage=p.proto.BotFeedbackMessage.fromObject(A.botFeedbackMessage)}if(A.invokerJid!=null&&(t.invokerJid=String(A.invokerJid)),A.requestWelcomeMessageMetadata!=null){if(typeof A.requestWelcomeMessageMetadata!="object")throw TypeError(".proto.Message.ProtocolMessage.requestWelcomeMessageMetadata: object expected");t.requestWelcomeMessageMetadata=p.proto.Message.RequestWelcomeMessageMetadata.fromObject(A.requestWelcomeMessageMetadata)}if(A.mediaNotifyMessage!=null){if(typeof A.mediaNotifyMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.mediaNotifyMessage: object expected");t.mediaNotifyMessage=p.proto.MediaNotifyMessage.fromObject(A.mediaNotifyMessage)}if(A.cloudApiThreadControlNotification!=null){if(typeof A.cloudApiThreadControlNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.cloudApiThreadControlNotification: object expected");t.cloudApiThreadControlNotification=p.proto.Message.CloudAPIThreadControlNotification.fromObject(A.cloudApiThreadControlNotification)}if(A.lidMigrationMappingSyncMessage!=null){if(typeof A.lidMigrationMappingSyncMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.lidMigrationMappingSyncMessage: object expected");t.lidMigrationMappingSyncMessage=p.proto.LIDMigrationMappingSyncMessage.fromObject(A.lidMigrationMappingSyncMessage)}if(A.limitSharing!=null){if(typeof A.limitSharing!="object")throw TypeError(".proto.Message.ProtocolMessage.limitSharing: object expected");t.limitSharing=p.proto.LimitSharing.fromObject(A.limitSharing)}if(A.aiPsiMetadata!=null&&(typeof A.aiPsiMetadata=="string"?l.base64.decode(A.aiPsiMetadata,t.aiPsiMetadata=l.newBuffer(l.base64.length(A.aiPsiMetadata)),0):A.aiPsiMetadata.length>=0&&(t.aiPsiMetadata=A.aiPsiMetadata)),A.aiQueryFanout!=null){if(typeof A.aiQueryFanout!="object")throw TypeError(".proto.Message.ProtocolMessage.aiQueryFanout: object expected");t.aiQueryFanout=p.proto.AIQueryFanout.fromObject(A.aiQueryFanout)}if(A.memberLabel!=null){if(typeof A.memberLabel!="object")throw TypeError(".proto.Message.ProtocolMessage.memberLabel: object expected");t.memberLabel=p.proto.MemberLabel.fromObject(A.memberLabel)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.Message.ProtocolMessage.Type[A.type]===void 0?A.type:p.proto.Message.ProtocolMessage.Type[A.type]:A.type,t.oneofs&&(s._type="type")),A.ephemeralExpiration!=null&&A.hasOwnProperty("ephemeralExpiration")&&(s.ephemeralExpiration=A.ephemeralExpiration,t.oneofs&&(s._ephemeralExpiration="ephemeralExpiration")),A.ephemeralSettingTimestamp!=null&&A.hasOwnProperty("ephemeralSettingTimestamp")&&(typeof A.ephemeralSettingTimestamp=="number"?s.ephemeralSettingTimestamp=t.longs===String?String(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp:s.ephemeralSettingTimestamp=t.longs===String?oe(A.ephemeralSettingTimestamp):t.longs===Number?ne(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp,t.oneofs&&(s._ephemeralSettingTimestamp="ephemeralSettingTimestamp")),A.historySyncNotification!=null&&A.hasOwnProperty("historySyncNotification")&&(s.historySyncNotification=p.proto.Message.HistorySyncNotification.toObject(A.historySyncNotification,t),t.oneofs&&(s._historySyncNotification="historySyncNotification")),A.appStateSyncKeyShare!=null&&A.hasOwnProperty("appStateSyncKeyShare")&&(s.appStateSyncKeyShare=p.proto.Message.AppStateSyncKeyShare.toObject(A.appStateSyncKeyShare,t),t.oneofs&&(s._appStateSyncKeyShare="appStateSyncKeyShare")),A.appStateSyncKeyRequest!=null&&A.hasOwnProperty("appStateSyncKeyRequest")&&(s.appStateSyncKeyRequest=p.proto.Message.AppStateSyncKeyRequest.toObject(A.appStateSyncKeyRequest,t),t.oneofs&&(s._appStateSyncKeyRequest="appStateSyncKeyRequest")),A.initialSecurityNotificationSettingSync!=null&&A.hasOwnProperty("initialSecurityNotificationSettingSync")&&(s.initialSecurityNotificationSettingSync=p.proto.Message.InitialSecurityNotificationSettingSync.toObject(A.initialSecurityNotificationSettingSync,t),t.oneofs&&(s._initialSecurityNotificationSettingSync="initialSecurityNotificationSettingSync")),A.appStateFatalExceptionNotification!=null&&A.hasOwnProperty("appStateFatalExceptionNotification")&&(s.appStateFatalExceptionNotification=p.proto.Message.AppStateFatalExceptionNotification.toObject(A.appStateFatalExceptionNotification,t),t.oneofs&&(s._appStateFatalExceptionNotification="appStateFatalExceptionNotification")),A.disappearingMode!=null&&A.hasOwnProperty("disappearingMode")&&(s.disappearingMode=p.proto.DisappearingMode.toObject(A.disappearingMode,t),t.oneofs&&(s._disappearingMode="disappearingMode")),A.editedMessage!=null&&A.hasOwnProperty("editedMessage")&&(s.editedMessage=p.proto.Message.toObject(A.editedMessage,t),t.oneofs&&(s._editedMessage="editedMessage")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=t.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=t.longs===String?oe(A.timestampMs):t.longs===Number?ne(A.timestampMs):A.timestampMs,t.oneofs&&(s._timestampMs="timestampMs")),A.peerDataOperationRequestMessage!=null&&A.hasOwnProperty("peerDataOperationRequestMessage")&&(s.peerDataOperationRequestMessage=p.proto.Message.PeerDataOperationRequestMessage.toObject(A.peerDataOperationRequestMessage,t),t.oneofs&&(s._peerDataOperationRequestMessage="peerDataOperationRequestMessage")),A.peerDataOperationRequestResponseMessage!=null&&A.hasOwnProperty("peerDataOperationRequestResponseMessage")&&(s.peerDataOperationRequestResponseMessage=p.proto.Message.PeerDataOperationRequestResponseMessage.toObject(A.peerDataOperationRequestResponseMessage,t),t.oneofs&&(s._peerDataOperationRequestResponseMessage="peerDataOperationRequestResponseMessage")),A.botFeedbackMessage!=null&&A.hasOwnProperty("botFeedbackMessage")&&(s.botFeedbackMessage=p.proto.BotFeedbackMessage.toObject(A.botFeedbackMessage,t),t.oneofs&&(s._botFeedbackMessage="botFeedbackMessage")),A.invokerJid!=null&&A.hasOwnProperty("invokerJid")&&(s.invokerJid=A.invokerJid,t.oneofs&&(s._invokerJid="invokerJid")),A.requestWelcomeMessageMetadata!=null&&A.hasOwnProperty("requestWelcomeMessageMetadata")&&(s.requestWelcomeMessageMetadata=p.proto.Message.RequestWelcomeMessageMetadata.toObject(A.requestWelcomeMessageMetadata,t),t.oneofs&&(s._requestWelcomeMessageMetadata="requestWelcomeMessageMetadata")),A.mediaNotifyMessage!=null&&A.hasOwnProperty("mediaNotifyMessage")&&(s.mediaNotifyMessage=p.proto.MediaNotifyMessage.toObject(A.mediaNotifyMessage,t),t.oneofs&&(s._mediaNotifyMessage="mediaNotifyMessage")),A.cloudApiThreadControlNotification!=null&&A.hasOwnProperty("cloudApiThreadControlNotification")&&(s.cloudApiThreadControlNotification=p.proto.Message.CloudAPIThreadControlNotification.toObject(A.cloudApiThreadControlNotification,t),t.oneofs&&(s._cloudApiThreadControlNotification="cloudApiThreadControlNotification")),A.lidMigrationMappingSyncMessage!=null&&A.hasOwnProperty("lidMigrationMappingSyncMessage")&&(s.lidMigrationMappingSyncMessage=p.proto.LIDMigrationMappingSyncMessage.toObject(A.lidMigrationMappingSyncMessage,t),t.oneofs&&(s._lidMigrationMappingSyncMessage="lidMigrationMappingSyncMessage")),A.limitSharing!=null&&A.hasOwnProperty("limitSharing")&&(s.limitSharing=p.proto.LimitSharing.toObject(A.limitSharing,t),t.oneofs&&(s._limitSharing="limitSharing")),A.aiPsiMetadata!=null&&A.hasOwnProperty("aiPsiMetadata")&&(s.aiPsiMetadata=t.bytes===String?l.base64.encode(A.aiPsiMetadata,0,A.aiPsiMetadata.length):t.bytes===Array?Array.prototype.slice.call(A.aiPsiMetadata):A.aiPsiMetadata,t.oneofs&&(s._aiPsiMetadata="aiPsiMetadata")),A.aiQueryFanout!=null&&A.hasOwnProperty("aiQueryFanout")&&(s.aiQueryFanout=p.proto.AIQueryFanout.toObject(A.aiQueryFanout,t),t.oneofs&&(s._aiQueryFanout="aiQueryFanout")),A.memberLabel!=null&&A.hasOwnProperty("memberLabel")&&(s.memberLabel=p.proto.MemberLabel.toObject(A.memberLabel,t),t.oneofs&&(s._memberLabel="memberLabel")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProtocolMessage"},i.Type=(function(){let a={},A=Object.create(a);return A[a[0]="REVOKE"]=0,A[a[3]="EPHEMERAL_SETTING"]=3,A[a[4]="EPHEMERAL_SYNC_RESPONSE"]=4,A[a[5]="HISTORY_SYNC_NOTIFICATION"]=5,A[a[6]="APP_STATE_SYNC_KEY_SHARE"]=6,A[a[7]="APP_STATE_SYNC_KEY_REQUEST"]=7,A[a[8]="MSG_FANOUT_BACKFILL_REQUEST"]=8,A[a[9]="INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC"]=9,A[a[10]="APP_STATE_FATAL_EXCEPTION_NOTIFICATION"]=10,A[a[11]="SHARE_PHONE_NUMBER"]=11,A[a[14]="MESSAGE_EDIT"]=14,A[a[16]="PEER_DATA_OPERATION_REQUEST_MESSAGE"]=16,A[a[17]="PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE"]=17,A[a[18]="REQUEST_WELCOME_MESSAGE"]=18,A[a[19]="BOT_FEEDBACK_MESSAGE"]=19,A[a[20]="MEDIA_NOTIFY_MESSAGE"]=20,A[a[21]="CLOUD_API_THREAD_CONTROL_NOTIFICATION"]=21,A[a[22]="LID_MIGRATION_MAPPING_SYNC"]=22,A[a[23]="REMINDER_MESSAGE"]=23,A[a[24]="BOT_MEMU_ONBOARDING_MESSAGE"]=24,A[a[25]="STATUS_MENTION_MESSAGE"]=25,A[a[26]="STOP_GENERATION_MESSAGE"]=26,A[a[27]="LIMIT_SHARING"]=27,A[a[28]="AI_PSI_METADATA"]=28,A[a[29]="AI_QUERY_FANOUT"]=29,A[a[30]="GROUP_MEMBER_LABEL_CHANGE"]=30,A})(),i})(),r.QuestionResponseMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.QuestionResponseMessage)return A;var t=new p.proto.Message.QuestionResponseMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.QuestionResponseMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(t.text=String(A.text)),t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,t.oneofs&&(s._text="text")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.QuestionResponseMessage"},i})(),r.ReactionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}case 3:{c.groupingKey=A.string();break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ReactionMessage)return A;var t=new p.proto.Message.ReactionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ReactionMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(t.text=String(A.text)),A.groupingKey!=null&&(t.groupingKey=String(A.groupingKey)),A.senderTimestampMs!=null&&(l.Long?(t.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?t.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?t.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(t.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,t.oneofs&&(s._text="text")),A.groupingKey!=null&&A.hasOwnProperty("groupingKey")&&(s.groupingKey=A.groupingKey,t.oneofs&&(s._groupingKey="groupingKey")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=t.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=t.longs===String?oe(A.senderTimestampMs):t.longs===Number?ne(A.senderTimestampMs):A.senderTimestampMs,t.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ReactionMessage"},i})(),r.RequestPaymentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 4:{c.noteMessage=p.proto.Message.decode(A,A.uint32());break}case 1:{c.currencyCodeIso4217=A.string();break}case 2:{c.amount1000=A.uint64();break}case 3:{c.requestFrom=A.string();break}case 5:{c.expiryTimestamp=A.int64();break}case 6:{c.amount=p.proto.Money.decode(A,A.uint32());break}case 7:{c.background=p.proto.PaymentBackground.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.RequestPaymentMessage)return A;var t=new p.proto.Message.RequestPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.RequestPaymentMessage.noteMessage: object expected");t.noteMessage=p.proto.Message.fromObject(A.noteMessage)}if(A.currencyCodeIso4217!=null&&(t.currencyCodeIso4217=String(A.currencyCodeIso4217)),A.amount1000!=null&&(l.Long?(t.amount1000=l.Long.fromValue(A.amount1000)).unsigned=!0:typeof A.amount1000=="string"?t.amount1000=parseInt(A.amount1000,10):typeof A.amount1000=="number"?t.amount1000=A.amount1000:typeof A.amount1000=="object"&&(t.amount1000=new l.LongBits(A.amount1000.low>>>0,A.amount1000.high>>>0).toNumber(!0))),A.requestFrom!=null&&(t.requestFrom=String(A.requestFrom)),A.expiryTimestamp!=null&&(l.Long?(t.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?t.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?t.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(t.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),A.amount!=null){if(typeof A.amount!="object")throw TypeError(".proto.Message.RequestPaymentMessage.amount: object expected");t.amount=p.proto.Money.fromObject(A.amount)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.RequestPaymentMessage.background: object expected");t.background=p.proto.PaymentBackground.fromObject(A.background)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.currencyCodeIso4217!=null&&A.hasOwnProperty("currencyCodeIso4217")&&(s.currencyCodeIso4217=A.currencyCodeIso4217,t.oneofs&&(s._currencyCodeIso4217="currencyCodeIso4217")),A.amount1000!=null&&A.hasOwnProperty("amount1000")&&(typeof A.amount1000=="number"?s.amount1000=t.longs===String?String(A.amount1000):A.amount1000:s.amount1000=t.longs===String?oe(A.amount1000,!0):t.longs===Number?ne(A.amount1000,!0):A.amount1000,t.oneofs&&(s._amount1000="amount1000")),A.requestFrom!=null&&A.hasOwnProperty("requestFrom")&&(s.requestFrom=A.requestFrom,t.oneofs&&(s._requestFrom="requestFrom")),A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=p.proto.Message.toObject(A.noteMessage,t),t.oneofs&&(s._noteMessage="noteMessage")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=t.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=t.longs===String?oe(A.expiryTimestamp):t.longs===Number?ne(A.expiryTimestamp):A.expiryTimestamp,t.oneofs&&(s._expiryTimestamp="expiryTimestamp")),A.amount!=null&&A.hasOwnProperty("amount")&&(s.amount=p.proto.Money.toObject(A.amount,t),t.oneofs&&(s._amount="amount")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=p.proto.PaymentBackground.toObject(A.background,t),t.oneofs&&(s._background="background")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPaymentMessage"},i})(),r.RequestPhoneNumberMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.RequestPhoneNumberMessage)return A;var t=new p.proto.Message.RequestPhoneNumberMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.RequestPhoneNumberMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPhoneNumberMessage"},i})(),r.RequestWelcomeMessageMetadata=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.localChatState=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.RequestWelcomeMessageMetadata)return A;var t=new p.proto.Message.RequestWelcomeMessageMetadata;switch(A.localChatState){default:if(typeof A.localChatState=="number"){t.localChatState=A.localChatState;break}break;case"EMPTY":case 0:t.localChatState=0;break;case"NON_EMPTY":case 1:t.localChatState=1;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.localChatState!=null&&A.hasOwnProperty("localChatState")&&(s.localChatState=t.enums===String?p.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]===void 0?A.localChatState:p.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]:A.localChatState,t.oneofs&&(s._localChatState="localChatState")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestWelcomeMessageMetadata"},i.LocalChatState=(function(){let a={},A=Object.create(a);return A[a[0]="EMPTY"]=0,A[a[1]="NON_EMPTY"]=1,A})(),i})(),r.ScheduledCallCreationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.scheduledTimestampMs=A.int64();break}case 2:{c.callType=A.int32();break}case 3:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ScheduledCallCreationMessage)return A;var t=new p.proto.Message.ScheduledCallCreationMessage;switch(A.scheduledTimestampMs!=null&&(l.Long?(t.scheduledTimestampMs=l.Long.fromValue(A.scheduledTimestampMs)).unsigned=!1:typeof A.scheduledTimestampMs=="string"?t.scheduledTimestampMs=parseInt(A.scheduledTimestampMs,10):typeof A.scheduledTimestampMs=="number"?t.scheduledTimestampMs=A.scheduledTimestampMs:typeof A.scheduledTimestampMs=="object"&&(t.scheduledTimestampMs=new l.LongBits(A.scheduledTimestampMs.low>>>0,A.scheduledTimestampMs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){t.callType=A.callType;break}break;case"UNKNOWN":case 0:t.callType=0;break;case"VOICE":case 1:t.callType=1;break;case"VIDEO":case 2:t.callType=2;break}return A.title!=null&&(t.title=String(A.title)),t},i.toObject=function(A,t){t||(t={});var s={};return A.scheduledTimestampMs!=null&&A.hasOwnProperty("scheduledTimestampMs")&&(typeof A.scheduledTimestampMs=="number"?s.scheduledTimestampMs=t.longs===String?String(A.scheduledTimestampMs):A.scheduledTimestampMs:s.scheduledTimestampMs=t.longs===String?oe(A.scheduledTimestampMs):t.longs===Number?ne(A.scheduledTimestampMs):A.scheduledTimestampMs,t.oneofs&&(s._scheduledTimestampMs="scheduledTimestampMs")),A.callType!=null&&A.hasOwnProperty("callType")&&(s.callType=t.enums===String?p.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]===void 0?A.callType:p.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]:A.callType,t.oneofs&&(s._callType="callType")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,t.oneofs&&(s._title="title")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallCreationMessage"},i.CallType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="VOICE"]=1,A[a[2]="VIDEO"]=2,A})(),i})(),r.ScheduledCallEditMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.editType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.ScheduledCallEditMessage)return A;var t=new p.proto.Message.ScheduledCallEditMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ScheduledCallEditMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}switch(A.editType){default:if(typeof A.editType=="number"){t.editType=A.editType;break}break;case"UNKNOWN":case 0:t.editType=0;break;case"CANCEL":case 1:t.editType=1;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),A.editType!=null&&A.hasOwnProperty("editType")&&(s.editType=t.enums===String?p.proto.Message.ScheduledCallEditMessage.EditType[A.editType]===void 0?A.editType:p.proto.Message.ScheduledCallEditMessage.EditType[A.editType]:A.editType,t.oneofs&&(s._editType="editType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallEditMessage"},i.EditType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="CANCEL"]=1,A})(),i})(),r.SecretEncryptedMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.targetMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}case 4:{c.secretEncType=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.SecretEncryptedMessage)return A;var t=new p.proto.Message.SecretEncryptedMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.SecretEncryptedMessage.targetMessageKey: object expected");t.targetMessageKey=p.proto.MessageKey.fromObject(A.targetMessageKey)}switch(A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,t.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(t.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,t.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(t.encIv=A.encIv)),A.secretEncType){default:if(typeof A.secretEncType=="number"){t.secretEncType=A.secretEncType;break}break;case"UNKNOWN":case 0:t.secretEncType=0;break;case"EVENT_EDIT":case 1:t.secretEncType=1;break;case"MESSAGE_EDIT":case 2:t.secretEncType=2;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=p.proto.MessageKey.toObject(A.targetMessageKey,t),t.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=t.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):t.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,t.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=t.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):t.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,t.oneofs&&(s._encIv="encIv")),A.secretEncType!=null&&A.hasOwnProperty("secretEncType")&&(s.secretEncType=t.enums===String?p.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]===void 0?A.secretEncType:p.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]:A.secretEncType,t.oneofs&&(s._secretEncType="secretEncType")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SecretEncryptedMessage"},i.SecretEncType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="EVENT_EDIT"]=1,A[a[2]="MESSAGE_EDIT"]=2,A})(),i})(),r.SendPaymentMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 2:{c.noteMessage=p.proto.Message.decode(A,A.uint32());break}case 3:{c.requestMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 4:{c.background=p.proto.PaymentBackground.decode(A,A.uint32());break}case 5:{c.transactionData=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.SendPaymentMessage)return A;var t=new p.proto.Message.SendPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.SendPaymentMessage.noteMessage: object expected");t.noteMessage=p.proto.Message.fromObject(A.noteMessage)}if(A.requestMessageKey!=null){if(typeof A.requestMessageKey!="object")throw TypeError(".proto.Message.SendPaymentMessage.requestMessageKey: object expected");t.requestMessageKey=p.proto.MessageKey.fromObject(A.requestMessageKey)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.SendPaymentMessage.background: object expected");t.background=p.proto.PaymentBackground.fromObject(A.background)}return A.transactionData!=null&&(t.transactionData=String(A.transactionData)),t},i.toObject=function(A,t){t||(t={});var s={};return A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=p.proto.Message.toObject(A.noteMessage,t),t.oneofs&&(s._noteMessage="noteMessage")),A.requestMessageKey!=null&&A.hasOwnProperty("requestMessageKey")&&(s.requestMessageKey=p.proto.MessageKey.toObject(A.requestMessageKey,t),t.oneofs&&(s._requestMessageKey="requestMessageKey")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=p.proto.PaymentBackground.toObject(A.background,t),t.oneofs&&(s._background="background")),A.transactionData!=null&&A.hasOwnProperty("transactionData")&&(s.transactionData=A.transactionData,t.oneofs&&(s._transactionData="transactionData")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SendPaymentMessage"},i})(),r.SenderKeyDistributionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.groupId=A.string();break}case 2:{c.axolotlSenderKeyDistributionMessage=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.SenderKeyDistributionMessage)return A;var t=new p.proto.Message.SenderKeyDistributionMessage;return A.groupId!=null&&(t.groupId=String(A.groupId)),A.axolotlSenderKeyDistributionMessage!=null&&(typeof A.axolotlSenderKeyDistributionMessage=="string"?l.base64.decode(A.axolotlSenderKeyDistributionMessage,t.axolotlSenderKeyDistributionMessage=l.newBuffer(l.base64.length(A.axolotlSenderKeyDistributionMessage)),0):A.axolotlSenderKeyDistributionMessage.length>=0&&(t.axolotlSenderKeyDistributionMessage=A.axolotlSenderKeyDistributionMessage)),t},i.toObject=function(A,t){t||(t={});var s={};return A.groupId!=null&&A.hasOwnProperty("groupId")&&(s.groupId=A.groupId,t.oneofs&&(s._groupId="groupId")),A.axolotlSenderKeyDistributionMessage!=null&&A.hasOwnProperty("axolotlSenderKeyDistributionMessage")&&(s.axolotlSenderKeyDistributionMessage=t.bytes===String?l.base64.encode(A.axolotlSenderKeyDistributionMessage,0,A.axolotlSenderKeyDistributionMessage.length):t.bytes===Array?Array.prototype.slice.call(A.axolotlSenderKeyDistributionMessage):A.axolotlSenderKeyDistributionMessage,t.oneofs&&(s._axolotlSenderKeyDistributionMessage="axolotlSenderKeyDistributionMessage")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SenderKeyDistributionMessage"},i})(),r.StatusNotificationMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.responseMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.originalMessageKey=p.proto.MessageKey.decode(A,A.uint32());break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusNotificationMessage)return A;var t=new p.proto.Message.StatusNotificationMessage;if(A.responseMessageKey!=null){if(typeof A.responseMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.responseMessageKey: object expected");t.responseMessageKey=p.proto.MessageKey.fromObject(A.responseMessageKey)}if(A.originalMessageKey!=null){if(typeof A.originalMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.originalMessageKey: object expected");t.originalMessageKey=p.proto.MessageKey.fromObject(A.originalMessageKey)}switch(A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"UNKNOWN":case 0:t.type=0;break;case"STATUS_ADD_YOURS":case 1:t.type=1;break;case"STATUS_RESHARE":case 2:t.type=2;break;case"STATUS_QUESTION_ANSWER_RESHARE":case 3:t.type=3;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.responseMessageKey!=null&&A.hasOwnProperty("responseMessageKey")&&(s.responseMessageKey=p.proto.MessageKey.toObject(A.responseMessageKey,t),t.oneofs&&(s._responseMessageKey="responseMessageKey")),A.originalMessageKey!=null&&A.hasOwnProperty("originalMessageKey")&&(s.originalMessageKey=p.proto.MessageKey.toObject(A.originalMessageKey,t),t.oneofs&&(s._originalMessageKey="originalMessageKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]===void 0?A.type:p.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]:A.type,t.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusNotificationMessage"},i.StatusNotificationType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="STATUS_ADD_YOURS"]=1,A[a[2]="STATUS_RESHARE"]=2,A[a[3]="STATUS_QUESTION_ANSWER_RESHARE"]=3,A})(),i})(),r.StatusQuestionAnswerMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusQuestionAnswerMessage)return A;var t=new p.proto.Message.StatusQuestionAnswerMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusQuestionAnswerMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(t.text=String(A.text)),t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,t.oneofs&&(s._text="text")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuestionAnswerMessage"},i})(),r.StatusQuotedMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.type=A.int32();break}case 2:{c.text=A.string();break}case 3:{c.thumbnail=A.bytes();break}case 4:{c.originalStatusId=p.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusQuotedMessage)return A;var t=new p.proto.Message.StatusQuotedMessage;switch(A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"QUESTION_ANSWER":case 1:t.type=1;break}if(A.text!=null&&(t.text=String(A.text)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,t.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(t.thumbnail=A.thumbnail)),A.originalStatusId!=null){if(typeof A.originalStatusId!="object")throw TypeError(".proto.Message.StatusQuotedMessage.originalStatusId: object expected");t.originalStatusId=p.proto.MessageKey.fromObject(A.originalStatusId)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]===void 0?A.type:p.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]:A.type,t.oneofs&&(s._type="type")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,t.oneofs&&(s._text="text")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=t.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,t.oneofs&&(s._thumbnail="thumbnail")),A.originalStatusId!=null&&A.hasOwnProperty("originalStatusId")&&(s.originalStatusId=p.proto.MessageKey.toObject(A.originalStatusId,t),t.oneofs&&(s._originalStatusId="originalStatusId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuotedMessage"},i.StatusQuotedMessageType=(function(){let a={},A=Object.create(a);return A[a[1]="QUESTION_ANSWER"]=1,A})(),i})(),r.StatusStickerInteractionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.stickerKey=A.string();break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StatusStickerInteractionMessage)return A;var t=new p.proto.Message.StatusStickerInteractionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusStickerInteractionMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}switch(A.stickerKey!=null&&(t.stickerKey=String(A.stickerKey)),A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"UNKNOWN":case 0:t.type=0;break;case"REACTION":case 1:t.type=1;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),A.stickerKey!=null&&A.hasOwnProperty("stickerKey")&&(s.stickerKey=A.stickerKey,t.oneofs&&(s._stickerKey="stickerKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]===void 0?A.type:p.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]:A.type,t.oneofs&&(s._type="type")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusStickerInteractionMessage"},i.StatusStickerType=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="REACTION"]=1,A})(),i})(),r.StickerMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.url=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.fileEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mimetype=A.string();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.directPath=A.string();break}case 9:{c.fileLength=A.uint64();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 11:{c.firstFrameLength=A.uint32();break}case 12:{c.firstFrameSidecar=A.bytes();break}case 13:{c.isAnimated=A.bool();break}case 16:{c.pngThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.stickerSentTs=A.int64();break}case 19:{c.isAvatar=A.bool();break}case 20:{c.isAiSticker=A.bool();break}case 21:{c.isLottie=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StickerMessage)return A;var t=new p.proto.Message.StickerMessage;if(A.url!=null&&(t.url=String(A.url)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,t.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(t.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.mimetype!=null&&(t.mimetype=String(A.mimetype)),A.height!=null&&(t.height=A.height>>>0),A.width!=null&&(t.width=A.width>>>0),A.directPath!=null&&(t.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(t.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?t.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?t.fileLength=A.fileLength:typeof A.fileLength=="object"&&(t.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKeyTimestamp!=null&&(l.Long?(t.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?t.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?t.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(t.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.firstFrameLength!=null&&(t.firstFrameLength=A.firstFrameLength>>>0),A.firstFrameSidecar!=null&&(typeof A.firstFrameSidecar=="string"?l.base64.decode(A.firstFrameSidecar,t.firstFrameSidecar=l.newBuffer(l.base64.length(A.firstFrameSidecar)),0):A.firstFrameSidecar.length>=0&&(t.firstFrameSidecar=A.firstFrameSidecar)),A.isAnimated!=null&&(t.isAnimated=!!A.isAnimated),A.pngThumbnail!=null&&(typeof A.pngThumbnail=="string"?l.base64.decode(A.pngThumbnail,t.pngThumbnail=l.newBuffer(l.base64.length(A.pngThumbnail)),0):A.pngThumbnail.length>=0&&(t.pngThumbnail=A.pngThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.stickerSentTs!=null&&(l.Long?(t.stickerSentTs=l.Long.fromValue(A.stickerSentTs)).unsigned=!1:typeof A.stickerSentTs=="string"?t.stickerSentTs=parseInt(A.stickerSentTs,10):typeof A.stickerSentTs=="number"?t.stickerSentTs=A.stickerSentTs:typeof A.stickerSentTs=="object"&&(t.stickerSentTs=new l.LongBits(A.stickerSentTs.low>>>0,A.stickerSentTs.high>>>0).toNumber())),A.isAvatar!=null&&(t.isAvatar=!!A.isAvatar),A.isAiSticker!=null&&(t.isAiSticker=!!A.isAiSticker),A.isLottie!=null&&(t.isLottie=!!A.isLottie),A.accessibilityLabel!=null&&(t.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){t.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:t.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:t.mediaKeyDomain=1;break;case"STATUS":case 2:t.mediaKeyDomain=2;break;case"CAPI":case 3:t.mediaKeyDomain=3;break;case"BOT":case 4:t.mediaKeyDomain=4;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=t.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,t.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=t.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,t.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=t.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,t.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,t.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,t.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,t.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,t.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=t.longs===String?String(A.fileLength):A.fileLength:s.fileLength=t.longs===String?oe(A.fileLength,!0):t.longs===Number?ne(A.fileLength,!0):A.fileLength,t.oneofs&&(s._fileLength="fileLength")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=t.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=t.longs===String?oe(A.mediaKeyTimestamp):t.longs===Number?ne(A.mediaKeyTimestamp):A.mediaKeyTimestamp,t.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.firstFrameLength!=null&&A.hasOwnProperty("firstFrameLength")&&(s.firstFrameLength=A.firstFrameLength,t.oneofs&&(s._firstFrameLength="firstFrameLength")),A.firstFrameSidecar!=null&&A.hasOwnProperty("firstFrameSidecar")&&(s.firstFrameSidecar=t.bytes===String?l.base64.encode(A.firstFrameSidecar,0,A.firstFrameSidecar.length):t.bytes===Array?Array.prototype.slice.call(A.firstFrameSidecar):A.firstFrameSidecar,t.oneofs&&(s._firstFrameSidecar="firstFrameSidecar")),A.isAnimated!=null&&A.hasOwnProperty("isAnimated")&&(s.isAnimated=A.isAnimated,t.oneofs&&(s._isAnimated="isAnimated")),A.pngThumbnail!=null&&A.hasOwnProperty("pngThumbnail")&&(s.pngThumbnail=t.bytes===String?l.base64.encode(A.pngThumbnail,0,A.pngThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.pngThumbnail):A.pngThumbnail,t.oneofs&&(s._pngThumbnail="pngThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.stickerSentTs!=null&&A.hasOwnProperty("stickerSentTs")&&(typeof A.stickerSentTs=="number"?s.stickerSentTs=t.longs===String?String(A.stickerSentTs):A.stickerSentTs:s.stickerSentTs=t.longs===String?oe(A.stickerSentTs):t.longs===Number?ne(A.stickerSentTs):A.stickerSentTs,t.oneofs&&(s._stickerSentTs="stickerSentTs")),A.isAvatar!=null&&A.hasOwnProperty("isAvatar")&&(s.isAvatar=A.isAvatar,t.oneofs&&(s._isAvatar="isAvatar")),A.isAiSticker!=null&&A.hasOwnProperty("isAiSticker")&&(s.isAiSticker=A.isAiSticker,t.oneofs&&(s._isAiSticker="isAiSticker")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,t.oneofs&&(s._isLottie="isLottie")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,t.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=t.enums===String?p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:p.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,t.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StickerMessage"},i})(),r.StickerPackMessage=(function(){function i(a){if(this.stickers=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.stickerPackId=A.string();break}case 2:{c.name=A.string();break}case 3:{c.publisher=A.string();break}case 4:{c.stickers&&c.stickers.length||(c.stickers=[]),c.stickers.push(p.proto.Message.StickerPackMessage.Sticker.decode(A,A.uint32()));break}case 5:{c.fileLength=A.uint64();break}case 6:{c.fileSha256=A.bytes();break}case 7:{c.fileEncSha256=A.bytes();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.caption=A.string();break}case 11:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.packDescription=A.string();break}case 13:{c.mediaKeyTimestamp=A.int64();break}case 14:{c.trayIconFileName=A.string();break}case 15:{c.thumbnailDirectPath=A.string();break}case 16:{c.thumbnailSha256=A.bytes();break}case 17:{c.thumbnailEncSha256=A.bytes();break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.imageDataHash=A.string();break}case 21:{c.stickerPackSize=A.uint64();break}case 22:{c.stickerPackOrigin=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StickerPackMessage)return A;var t=new p.proto.Message.StickerPackMessage;if(A.stickerPackId!=null&&(t.stickerPackId=String(A.stickerPackId)),A.name!=null&&(t.name=String(A.name)),A.publisher!=null&&(t.publisher=String(A.publisher)),A.stickers){if(!Array.isArray(A.stickers))throw TypeError(".proto.Message.StickerPackMessage.stickers: array expected");t.stickers=[];for(var s=0;s>>0,A.fileLength.high>>>0).toNumber(!0))),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,t.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(t.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.directPath!=null&&(t.directPath=String(A.directPath)),A.caption!=null&&(t.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerPackMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.packDescription!=null&&(t.packDescription=String(A.packDescription)),A.mediaKeyTimestamp!=null&&(l.Long?(t.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?t.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?t.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(t.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.trayIconFileName!=null&&(t.trayIconFileName=String(A.trayIconFileName)),A.thumbnailDirectPath!=null&&(t.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,t.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(t.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,t.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(t.thumbnailEncSha256=A.thumbnailEncSha256)),A.thumbnailHeight!=null&&(t.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(t.thumbnailWidth=A.thumbnailWidth>>>0),A.imageDataHash!=null&&(t.imageDataHash=String(A.imageDataHash)),A.stickerPackSize!=null&&(l.Long?(t.stickerPackSize=l.Long.fromValue(A.stickerPackSize)).unsigned=!0:typeof A.stickerPackSize=="string"?t.stickerPackSize=parseInt(A.stickerPackSize,10):typeof A.stickerPackSize=="number"?t.stickerPackSize=A.stickerPackSize:typeof A.stickerPackSize=="object"&&(t.stickerPackSize=new l.LongBits(A.stickerPackSize.low>>>0,A.stickerPackSize.high>>>0).toNumber(!0))),A.stickerPackOrigin){default:if(typeof A.stickerPackOrigin=="number"){t.stickerPackOrigin=A.stickerPackOrigin;break}break;case"FIRST_PARTY":case 0:t.stickerPackOrigin=0;break;case"THIRD_PARTY":case 1:t.stickerPackOrigin=1;break;case"USER_CREATED":case 2:t.stickerPackOrigin=2;break}return t},i.toObject=function(A,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.stickers=[]),A.stickerPackId!=null&&A.hasOwnProperty("stickerPackId")&&(s.stickerPackId=A.stickerPackId,t.oneofs&&(s._stickerPackId="stickerPackId")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),A.publisher!=null&&A.hasOwnProperty("publisher")&&(s.publisher=A.publisher,t.oneofs&&(s._publisher="publisher")),A.stickers&&A.stickers.length){s.stickers=[];for(var g=0;g>>3){case 1:{d.fileName=s.string();break}case 2:{d.isAnimated=s.bool();break}case 3:{d.emojis&&d.emojis.length||(d.emojis=[]),d.emojis.push(s.string());break}case 4:{d.accessibilityLabel=s.string();break}case 5:{d.isLottie=s.bool();break}case 6:{d.mimetype=s.string();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.StickerPackMessage.Sticker)return s;var g=new p.proto.Message.StickerPackMessage.Sticker;if(s.fileName!=null&&(g.fileName=String(s.fileName)),s.isAnimated!=null&&(g.isAnimated=!!s.isAnimated),s.emojis){if(!Array.isArray(s.emojis))throw TypeError(".proto.Message.StickerPackMessage.Sticker.emojis: array expected");g.emojis=[];for(var c=0;c>>3){case 1:{c.filehash&&c.filehash.length||(c.filehash=[]),c.filehash.push(A.string());break}case 2:{c.rmrSource=A.string();break}case 3:{c.requestTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.StickerSyncRMRMessage)return A;var t=new p.proto.Message.StickerSyncRMRMessage;if(A.filehash){if(!Array.isArray(A.filehash))throw TypeError(".proto.Message.StickerSyncRMRMessage.filehash: array expected");t.filehash=[];for(var s=0;s>>0,A.requestTimestamp.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.filehash=[]),A.filehash&&A.filehash.length){s.filehash=[];for(var g=0;g>>3){case 1:{c.selectedId=A.string();break}case 2:{c.selectedDisplayText=A.string();break}case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.selectedIndex=A.uint32();break}case 5:{c.selectedCarouselCardIndex=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.TemplateButtonReplyMessage)return A;var t=new p.proto.Message.TemplateButtonReplyMessage;if(A.selectedId!=null&&(t.selectedId=String(A.selectedId)),A.selectedDisplayText!=null&&(t.selectedDisplayText=String(A.selectedDisplayText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateButtonReplyMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}return A.selectedIndex!=null&&(t.selectedIndex=A.selectedIndex>>>0),A.selectedCarouselCardIndex!=null&&(t.selectedCarouselCardIndex=A.selectedCarouselCardIndex>>>0),t},i.toObject=function(A,t){t||(t={});var s={};return A.selectedId!=null&&A.hasOwnProperty("selectedId")&&(s.selectedId=A.selectedId,t.oneofs&&(s._selectedId="selectedId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,t.oneofs&&(s._selectedDisplayText="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.selectedIndex!=null&&A.hasOwnProperty("selectedIndex")&&(s.selectedIndex=A.selectedIndex,t.oneofs&&(s._selectedIndex="selectedIndex")),A.selectedCarouselCardIndex!=null&&A.hasOwnProperty("selectedCarouselCardIndex")&&(s.selectedCarouselCardIndex=A.selectedCarouselCardIndex,t.oneofs&&(s._selectedCarouselCardIndex="selectedCarouselCardIndex")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateButtonReplyMessage"},i})(),r.TemplateMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 3:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.hydratedTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 9:{c.templateId=A.string();break}case 1:{c.fourRowTemplate=p.proto.Message.TemplateMessage.FourRowTemplate.decode(A,A.uint32());break}case 2:{c.hydratedFourRowTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 5:{c.interactiveMessageTemplate=p.proto.Message.InteractiveMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.TemplateMessage)return A;var t=new p.proto.Message.TemplateMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}if(A.hydratedTemplate!=null){if(typeof A.hydratedTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedTemplate: object expected");t.hydratedTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedTemplate)}if(A.templateId!=null&&(t.templateId=String(A.templateId)),A.fourRowTemplate!=null){if(typeof A.fourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.fourRowTemplate: object expected");t.fourRowTemplate=p.proto.Message.TemplateMessage.FourRowTemplate.fromObject(A.fourRowTemplate)}if(A.hydratedFourRowTemplate!=null){if(typeof A.hydratedFourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedFourRowTemplate: object expected");t.hydratedFourRowTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedFourRowTemplate)}if(A.interactiveMessageTemplate!=null){if(typeof A.interactiveMessageTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.interactiveMessageTemplate: object expected");t.interactiveMessageTemplate=p.proto.Message.InteractiveMessage.fromObject(A.interactiveMessageTemplate)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.fourRowTemplate!=null&&A.hasOwnProperty("fourRowTemplate")&&(s.fourRowTemplate=p.proto.Message.TemplateMessage.FourRowTemplate.toObject(A.fourRowTemplate,t),t.oneofs&&(s.format="fourRowTemplate")),A.hydratedFourRowTemplate!=null&&A.hasOwnProperty("hydratedFourRowTemplate")&&(s.hydratedFourRowTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedFourRowTemplate,t),t.oneofs&&(s.format="hydratedFourRowTemplate")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=p.proto.ContextInfo.toObject(A.contextInfo,t),t.oneofs&&(s._contextInfo="contextInfo")),A.hydratedTemplate!=null&&A.hasOwnProperty("hydratedTemplate")&&(s.hydratedTemplate=p.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedTemplate,t),t.oneofs&&(s._hydratedTemplate="hydratedTemplate")),A.interactiveMessageTemplate!=null&&A.hasOwnProperty("interactiveMessageTemplate")&&(s.interactiveMessageTemplate=p.proto.Message.InteractiveMessage.toObject(A.interactiveMessageTemplate,t),t.oneofs&&(s.format="interactiveMessageTemplate")),A.templateId!=null&&A.hasOwnProperty("templateId")&&(s.templateId=A.templateId,t.oneofs&&(s._templateId="templateId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateMessage"},i.FourRowTemplate=(function(){function a(t){if(this.buttons=[],t)for(var s=Object.keys(t),g=0;g>>3){case 6:{d.content=p.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 7:{d.footer=p.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 8:{d.buttons&&d.buttons.length||(d.buttons=[]),d.buttons.push(p.proto.TemplateButton.decode(s,s.uint32()));break}case 1:{d.documentMessage=p.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{d.highlyStructuredMessage=p.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 3:{d.imageMessage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{d.videoMessage=p.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{d.locationMessage=p.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.TemplateMessage.FourRowTemplate)return s;var g=new p.proto.Message.TemplateMessage.FourRowTemplate;if(s.content!=null){if(typeof s.content!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.content: object expected");g.content=p.proto.Message.HighlyStructuredMessage.fromObject(s.content)}if(s.footer!=null){if(typeof s.footer!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.footer: object expected");g.footer=p.proto.Message.HighlyStructuredMessage.fromObject(s.footer)}if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 6:{d.hydratedContentText=s.string();break}case 7:{d.hydratedFooterText=s.string();break}case 8:{d.hydratedButtons&&d.hydratedButtons.length||(d.hydratedButtons=[]),d.hydratedButtons.push(p.proto.HydratedTemplateButton.decode(s,s.uint32()));break}case 9:{d.templateId=s.string();break}case 10:{d.maskLinkedDevices=s.bool();break}case 1:{d.documentMessage=p.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{d.hydratedTitleText=s.string();break}case 3:{d.imageMessage=p.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{d.videoMessage=p.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{d.locationMessage=p.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.Message.TemplateMessage.HydratedFourRowTemplate)return s;var g=new p.proto.Message.TemplateMessage.HydratedFourRowTemplate;if(s.hydratedContentText!=null&&(g.hydratedContentText=String(s.hydratedContentText)),s.hydratedFooterText!=null&&(g.hydratedFooterText=String(s.hydratedFooterText)),s.hydratedButtons){if(!Array.isArray(s.hydratedButtons))throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.hydratedButtons: array expected");g.hydratedButtons=[];for(var c=0;c>>3){case 1:{c.fbExperimentId=A.uint32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.URLMetadata)return A;var t=new p.proto.Message.URLMetadata;return A.fbExperimentId!=null&&(t.fbExperimentId=A.fbExperimentId>>>0),t},i.toObject=function(A,t){t||(t={});var s={};return A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,t.oneofs&&(s._fbExperimentId="fbExperimentId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.URLMetadata"},i})(),r.VideoEndCard=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.username=a.string();break}case 2:{g.caption=a.string();break}case 3:{g.thumbnailImageUrl=a.string();break}case 4:{g.profilePictureUrl=a.string();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.Message.VideoEndCard)return a;var A=new p.proto.Message.VideoEndCard;return a.username!=null&&(A.username=String(a.username)),a.caption!=null&&(A.caption=String(a.caption)),a.thumbnailImageUrl!=null&&(A.thumbnailImageUrl=String(a.thumbnailImageUrl)),a.profilePictureUrl!=null&&(A.profilePictureUrl=String(a.profilePictureUrl)),A},i.toObject=function(a,A){A||(A={});var t={};return A.defaults&&(t.username="",t.caption="",t.thumbnailImageUrl="",t.profilePictureUrl=""),a.username!=null&&a.hasOwnProperty("username")&&(t.username=a.username),a.caption!=null&&a.hasOwnProperty("caption")&&(t.caption=a.caption),a.thumbnailImageUrl!=null&&a.hasOwnProperty("thumbnailImageUrl")&&(t.thumbnailImageUrl=a.thumbnailImageUrl),a.profilePictureUrl!=null&&a.hasOwnProperty("profilePictureUrl")&&(t.profilePictureUrl=a.profilePictureUrl),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.Message.VideoEndCard"},i})(),r.VideoMessage=(function(){function i(a){if(this.interactiveAnnotations=[],this.annotations=[],this.processedVideos=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.mediaKey=A.bytes();break}case 7:{c.caption=A.string();break}case 8:{c.gifPlayback=A.bool();break}case 9:{c.height=A.uint32();break}case 10:{c.width=A.uint32();break}case 11:{c.fileEncSha256=A.bytes();break}case 12:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(p.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 13:{c.directPath=A.string();break}case 14:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=p.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.gifAttribution=A.int32();break}case 20:{c.viewOnce=A.bool();break}case 21:{c.thumbnailDirectPath=A.string();break}case 22:{c.thumbnailSha256=A.bytes();break}case 23:{c.thumbnailEncSha256=A.bytes();break}case 24:{c.staticUrl=A.string();break}case 25:{c.annotations&&c.annotations.length||(c.annotations=[]),c.annotations.push(p.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 26:{c.accessibilityLabel=A.string();break}case 27:{c.processedVideos&&c.processedVideos.length||(c.processedVideos=[]),c.processedVideos.push(p.proto.ProcessedVideo.decode(A,A.uint32()));break}case 28:{c.externalShareFullVideoDurationInSeconds=A.uint32();break}case 29:{c.motionPhotoPresentationOffsetMs=A.uint64();break}case 30:{c.metadataUrl=A.string();break}case 31:{c.videoSourceType=A.int32();break}case 32:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.Message.VideoMessage)return A;var t=new p.proto.Message.VideoMessage;if(A.url!=null&&(t.url=String(A.url)),A.mimetype!=null&&(t.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,t.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(t.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(t.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?t.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?t.fileLength=A.fileLength:typeof A.fileLength=="object"&&(t.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(t.seconds=A.seconds>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.caption!=null&&(t.caption=String(A.caption)),A.gifPlayback!=null&&(t.gifPlayback=!!A.gifPlayback),A.height!=null&&(t.height=A.height>>>0),A.width!=null&&(t.width=A.width>>>0),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.VideoMessage.interactiveAnnotations: array expected");t.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.VideoMessage.contextInfo: object expected");t.contextInfo=p.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,t.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(t.streamingSidecar=A.streamingSidecar)),A.gifAttribution){default:if(typeof A.gifAttribution=="number"){t.gifAttribution=A.gifAttribution;break}break;case"NONE":case 0:t.gifAttribution=0;break;case"GIPHY":case 1:t.gifAttribution=1;break;case"TENOR":case 2:t.gifAttribution=2;break;case"KLIPY":case 3:t.gifAttribution=3;break}if(A.viewOnce!=null&&(t.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(t.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,t.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(t.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,t.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(t.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(t.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.VideoMessage.annotations: array expected");t.annotations=[];for(var s=0;s>>0),A.motionPhotoPresentationOffsetMs!=null&&(l.Long?(t.motionPhotoPresentationOffsetMs=l.Long.fromValue(A.motionPhotoPresentationOffsetMs)).unsigned=!0:typeof A.motionPhotoPresentationOffsetMs=="string"?t.motionPhotoPresentationOffsetMs=parseInt(A.motionPhotoPresentationOffsetMs,10):typeof A.motionPhotoPresentationOffsetMs=="number"?t.motionPhotoPresentationOffsetMs=A.motionPhotoPresentationOffsetMs:typeof A.motionPhotoPresentationOffsetMs=="object"&&(t.motionPhotoPresentationOffsetMs=new l.LongBits(A.motionPhotoPresentationOffsetMs.low>>>0,A.motionPhotoPresentationOffsetMs.high>>>0).toNumber(!0))),A.metadataUrl!=null&&(t.metadataUrl=String(A.metadataUrl)),A.videoSourceType){default:if(typeof A.videoSourceType=="number"){t.videoSourceType=A.videoSourceType;break}break;case"USER_VIDEO":case 0:t.videoSourceType=0;break;case"AI_GENERATED":case 1:t.videoSourceType=1;break}switch(A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){t.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:t.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:t.mediaKeyDomain=1;break;case"STATUS":case 2:t.mediaKeyDomain=2;break;case"CAPI":case 3:t.mediaKeyDomain=3;break;case"BOT":case 4:t.mediaKeyDomain=4;break}return t},i.toObject=function(A,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.interactiveAnnotations=[],s.annotations=[],s.processedVideos=[]),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,t.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=t.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,t.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=t.longs===String?String(A.fileLength):A.fileLength:s.fileLength=t.longs===String?oe(A.fileLength,!0):t.longs===Number?ne(A.fileLength,!0):A.fileLength,t.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,t.oneofs&&(s._seconds="seconds")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=t.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,t.oneofs&&(s._mediaKey="mediaKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,t.oneofs&&(s._caption="caption")),A.gifPlayback!=null&&A.hasOwnProperty("gifPlayback")&&(s.gifPlayback=A.gifPlayback,t.oneofs&&(s._gifPlayback="gifPlayback")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,t.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,t.oneofs&&(s._width="width")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=t.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,t.oneofs&&(s._fileEncSha256="fileEncSha256")),A.interactiveAnnotations&&A.interactiveAnnotations.length){s.interactiveAnnotations=[];for(var g=0;g>>3){case 1:{s.messageAddOnType=e.int32();break}case 2:{s.messageAddOn=p.proto.Message.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.status=e.int32();break}case 6:{s.addOnContextInfo=p.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}case 7:{s.messageAddOnKey=p.proto.MessageKey.decode(e,e.uint32());break}case 8:{s.legacyMessage=p.proto.LegacyMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MessageAddOn)return e;var a=new p.proto.MessageAddOn;switch(e.messageAddOnType){default:if(typeof e.messageAddOnType=="number"){a.messageAddOnType=e.messageAddOnType;break}break;case"UNDEFINED":case 0:a.messageAddOnType=0;break;case"REACTION":case 1:a.messageAddOnType=1;break;case"EVENT_RESPONSE":case 2:a.messageAddOnType=2;break;case"POLL_UPDATE":case 3:a.messageAddOnType=3;break;case"PIN_IN_CHAT":case 4:a.messageAddOnType=4;break}if(e.messageAddOn!=null){if(typeof e.messageAddOn!="object")throw TypeError(".proto.MessageAddOn.messageAddOn: object expected");a.messageAddOn=p.proto.Message.fromObject(e.messageAddOn)}switch(e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.status){default:if(typeof e.status=="number"){a.status=e.status;break}break;case"ERROR":case 0:a.status=0;break;case"PENDING":case 1:a.status=1;break;case"SERVER_ACK":case 2:a.status=2;break;case"DELIVERY_ACK":case 3:a.status=3;break;case"READ":case 4:a.status=4;break;case"PLAYED":case 5:a.status=5;break}if(e.addOnContextInfo!=null){if(typeof e.addOnContextInfo!="object")throw TypeError(".proto.MessageAddOn.addOnContextInfo: object expected");a.addOnContextInfo=p.proto.MessageAddOnContextInfo.fromObject(e.addOnContextInfo)}if(e.messageAddOnKey!=null){if(typeof e.messageAddOnKey!="object")throw TypeError(".proto.MessageAddOn.messageAddOnKey: object expected");a.messageAddOnKey=p.proto.MessageKey.fromObject(e.messageAddOnKey)}if(e.legacyMessage!=null){if(typeof e.legacyMessage!="object")throw TypeError(".proto.MessageAddOn.legacyMessage: object expected");a.legacyMessage=p.proto.LegacyMessage.fromObject(e.legacyMessage)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.messageAddOnType!=null&&e.hasOwnProperty("messageAddOnType")&&(A.messageAddOnType=a.enums===String?p.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]===void 0?e.messageAddOnType:p.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]:e.messageAddOnType,a.oneofs&&(A._messageAddOnType="messageAddOnType")),e.messageAddOn!=null&&e.hasOwnProperty("messageAddOn")&&(A.messageAddOn=p.proto.Message.toObject(e.messageAddOn,a),a.oneofs&&(A._messageAddOn="messageAddOn")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?oe(e.senderTimestampMs):a.longs===Number?ne(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?oe(e.serverTimestampMs):a.longs===Number?ne(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=a.enums===String?p.proto.WebMessageInfo.Status[e.status]===void 0?e.status:p.proto.WebMessageInfo.Status[e.status]:e.status,a.oneofs&&(A._status="status")),e.addOnContextInfo!=null&&e.hasOwnProperty("addOnContextInfo")&&(A.addOnContextInfo=p.proto.MessageAddOnContextInfo.toObject(e.addOnContextInfo,a),a.oneofs&&(A._addOnContextInfo="addOnContextInfo")),e.messageAddOnKey!=null&&e.hasOwnProperty("messageAddOnKey")&&(A.messageAddOnKey=p.proto.MessageKey.toObject(e.messageAddOnKey,a),a.oneofs&&(A._messageAddOnKey="messageAddOnKey")),e.legacyMessage!=null&&e.hasOwnProperty("legacyMessage")&&(A.legacyMessage=p.proto.LegacyMessage.toObject(e.legacyMessage,a),a.oneofs&&(A._legacyMessage="legacyMessage")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOn"},r.MessageAddOnType=(function(){let i={},e=Object.create(i);return e[i[0]="UNDEFINED"]=0,e[i[1]="REACTION"]=1,e[i[2]="EVENT_RESPONSE"]=2,e[i[3]="POLL_UPDATE"]=3,e[i[4]="PIN_IN_CHAT"]=4,e})(),r})(),n.MessageAddOnContextInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageAddOnDurationInSecs=e.uint32();break}case 2:{s.messageAddOnExpiryType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MessageAddOnContextInfo)return e;var a=new p.proto.MessageAddOnContextInfo;switch(e.messageAddOnDurationInSecs!=null&&(a.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){a.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:a.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:a.messageAddOnExpiryType=2;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.messageAddOnDurationInSecs!=null&&e.hasOwnProperty("messageAddOnDurationInSecs")&&(A.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs,a.oneofs&&(A._messageAddOnDurationInSecs="messageAddOnDurationInSecs")),e.messageAddOnExpiryType!=null&&e.hasOwnProperty("messageAddOnExpiryType")&&(A.messageAddOnExpiryType=a.enums===String?p.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]===void 0?e.messageAddOnExpiryType:p.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]:e.messageAddOnExpiryType,a.oneofs&&(A._messageAddOnExpiryType="messageAddOnExpiryType")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOnContextInfo"},r})(),n.MessageAssociation=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.associationType=e.int32();break}case 2:{s.parentMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.messageIndex=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MessageAssociation)return e;var a=new p.proto.MessageAssociation;switch(e.associationType){default:if(typeof e.associationType=="number"){a.associationType=e.associationType;break}break;case"UNKNOWN":case 0:a.associationType=0;break;case"MEDIA_ALBUM":case 1:a.associationType=1;break;case"BOT_PLUGIN":case 2:a.associationType=2;break;case"EVENT_COVER_IMAGE":case 3:a.associationType=3;break;case"STATUS_POLL":case 4:a.associationType=4;break;case"HD_VIDEO_DUAL_UPLOAD":case 5:a.associationType=5;break;case"STATUS_EXTERNAL_RESHARE":case 6:a.associationType=6;break;case"MEDIA_POLL":case 7:a.associationType=7;break;case"STATUS_ADD_YOURS":case 8:a.associationType=8;break;case"STATUS_NOTIFICATION":case 9:a.associationType=9;break;case"HD_IMAGE_DUAL_UPLOAD":case 10:a.associationType=10;break;case"STICKER_ANNOTATION":case 11:a.associationType=11;break;case"MOTION_PHOTO":case 12:a.associationType=12;break;case"STATUS_LINK_ACTION":case 13:a.associationType=13;break;case"VIEW_ALL_REPLIES":case 14:a.associationType=14;break;case"STATUS_ADD_YOURS_AI_IMAGINE":case 15:a.associationType=15;break;case"STATUS_QUESTION":case 16:a.associationType=16;break;case"STATUS_ADD_YOURS_DIWALI":case 17:a.associationType=17;break;case"STATUS_REACTION":case 18:a.associationType=18;break;case"HEVC_VIDEO_DUAL_UPLOAD":case 19:a.associationType=19;break}if(e.parentMessageKey!=null){if(typeof e.parentMessageKey!="object")throw TypeError(".proto.MessageAssociation.parentMessageKey: object expected");a.parentMessageKey=p.proto.MessageKey.fromObject(e.parentMessageKey)}return e.messageIndex!=null&&(a.messageIndex=e.messageIndex|0),a},r.toObject=function(e,a){a||(a={});var A={};return e.associationType!=null&&e.hasOwnProperty("associationType")&&(A.associationType=a.enums===String?p.proto.MessageAssociation.AssociationType[e.associationType]===void 0?e.associationType:p.proto.MessageAssociation.AssociationType[e.associationType]:e.associationType,a.oneofs&&(A._associationType="associationType")),e.parentMessageKey!=null&&e.hasOwnProperty("parentMessageKey")&&(A.parentMessageKey=p.proto.MessageKey.toObject(e.parentMessageKey,a),a.oneofs&&(A._parentMessageKey="parentMessageKey")),e.messageIndex!=null&&e.hasOwnProperty("messageIndex")&&(A.messageIndex=e.messageIndex,a.oneofs&&(A._messageIndex="messageIndex")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAssociation"},r.AssociationType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="MEDIA_ALBUM"]=1,e[i[2]="BOT_PLUGIN"]=2,e[i[3]="EVENT_COVER_IMAGE"]=3,e[i[4]="STATUS_POLL"]=4,e[i[5]="HD_VIDEO_DUAL_UPLOAD"]=5,e[i[6]="STATUS_EXTERNAL_RESHARE"]=6,e[i[7]="MEDIA_POLL"]=7,e[i[8]="STATUS_ADD_YOURS"]=8,e[i[9]="STATUS_NOTIFICATION"]=9,e[i[10]="HD_IMAGE_DUAL_UPLOAD"]=10,e[i[11]="STICKER_ANNOTATION"]=11,e[i[12]="MOTION_PHOTO"]=12,e[i[13]="STATUS_LINK_ACTION"]=13,e[i[14]="VIEW_ALL_REPLIES"]=14,e[i[15]="STATUS_ADD_YOURS_AI_IMAGINE"]=15,e[i[16]="STATUS_QUESTION"]=16,e[i[17]="STATUS_ADD_YOURS_DIWALI"]=17,e[i[18]="STATUS_REACTION"]=18,e[i[19]="HEVC_VIDEO_DUAL_UPLOAD"]=19,e})(),r})(),n.MessageContextInfo=(function(){function r(i){if(this.threadId=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.deviceListMetadata=p.proto.DeviceListMetadata.decode(e,e.uint32());break}case 2:{s.deviceListMetadataVersion=e.int32();break}case 3:{s.messageSecret=e.bytes();break}case 4:{s.paddingBytes=e.bytes();break}case 5:{s.messageAddOnDurationInSecs=e.uint32();break}case 6:{s.botMessageSecret=e.bytes();break}case 7:{s.botMetadata=p.proto.BotMetadata.decode(e,e.uint32());break}case 8:{s.reportingTokenVersion=e.int32();break}case 9:{s.messageAddOnExpiryType=e.int32();break}case 10:{s.messageAssociation=p.proto.MessageAssociation.decode(e,e.uint32());break}case 11:{s.capiCreatedGroup=e.bool();break}case 12:{s.supportPayload=e.string();break}case 13:{s.limitSharing=p.proto.LimitSharing.decode(e,e.uint32());break}case 14:{s.limitSharingV2=p.proto.LimitSharing.decode(e,e.uint32());break}case 15:{s.threadId&&s.threadId.length||(s.threadId=[]),s.threadId.push(p.proto.ThreadID.decode(e,e.uint32()));break}case 16:{s.weblinkRenderConfig=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MessageContextInfo)return e;var a=new p.proto.MessageContextInfo;if(e.deviceListMetadata!=null){if(typeof e.deviceListMetadata!="object")throw TypeError(".proto.MessageContextInfo.deviceListMetadata: object expected");a.deviceListMetadata=p.proto.DeviceListMetadata.fromObject(e.deviceListMetadata)}if(e.deviceListMetadataVersion!=null&&(a.deviceListMetadataVersion=e.deviceListMetadataVersion|0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,a.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(a.messageSecret=e.messageSecret)),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,a.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(a.paddingBytes=e.paddingBytes)),e.messageAddOnDurationInSecs!=null&&(a.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,a.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(a.botMessageSecret=e.botMessageSecret)),e.botMetadata!=null){if(typeof e.botMetadata!="object")throw TypeError(".proto.MessageContextInfo.botMetadata: object expected");a.botMetadata=p.proto.BotMetadata.fromObject(e.botMetadata)}switch(e.reportingTokenVersion!=null&&(a.reportingTokenVersion=e.reportingTokenVersion|0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){a.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:a.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:a.messageAddOnExpiryType=2;break}if(e.messageAssociation!=null){if(typeof e.messageAssociation!="object")throw TypeError(".proto.MessageContextInfo.messageAssociation: object expected");a.messageAssociation=p.proto.MessageAssociation.fromObject(e.messageAssociation)}if(e.capiCreatedGroup!=null&&(a.capiCreatedGroup=!!e.capiCreatedGroup),e.supportPayload!=null&&(a.supportPayload=String(e.supportPayload)),e.limitSharing!=null){if(typeof e.limitSharing!="object")throw TypeError(".proto.MessageContextInfo.limitSharing: object expected");a.limitSharing=p.proto.LimitSharing.fromObject(e.limitSharing)}if(e.limitSharingV2!=null){if(typeof e.limitSharingV2!="object")throw TypeError(".proto.MessageContextInfo.limitSharingV2: object expected");a.limitSharingV2=p.proto.LimitSharing.fromObject(e.limitSharingV2)}if(e.threadId){if(!Array.isArray(e.threadId))throw TypeError(".proto.MessageContextInfo.threadId: array expected");a.threadId=[];for(var A=0;A>>3){case 1:{s.remoteJid=e.string();break}case 2:{s.fromMe=e.bool();break}case 3:{s.id=e.string();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MessageKey)return e;var a=new p.proto.MessageKey;return e.remoteJid!=null&&(a.remoteJid=String(e.remoteJid)),e.fromMe!=null&&(a.fromMe=!!e.fromMe),e.id!=null&&(a.id=String(e.id)),e.participant!=null&&(a.participant=String(e.participant)),a},r.toObject=function(e,a){a||(a={});var A={};return e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,a.oneofs&&(A._remoteJid="remoteJid")),e.fromMe!=null&&e.hasOwnProperty("fromMe")&&(A.fromMe=e.fromMe,a.oneofs&&(A._fromMe="fromMe")),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,a.oneofs&&(A._participant="participant")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageKey"},r})(),n.MessageSecretMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.version=e.sfixed32();break}case 2:{s.encIv=e.bytes();break}case 3:{s.encPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MessageSecretMessage)return e;var a=new p.proto.MessageSecretMessage;return e.version!=null&&(a.version=e.version|0),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,a.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(a.encIv=e.encIv)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,a.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(a.encPayload=e.encPayload)),a},r.toObject=function(e,a){a||(a={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,a.oneofs&&(A._version="version")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=a.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):a.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,a.oneofs&&(A._encIv="encIv")),e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=a.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,a.oneofs&&(A._encPayload="encPayload")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageSecretMessage"},r})(),n.Money=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.value=e.int64();break}case 2:{s.offset=e.uint32();break}case 3:{s.currencyCode=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Money)return e;var a=new p.proto.Money;return e.value!=null&&(l.Long?(a.value=l.Long.fromValue(e.value)).unsigned=!1:typeof e.value=="string"?a.value=parseInt(e.value,10):typeof e.value=="number"?a.value=e.value:typeof e.value=="object"&&(a.value=new l.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber())),e.offset!=null&&(a.offset=e.offset>>>0),e.currencyCode!=null&&(a.currencyCode=String(e.currencyCode)),a},r.toObject=function(e,a){a||(a={});var A={};return e.value!=null&&e.hasOwnProperty("value")&&(typeof e.value=="number"?A.value=a.longs===String?String(e.value):e.value:A.value=a.longs===String?oe(e.value):a.longs===Number?ne(e.value):e.value,a.oneofs&&(A._value="value")),e.offset!=null&&e.hasOwnProperty("offset")&&(A.offset=e.offset,a.oneofs&&(A._offset="offset")),e.currencyCode!=null&&e.hasOwnProperty("currencyCode")&&(A.currencyCode=e.currencyCode,a.oneofs&&(A._currencyCode="currencyCode")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Money"},r})(),n.MsgOpaqueData=(function(){function r(i){if(this.pollOptions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.body=e.string();break}case 3:{s.caption=e.string();break}case 5:{s.lng=e.double();break}case 6:{s.isLive=e.bool();break}case 7:{s.lat=e.double();break}case 8:{s.paymentAmount1000=e.int32();break}case 9:{s.paymentNoteMsgBody=e.string();break}case 11:{s.matchedText=e.string();break}case 12:{s.title=e.string();break}case 13:{s.description=e.string();break}case 14:{s.futureproofBuffer=e.bytes();break}case 15:{s.clientUrl=e.string();break}case 16:{s.loc=e.string();break}case 17:{s.pollName=e.string();break}case 18:{s.pollOptions&&s.pollOptions.length||(s.pollOptions=[]),s.pollOptions.push(p.proto.MsgOpaqueData.PollOption.decode(e,e.uint32()));break}case 20:{s.pollSelectableOptionsCount=e.uint32();break}case 21:{s.messageSecret=e.bytes();break}case 51:{s.originalSelfAuthor=e.string();break}case 22:{s.senderTimestampMs=e.int64();break}case 23:{s.pollUpdateParentKey=e.string();break}case 24:{s.encPollVote=p.proto.PollEncValue.decode(e,e.uint32());break}case 28:{s.isSentCagPollCreation=e.bool();break}case 42:{s.pollContentType=e.int32();break}case 46:{s.pollType=e.int32();break}case 47:{s.correctOptionIndex=e.int32();break}case 41:{s.pollVotesSnapshot=p.proto.MsgOpaqueData.PollVotesSnapshot.decode(e,e.uint32());break}case 25:{s.encReactionTargetMessageKey=e.string();break}case 26:{s.encReactionEncPayload=e.bytes();break}case 27:{s.encReactionEncIv=e.bytes();break}case 29:{s.botMessageSecret=e.bytes();break}case 30:{s.targetMessageKey=e.string();break}case 31:{s.encPayload=e.bytes();break}case 32:{s.encIv=e.bytes();break}case 33:{s.eventName=e.string();break}case 34:{s.isEventCanceled=e.bool();break}case 35:{s.eventDescription=e.string();break}case 36:{s.eventJoinLink=e.string();break}case 37:{s.eventStartTime=e.int64();break}case 38:{s.eventLocation=p.proto.MsgOpaqueData.EventLocation.decode(e,e.uint32());break}case 40:{s.eventEndTime=e.int64();break}case 44:{s.eventIsScheduledCall=e.bool();break}case 45:{s.eventExtraGuestsAllowed=e.bool();break}case 43:{s.plainProtobufBytes=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MsgOpaqueData)return e;var a=new p.proto.MsgOpaqueData;if(e.body!=null&&(a.body=String(e.body)),e.caption!=null&&(a.caption=String(e.caption)),e.lng!=null&&(a.lng=Number(e.lng)),e.isLive!=null&&(a.isLive=!!e.isLive),e.lat!=null&&(a.lat=Number(e.lat)),e.paymentAmount1000!=null&&(a.paymentAmount1000=e.paymentAmount1000|0),e.paymentNoteMsgBody!=null&&(a.paymentNoteMsgBody=String(e.paymentNoteMsgBody)),e.matchedText!=null&&(a.matchedText=String(e.matchedText)),e.title!=null&&(a.title=String(e.title)),e.description!=null&&(a.description=String(e.description)),e.futureproofBuffer!=null&&(typeof e.futureproofBuffer=="string"?l.base64.decode(e.futureproofBuffer,a.futureproofBuffer=l.newBuffer(l.base64.length(e.futureproofBuffer)),0):e.futureproofBuffer.length>=0&&(a.futureproofBuffer=e.futureproofBuffer)),e.clientUrl!=null&&(a.clientUrl=String(e.clientUrl)),e.loc!=null&&(a.loc=String(e.loc)),e.pollName!=null&&(a.pollName=String(e.pollName)),e.pollOptions){if(!Array.isArray(e.pollOptions))throw TypeError(".proto.MsgOpaqueData.pollOptions: array expected");a.pollOptions=[];for(var A=0;A>>0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,a.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(a.messageSecret=e.messageSecret)),e.originalSelfAuthor!=null&&(a.originalSelfAuthor=String(e.originalSelfAuthor)),e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.pollUpdateParentKey!=null&&(a.pollUpdateParentKey=String(e.pollUpdateParentKey)),e.encPollVote!=null){if(typeof e.encPollVote!="object")throw TypeError(".proto.MsgOpaqueData.encPollVote: object expected");a.encPollVote=p.proto.PollEncValue.fromObject(e.encPollVote)}switch(e.isSentCagPollCreation!=null&&(a.isSentCagPollCreation=!!e.isSentCagPollCreation),e.pollContentType){default:if(typeof e.pollContentType=="number"){a.pollContentType=e.pollContentType;break}break;case"UNKNOWN":case 0:a.pollContentType=0;break;case"TEXT":case 1:a.pollContentType=1;break;case"IMAGE":case 2:a.pollContentType=2;break}switch(e.pollType){default:if(typeof e.pollType=="number"){a.pollType=e.pollType;break}break;case"POLL":case 0:a.pollType=0;break;case"QUIZ":case 1:a.pollType=1;break}if(e.correctOptionIndex!=null&&(a.correctOptionIndex=e.correctOptionIndex|0),e.pollVotesSnapshot!=null){if(typeof e.pollVotesSnapshot!="object")throw TypeError(".proto.MsgOpaqueData.pollVotesSnapshot: object expected");a.pollVotesSnapshot=p.proto.MsgOpaqueData.PollVotesSnapshot.fromObject(e.pollVotesSnapshot)}if(e.encReactionTargetMessageKey!=null&&(a.encReactionTargetMessageKey=String(e.encReactionTargetMessageKey)),e.encReactionEncPayload!=null&&(typeof e.encReactionEncPayload=="string"?l.base64.decode(e.encReactionEncPayload,a.encReactionEncPayload=l.newBuffer(l.base64.length(e.encReactionEncPayload)),0):e.encReactionEncPayload.length>=0&&(a.encReactionEncPayload=e.encReactionEncPayload)),e.encReactionEncIv!=null&&(typeof e.encReactionEncIv=="string"?l.base64.decode(e.encReactionEncIv,a.encReactionEncIv=l.newBuffer(l.base64.length(e.encReactionEncIv)),0):e.encReactionEncIv.length>=0&&(a.encReactionEncIv=e.encReactionEncIv)),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,a.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(a.botMessageSecret=e.botMessageSecret)),e.targetMessageKey!=null&&(a.targetMessageKey=String(e.targetMessageKey)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,a.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(a.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,a.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(a.encIv=e.encIv)),e.eventName!=null&&(a.eventName=String(e.eventName)),e.isEventCanceled!=null&&(a.isEventCanceled=!!e.isEventCanceled),e.eventDescription!=null&&(a.eventDescription=String(e.eventDescription)),e.eventJoinLink!=null&&(a.eventJoinLink=String(e.eventJoinLink)),e.eventStartTime!=null&&(l.Long?(a.eventStartTime=l.Long.fromValue(e.eventStartTime)).unsigned=!1:typeof e.eventStartTime=="string"?a.eventStartTime=parseInt(e.eventStartTime,10):typeof e.eventStartTime=="number"?a.eventStartTime=e.eventStartTime:typeof e.eventStartTime=="object"&&(a.eventStartTime=new l.LongBits(e.eventStartTime.low>>>0,e.eventStartTime.high>>>0).toNumber())),e.eventLocation!=null){if(typeof e.eventLocation!="object")throw TypeError(".proto.MsgOpaqueData.eventLocation: object expected");a.eventLocation=p.proto.MsgOpaqueData.EventLocation.fromObject(e.eventLocation)}return e.eventEndTime!=null&&(l.Long?(a.eventEndTime=l.Long.fromValue(e.eventEndTime)).unsigned=!1:typeof e.eventEndTime=="string"?a.eventEndTime=parseInt(e.eventEndTime,10):typeof e.eventEndTime=="number"?a.eventEndTime=e.eventEndTime:typeof e.eventEndTime=="object"&&(a.eventEndTime=new l.LongBits(e.eventEndTime.low>>>0,e.eventEndTime.high>>>0).toNumber())),e.eventIsScheduledCall!=null&&(a.eventIsScheduledCall=!!e.eventIsScheduledCall),e.eventExtraGuestsAllowed!=null&&(a.eventExtraGuestsAllowed=!!e.eventExtraGuestsAllowed),e.plainProtobufBytes!=null&&(typeof e.plainProtobufBytes=="string"?l.base64.decode(e.plainProtobufBytes,a.plainProtobufBytes=l.newBuffer(l.base64.length(e.plainProtobufBytes)),0):e.plainProtobufBytes.length>=0&&(a.plainProtobufBytes=e.plainProtobufBytes)),a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.pollOptions=[]),e.body!=null&&e.hasOwnProperty("body")&&(A.body=e.body,a.oneofs&&(A._body="body")),e.caption!=null&&e.hasOwnProperty("caption")&&(A.caption=e.caption,a.oneofs&&(A._caption="caption")),e.lng!=null&&e.hasOwnProperty("lng")&&(A.lng=a.json&&!isFinite(e.lng)?String(e.lng):e.lng,a.oneofs&&(A._lng="lng")),e.isLive!=null&&e.hasOwnProperty("isLive")&&(A.isLive=e.isLive,a.oneofs&&(A._isLive="isLive")),e.lat!=null&&e.hasOwnProperty("lat")&&(A.lat=a.json&&!isFinite(e.lat)?String(e.lat):e.lat,a.oneofs&&(A._lat="lat")),e.paymentAmount1000!=null&&e.hasOwnProperty("paymentAmount1000")&&(A.paymentAmount1000=e.paymentAmount1000,a.oneofs&&(A._paymentAmount1000="paymentAmount1000")),e.paymentNoteMsgBody!=null&&e.hasOwnProperty("paymentNoteMsgBody")&&(A.paymentNoteMsgBody=e.paymentNoteMsgBody,a.oneofs&&(A._paymentNoteMsgBody="paymentNoteMsgBody")),e.matchedText!=null&&e.hasOwnProperty("matchedText")&&(A.matchedText=e.matchedText,a.oneofs&&(A._matchedText="matchedText")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,a.oneofs&&(A._title="title")),e.description!=null&&e.hasOwnProperty("description")&&(A.description=e.description,a.oneofs&&(A._description="description")),e.futureproofBuffer!=null&&e.hasOwnProperty("futureproofBuffer")&&(A.futureproofBuffer=a.bytes===String?l.base64.encode(e.futureproofBuffer,0,e.futureproofBuffer.length):a.bytes===Array?Array.prototype.slice.call(e.futureproofBuffer):e.futureproofBuffer,a.oneofs&&(A._futureproofBuffer="futureproofBuffer")),e.clientUrl!=null&&e.hasOwnProperty("clientUrl")&&(A.clientUrl=e.clientUrl,a.oneofs&&(A._clientUrl="clientUrl")),e.loc!=null&&e.hasOwnProperty("loc")&&(A.loc=e.loc,a.oneofs&&(A._loc="loc")),e.pollName!=null&&e.hasOwnProperty("pollName")&&(A.pollName=e.pollName,a.oneofs&&(A._pollName="pollName")),e.pollOptions&&e.pollOptions.length){A.pollOptions=[];for(var t=0;t>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.jpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.MsgOpaqueData.EventLocation)return A;var t=new p.proto.MsgOpaqueData.EventLocation;return A.degreesLatitude!=null&&(t.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(t.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(t.name=String(A.name)),A.address!=null&&(t.address=String(A.address)),A.url!=null&&(t.url=String(A.url)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,t.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(t.jpegThumbnail=A.jpegThumbnail)),t},i.toObject=function(A,t){t||(t={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=t.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,t.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=t.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,t.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,t.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=t.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):t.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,t.oneofs&&(s._jpegThumbnail="jpegThumbnail")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.EventLocation"},i})(),r.PollContentType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="TEXT"]=1,e[i[2]="IMAGE"]=2,e})(),r.PollOption=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.name=A.string();break}case 2:{c.hash=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.MsgOpaqueData.PollOption)return A;var t=new p.proto.MsgOpaqueData.PollOption;return A.name!=null&&(t.name=String(A.name)),A.hash!=null&&(t.hash=String(A.hash)),t},i.toObject=function(A,t){t||(t={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),A.hash!=null&&A.hasOwnProperty("hash")&&(s.hash=A.hash,t.oneofs&&(s._hash="hash")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollOption"},i})(),r.PollType=(function(){let i={},e=Object.create(i);return e[i[0]="POLL"]=0,e[i[1]="QUIZ"]=1,e})(),r.PollVoteSnapshot=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.option=p.proto.MsgOpaqueData.PollOption.decode(A,A.uint32());break}case 2:{c.optionVoteCount=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.MsgOpaqueData.PollVoteSnapshot)return A;var t=new p.proto.MsgOpaqueData.PollVoteSnapshot;if(A.option!=null){if(typeof A.option!="object")throw TypeError(".proto.MsgOpaqueData.PollVoteSnapshot.option: object expected");t.option=p.proto.MsgOpaqueData.PollOption.fromObject(A.option)}return A.optionVoteCount!=null&&(t.optionVoteCount=A.optionVoteCount|0),t},i.toObject=function(A,t){t||(t={});var s={};return A.option!=null&&A.hasOwnProperty("option")&&(s.option=p.proto.MsgOpaqueData.PollOption.toObject(A.option,t),t.oneofs&&(s._option="option")),A.optionVoteCount!=null&&A.hasOwnProperty("optionVoteCount")&&(s.optionVoteCount=A.optionVoteCount,t.oneofs&&(s._optionVoteCount="optionVoteCount")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollVoteSnapshot"},i})(),r.PollVotesSnapshot=(function(){function i(e){if(this.pollVotes=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.pollVotes&&g.pollVotes.length||(g.pollVotes=[]),g.pollVotes.push(p.proto.MsgOpaqueData.PollVoteSnapshot.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.MsgOpaqueData.PollVotesSnapshot)return a;var A=new p.proto.MsgOpaqueData.PollVotesSnapshot;if(a.pollVotes){if(!Array.isArray(a.pollVotes))throw TypeError(".proto.MsgOpaqueData.PollVotesSnapshot.pollVotes: array expected");A.pollVotes=[];for(var t=0;t>>3){case 1:{s.currentMsg=p.proto.MsgOpaqueData.decode(e,e.uint32());break}case 2:{s.quotedMsg=p.proto.MsgOpaqueData.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.MsgRowOpaqueData)return e;var a=new p.proto.MsgRowOpaqueData;if(e.currentMsg!=null){if(typeof e.currentMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.currentMsg: object expected");a.currentMsg=p.proto.MsgOpaqueData.fromObject(e.currentMsg)}if(e.quotedMsg!=null){if(typeof e.quotedMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.quotedMsg: object expected");a.quotedMsg=p.proto.MsgOpaqueData.fromObject(e.quotedMsg)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.currentMsg!=null&&e.hasOwnProperty("currentMsg")&&(A.currentMsg=p.proto.MsgOpaqueData.toObject(e.currentMsg,a),a.oneofs&&(A._currentMsg="currentMsg")),e.quotedMsg!=null&&e.hasOwnProperty("quotedMsg")&&(A.quotedMsg=p.proto.MsgOpaqueData.toObject(e.quotedMsg,a),a.oneofs&&(A._quotedMsg="quotedMsg")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MsgRowOpaqueData"},r})(),n.MutationProps=(function(){let r={},o=Object.create(r);return o[r[2]="STAR_ACTION"]=2,o[r[3]="CONTACT_ACTION"]=3,o[r[4]="MUTE_ACTION"]=4,o[r[5]="PIN_ACTION"]=5,o[r[6]="SECURITY_NOTIFICATION_SETTING"]=6,o[r[7]="PUSH_NAME_SETTING"]=7,o[r[8]="QUICK_REPLY_ACTION"]=8,o[r[11]="RECENT_EMOJI_WEIGHTS_ACTION"]=11,o[r[13]="LABEL_MESSAGE_ACTION"]=13,o[r[14]="LABEL_EDIT_ACTION"]=14,o[r[15]="LABEL_ASSOCIATION_ACTION"]=15,o[r[16]="LOCALE_SETTING"]=16,o[r[17]="ARCHIVE_CHAT_ACTION"]=17,o[r[18]="DELETE_MESSAGE_FOR_ME_ACTION"]=18,o[r[19]="KEY_EXPIRATION"]=19,o[r[20]="MARK_CHAT_AS_READ_ACTION"]=20,o[r[21]="CLEAR_CHAT_ACTION"]=21,o[r[22]="DELETE_CHAT_ACTION"]=22,o[r[23]="UNARCHIVE_CHATS_SETTING"]=23,o[r[24]="PRIMARY_FEATURE"]=24,o[r[26]="ANDROID_UNSUPPORTED_ACTIONS"]=26,o[r[27]="AGENT_ACTION"]=27,o[r[28]="SUBSCRIPTION_ACTION"]=28,o[r[29]="USER_STATUS_MUTE_ACTION"]=29,o[r[30]="TIME_FORMAT_ACTION"]=30,o[r[31]="NUX_ACTION"]=31,o[r[32]="PRIMARY_VERSION_ACTION"]=32,o[r[33]="STICKER_ACTION"]=33,o[r[34]="REMOVE_RECENT_STICKER_ACTION"]=34,o[r[35]="CHAT_ASSIGNMENT"]=35,o[r[36]="CHAT_ASSIGNMENT_OPENED_STATUS"]=36,o[r[37]="PN_FOR_LID_CHAT_ACTION"]=37,o[r[38]="MARKETING_MESSAGE_ACTION"]=38,o[r[39]="MARKETING_MESSAGE_BROADCAST_ACTION"]=39,o[r[40]="EXTERNAL_WEB_BETA_ACTION"]=40,o[r[41]="PRIVACY_SETTING_RELAY_ALL_CALLS"]=41,o[r[42]="CALL_LOG_ACTION"]=42,o[r[43]="UGC_BOT"]=43,o[r[44]="STATUS_PRIVACY"]=44,o[r[45]="BOT_WELCOME_REQUEST_ACTION"]=45,o[r[46]="DELETE_INDIVIDUAL_CALL_LOG"]=46,o[r[47]="LABEL_REORDERING_ACTION"]=47,o[r[48]="PAYMENT_INFO_ACTION"]=48,o[r[49]="CUSTOM_PAYMENT_METHODS_ACTION"]=49,o[r[50]="LOCK_CHAT_ACTION"]=50,o[r[51]="CHAT_LOCK_SETTINGS"]=51,o[r[52]="WAMO_USER_IDENTIFIER_ACTION"]=52,o[r[53]="PRIVACY_SETTING_DISABLE_LINK_PREVIEWS_ACTION"]=53,o[r[54]="DEVICE_CAPABILITIES"]=54,o[r[55]="NOTE_EDIT_ACTION"]=55,o[r[56]="FAVORITES_ACTION"]=56,o[r[57]="MERCHANT_PAYMENT_PARTNER_ACTION"]=57,o[r[58]="WAFFLE_ACCOUNT_LINK_STATE_ACTION"]=58,o[r[59]="USERNAME_CHAT_START_MODE"]=59,o[r[60]="NOTIFICATION_ACTIVITY_SETTING_ACTION"]=60,o[r[61]="LID_CONTACT_ACTION"]=61,o[r[62]="CTWA_PER_CUSTOMER_DATA_SHARING_ACTION"]=62,o[r[63]="PAYMENT_TOS_ACTION"]=63,o[r[64]="PRIVACY_SETTING_CHANNELS_PERSONALISED_RECOMMENDATION_ACTION"]=64,o[r[65]="BUSINESS_BROADCAST_ASSOCIATION_ACTION"]=65,o[r[66]="DETECTED_OUTCOMES_STATUS_ACTION"]=66,o[r[68]="MAIBA_AI_FEATURES_CONTROL_ACTION"]=68,o[r[69]="BUSINESS_BROADCAST_LIST_ACTION"]=69,o[r[70]="MUSIC_USER_ID_ACTION"]=70,o[r[71]="STATUS_POST_OPT_IN_NOTIFICATION_PREFERENCES_ACTION"]=71,o[r[72]="AVATAR_UPDATED_ACTION"]=72,o[r[73]="GALAXY_FLOW_ACTION"]=73,o[r[74]="PRIVATE_PROCESSING_SETTING_ACTION"]=74,o[r[75]="NEWSLETTER_SAVED_INTERESTS_ACTION"]=75,o[r[76]="AI_THREAD_RENAME_ACTION"]=76,o[r[77]="INTERACTIVE_MESSAGE_ACTION"]=77,o[r[10001]="SHARE_OWN_PN"]=10001,o[r[10002]="BUSINESS_BROADCAST_ACTION"]=10002,o})(),n.NoiseCertificate=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.NoiseCertificate)return e;var a=new p.proto.NoiseCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),a},r.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NoiseCertificate"},r.Details=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.serial=A.uint32();break}case 2:{c.issuer=A.string();break}case 3:{c.expires=A.uint64();break}case 4:{c.subject=A.string();break}case 5:{c.key=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.NoiseCertificate.Details)return A;var t=new p.proto.NoiseCertificate.Details;return A.serial!=null&&(t.serial=A.serial>>>0),A.issuer!=null&&(t.issuer=String(A.issuer)),A.expires!=null&&(l.Long?(t.expires=l.Long.fromValue(A.expires)).unsigned=!0:typeof A.expires=="string"?t.expires=parseInt(A.expires,10):typeof A.expires=="number"?t.expires=A.expires:typeof A.expires=="object"&&(t.expires=new l.LongBits(A.expires.low>>>0,A.expires.high>>>0).toNumber(!0))),A.subject!=null&&(t.subject=String(A.subject)),A.key!=null&&(typeof A.key=="string"?l.base64.decode(A.key,t.key=l.newBuffer(l.base64.length(A.key)),0):A.key.length>=0&&(t.key=A.key)),t},i.toObject=function(A,t){t||(t={});var s={};return A.serial!=null&&A.hasOwnProperty("serial")&&(s.serial=A.serial,t.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,t.oneofs&&(s._issuer="issuer")),A.expires!=null&&A.hasOwnProperty("expires")&&(typeof A.expires=="number"?s.expires=t.longs===String?String(A.expires):A.expires:s.expires=t.longs===String?oe(A.expires,!0):t.longs===Number?ne(A.expires,!0):A.expires,t.oneofs&&(s._expires="expires")),A.subject!=null&&A.hasOwnProperty("subject")&&(s.subject=A.subject,t.oneofs&&(s._subject="subject")),A.key!=null&&A.hasOwnProperty("key")&&(s.key=t.bytes===String?l.base64.encode(A.key,0,A.key.length):t.bytes===Array?Array.prototype.slice.call(A.key):A.key,t.oneofs&&(s._key="key")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.NoiseCertificate.Details"},i})(),r})(),n.NotificationMessageInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.NotificationMessageInfo)return e;var a=new p.proto.NotificationMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.NotificationMessageInfo.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.NotificationMessageInfo.message: object expected");a.message=p.proto.Message.fromObject(e.message)}return e.messageTimestamp!=null&&(l.Long?(a.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?a.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?a.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(a.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.participant!=null&&(a.participant=String(e.participant)),a},r.toObject=function(e,a){a||(a={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=p.proto.Message.toObject(e.message,a),a.oneofs&&(A._message="message")),e.messageTimestamp!=null&&e.hasOwnProperty("messageTimestamp")&&(typeof e.messageTimestamp=="number"?A.messageTimestamp=a.longs===String?String(e.messageTimestamp):e.messageTimestamp:A.messageTimestamp=a.longs===String?oe(e.messageTimestamp,!0):a.longs===Number?ne(e.messageTimestamp,!0):e.messageTimestamp,a.oneofs&&(A._messageTimestamp="messageTimestamp")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,a.oneofs&&(A._participant="participant")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationMessageInfo"},r})(),n.NotificationSettings=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.messageVibrate=e.string();break}case 2:{s.messagePopup=e.string();break}case 3:{s.messageLight=e.string();break}case 4:{s.lowPriorityNotifications=e.bool();break}case 5:{s.reactionsMuted=e.bool();break}case 6:{s.callVibrate=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.NotificationSettings)return e;var a=new p.proto.NotificationSettings;return e.messageVibrate!=null&&(a.messageVibrate=String(e.messageVibrate)),e.messagePopup!=null&&(a.messagePopup=String(e.messagePopup)),e.messageLight!=null&&(a.messageLight=String(e.messageLight)),e.lowPriorityNotifications!=null&&(a.lowPriorityNotifications=!!e.lowPriorityNotifications),e.reactionsMuted!=null&&(a.reactionsMuted=!!e.reactionsMuted),e.callVibrate!=null&&(a.callVibrate=String(e.callVibrate)),a},r.toObject=function(e,a){a||(a={});var A={};return e.messageVibrate!=null&&e.hasOwnProperty("messageVibrate")&&(A.messageVibrate=e.messageVibrate,a.oneofs&&(A._messageVibrate="messageVibrate")),e.messagePopup!=null&&e.hasOwnProperty("messagePopup")&&(A.messagePopup=e.messagePopup,a.oneofs&&(A._messagePopup="messagePopup")),e.messageLight!=null&&e.hasOwnProperty("messageLight")&&(A.messageLight=e.messageLight,a.oneofs&&(A._messageLight="messageLight")),e.lowPriorityNotifications!=null&&e.hasOwnProperty("lowPriorityNotifications")&&(A.lowPriorityNotifications=e.lowPriorityNotifications,a.oneofs&&(A._lowPriorityNotifications="lowPriorityNotifications")),e.reactionsMuted!=null&&e.hasOwnProperty("reactionsMuted")&&(A.reactionsMuted=e.reactionsMuted,a.oneofs&&(A._reactionsMuted="reactionsMuted")),e.callVibrate!=null&&e.hasOwnProperty("callVibrate")&&(A.callVibrate=e.callVibrate,a.oneofs&&(A._callVibrate="callVibrate")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationSettings"},r})(),n.PairingRequest=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.companionPublicKey=e.bytes();break}case 2:{s.companionIdentityKey=e.bytes();break}case 3:{s.advSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PairingRequest)return e;var a=new p.proto.PairingRequest;return e.companionPublicKey!=null&&(typeof e.companionPublicKey=="string"?l.base64.decode(e.companionPublicKey,a.companionPublicKey=l.newBuffer(l.base64.length(e.companionPublicKey)),0):e.companionPublicKey.length>=0&&(a.companionPublicKey=e.companionPublicKey)),e.companionIdentityKey!=null&&(typeof e.companionIdentityKey=="string"?l.base64.decode(e.companionIdentityKey,a.companionIdentityKey=l.newBuffer(l.base64.length(e.companionIdentityKey)),0):e.companionIdentityKey.length>=0&&(a.companionIdentityKey=e.companionIdentityKey)),e.advSecret!=null&&(typeof e.advSecret=="string"?l.base64.decode(e.advSecret,a.advSecret=l.newBuffer(l.base64.length(e.advSecret)),0):e.advSecret.length>=0&&(a.advSecret=e.advSecret)),a},r.toObject=function(e,a){a||(a={});var A={};return e.companionPublicKey!=null&&e.hasOwnProperty("companionPublicKey")&&(A.companionPublicKey=a.bytes===String?l.base64.encode(e.companionPublicKey,0,e.companionPublicKey.length):a.bytes===Array?Array.prototype.slice.call(e.companionPublicKey):e.companionPublicKey,a.oneofs&&(A._companionPublicKey="companionPublicKey")),e.companionIdentityKey!=null&&e.hasOwnProperty("companionIdentityKey")&&(A.companionIdentityKey=a.bytes===String?l.base64.encode(e.companionIdentityKey,0,e.companionIdentityKey.length):a.bytes===Array?Array.prototype.slice.call(e.companionIdentityKey):e.companionIdentityKey,a.oneofs&&(A._companionIdentityKey="companionIdentityKey")),e.advSecret!=null&&e.hasOwnProperty("advSecret")&&(A.advSecret=a.bytes===String?l.base64.encode(e.advSecret,0,e.advSecret.length):a.bytes===Array?Array.prototype.slice.call(e.advSecret):e.advSecret,a.oneofs&&(A._advSecret="advSecret")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PairingRequest"},r})(),n.PastParticipant=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.userJid=e.string();break}case 2:{s.leaveReason=e.int32();break}case 3:{s.leaveTs=e.uint64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PastParticipant)return e;var a=new p.proto.PastParticipant;switch(e.userJid!=null&&(a.userJid=String(e.userJid)),e.leaveReason){default:if(typeof e.leaveReason=="number"){a.leaveReason=e.leaveReason;break}break;case"LEFT":case 0:a.leaveReason=0;break;case"REMOVED":case 1:a.leaveReason=1;break}return e.leaveTs!=null&&(l.Long?(a.leaveTs=l.Long.fromValue(e.leaveTs)).unsigned=!0:typeof e.leaveTs=="string"?a.leaveTs=parseInt(e.leaveTs,10):typeof e.leaveTs=="number"?a.leaveTs=e.leaveTs:typeof e.leaveTs=="object"&&(a.leaveTs=new l.LongBits(e.leaveTs.low>>>0,e.leaveTs.high>>>0).toNumber(!0))),a},r.toObject=function(e,a){a||(a={});var A={};return e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid,a.oneofs&&(A._userJid="userJid")),e.leaveReason!=null&&e.hasOwnProperty("leaveReason")&&(A.leaveReason=a.enums===String?p.proto.PastParticipant.LeaveReason[e.leaveReason]===void 0?e.leaveReason:p.proto.PastParticipant.LeaveReason[e.leaveReason]:e.leaveReason,a.oneofs&&(A._leaveReason="leaveReason")),e.leaveTs!=null&&e.hasOwnProperty("leaveTs")&&(typeof e.leaveTs=="number"?A.leaveTs=a.longs===String?String(e.leaveTs):e.leaveTs:A.leaveTs=a.longs===String?oe(e.leaveTs,!0):a.longs===Number?ne(e.leaveTs,!0):e.leaveTs,a.oneofs&&(A._leaveTs="leaveTs")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PastParticipant"},r.LeaveReason=(function(){let i={},e=Object.create(i);return e[i[0]="LEFT"]=0,e[i[1]="REMOVED"]=1,e})(),r})(),n.PastParticipants=(function(){function r(i){if(this.pastParticipants=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.groupJid=e.string();break}case 2:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(p.proto.PastParticipant.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PastParticipants)return e;var a=new p.proto.PastParticipants;if(e.groupJid!=null&&(a.groupJid=String(e.groupJid)),e.pastParticipants){if(!Array.isArray(e.pastParticipants))throw TypeError(".proto.PastParticipants.pastParticipants: array expected");a.pastParticipants=[];for(var A=0;A>>3){case 1:{s.currentLthash=e.bytes();break}case 2:{s.newLthash=e.bytes();break}case 3:{s.patchVersion=e.bytes();break}case 4:{s.collectionName=e.bytes();break}case 5:{s.firstFourBytesFromAHashOfSnapshotMacKey=e.bytes();break}case 6:{s.newLthashSubtract=e.bytes();break}case 7:{s.numberAdd=e.int32();break}case 8:{s.numberRemove=e.int32();break}case 9:{s.numberOverride=e.int32();break}case 10:{s.senderPlatform=e.int32();break}case 11:{s.isSenderPrimary=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PatchDebugData)return e;var a=new p.proto.PatchDebugData;switch(e.currentLthash!=null&&(typeof e.currentLthash=="string"?l.base64.decode(e.currentLthash,a.currentLthash=l.newBuffer(l.base64.length(e.currentLthash)),0):e.currentLthash.length>=0&&(a.currentLthash=e.currentLthash)),e.newLthash!=null&&(typeof e.newLthash=="string"?l.base64.decode(e.newLthash,a.newLthash=l.newBuffer(l.base64.length(e.newLthash)),0):e.newLthash.length>=0&&(a.newLthash=e.newLthash)),e.patchVersion!=null&&(typeof e.patchVersion=="string"?l.base64.decode(e.patchVersion,a.patchVersion=l.newBuffer(l.base64.length(e.patchVersion)),0):e.patchVersion.length>=0&&(a.patchVersion=e.patchVersion)),e.collectionName!=null&&(typeof e.collectionName=="string"?l.base64.decode(e.collectionName,a.collectionName=l.newBuffer(l.base64.length(e.collectionName)),0):e.collectionName.length>=0&&(a.collectionName=e.collectionName)),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&(typeof e.firstFourBytesFromAHashOfSnapshotMacKey=="string"?l.base64.decode(e.firstFourBytesFromAHashOfSnapshotMacKey,a.firstFourBytesFromAHashOfSnapshotMacKey=l.newBuffer(l.base64.length(e.firstFourBytesFromAHashOfSnapshotMacKey)),0):e.firstFourBytesFromAHashOfSnapshotMacKey.length>=0&&(a.firstFourBytesFromAHashOfSnapshotMacKey=e.firstFourBytesFromAHashOfSnapshotMacKey)),e.newLthashSubtract!=null&&(typeof e.newLthashSubtract=="string"?l.base64.decode(e.newLthashSubtract,a.newLthashSubtract=l.newBuffer(l.base64.length(e.newLthashSubtract)),0):e.newLthashSubtract.length>=0&&(a.newLthashSubtract=e.newLthashSubtract)),e.numberAdd!=null&&(a.numberAdd=e.numberAdd|0),e.numberRemove!=null&&(a.numberRemove=e.numberRemove|0),e.numberOverride!=null&&(a.numberOverride=e.numberOverride|0),e.senderPlatform){default:if(typeof e.senderPlatform=="number"){a.senderPlatform=e.senderPlatform;break}break;case"ANDROID":case 0:a.senderPlatform=0;break;case"SMBA":case 1:a.senderPlatform=1;break;case"IPHONE":case 2:a.senderPlatform=2;break;case"SMBI":case 3:a.senderPlatform=3;break;case"WEB":case 4:a.senderPlatform=4;break;case"UWP":case 5:a.senderPlatform=5;break;case"DARWIN":case 6:a.senderPlatform=6;break;case"IPAD":case 7:a.senderPlatform=7;break;case"WEAROS":case 8:a.senderPlatform=8;break;case"WASG":case 9:a.senderPlatform=9;break;case"WEARM":case 10:a.senderPlatform=10;break;case"CAPI":case 11:a.senderPlatform=11;break}return e.isSenderPrimary!=null&&(a.isSenderPrimary=!!e.isSenderPrimary),a},r.toObject=function(e,a){a||(a={});var A={};return e.currentLthash!=null&&e.hasOwnProperty("currentLthash")&&(A.currentLthash=a.bytes===String?l.base64.encode(e.currentLthash,0,e.currentLthash.length):a.bytes===Array?Array.prototype.slice.call(e.currentLthash):e.currentLthash,a.oneofs&&(A._currentLthash="currentLthash")),e.newLthash!=null&&e.hasOwnProperty("newLthash")&&(A.newLthash=a.bytes===String?l.base64.encode(e.newLthash,0,e.newLthash.length):a.bytes===Array?Array.prototype.slice.call(e.newLthash):e.newLthash,a.oneofs&&(A._newLthash="newLthash")),e.patchVersion!=null&&e.hasOwnProperty("patchVersion")&&(A.patchVersion=a.bytes===String?l.base64.encode(e.patchVersion,0,e.patchVersion.length):a.bytes===Array?Array.prototype.slice.call(e.patchVersion):e.patchVersion,a.oneofs&&(A._patchVersion="patchVersion")),e.collectionName!=null&&e.hasOwnProperty("collectionName")&&(A.collectionName=a.bytes===String?l.base64.encode(e.collectionName,0,e.collectionName.length):a.bytes===Array?Array.prototype.slice.call(e.collectionName):e.collectionName,a.oneofs&&(A._collectionName="collectionName")),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&e.hasOwnProperty("firstFourBytesFromAHashOfSnapshotMacKey")&&(A.firstFourBytesFromAHashOfSnapshotMacKey=a.bytes===String?l.base64.encode(e.firstFourBytesFromAHashOfSnapshotMacKey,0,e.firstFourBytesFromAHashOfSnapshotMacKey.length):a.bytes===Array?Array.prototype.slice.call(e.firstFourBytesFromAHashOfSnapshotMacKey):e.firstFourBytesFromAHashOfSnapshotMacKey,a.oneofs&&(A._firstFourBytesFromAHashOfSnapshotMacKey="firstFourBytesFromAHashOfSnapshotMacKey")),e.newLthashSubtract!=null&&e.hasOwnProperty("newLthashSubtract")&&(A.newLthashSubtract=a.bytes===String?l.base64.encode(e.newLthashSubtract,0,e.newLthashSubtract.length):a.bytes===Array?Array.prototype.slice.call(e.newLthashSubtract):e.newLthashSubtract,a.oneofs&&(A._newLthashSubtract="newLthashSubtract")),e.numberAdd!=null&&e.hasOwnProperty("numberAdd")&&(A.numberAdd=e.numberAdd,a.oneofs&&(A._numberAdd="numberAdd")),e.numberRemove!=null&&e.hasOwnProperty("numberRemove")&&(A.numberRemove=e.numberRemove,a.oneofs&&(A._numberRemove="numberRemove")),e.numberOverride!=null&&e.hasOwnProperty("numberOverride")&&(A.numberOverride=e.numberOverride,a.oneofs&&(A._numberOverride="numberOverride")),e.senderPlatform!=null&&e.hasOwnProperty("senderPlatform")&&(A.senderPlatform=a.enums===String?p.proto.PatchDebugData.Platform[e.senderPlatform]===void 0?e.senderPlatform:p.proto.PatchDebugData.Platform[e.senderPlatform]:e.senderPlatform,a.oneofs&&(A._senderPlatform="senderPlatform")),e.isSenderPrimary!=null&&e.hasOwnProperty("isSenderPrimary")&&(A.isSenderPrimary=e.isSenderPrimary,a.oneofs&&(A._isSenderPrimary="isSenderPrimary")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PatchDebugData"},r.Platform=(function(){let i={},e=Object.create(i);return e[i[0]="ANDROID"]=0,e[i[1]="SMBA"]=1,e[i[2]="IPHONE"]=2,e[i[3]="SMBI"]=3,e[i[4]="WEB"]=4,e[i[5]="UWP"]=5,e[i[6]="DARWIN"]=6,e[i[7]="IPAD"]=7,e[i[8]="WEAROS"]=8,e[i[9]="WASG"]=9,e[i[10]="WEARM"]=10,e[i[11]="CAPI"]=11,e})(),r})(),n.PaymentBackground=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.string();break}case 2:{s.fileLength=e.uint64();break}case 3:{s.width=e.uint32();break}case 4:{s.height=e.uint32();break}case 5:{s.mimetype=e.string();break}case 6:{s.placeholderArgb=e.fixed32();break}case 7:{s.textArgb=e.fixed32();break}case 8:{s.subtextArgb=e.fixed32();break}case 9:{s.mediaData=p.proto.PaymentBackground.MediaData.decode(e,e.uint32());break}case 10:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PaymentBackground)return e;var a=new p.proto.PaymentBackground;if(e.id!=null&&(a.id=String(e.id)),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.width!=null&&(a.width=e.width>>>0),e.height!=null&&(a.height=e.height>>>0),e.mimetype!=null&&(a.mimetype=String(e.mimetype)),e.placeholderArgb!=null&&(a.placeholderArgb=e.placeholderArgb>>>0),e.textArgb!=null&&(a.textArgb=e.textArgb>>>0),e.subtextArgb!=null&&(a.subtextArgb=e.subtextArgb>>>0),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.PaymentBackground.mediaData: object expected");a.mediaData=p.proto.PaymentBackground.MediaData.fromObject(e.mediaData)}switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"UNKNOWN":case 0:a.type=0;break;case"DEFAULT":case 1:a.type=1;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=a.longs===String?String(e.fileLength):e.fileLength:A.fileLength=a.longs===String?oe(e.fileLength,!0):a.longs===Number?ne(e.fileLength,!0):e.fileLength,a.oneofs&&(A._fileLength="fileLength")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,a.oneofs&&(A._width="width")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,a.oneofs&&(A._height="height")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,a.oneofs&&(A._mimetype="mimetype")),e.placeholderArgb!=null&&e.hasOwnProperty("placeholderArgb")&&(A.placeholderArgb=e.placeholderArgb,a.oneofs&&(A._placeholderArgb="placeholderArgb")),e.textArgb!=null&&e.hasOwnProperty("textArgb")&&(A.textArgb=e.textArgb,a.oneofs&&(A._textArgb="textArgb")),e.subtextArgb!=null&&e.hasOwnProperty("subtextArgb")&&(A.subtextArgb=e.subtextArgb,a.oneofs&&(A._subtextArgb="subtextArgb")),e.mediaData!=null&&e.hasOwnProperty("mediaData")&&(A.mediaData=p.proto.PaymentBackground.MediaData.toObject(e.mediaData,a),a.oneofs&&(A._mediaData="mediaData")),e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.PaymentBackground.Type[e.type]===void 0?e.type:p.proto.PaymentBackground.Type[e.type]:e.type,a.oneofs&&(A._type="type")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentBackground"},r.MediaData=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.mediaKey=A.bytes();break}case 2:{c.mediaKeyTimestamp=A.int64();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.PaymentBackground.MediaData)return A;var t=new p.proto.PaymentBackground.MediaData;return A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(t.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?t.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?t.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(t.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,t.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(t.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(t.directPath=String(A.directPath)),t},i.toObject=function(A,t){t||(t={});var s={};return A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=t.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,t.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=t.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=t.longs===String?oe(A.mediaKeyTimestamp):t.longs===Number?ne(A.mediaKeyTimestamp):A.mediaKeyTimestamp,t.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=t.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,t.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=t.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,t.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,t.oneofs&&(s._directPath="directPath")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.PaymentBackground.MediaData"},i})(),r.Type=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="DEFAULT"]=1,e})(),r})(),n.PaymentInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.currencyDeprecated=e.int32();break}case 2:{s.amount1000=e.uint64();break}case 3:{s.receiverJid=e.string();break}case 4:{s.status=e.int32();break}case 5:{s.transactionTimestamp=e.uint64();break}case 6:{s.requestMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 7:{s.expiryTimestamp=e.uint64();break}case 8:{s.futureproofed=e.bool();break}case 9:{s.currency=e.string();break}case 10:{s.txnStatus=e.int32();break}case 11:{s.useNoviFiatFormat=e.bool();break}case 12:{s.primaryAmount=p.proto.Money.decode(e,e.uint32());break}case 13:{s.exchangeAmount=p.proto.Money.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PaymentInfo)return e;var a=new p.proto.PaymentInfo;switch(e.currencyDeprecated){default:if(typeof e.currencyDeprecated=="number"){a.currencyDeprecated=e.currencyDeprecated;break}break;case"UNKNOWN_CURRENCY":case 0:a.currencyDeprecated=0;break;case"INR":case 1:a.currencyDeprecated=1;break}switch(e.amount1000!=null&&(l.Long?(a.amount1000=l.Long.fromValue(e.amount1000)).unsigned=!0:typeof e.amount1000=="string"?a.amount1000=parseInt(e.amount1000,10):typeof e.amount1000=="number"?a.amount1000=e.amount1000:typeof e.amount1000=="object"&&(a.amount1000=new l.LongBits(e.amount1000.low>>>0,e.amount1000.high>>>0).toNumber(!0))),e.receiverJid!=null&&(a.receiverJid=String(e.receiverJid)),e.status){default:if(typeof e.status=="number"){a.status=e.status;break}break;case"UNKNOWN_STATUS":case 0:a.status=0;break;case"PROCESSING":case 1:a.status=1;break;case"SENT":case 2:a.status=2;break;case"NEED_TO_ACCEPT":case 3:a.status=3;break;case"COMPLETE":case 4:a.status=4;break;case"COULD_NOT_COMPLETE":case 5:a.status=5;break;case"REFUNDED":case 6:a.status=6;break;case"EXPIRED":case 7:a.status=7;break;case"REJECTED":case 8:a.status=8;break;case"CANCELLED":case 9:a.status=9;break;case"WAITING_FOR_PAYER":case 10:a.status=10;break;case"WAITING":case 11:a.status=11;break}if(e.transactionTimestamp!=null&&(l.Long?(a.transactionTimestamp=l.Long.fromValue(e.transactionTimestamp)).unsigned=!0:typeof e.transactionTimestamp=="string"?a.transactionTimestamp=parseInt(e.transactionTimestamp,10):typeof e.transactionTimestamp=="number"?a.transactionTimestamp=e.transactionTimestamp:typeof e.transactionTimestamp=="object"&&(a.transactionTimestamp=new l.LongBits(e.transactionTimestamp.low>>>0,e.transactionTimestamp.high>>>0).toNumber(!0))),e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected");a.requestMessageKey=p.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.expiryTimestamp!=null&&(l.Long?(a.expiryTimestamp=l.Long.fromValue(e.expiryTimestamp)).unsigned=!0:typeof e.expiryTimestamp=="string"?a.expiryTimestamp=parseInt(e.expiryTimestamp,10):typeof e.expiryTimestamp=="number"?a.expiryTimestamp=e.expiryTimestamp:typeof e.expiryTimestamp=="object"&&(a.expiryTimestamp=new l.LongBits(e.expiryTimestamp.low>>>0,e.expiryTimestamp.high>>>0).toNumber(!0))),e.futureproofed!=null&&(a.futureproofed=!!e.futureproofed),e.currency!=null&&(a.currency=String(e.currency)),e.txnStatus){default:if(typeof e.txnStatus=="number"){a.txnStatus=e.txnStatus;break}break;case"UNKNOWN":case 0:a.txnStatus=0;break;case"PENDING_SETUP":case 1:a.txnStatus=1;break;case"PENDING_RECEIVER_SETUP":case 2:a.txnStatus=2;break;case"INIT":case 3:a.txnStatus=3;break;case"SUCCESS":case 4:a.txnStatus=4;break;case"COMPLETED":case 5:a.txnStatus=5;break;case"FAILED":case 6:a.txnStatus=6;break;case"FAILED_RISK":case 7:a.txnStatus=7;break;case"FAILED_PROCESSING":case 8:a.txnStatus=8;break;case"FAILED_RECEIVER_PROCESSING":case 9:a.txnStatus=9;break;case"FAILED_DA":case 10:a.txnStatus=10;break;case"FAILED_DA_FINAL":case 11:a.txnStatus=11;break;case"REFUNDED_TXN":case 12:a.txnStatus=12;break;case"REFUND_FAILED":case 13:a.txnStatus=13;break;case"REFUND_FAILED_PROCESSING":case 14:a.txnStatus=14;break;case"REFUND_FAILED_DA":case 15:a.txnStatus=15;break;case"EXPIRED_TXN":case 16:a.txnStatus=16;break;case"AUTH_CANCELED":case 17:a.txnStatus=17;break;case"AUTH_CANCEL_FAILED_PROCESSING":case 18:a.txnStatus=18;break;case"AUTH_CANCEL_FAILED":case 19:a.txnStatus=19;break;case"COLLECT_INIT":case 20:a.txnStatus=20;break;case"COLLECT_SUCCESS":case 21:a.txnStatus=21;break;case"COLLECT_FAILED":case 22:a.txnStatus=22;break;case"COLLECT_FAILED_RISK":case 23:a.txnStatus=23;break;case"COLLECT_REJECTED":case 24:a.txnStatus=24;break;case"COLLECT_EXPIRED":case 25:a.txnStatus=25;break;case"COLLECT_CANCELED":case 26:a.txnStatus=26;break;case"COLLECT_CANCELLING":case 27:a.txnStatus=27;break;case"IN_REVIEW":case 28:a.txnStatus=28;break;case"REVERSAL_SUCCESS":case 29:a.txnStatus=29;break;case"REVERSAL_PENDING":case 30:a.txnStatus=30;break;case"REFUND_PENDING":case 31:a.txnStatus=31;break}if(e.useNoviFiatFormat!=null&&(a.useNoviFiatFormat=!!e.useNoviFiatFormat),e.primaryAmount!=null){if(typeof e.primaryAmount!="object")throw TypeError(".proto.PaymentInfo.primaryAmount: object expected");a.primaryAmount=p.proto.Money.fromObject(e.primaryAmount)}if(e.exchangeAmount!=null){if(typeof e.exchangeAmount!="object")throw TypeError(".proto.PaymentInfo.exchangeAmount: object expected");a.exchangeAmount=p.proto.Money.fromObject(e.exchangeAmount)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.currencyDeprecated!=null&&e.hasOwnProperty("currencyDeprecated")&&(A.currencyDeprecated=a.enums===String?p.proto.PaymentInfo.Currency[e.currencyDeprecated]===void 0?e.currencyDeprecated:p.proto.PaymentInfo.Currency[e.currencyDeprecated]:e.currencyDeprecated,a.oneofs&&(A._currencyDeprecated="currencyDeprecated")),e.amount1000!=null&&e.hasOwnProperty("amount1000")&&(typeof e.amount1000=="number"?A.amount1000=a.longs===String?String(e.amount1000):e.amount1000:A.amount1000=a.longs===String?oe(e.amount1000,!0):a.longs===Number?ne(e.amount1000,!0):e.amount1000,a.oneofs&&(A._amount1000="amount1000")),e.receiverJid!=null&&e.hasOwnProperty("receiverJid")&&(A.receiverJid=e.receiverJid,a.oneofs&&(A._receiverJid="receiverJid")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=a.enums===String?p.proto.PaymentInfo.Status[e.status]===void 0?e.status:p.proto.PaymentInfo.Status[e.status]:e.status,a.oneofs&&(A._status="status")),e.transactionTimestamp!=null&&e.hasOwnProperty("transactionTimestamp")&&(typeof e.transactionTimestamp=="number"?A.transactionTimestamp=a.longs===String?String(e.transactionTimestamp):e.transactionTimestamp:A.transactionTimestamp=a.longs===String?oe(e.transactionTimestamp,!0):a.longs===Number?ne(e.transactionTimestamp,!0):e.transactionTimestamp,a.oneofs&&(A._transactionTimestamp="transactionTimestamp")),e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=p.proto.MessageKey.toObject(e.requestMessageKey,a),a.oneofs&&(A._requestMessageKey="requestMessageKey")),e.expiryTimestamp!=null&&e.hasOwnProperty("expiryTimestamp")&&(typeof e.expiryTimestamp=="number"?A.expiryTimestamp=a.longs===String?String(e.expiryTimestamp):e.expiryTimestamp:A.expiryTimestamp=a.longs===String?oe(e.expiryTimestamp,!0):a.longs===Number?ne(e.expiryTimestamp,!0):e.expiryTimestamp,a.oneofs&&(A._expiryTimestamp="expiryTimestamp")),e.futureproofed!=null&&e.hasOwnProperty("futureproofed")&&(A.futureproofed=e.futureproofed,a.oneofs&&(A._futureproofed="futureproofed")),e.currency!=null&&e.hasOwnProperty("currency")&&(A.currency=e.currency,a.oneofs&&(A._currency="currency")),e.txnStatus!=null&&e.hasOwnProperty("txnStatus")&&(A.txnStatus=a.enums===String?p.proto.PaymentInfo.TxnStatus[e.txnStatus]===void 0?e.txnStatus:p.proto.PaymentInfo.TxnStatus[e.txnStatus]:e.txnStatus,a.oneofs&&(A._txnStatus="txnStatus")),e.useNoviFiatFormat!=null&&e.hasOwnProperty("useNoviFiatFormat")&&(A.useNoviFiatFormat=e.useNoviFiatFormat,a.oneofs&&(A._useNoviFiatFormat="useNoviFiatFormat")),e.primaryAmount!=null&&e.hasOwnProperty("primaryAmount")&&(A.primaryAmount=p.proto.Money.toObject(e.primaryAmount,a),a.oneofs&&(A._primaryAmount="primaryAmount")),e.exchangeAmount!=null&&e.hasOwnProperty("exchangeAmount")&&(A.exchangeAmount=p.proto.Money.toObject(e.exchangeAmount,a),a.oneofs&&(A._exchangeAmount="exchangeAmount")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentInfo"},r.Currency=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_CURRENCY"]=0,e[i[1]="INR"]=1,e})(),r.Status=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_STATUS"]=0,e[i[1]="PROCESSING"]=1,e[i[2]="SENT"]=2,e[i[3]="NEED_TO_ACCEPT"]=3,e[i[4]="COMPLETE"]=4,e[i[5]="COULD_NOT_COMPLETE"]=5,e[i[6]="REFUNDED"]=6,e[i[7]="EXPIRED"]=7,e[i[8]="REJECTED"]=8,e[i[9]="CANCELLED"]=9,e[i[10]="WAITING_FOR_PAYER"]=10,e[i[11]="WAITING"]=11,e})(),r.TxnStatus=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="PENDING_SETUP"]=1,e[i[2]="PENDING_RECEIVER_SETUP"]=2,e[i[3]="INIT"]=3,e[i[4]="SUCCESS"]=4,e[i[5]="COMPLETED"]=5,e[i[6]="FAILED"]=6,e[i[7]="FAILED_RISK"]=7,e[i[8]="FAILED_PROCESSING"]=8,e[i[9]="FAILED_RECEIVER_PROCESSING"]=9,e[i[10]="FAILED_DA"]=10,e[i[11]="FAILED_DA_FINAL"]=11,e[i[12]="REFUNDED_TXN"]=12,e[i[13]="REFUND_FAILED"]=13,e[i[14]="REFUND_FAILED_PROCESSING"]=14,e[i[15]="REFUND_FAILED_DA"]=15,e[i[16]="EXPIRED_TXN"]=16,e[i[17]="AUTH_CANCELED"]=17,e[i[18]="AUTH_CANCEL_FAILED_PROCESSING"]=18,e[i[19]="AUTH_CANCEL_FAILED"]=19,e[i[20]="COLLECT_INIT"]=20,e[i[21]="COLLECT_SUCCESS"]=21,e[i[22]="COLLECT_FAILED"]=22,e[i[23]="COLLECT_FAILED_RISK"]=23,e[i[24]="COLLECT_REJECTED"]=24,e[i[25]="COLLECT_EXPIRED"]=25,e[i[26]="COLLECT_CANCELED"]=26,e[i[27]="COLLECT_CANCELLING"]=27,e[i[28]="IN_REVIEW"]=28,e[i[29]="REVERSAL_SUCCESS"]=29,e[i[30]="REVERSAL_PENDING"]=30,e[i[31]="REFUND_PENDING"]=31,e})(),r})(),n.PhoneNumberToLIDMapping=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pnJid=e.string();break}case 2:{s.lidJid=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PhoneNumberToLIDMapping)return e;var a=new p.proto.PhoneNumberToLIDMapping;return e.pnJid!=null&&(a.pnJid=String(e.pnJid)),e.lidJid!=null&&(a.lidJid=String(e.lidJid)),a},r.toObject=function(e,a){a||(a={});var A={};return e.pnJid!=null&&e.hasOwnProperty("pnJid")&&(A.pnJid=e.pnJid,a.oneofs&&(A._pnJid="pnJid")),e.lidJid!=null&&e.hasOwnProperty("lidJid")&&(A.lidJid=e.lidJid,a.oneofs&&(A._lidJid="lidJid")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhoneNumberToLIDMapping"},r})(),n.PhotoChange=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.oldPhoto=e.bytes();break}case 2:{s.newPhoto=e.bytes();break}case 3:{s.newPhotoId=e.uint32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PhotoChange)return e;var a=new p.proto.PhotoChange;return e.oldPhoto!=null&&(typeof e.oldPhoto=="string"?l.base64.decode(e.oldPhoto,a.oldPhoto=l.newBuffer(l.base64.length(e.oldPhoto)),0):e.oldPhoto.length>=0&&(a.oldPhoto=e.oldPhoto)),e.newPhoto!=null&&(typeof e.newPhoto=="string"?l.base64.decode(e.newPhoto,a.newPhoto=l.newBuffer(l.base64.length(e.newPhoto)),0):e.newPhoto.length>=0&&(a.newPhoto=e.newPhoto)),e.newPhotoId!=null&&(a.newPhotoId=e.newPhotoId>>>0),a},r.toObject=function(e,a){a||(a={});var A={};return e.oldPhoto!=null&&e.hasOwnProperty("oldPhoto")&&(A.oldPhoto=a.bytes===String?l.base64.encode(e.oldPhoto,0,e.oldPhoto.length):a.bytes===Array?Array.prototype.slice.call(e.oldPhoto):e.oldPhoto,a.oneofs&&(A._oldPhoto="oldPhoto")),e.newPhoto!=null&&e.hasOwnProperty("newPhoto")&&(A.newPhoto=a.bytes===String?l.base64.encode(e.newPhoto,0,e.newPhoto.length):a.bytes===Array?Array.prototype.slice.call(e.newPhoto):e.newPhoto,a.oneofs&&(A._newPhoto="newPhoto")),e.newPhotoId!=null&&e.hasOwnProperty("newPhotoId")&&(A.newPhotoId=e.newPhotoId,a.oneofs&&(A._newPhotoId="newPhotoId")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhotoChange"},r})(),n.PinInChat=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}case 2:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.messageAddOnContextInfo=p.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PinInChat)return e;var a=new p.proto.PinInChat;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"UNKNOWN_TYPE":case 0:a.type=0;break;case"PIN_FOR_ALL":case 1:a.type=1;break;case"UNPIN_FOR_ALL":case 2:a.type=2;break}if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.PinInChat.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}if(e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.messageAddOnContextInfo!=null){if(typeof e.messageAddOnContextInfo!="object")throw TypeError(".proto.PinInChat.messageAddOnContextInfo: object expected");a.messageAddOnContextInfo=p.proto.MessageAddOnContextInfo.fromObject(e.messageAddOnContextInfo)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.PinInChat.Type[e.type]===void 0?e.type:p.proto.PinInChat.Type[e.type]:e.type,a.oneofs&&(A._type="type")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?oe(e.senderTimestampMs):a.longs===Number?ne(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?oe(e.serverTimestampMs):a.longs===Number?ne(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.messageAddOnContextInfo!=null&&e.hasOwnProperty("messageAddOnContextInfo")&&(A.messageAddOnContextInfo=p.proto.MessageAddOnContextInfo.toObject(e.messageAddOnContextInfo,a),a.oneofs&&(A._messageAddOnContextInfo="messageAddOnContextInfo")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PinInChat"},r.Type=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN_TYPE"]=0,e[i[1]="PIN_FOR_ALL"]=1,e[i[2]="UNPIN_FOR_ALL"]=2,e})(),r})(),n.Point=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.xDeprecated=e.int32();break}case 2:{s.yDeprecated=e.int32();break}case 3:{s.x=e.double();break}case 4:{s.y=e.double();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Point)return e;var a=new p.proto.Point;return e.xDeprecated!=null&&(a.xDeprecated=e.xDeprecated|0),e.yDeprecated!=null&&(a.yDeprecated=e.yDeprecated|0),e.x!=null&&(a.x=Number(e.x)),e.y!=null&&(a.y=Number(e.y)),a},r.toObject=function(e,a){a||(a={});var A={};return e.xDeprecated!=null&&e.hasOwnProperty("xDeprecated")&&(A.xDeprecated=e.xDeprecated,a.oneofs&&(A._xDeprecated="xDeprecated")),e.yDeprecated!=null&&e.hasOwnProperty("yDeprecated")&&(A.yDeprecated=e.yDeprecated,a.oneofs&&(A._yDeprecated="yDeprecated")),e.x!=null&&e.hasOwnProperty("x")&&(A.x=a.json&&!isFinite(e.x)?String(e.x):e.x,a.oneofs&&(A._x="x")),e.y!=null&&e.hasOwnProperty("y")&&(A.y=a.json&&!isFinite(e.y)?String(e.y):e.y,a.oneofs&&(A._y="y")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Point"},r})(),n.PollAdditionalMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pollInvalidated=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PollAdditionalMetadata)return e;var a=new p.proto.PollAdditionalMetadata;return e.pollInvalidated!=null&&(a.pollInvalidated=!!e.pollInvalidated),a},r.toObject=function(e,a){a||(a={});var A={};return e.pollInvalidated!=null&&e.hasOwnProperty("pollInvalidated")&&(A.pollInvalidated=e.pollInvalidated,a.oneofs&&(A._pollInvalidated="pollInvalidated")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollAdditionalMetadata"},r})(),n.PollEncValue=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encPayload=e.bytes();break}case 2:{s.encIv=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PollEncValue)return e;var a=new p.proto.PollEncValue;return e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,a.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(a.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,a.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(a.encIv=e.encIv)),a},r.toObject=function(e,a){a||(a={});var A={};return e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=a.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):a.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,a.oneofs&&(A._encPayload="encPayload")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=a.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):a.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,a.oneofs&&(A._encIv="encIv")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollEncValue"},r})(),n.PollUpdate=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.pollUpdateMessageKey=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.vote=p.proto.Message.PollVoteMessage.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PollUpdate)return e;var a=new p.proto.PollUpdate;if(e.pollUpdateMessageKey!=null){if(typeof e.pollUpdateMessageKey!="object")throw TypeError(".proto.PollUpdate.pollUpdateMessageKey: object expected");a.pollUpdateMessageKey=p.proto.MessageKey.fromObject(e.pollUpdateMessageKey)}if(e.vote!=null){if(typeof e.vote!="object")throw TypeError(".proto.PollUpdate.vote: object expected");a.vote=p.proto.Message.PollVoteMessage.fromObject(e.vote)}return e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(a.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?a.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?a.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(a.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.unread!=null&&(a.unread=!!e.unread),a},r.toObject=function(e,a){a||(a={});var A={};return e.pollUpdateMessageKey!=null&&e.hasOwnProperty("pollUpdateMessageKey")&&(A.pollUpdateMessageKey=p.proto.MessageKey.toObject(e.pollUpdateMessageKey,a),a.oneofs&&(A._pollUpdateMessageKey="pollUpdateMessageKey")),e.vote!=null&&e.hasOwnProperty("vote")&&(A.vote=p.proto.Message.PollVoteMessage.toObject(e.vote,a),a.oneofs&&(A._vote="vote")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?oe(e.senderTimestampMs):a.longs===Number?ne(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=a.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=a.longs===String?oe(e.serverTimestampMs):a.longs===Number?ne(e.serverTimestampMs):e.serverTimestampMs,a.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,a.oneofs&&(A._unread="unread")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollUpdate"},r})(),n.PreKeyRecordStructure=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PreKeyRecordStructure)return e;var a=new p.proto.PreKeyRecordStructure;return e.id!=null&&(a.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,a.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(a.privateKey=e.privateKey)),a},r.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=a.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):a.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,a.oneofs&&(A._privateKey="privateKey")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeyRecordStructure"},r})(),n.PreKeySignalMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 5:{s.registrationId=e.uint32();break}case 1:{s.preKeyId=e.uint32();break}case 6:{s.signedPreKeyId=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.identityKey=e.bytes();break}case 4:{s.message=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PreKeySignalMessage)return e;var a=new p.proto.PreKeySignalMessage;return e.registrationId!=null&&(a.registrationId=e.registrationId>>>0),e.preKeyId!=null&&(a.preKeyId=e.preKeyId>>>0),e.signedPreKeyId!=null&&(a.signedPreKeyId=e.signedPreKeyId>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,a.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(a.baseKey=e.baseKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,a.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(a.identityKey=e.identityKey)),e.message!=null&&(typeof e.message=="string"?l.base64.decode(e.message,a.message=l.newBuffer(l.base64.length(e.message)),0):e.message.length>=0&&(a.message=e.message)),a},r.toObject=function(e,a){a||(a={});var A={};return e.preKeyId!=null&&e.hasOwnProperty("preKeyId")&&(A.preKeyId=e.preKeyId,a.oneofs&&(A._preKeyId="preKeyId")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=a.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):a.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,a.oneofs&&(A._baseKey="baseKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=a.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):a.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,a.oneofs&&(A._identityKey="identityKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=a.bytes===String?l.base64.encode(e.message,0,e.message.length):a.bytes===Array?Array.prototype.slice.call(e.message):e.message,a.oneofs&&(A._message="message")),e.registrationId!=null&&e.hasOwnProperty("registrationId")&&(A.registrationId=e.registrationId,a.oneofs&&(A._registrationId="registrationId")),e.signedPreKeyId!=null&&e.hasOwnProperty("signedPreKeyId")&&(A.signedPreKeyId=e.signedPreKeyId,a.oneofs&&(A._signedPreKeyId="signedPreKeyId")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeySignalMessage"},r})(),n.PremiumMessageInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.serverCampaignId=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PremiumMessageInfo)return e;var a=new p.proto.PremiumMessageInfo;return e.serverCampaignId!=null&&(a.serverCampaignId=String(e.serverCampaignId)),a},r.toObject=function(e,a){a||(a={});var A={};return e.serverCampaignId!=null&&e.hasOwnProperty("serverCampaignId")&&(A.serverCampaignId=e.serverCampaignId,a.oneofs&&(A._serverCampaignId="serverCampaignId")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PremiumMessageInfo"},r})(),n.PrimaryEphemeralIdentity=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.nonce=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.PrimaryEphemeralIdentity)return e;var a=new p.proto.PrimaryEphemeralIdentity;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.nonce!=null&&(typeof e.nonce=="string"?l.base64.decode(e.nonce,a.nonce=l.newBuffer(l.base64.length(e.nonce)),0):e.nonce.length>=0&&(a.nonce=e.nonce)),a},r.toObject=function(e,a){a||(a={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.nonce!=null&&e.hasOwnProperty("nonce")&&(A.nonce=a.bytes===String?l.base64.encode(e.nonce,0,e.nonce.length):a.bytes===Array?Array.prototype.slice.call(e.nonce):e.nonce,a.oneofs&&(A._nonce="nonce")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PrimaryEphemeralIdentity"},r})(),n.PrivacySystemMessage=(function(){let r={},o=Object.create(r);return o[r[1]="E2EE_MSG"]=1,o[r[2]="NE2EE_SELF"]=2,o[r[3]="NE2EE_OTHER"]=3,o})(),n.ProcessedVideo=(function(){function r(i){if(this.capabilities=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.directPath=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.height=e.uint32();break}case 4:{s.width=e.uint32();break}case 5:{s.fileLength=e.uint64();break}case 6:{s.bitrate=e.uint32();break}case 7:{s.quality=e.int32();break}case 8:{s.capabilities&&s.capabilities.length||(s.capabilities=[]),s.capabilities.push(e.string());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ProcessedVideo)return e;var a=new p.proto.ProcessedVideo;switch(e.directPath!=null&&(a.directPath=String(e.directPath)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,a.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(a.fileSha256=e.fileSha256)),e.height!=null&&(a.height=e.height>>>0),e.width!=null&&(a.width=e.width>>>0),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.bitrate!=null&&(a.bitrate=e.bitrate>>>0),e.quality){default:if(typeof e.quality=="number"){a.quality=e.quality;break}break;case"UNDEFINED":case 0:a.quality=0;break;case"LOW":case 1:a.quality=1;break;case"MID":case 2:a.quality=2;break;case"HIGH":case 3:a.quality=3;break}if(e.capabilities){if(!Array.isArray(e.capabilities))throw TypeError(".proto.ProcessedVideo.capabilities: array expected");a.capabilities=[];for(var A=0;A>>3){case 1:{s.companionEphemeralIdentity=e.bytes();break}case 2:{s.commitment=p.proto.CompanionCommitment.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ProloguePayload)return e;var a=new p.proto.ProloguePayload;if(e.companionEphemeralIdentity!=null&&(typeof e.companionEphemeralIdentity=="string"?l.base64.decode(e.companionEphemeralIdentity,a.companionEphemeralIdentity=l.newBuffer(l.base64.length(e.companionEphemeralIdentity)),0):e.companionEphemeralIdentity.length>=0&&(a.companionEphemeralIdentity=e.companionEphemeralIdentity)),e.commitment!=null){if(typeof e.commitment!="object")throw TypeError(".proto.ProloguePayload.commitment: object expected");a.commitment=p.proto.CompanionCommitment.fromObject(e.commitment)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.companionEphemeralIdentity!=null&&e.hasOwnProperty("companionEphemeralIdentity")&&(A.companionEphemeralIdentity=a.bytes===String?l.base64.encode(e.companionEphemeralIdentity,0,e.companionEphemeralIdentity.length):a.bytes===Array?Array.prototype.slice.call(e.companionEphemeralIdentity):e.companionEphemeralIdentity,a.oneofs&&(A._companionEphemeralIdentity="companionEphemeralIdentity")),e.commitment!=null&&e.hasOwnProperty("commitment")&&(A.commitment=p.proto.CompanionCommitment.toObject(e.commitment,a),a.oneofs&&(A._commitment="commitment")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ProloguePayload"},r})(),n.Pushname=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.string();break}case 2:{s.pushname=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Pushname)return e;var a=new p.proto.Pushname;return e.id!=null&&(a.id=String(e.id)),e.pushname!=null&&(a.pushname=String(e.pushname)),a},r.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.pushname!=null&&e.hasOwnProperty("pushname")&&(A.pushname=e.pushname,a.oneofs&&(A._pushname="pushname")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Pushname"},r})(),n.QuarantinedMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.originalData=e.bytes();break}case 2:{s.extractedText=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.QuarantinedMessage)return e;var a=new p.proto.QuarantinedMessage;return e.originalData!=null&&(typeof e.originalData=="string"?l.base64.decode(e.originalData,a.originalData=l.newBuffer(l.base64.length(e.originalData)),0):e.originalData.length>=0&&(a.originalData=e.originalData)),e.extractedText!=null&&(a.extractedText=String(e.extractedText)),a},r.toObject=function(e,a){a||(a={});var A={};return e.originalData!=null&&e.hasOwnProperty("originalData")&&(A.originalData=a.bytes===String?l.base64.encode(e.originalData,0,e.originalData.length):a.bytes===Array?Array.prototype.slice.call(e.originalData):e.originalData,a.oneofs&&(A._originalData="originalData")),e.extractedText!=null&&e.hasOwnProperty("extractedText")&&(A.extractedText=e.extractedText,a.oneofs&&(A._extractedText="extractedText")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.QuarantinedMessage"},r})(),n.Reaction=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.text=e.string();break}case 3:{s.groupingKey=e.string();break}case 4:{s.senderTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Reaction)return e;var a=new p.proto.Reaction;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.Reaction.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}return e.text!=null&&(a.text=String(e.text)),e.groupingKey!=null&&(a.groupingKey=String(e.groupingKey)),e.senderTimestampMs!=null&&(l.Long?(a.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?a.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?a.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(a.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.unread!=null&&(a.unread=!!e.unread),a},r.toObject=function(e,a){a||(a={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=p.proto.MessageKey.toObject(e.key,a),a.oneofs&&(A._key="key")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,a.oneofs&&(A._text="text")),e.groupingKey!=null&&e.hasOwnProperty("groupingKey")&&(A.groupingKey=e.groupingKey,a.oneofs&&(A._groupingKey="groupingKey")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=a.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=a.longs===String?oe(e.senderTimestampMs):a.longs===Number?ne(e.senderTimestampMs):e.senderTimestampMs,a.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,a.oneofs&&(A._unread="unread")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reaction"},r})(),n.RecentEmojiWeight=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.emoji=e.string();break}case 2:{s.weight=e.float();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.RecentEmojiWeight)return e;var a=new p.proto.RecentEmojiWeight;return e.emoji!=null&&(a.emoji=String(e.emoji)),e.weight!=null&&(a.weight=Number(e.weight)),a},r.toObject=function(e,a){a||(a={});var A={};return e.emoji!=null&&e.hasOwnProperty("emoji")&&(A.emoji=e.emoji,a.oneofs&&(A._emoji="emoji")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=a.json&&!isFinite(e.weight)?String(e.weight):e.weight,a.oneofs&&(A._weight="weight")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.RecentEmojiWeight"},r})(),n.RecordStructure=(function(){function r(i){if(this.previousSessions=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.currentSession=p.proto.SessionStructure.decode(e,e.uint32());break}case 2:{s.previousSessions&&s.previousSessions.length||(s.previousSessions=[]),s.previousSessions.push(p.proto.SessionStructure.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.RecordStructure)return e;var a=new p.proto.RecordStructure;if(e.currentSession!=null){if(typeof e.currentSession!="object")throw TypeError(".proto.RecordStructure.currentSession: object expected");a.currentSession=p.proto.SessionStructure.fromObject(e.currentSession)}if(e.previousSessions){if(!Array.isArray(e.previousSessions))throw TypeError(".proto.RecordStructure.previousSessions: array expected");a.previousSessions=[];for(var A=0;A>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.never=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.Reportable)return e;var a=new p.proto.Reportable;return e.minVersion!=null&&(a.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(a.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(a.notReportableMinVersion=e.notReportableMinVersion>>>0),e.never!=null&&(a.never=!!e.never),a},r.toObject=function(e,a){a||(a={});var A={};return e.minVersion!=null&&e.hasOwnProperty("minVersion")&&(A.minVersion=e.minVersion,a.oneofs&&(A._minVersion="minVersion")),e.maxVersion!=null&&e.hasOwnProperty("maxVersion")&&(A.maxVersion=e.maxVersion,a.oneofs&&(A._maxVersion="maxVersion")),e.notReportableMinVersion!=null&&e.hasOwnProperty("notReportableMinVersion")&&(A.notReportableMinVersion=e.notReportableMinVersion,a.oneofs&&(A._notReportableMinVersion="notReportableMinVersion")),e.never!=null&&e.hasOwnProperty("never")&&(A.never=e.never,a.oneofs&&(A._never="never")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reportable"},r})(),n.ReportingTokenInfo=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.reportingTag=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ReportingTokenInfo)return e;var a=new p.proto.ReportingTokenInfo;return e.reportingTag!=null&&(typeof e.reportingTag=="string"?l.base64.decode(e.reportingTag,a.reportingTag=l.newBuffer(l.base64.length(e.reportingTag)),0):e.reportingTag.length>=0&&(a.reportingTag=e.reportingTag)),a},r.toObject=function(e,a){a||(a={});var A={};return e.reportingTag!=null&&e.hasOwnProperty("reportingTag")&&(A.reportingTag=a.bytes===String?l.base64.encode(e.reportingTag,0,e.reportingTag.length):a.bytes===Array?Array.prototype.slice.call(e.reportingTag):e.reportingTag,a.oneofs&&(A._reportingTag="reportingTag")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ReportingTokenInfo"},r})(),n.SenderKeyDistributionMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.chainKey=e.bytes();break}case 4:{s.signingKey=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SenderKeyDistributionMessage)return e;var a=new p.proto.SenderKeyDistributionMessage;return e.id!=null&&(a.id=e.id>>>0),e.iteration!=null&&(a.iteration=e.iteration>>>0),e.chainKey!=null&&(typeof e.chainKey=="string"?l.base64.decode(e.chainKey,a.chainKey=l.newBuffer(l.base64.length(e.chainKey)),0):e.chainKey.length>=0&&(a.chainKey=e.chainKey)),e.signingKey!=null&&(typeof e.signingKey=="string"?l.base64.decode(e.signingKey,a.signingKey=l.newBuffer(l.base64.length(e.signingKey)),0):e.signingKey.length>=0&&(a.signingKey=e.signingKey)),a},r.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,a.oneofs&&(A._iteration="iteration")),e.chainKey!=null&&e.hasOwnProperty("chainKey")&&(A.chainKey=a.bytes===String?l.base64.encode(e.chainKey,0,e.chainKey.length):a.bytes===Array?Array.prototype.slice.call(e.chainKey):e.chainKey,a.oneofs&&(A._chainKey="chainKey")),e.signingKey!=null&&e.hasOwnProperty("signingKey")&&(A.signingKey=a.bytes===String?l.base64.encode(e.signingKey,0,e.signingKey.length):a.bytes===Array?Array.prototype.slice.call(e.signingKey):e.signingKey,a.oneofs&&(A._signingKey="signingKey")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyDistributionMessage"},r})(),n.SenderKeyMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SenderKeyMessage)return e;var a=new p.proto.SenderKeyMessage;return e.id!=null&&(a.id=e.id>>>0),e.iteration!=null&&(a.iteration=e.iteration>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,a.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(a.ciphertext=e.ciphertext)),a},r.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,a.oneofs&&(A._iteration="iteration")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=a.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):a.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,a.oneofs&&(A._ciphertext="ciphertext")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyMessage"},r})(),n.SenderKeyRecordStructure=(function(){function r(o){if(this.senderKeyStates=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{t.senderKeyStates&&t.senderKeyStates.length||(t.senderKeyStates=[]),t.senderKeyStates.push(p.proto.SenderKeyStateStructure.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.SenderKeyRecordStructure)return i;var e=new p.proto.SenderKeyRecordStructure;if(i.senderKeyStates){if(!Array.isArray(i.senderKeyStates))throw TypeError(".proto.SenderKeyRecordStructure.senderKeyStates: array expected");e.senderKeyStates=[];for(var a=0;a>>3){case 1:{s.senderKeyId=e.uint32();break}case 2:{s.senderChainKey=p.proto.SenderKeyStateStructure.SenderChainKey.decode(e,e.uint32());break}case 3:{s.senderSigningKey=p.proto.SenderKeyStateStructure.SenderSigningKey.decode(e,e.uint32());break}case 4:{s.senderMessageKeys&&s.senderMessageKeys.length||(s.senderMessageKeys=[]),s.senderMessageKeys.push(p.proto.SenderKeyStateStructure.SenderMessageKey.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SenderKeyStateStructure)return e;var a=new p.proto.SenderKeyStateStructure;if(e.senderKeyId!=null&&(a.senderKeyId=e.senderKeyId>>>0),e.senderChainKey!=null){if(typeof e.senderChainKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderChainKey: object expected");a.senderChainKey=p.proto.SenderKeyStateStructure.SenderChainKey.fromObject(e.senderChainKey)}if(e.senderSigningKey!=null){if(typeof e.senderSigningKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderSigningKey: object expected");a.senderSigningKey=p.proto.SenderKeyStateStructure.SenderSigningKey.fromObject(e.senderSigningKey)}if(e.senderMessageKeys){if(!Array.isArray(e.senderMessageKeys))throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: array expected");a.senderMessageKeys=[];for(var A=0;A>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SenderKeyStateStructure.SenderChainKey)return A;var t=new p.proto.SenderKeyStateStructure.SenderChainKey;return A.iteration!=null&&(t.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,t.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(t.seed=A.seed)),t},i.toObject=function(A,t){t||(t={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,t.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=t.bytes===String?l.base64.encode(A.seed,0,A.seed.length):t.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,t.oneofs&&(s._seed="seed")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderChainKey"},i})(),r.SenderMessageKey=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SenderKeyStateStructure.SenderMessageKey)return A;var t=new p.proto.SenderKeyStateStructure.SenderMessageKey;return A.iteration!=null&&(t.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,t.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(t.seed=A.seed)),t},i.toObject=function(A,t){t||(t={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,t.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=t.bytes===String?l.base64.encode(A.seed,0,A.seed.length):t.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,t.oneofs&&(s._seed="seed")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderMessageKey"},i})(),r.SenderSigningKey=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.public=A.bytes();break}case 2:{c.private=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SenderKeyStateStructure.SenderSigningKey)return A;var t=new p.proto.SenderKeyStateStructure.SenderSigningKey;return A.public!=null&&(typeof A.public=="string"?l.base64.decode(A.public,t.public=l.newBuffer(l.base64.length(A.public)),0):A.public.length>=0&&(t.public=A.public)),A.private!=null&&(typeof A.private=="string"?l.base64.decode(A.private,t.private=l.newBuffer(l.base64.length(A.private)),0):A.private.length>=0&&(t.private=A.private)),t},i.toObject=function(A,t){t||(t={});var s={};return A.public!=null&&A.hasOwnProperty("public")&&(s.public=t.bytes===String?l.base64.encode(A.public,0,A.public.length):t.bytes===Array?Array.prototype.slice.call(A.public):A.public,t.oneofs&&(s._public="public")),A.private!=null&&A.hasOwnProperty("private")&&(s.private=t.bytes===String?l.base64.encode(A.private,0,A.private.length):t.bytes===Array?Array.prototype.slice.call(A.private):A.private,t.oneofs&&(s._private="private")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderSigningKey"},i})(),r})(),n.ServerErrorReceipt=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.stanzaId=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ServerErrorReceipt)return e;var a=new p.proto.ServerErrorReceipt;return e.stanzaId!=null&&(a.stanzaId=String(e.stanzaId)),a},r.toObject=function(e,a){a||(a={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,a.oneofs&&(A._stanzaId="stanzaId")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ServerErrorReceipt"},r})(),n.SessionStructure=(function(){function r(i){if(this.receiverChains=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.sessionVersion=e.uint32();break}case 2:{s.localIdentityPublic=e.bytes();break}case 3:{s.remoteIdentityPublic=e.bytes();break}case 4:{s.rootKey=e.bytes();break}case 5:{s.previousCounter=e.uint32();break}case 6:{s.senderChain=p.proto.SessionStructure.Chain.decode(e,e.uint32());break}case 7:{s.receiverChains&&s.receiverChains.length||(s.receiverChains=[]),s.receiverChains.push(p.proto.SessionStructure.Chain.decode(e,e.uint32()));break}case 8:{s.pendingKeyExchange=p.proto.SessionStructure.PendingKeyExchange.decode(e,e.uint32());break}case 9:{s.pendingPreKey=p.proto.SessionStructure.PendingPreKey.decode(e,e.uint32());break}case 10:{s.remoteRegistrationId=e.uint32();break}case 11:{s.localRegistrationId=e.uint32();break}case 12:{s.needsRefresh=e.bool();break}case 13:{s.aliceBaseKey=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SessionStructure)return e;var a=new p.proto.SessionStructure;if(e.sessionVersion!=null&&(a.sessionVersion=e.sessionVersion>>>0),e.localIdentityPublic!=null&&(typeof e.localIdentityPublic=="string"?l.base64.decode(e.localIdentityPublic,a.localIdentityPublic=l.newBuffer(l.base64.length(e.localIdentityPublic)),0):e.localIdentityPublic.length>=0&&(a.localIdentityPublic=e.localIdentityPublic)),e.remoteIdentityPublic!=null&&(typeof e.remoteIdentityPublic=="string"?l.base64.decode(e.remoteIdentityPublic,a.remoteIdentityPublic=l.newBuffer(l.base64.length(e.remoteIdentityPublic)),0):e.remoteIdentityPublic.length>=0&&(a.remoteIdentityPublic=e.remoteIdentityPublic)),e.rootKey!=null&&(typeof e.rootKey=="string"?l.base64.decode(e.rootKey,a.rootKey=l.newBuffer(l.base64.length(e.rootKey)),0):e.rootKey.length>=0&&(a.rootKey=e.rootKey)),e.previousCounter!=null&&(a.previousCounter=e.previousCounter>>>0),e.senderChain!=null){if(typeof e.senderChain!="object")throw TypeError(".proto.SessionStructure.senderChain: object expected");a.senderChain=p.proto.SessionStructure.Chain.fromObject(e.senderChain)}if(e.receiverChains){if(!Array.isArray(e.receiverChains))throw TypeError(".proto.SessionStructure.receiverChains: array expected");a.receiverChains=[];for(var A=0;A>>0),e.localRegistrationId!=null&&(a.localRegistrationId=e.localRegistrationId>>>0),e.needsRefresh!=null&&(a.needsRefresh=!!e.needsRefresh),e.aliceBaseKey!=null&&(typeof e.aliceBaseKey=="string"?l.base64.decode(e.aliceBaseKey,a.aliceBaseKey=l.newBuffer(l.base64.length(e.aliceBaseKey)),0):e.aliceBaseKey.length>=0&&(a.aliceBaseKey=e.aliceBaseKey)),a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.receiverChains=[]),e.sessionVersion!=null&&e.hasOwnProperty("sessionVersion")&&(A.sessionVersion=e.sessionVersion,a.oneofs&&(A._sessionVersion="sessionVersion")),e.localIdentityPublic!=null&&e.hasOwnProperty("localIdentityPublic")&&(A.localIdentityPublic=a.bytes===String?l.base64.encode(e.localIdentityPublic,0,e.localIdentityPublic.length):a.bytes===Array?Array.prototype.slice.call(e.localIdentityPublic):e.localIdentityPublic,a.oneofs&&(A._localIdentityPublic="localIdentityPublic")),e.remoteIdentityPublic!=null&&e.hasOwnProperty("remoteIdentityPublic")&&(A.remoteIdentityPublic=a.bytes===String?l.base64.encode(e.remoteIdentityPublic,0,e.remoteIdentityPublic.length):a.bytes===Array?Array.prototype.slice.call(e.remoteIdentityPublic):e.remoteIdentityPublic,a.oneofs&&(A._remoteIdentityPublic="remoteIdentityPublic")),e.rootKey!=null&&e.hasOwnProperty("rootKey")&&(A.rootKey=a.bytes===String?l.base64.encode(e.rootKey,0,e.rootKey.length):a.bytes===Array?Array.prototype.slice.call(e.rootKey):e.rootKey,a.oneofs&&(A._rootKey="rootKey")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,a.oneofs&&(A._previousCounter="previousCounter")),e.senderChain!=null&&e.hasOwnProperty("senderChain")&&(A.senderChain=p.proto.SessionStructure.Chain.toObject(e.senderChain,a),a.oneofs&&(A._senderChain="senderChain")),e.receiverChains&&e.receiverChains.length){A.receiverChains=[];for(var t=0;t>>3){case 1:{c.senderRatchetKey=A.bytes();break}case 2:{c.senderRatchetKeyPrivate=A.bytes();break}case 3:{c.chainKey=p.proto.SessionStructure.Chain.ChainKey.decode(A,A.uint32());break}case 4:{c.messageKeys&&c.messageKeys.length||(c.messageKeys=[]),c.messageKeys.push(p.proto.SessionStructure.Chain.MessageKey.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SessionStructure.Chain)return A;var t=new p.proto.SessionStructure.Chain;if(A.senderRatchetKey!=null&&(typeof A.senderRatchetKey=="string"?l.base64.decode(A.senderRatchetKey,t.senderRatchetKey=l.newBuffer(l.base64.length(A.senderRatchetKey)),0):A.senderRatchetKey.length>=0&&(t.senderRatchetKey=A.senderRatchetKey)),A.senderRatchetKeyPrivate!=null&&(typeof A.senderRatchetKeyPrivate=="string"?l.base64.decode(A.senderRatchetKeyPrivate,t.senderRatchetKeyPrivate=l.newBuffer(l.base64.length(A.senderRatchetKeyPrivate)),0):A.senderRatchetKeyPrivate.length>=0&&(t.senderRatchetKeyPrivate=A.senderRatchetKeyPrivate)),A.chainKey!=null){if(typeof A.chainKey!="object")throw TypeError(".proto.SessionStructure.Chain.chainKey: object expected");t.chainKey=p.proto.SessionStructure.Chain.ChainKey.fromObject(A.chainKey)}if(A.messageKeys){if(!Array.isArray(A.messageKeys))throw TypeError(".proto.SessionStructure.Chain.messageKeys: array expected");t.messageKeys=[];for(var s=0;s>>3){case 1:{d.index=s.uint32();break}case 2:{d.key=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.SessionStructure.Chain.ChainKey)return s;var g=new p.proto.SessionStructure.Chain.ChainKey;return s.index!=null&&(g.index=s.index>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),g},a.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.ChainKey"},a})(),i.MessageKey=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.index=s.uint32();break}case 2:{d.cipherKey=s.bytes();break}case 3:{d.macKey=s.bytes();break}case 4:{d.iv=s.bytes();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.SessionStructure.Chain.MessageKey)return s;var g=new p.proto.SessionStructure.Chain.MessageKey;return s.index!=null&&(g.index=s.index>>>0),s.cipherKey!=null&&(typeof s.cipherKey=="string"?l.base64.decode(s.cipherKey,g.cipherKey=l.newBuffer(l.base64.length(s.cipherKey)),0):s.cipherKey.length>=0&&(g.cipherKey=s.cipherKey)),s.macKey!=null&&(typeof s.macKey=="string"?l.base64.decode(s.macKey,g.macKey=l.newBuffer(l.base64.length(s.macKey)),0):s.macKey.length>=0&&(g.macKey=s.macKey)),s.iv!=null&&(typeof s.iv=="string"?l.base64.decode(s.iv,g.iv=l.newBuffer(l.base64.length(s.iv)),0):s.iv.length>=0&&(g.iv=s.iv)),g},a.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.cipherKey!=null&&s.hasOwnProperty("cipherKey")&&(c.cipherKey=g.bytes===String?l.base64.encode(s.cipherKey,0,s.cipherKey.length):g.bytes===Array?Array.prototype.slice.call(s.cipherKey):s.cipherKey,g.oneofs&&(c._cipherKey="cipherKey")),s.macKey!=null&&s.hasOwnProperty("macKey")&&(c.macKey=g.bytes===String?l.base64.encode(s.macKey,0,s.macKey.length):g.bytes===Array?Array.prototype.slice.call(s.macKey):s.macKey,g.oneofs&&(c._macKey="macKey")),s.iv!=null&&s.hasOwnProperty("iv")&&(c.iv=g.bytes===String?l.base64.encode(s.iv,0,s.iv.length):g.bytes===Array?Array.prototype.slice.call(s.iv):s.iv,g.oneofs&&(c._iv="iv")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.MessageKey"},a})(),i})(),r.PendingKeyExchange=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.sequence=A.uint32();break}case 2:{c.localBaseKey=A.bytes();break}case 3:{c.localBaseKeyPrivate=A.bytes();break}case 4:{c.localRatchetKey=A.bytes();break}case 5:{c.localRatchetKeyPrivate=A.bytes();break}case 7:{c.localIdentityKey=A.bytes();break}case 8:{c.localIdentityKeyPrivate=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SessionStructure.PendingKeyExchange)return A;var t=new p.proto.SessionStructure.PendingKeyExchange;return A.sequence!=null&&(t.sequence=A.sequence>>>0),A.localBaseKey!=null&&(typeof A.localBaseKey=="string"?l.base64.decode(A.localBaseKey,t.localBaseKey=l.newBuffer(l.base64.length(A.localBaseKey)),0):A.localBaseKey.length>=0&&(t.localBaseKey=A.localBaseKey)),A.localBaseKeyPrivate!=null&&(typeof A.localBaseKeyPrivate=="string"?l.base64.decode(A.localBaseKeyPrivate,t.localBaseKeyPrivate=l.newBuffer(l.base64.length(A.localBaseKeyPrivate)),0):A.localBaseKeyPrivate.length>=0&&(t.localBaseKeyPrivate=A.localBaseKeyPrivate)),A.localRatchetKey!=null&&(typeof A.localRatchetKey=="string"?l.base64.decode(A.localRatchetKey,t.localRatchetKey=l.newBuffer(l.base64.length(A.localRatchetKey)),0):A.localRatchetKey.length>=0&&(t.localRatchetKey=A.localRatchetKey)),A.localRatchetKeyPrivate!=null&&(typeof A.localRatchetKeyPrivate=="string"?l.base64.decode(A.localRatchetKeyPrivate,t.localRatchetKeyPrivate=l.newBuffer(l.base64.length(A.localRatchetKeyPrivate)),0):A.localRatchetKeyPrivate.length>=0&&(t.localRatchetKeyPrivate=A.localRatchetKeyPrivate)),A.localIdentityKey!=null&&(typeof A.localIdentityKey=="string"?l.base64.decode(A.localIdentityKey,t.localIdentityKey=l.newBuffer(l.base64.length(A.localIdentityKey)),0):A.localIdentityKey.length>=0&&(t.localIdentityKey=A.localIdentityKey)),A.localIdentityKeyPrivate!=null&&(typeof A.localIdentityKeyPrivate=="string"?l.base64.decode(A.localIdentityKeyPrivate,t.localIdentityKeyPrivate=l.newBuffer(l.base64.length(A.localIdentityKeyPrivate)),0):A.localIdentityKeyPrivate.length>=0&&(t.localIdentityKeyPrivate=A.localIdentityKeyPrivate)),t},i.toObject=function(A,t){t||(t={});var s={};return A.sequence!=null&&A.hasOwnProperty("sequence")&&(s.sequence=A.sequence,t.oneofs&&(s._sequence="sequence")),A.localBaseKey!=null&&A.hasOwnProperty("localBaseKey")&&(s.localBaseKey=t.bytes===String?l.base64.encode(A.localBaseKey,0,A.localBaseKey.length):t.bytes===Array?Array.prototype.slice.call(A.localBaseKey):A.localBaseKey,t.oneofs&&(s._localBaseKey="localBaseKey")),A.localBaseKeyPrivate!=null&&A.hasOwnProperty("localBaseKeyPrivate")&&(s.localBaseKeyPrivate=t.bytes===String?l.base64.encode(A.localBaseKeyPrivate,0,A.localBaseKeyPrivate.length):t.bytes===Array?Array.prototype.slice.call(A.localBaseKeyPrivate):A.localBaseKeyPrivate,t.oneofs&&(s._localBaseKeyPrivate="localBaseKeyPrivate")),A.localRatchetKey!=null&&A.hasOwnProperty("localRatchetKey")&&(s.localRatchetKey=t.bytes===String?l.base64.encode(A.localRatchetKey,0,A.localRatchetKey.length):t.bytes===Array?Array.prototype.slice.call(A.localRatchetKey):A.localRatchetKey,t.oneofs&&(s._localRatchetKey="localRatchetKey")),A.localRatchetKeyPrivate!=null&&A.hasOwnProperty("localRatchetKeyPrivate")&&(s.localRatchetKeyPrivate=t.bytes===String?l.base64.encode(A.localRatchetKeyPrivate,0,A.localRatchetKeyPrivate.length):t.bytes===Array?Array.prototype.slice.call(A.localRatchetKeyPrivate):A.localRatchetKeyPrivate,t.oneofs&&(s._localRatchetKeyPrivate="localRatchetKeyPrivate")),A.localIdentityKey!=null&&A.hasOwnProperty("localIdentityKey")&&(s.localIdentityKey=t.bytes===String?l.base64.encode(A.localIdentityKey,0,A.localIdentityKey.length):t.bytes===Array?Array.prototype.slice.call(A.localIdentityKey):A.localIdentityKey,t.oneofs&&(s._localIdentityKey="localIdentityKey")),A.localIdentityKeyPrivate!=null&&A.hasOwnProperty("localIdentityKeyPrivate")&&(s.localIdentityKeyPrivate=t.bytes===String?l.base64.encode(A.localIdentityKeyPrivate,0,A.localIdentityKeyPrivate.length):t.bytes===Array?Array.prototype.slice.call(A.localIdentityKeyPrivate):A.localIdentityKeyPrivate,t.oneofs&&(s._localIdentityKeyPrivate="localIdentityKeyPrivate")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingKeyExchange"},i})(),r.PendingPreKey=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.preKeyId=A.uint32();break}case 3:{c.signedPreKeyId=A.int32();break}case 2:{c.baseKey=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SessionStructure.PendingPreKey)return A;var t=new p.proto.SessionStructure.PendingPreKey;return A.preKeyId!=null&&(t.preKeyId=A.preKeyId>>>0),A.signedPreKeyId!=null&&(t.signedPreKeyId=A.signedPreKeyId|0),A.baseKey!=null&&(typeof A.baseKey=="string"?l.base64.decode(A.baseKey,t.baseKey=l.newBuffer(l.base64.length(A.baseKey)),0):A.baseKey.length>=0&&(t.baseKey=A.baseKey)),t},i.toObject=function(A,t){t||(t={});var s={};return A.preKeyId!=null&&A.hasOwnProperty("preKeyId")&&(s.preKeyId=A.preKeyId,t.oneofs&&(s._preKeyId="preKeyId")),A.baseKey!=null&&A.hasOwnProperty("baseKey")&&(s.baseKey=t.bytes===String?l.base64.encode(A.baseKey,0,A.baseKey.length):t.bytes===Array?Array.prototype.slice.call(A.baseKey):A.baseKey,t.oneofs&&(s._baseKey="baseKey")),A.signedPreKeyId!=null&&A.hasOwnProperty("signedPreKeyId")&&(s.signedPreKeyId=A.signedPreKeyId,t.oneofs&&(s._signedPreKeyId="signedPreKeyId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingPreKey"},i})(),r})(),n.SessionTransparencyMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.disclaimerText=e.string();break}case 2:{s.hcaId=e.string();break}case 3:{s.sessionTransparencyType=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SessionTransparencyMetadata)return e;var a=new p.proto.SessionTransparencyMetadata;switch(e.disclaimerText!=null&&(a.disclaimerText=String(e.disclaimerText)),e.hcaId!=null&&(a.hcaId=String(e.hcaId)),e.sessionTransparencyType){default:if(typeof e.sessionTransparencyType=="number"){a.sessionTransparencyType=e.sessionTransparencyType;break}break;case"UNKNOWN_TYPE":case 0:a.sessionTransparencyType=0;break;case"NY_AI_SAFETY_DISCLAIMER":case 1:a.sessionTransparencyType=1;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.disclaimerText!=null&&e.hasOwnProperty("disclaimerText")&&(A.disclaimerText=e.disclaimerText,a.oneofs&&(A._disclaimerText="disclaimerText")),e.hcaId!=null&&e.hasOwnProperty("hcaId")&&(A.hcaId=e.hcaId,a.oneofs&&(A._hcaId="hcaId")),e.sessionTransparencyType!=null&&e.hasOwnProperty("sessionTransparencyType")&&(A.sessionTransparencyType=a.enums===String?p.proto.SessionTransparencyType[e.sessionTransparencyType]===void 0?e.sessionTransparencyType:p.proto.SessionTransparencyType[e.sessionTransparencyType]:e.sessionTransparencyType,a.oneofs&&(A._sessionTransparencyType="sessionTransparencyType")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SessionTransparencyMetadata"},r})(),n.SessionTransparencyType=(function(){let r={},o=Object.create(r);return o[r[0]="UNKNOWN_TYPE"]=0,o[r[1]="NY_AI_SAFETY_DISCLAIMER"]=1,o})(),n.SignalMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.ratchetKey=e.bytes();break}case 2:{s.counter=e.uint32();break}case 3:{s.previousCounter=e.uint32();break}case 4:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SignalMessage)return e;var a=new p.proto.SignalMessage;return e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,a.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(a.ratchetKey=e.ratchetKey)),e.counter!=null&&(a.counter=e.counter>>>0),e.previousCounter!=null&&(a.previousCounter=e.previousCounter>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,a.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(a.ciphertext=e.ciphertext)),a},r.toObject=function(e,a){a||(a={});var A={};return e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=a.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):a.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,a.oneofs&&(A._ratchetKey="ratchetKey")),e.counter!=null&&e.hasOwnProperty("counter")&&(A.counter=e.counter,a.oneofs&&(A._counter="counter")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,a.oneofs&&(A._previousCounter="previousCounter")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=a.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):a.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,a.oneofs&&(A._ciphertext="ciphertext")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignalMessage"},r})(),n.SignedPreKeyRecordStructure=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}case 4:{s.signature=e.bytes();break}case 5:{s.timestamp=e.fixed64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SignedPreKeyRecordStructure)return e;var a=new p.proto.SignedPreKeyRecordStructure;return e.id!=null&&(a.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,a.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(a.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,a.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(a.privateKey=e.privateKey)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),a},r.toObject=function(e,a){a||(a={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,a.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=a.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):a.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,a.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=a.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):a.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,a.oneofs&&(A._privateKey="privateKey")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?oe(e.timestamp):a.longs===Number?ne(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignedPreKeyRecordStructure"},r})(),n.StatusAttribution=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.type=e.int32();break}case 2:{s.actionUrl=e.string();break}case 3:{s.statusReshare=p.proto.StatusAttribution.StatusReshare.decode(e,e.uint32());break}case 4:{s.externalShare=p.proto.StatusAttribution.ExternalShare.decode(e,e.uint32());break}case 5:{s.music=p.proto.StatusAttribution.Music.decode(e,e.uint32());break}case 6:{s.groupStatus=p.proto.StatusAttribution.GroupStatus.decode(e,e.uint32());break}case 7:{s.rlAttribution=p.proto.StatusAttribution.RLAttribution.decode(e,e.uint32());break}case 8:{s.aiCreatedAttribution=p.proto.StatusAttribution.AiCreatedAttribution.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.StatusAttribution)return e;var a=new p.proto.StatusAttribution;switch(e.type){default:if(typeof e.type=="number"){a.type=e.type;break}break;case"UNKNOWN":case 0:a.type=0;break;case"RESHARE":case 1:a.type=1;break;case"EXTERNAL_SHARE":case 2:a.type=2;break;case"MUSIC":case 3:a.type=3;break;case"STATUS_MENTION":case 4:a.type=4;break;case"GROUP_STATUS":case 5:a.type=5;break;case"RL_ATTRIBUTION":case 6:a.type=6;break;case"AI_CREATED":case 7:a.type=7;break;case"LAYOUTS":case 8:a.type=8;break}if(e.actionUrl!=null&&(a.actionUrl=String(e.actionUrl)),e.statusReshare!=null){if(typeof e.statusReshare!="object")throw TypeError(".proto.StatusAttribution.statusReshare: object expected");a.statusReshare=p.proto.StatusAttribution.StatusReshare.fromObject(e.statusReshare)}if(e.externalShare!=null){if(typeof e.externalShare!="object")throw TypeError(".proto.StatusAttribution.externalShare: object expected");a.externalShare=p.proto.StatusAttribution.ExternalShare.fromObject(e.externalShare)}if(e.music!=null){if(typeof e.music!="object")throw TypeError(".proto.StatusAttribution.music: object expected");a.music=p.proto.StatusAttribution.Music.fromObject(e.music)}if(e.groupStatus!=null){if(typeof e.groupStatus!="object")throw TypeError(".proto.StatusAttribution.groupStatus: object expected");a.groupStatus=p.proto.StatusAttribution.GroupStatus.fromObject(e.groupStatus)}if(e.rlAttribution!=null){if(typeof e.rlAttribution!="object")throw TypeError(".proto.StatusAttribution.rlAttribution: object expected");a.rlAttribution=p.proto.StatusAttribution.RLAttribution.fromObject(e.rlAttribution)}if(e.aiCreatedAttribution!=null){if(typeof e.aiCreatedAttribution!="object")throw TypeError(".proto.StatusAttribution.aiCreatedAttribution: object expected");a.aiCreatedAttribution=p.proto.StatusAttribution.AiCreatedAttribution.fromObject(e.aiCreatedAttribution)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=a.enums===String?p.proto.StatusAttribution.Type[e.type]===void 0?e.type:p.proto.StatusAttribution.Type[e.type]:e.type,a.oneofs&&(A._type="type")),e.actionUrl!=null&&e.hasOwnProperty("actionUrl")&&(A.actionUrl=e.actionUrl,a.oneofs&&(A._actionUrl="actionUrl")),e.statusReshare!=null&&e.hasOwnProperty("statusReshare")&&(A.statusReshare=p.proto.StatusAttribution.StatusReshare.toObject(e.statusReshare,a),a.oneofs&&(A.attributionData="statusReshare")),e.externalShare!=null&&e.hasOwnProperty("externalShare")&&(A.externalShare=p.proto.StatusAttribution.ExternalShare.toObject(e.externalShare,a),a.oneofs&&(A.attributionData="externalShare")),e.music!=null&&e.hasOwnProperty("music")&&(A.music=p.proto.StatusAttribution.Music.toObject(e.music,a),a.oneofs&&(A.attributionData="music")),e.groupStatus!=null&&e.hasOwnProperty("groupStatus")&&(A.groupStatus=p.proto.StatusAttribution.GroupStatus.toObject(e.groupStatus,a),a.oneofs&&(A.attributionData="groupStatus")),e.rlAttribution!=null&&e.hasOwnProperty("rlAttribution")&&(A.rlAttribution=p.proto.StatusAttribution.RLAttribution.toObject(e.rlAttribution,a),a.oneofs&&(A.attributionData="rlAttribution")),e.aiCreatedAttribution!=null&&e.hasOwnProperty("aiCreatedAttribution")&&(A.aiCreatedAttribution=p.proto.StatusAttribution.AiCreatedAttribution.toObject(e.aiCreatedAttribution,a),a.oneofs&&(A.attributionData="aiCreatedAttribution")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusAttribution"},r.AiCreatedAttribution=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.AiCreatedAttribution)return A;var t=new p.proto.StatusAttribution.AiCreatedAttribution;switch(A.source){default:if(typeof A.source=="number"){t.source=A.source;break}break;case"UNKNOWN":case 0:t.source=0;break;case"STATUS_MIMICRY":case 1:t.source=1;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=t.enums===String?p.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]:A.source,t.oneofs&&(s._source="source")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.AiCreatedAttribution"},i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="STATUS_MIMICRY"]=1,A})(),i})(),r.ExternalShare=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.actionUrl=A.string();break}case 2:{c.source=A.int32();break}case 3:{c.duration=A.int32();break}case 4:{c.actionFallbackUrl=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.ExternalShare)return A;var t=new p.proto.StatusAttribution.ExternalShare;switch(A.actionUrl!=null&&(t.actionUrl=String(A.actionUrl)),A.source){default:if(typeof A.source=="number"){t.source=A.source;break}break;case"UNKNOWN":case 0:t.source=0;break;case"INSTAGRAM":case 1:t.source=1;break;case"FACEBOOK":case 2:t.source=2;break;case"MESSENGER":case 3:t.source=3;break;case"SPOTIFY":case 4:t.source=4;break;case"YOUTUBE":case 5:t.source=5;break;case"PINTEREST":case 6:t.source=6;break;case"THREADS":case 7:t.source=7;break;case"APPLE_MUSIC":case 8:t.source=8;break;case"SHARECHAT":case 9:t.source=9;break;case"GOOGLE_PHOTOS":case 10:t.source=10;break}return A.duration!=null&&(t.duration=A.duration|0),A.actionFallbackUrl!=null&&(t.actionFallbackUrl=String(A.actionFallbackUrl)),t},i.toObject=function(A,t){t||(t={});var s={};return A.actionUrl!=null&&A.hasOwnProperty("actionUrl")&&(s.actionUrl=A.actionUrl,t.oneofs&&(s._actionUrl="actionUrl")),A.source!=null&&A.hasOwnProperty("source")&&(s.source=t.enums===String?p.proto.StatusAttribution.ExternalShare.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.ExternalShare.Source[A.source]:A.source,t.oneofs&&(s._source="source")),A.duration!=null&&A.hasOwnProperty("duration")&&(s.duration=A.duration,t.oneofs&&(s._duration="duration")),A.actionFallbackUrl!=null&&A.hasOwnProperty("actionFallbackUrl")&&(s.actionFallbackUrl=A.actionFallbackUrl,t.oneofs&&(s._actionFallbackUrl="actionFallbackUrl")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.ExternalShare"},i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="INSTAGRAM"]=1,A[a[2]="FACEBOOK"]=2,A[a[3]="MESSENGER"]=3,A[a[4]="SPOTIFY"]=4,A[a[5]="YOUTUBE"]=5,A[a[6]="PINTEREST"]=6,A[a[7]="THREADS"]=7,A[a[8]="APPLE_MUSIC"]=8,A[a[9]="SHARECHAT"]=9,A[a[10]="GOOGLE_PHOTOS"]=10,A})(),i})(),r.GroupStatus=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.authorJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.GroupStatus)return A;var t=new p.proto.StatusAttribution.GroupStatus;return A.authorJid!=null&&(t.authorJid=String(A.authorJid)),t},i.toObject=function(A,t){t||(t={});var s={};return A.authorJid!=null&&A.hasOwnProperty("authorJid")&&(s.authorJid=A.authorJid,t.oneofs&&(s._authorJid="authorJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.GroupStatus"},i})(),r.Music=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.authorName=A.string();break}case 2:{c.songId=A.string();break}case 3:{c.title=A.string();break}case 4:{c.author=A.string();break}case 5:{c.artistAttribution=A.string();break}case 6:{c.isExplicit=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.Music)return A;var t=new p.proto.StatusAttribution.Music;return A.authorName!=null&&(t.authorName=String(A.authorName)),A.songId!=null&&(t.songId=String(A.songId)),A.title!=null&&(t.title=String(A.title)),A.author!=null&&(t.author=String(A.author)),A.artistAttribution!=null&&(t.artistAttribution=String(A.artistAttribution)),A.isExplicit!=null&&(t.isExplicit=!!A.isExplicit),t},i.toObject=function(A,t){t||(t={});var s={};return A.authorName!=null&&A.hasOwnProperty("authorName")&&(s.authorName=A.authorName,t.oneofs&&(s._authorName="authorName")),A.songId!=null&&A.hasOwnProperty("songId")&&(s.songId=A.songId,t.oneofs&&(s._songId="songId")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,t.oneofs&&(s._title="title")),A.author!=null&&A.hasOwnProperty("author")&&(s.author=A.author,t.oneofs&&(s._author="author")),A.artistAttribution!=null&&A.hasOwnProperty("artistAttribution")&&(s.artistAttribution=A.artistAttribution,t.oneofs&&(s._artistAttribution="artistAttribution")),A.isExplicit!=null&&A.hasOwnProperty("isExplicit")&&(s.isExplicit=A.isExplicit,t.oneofs&&(s._isExplicit="isExplicit")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.Music"},i})(),r.RLAttribution=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.RLAttribution)return A;var t=new p.proto.StatusAttribution.RLAttribution;switch(A.source){default:if(typeof A.source=="number"){t.source=A.source;break}break;case"UNKNOWN":case 0:t.source=0;break;case"RAY_BAN_META_GLASSES":case 1:t.source=1;break;case"OAKLEY_META_GLASSES":case 2:t.source=2;break;case"HYPERNOVA_GLASSES":case 3:t.source=3;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=t.enums===String?p.proto.StatusAttribution.RLAttribution.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.RLAttribution.Source[A.source]:A.source,t.oneofs&&(s._source="source")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.RLAttribution"},i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="RAY_BAN_META_GLASSES"]=1,A[a[2]="OAKLEY_META_GLASSES"]=2,A[a[3]="HYPERNOVA_GLASSES"]=3,A})(),i})(),r.StatusReshare=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.source=A.int32();break}case 2:{c.metadata=p.proto.StatusAttribution.StatusReshare.Metadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.StatusAttribution.StatusReshare)return A;var t=new p.proto.StatusAttribution.StatusReshare;switch(A.source){default:if(typeof A.source=="number"){t.source=A.source;break}break;case"UNKNOWN":case 0:t.source=0;break;case"INTERNAL_RESHARE":case 1:t.source=1;break;case"MENTION_RESHARE":case 2:t.source=2;break;case"CHANNEL_RESHARE":case 3:t.source=3;break;case"FORWARD":case 4:t.source=4;break}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.StatusAttribution.StatusReshare.metadata: object expected");t.metadata=p.proto.StatusAttribution.StatusReshare.Metadata.fromObject(A.metadata)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=t.enums===String?p.proto.StatusAttribution.StatusReshare.Source[A.source]===void 0?A.source:p.proto.StatusAttribution.StatusReshare.Source[A.source]:A.source,t.oneofs&&(s._source="source")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=p.proto.StatusAttribution.StatusReshare.Metadata.toObject(A.metadata,t),t.oneofs&&(s._metadata="metadata")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.StatusReshare"},i.Metadata=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.duration=s.int32();break}case 2:{d.channelJid=s.string();break}case 3:{d.channelMessageId=s.int32();break}case 4:{d.hasMultipleReshares=s.bool();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.StatusAttribution.StatusReshare.Metadata)return s;var g=new p.proto.StatusAttribution.StatusReshare.Metadata;return s.duration!=null&&(g.duration=s.duration|0),s.channelJid!=null&&(g.channelJid=String(s.channelJid)),s.channelMessageId!=null&&(g.channelMessageId=s.channelMessageId|0),s.hasMultipleReshares!=null&&(g.hasMultipleReshares=!!s.hasMultipleReshares),g},a.toObject=function(s,g){g||(g={});var c={};return s.duration!=null&&s.hasOwnProperty("duration")&&(c.duration=s.duration,g.oneofs&&(c._duration="duration")),s.channelJid!=null&&s.hasOwnProperty("channelJid")&&(c.channelJid=s.channelJid,g.oneofs&&(c._channelJid="channelJid")),s.channelMessageId!=null&&s.hasOwnProperty("channelMessageId")&&(c.channelMessageId=s.channelMessageId,g.oneofs&&(c._channelMessageId="channelMessageId")),s.hasMultipleReshares!=null&&s.hasOwnProperty("hasMultipleReshares")&&(c.hasMultipleReshares=s.hasMultipleReshares,g.oneofs&&(c._hasMultipleReshares="hasMultipleReshares")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.StatusAttribution.StatusReshare.Metadata"},a})(),i.Source=(function(){let a={},A=Object.create(a);return A[a[0]="UNKNOWN"]=0,A[a[1]="INTERNAL_RESHARE"]=1,A[a[2]="MENTION_RESHARE"]=2,A[a[3]="CHANNEL_RESHARE"]=3,A[a[4]="FORWARD"]=4,A})(),i})(),r.Type=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="RESHARE"]=1,e[i[2]="EXTERNAL_SHARE"]=2,e[i[3]="MUSIC"]=3,e[i[4]="STATUS_MENTION"]=4,e[i[5]="GROUP_STATUS"]=5,e[i[6]="RL_ATTRIBUTION"]=6,e[i[7]="AI_CREATED"]=7,e[i[8]="LAYOUTS"]=8,e})(),r})(),n.StatusMentionMessage=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.quotedStatus=p.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.StatusMentionMessage)return e;var a=new p.proto.StatusMentionMessage;if(e.quotedStatus!=null){if(typeof e.quotedStatus!="object")throw TypeError(".proto.StatusMentionMessage.quotedStatus: object expected");a.quotedStatus=p.proto.Message.fromObject(e.quotedStatus)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.quotedStatus!=null&&e.hasOwnProperty("quotedStatus")&&(A.quotedStatus=p.proto.Message.toObject(e.quotedStatus,a),a.oneofs&&(A._quotedStatus="quotedStatus")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusMentionMessage"},r})(),n.StatusPSA=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 44:{s.campaignId=e.uint64();break}case 45:{s.campaignExpirationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.StatusPSA)return e;var a=new p.proto.StatusPSA;return e.campaignId!=null&&(l.Long?(a.campaignId=l.Long.fromValue(e.campaignId)).unsigned=!0:typeof e.campaignId=="string"?a.campaignId=parseInt(e.campaignId,10):typeof e.campaignId=="number"?a.campaignId=e.campaignId:typeof e.campaignId=="object"&&(a.campaignId=new l.LongBits(e.campaignId.low>>>0,e.campaignId.high>>>0).toNumber(!0))),e.campaignExpirationTimestamp!=null&&(l.Long?(a.campaignExpirationTimestamp=l.Long.fromValue(e.campaignExpirationTimestamp)).unsigned=!0:typeof e.campaignExpirationTimestamp=="string"?a.campaignExpirationTimestamp=parseInt(e.campaignExpirationTimestamp,10):typeof e.campaignExpirationTimestamp=="number"?a.campaignExpirationTimestamp=e.campaignExpirationTimestamp:typeof e.campaignExpirationTimestamp=="object"&&(a.campaignExpirationTimestamp=new l.LongBits(e.campaignExpirationTimestamp.low>>>0,e.campaignExpirationTimestamp.high>>>0).toNumber(!0))),a},r.toObject=function(e,a){a||(a={});var A={};if(a.defaults)if(l.Long){var t=new l.Long(0,0,!0);A.campaignId=a.longs===String?t.toString():a.longs===Number?t.toNumber():t}else A.campaignId=a.longs===String?"0":0;return e.campaignId!=null&&e.hasOwnProperty("campaignId")&&(typeof e.campaignId=="number"?A.campaignId=a.longs===String?String(e.campaignId):e.campaignId:A.campaignId=a.longs===String?oe(e.campaignId,!0):a.longs===Number?ne(e.campaignId,!0):e.campaignId),e.campaignExpirationTimestamp!=null&&e.hasOwnProperty("campaignExpirationTimestamp")&&(typeof e.campaignExpirationTimestamp=="number"?A.campaignExpirationTimestamp=a.longs===String?String(e.campaignExpirationTimestamp):e.campaignExpirationTimestamp:A.campaignExpirationTimestamp=a.longs===String?oe(e.campaignExpirationTimestamp,!0):a.longs===Number?ne(e.campaignExpirationTimestamp,!0):e.campaignExpirationTimestamp,a.oneofs&&(A._campaignExpirationTimestamp="campaignExpirationTimestamp")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusPSA"},r})(),n.StickerMetadata=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.url=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.fileEncSha256=e.bytes();break}case 4:{s.mediaKey=e.bytes();break}case 5:{s.mimetype=e.string();break}case 6:{s.height=e.uint32();break}case 7:{s.width=e.uint32();break}case 8:{s.directPath=e.string();break}case 9:{s.fileLength=e.uint64();break}case 10:{s.weight=e.float();break}case 11:{s.lastStickerSentTs=e.int64();break}case 12:{s.isLottie=e.bool();break}case 13:{s.imageHash=e.string();break}case 14:{s.isAvatarSticker=e.bool();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.StickerMetadata)return e;var a=new p.proto.StickerMetadata;return e.url!=null&&(a.url=String(e.url)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,a.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(a.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,a.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(a.fileEncSha256=e.fileEncSha256)),e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,a.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(a.mediaKey=e.mediaKey)),e.mimetype!=null&&(a.mimetype=String(e.mimetype)),e.height!=null&&(a.height=e.height>>>0),e.width!=null&&(a.width=e.width>>>0),e.directPath!=null&&(a.directPath=String(e.directPath)),e.fileLength!=null&&(l.Long?(a.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?a.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?a.fileLength=e.fileLength:typeof e.fileLength=="object"&&(a.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.weight!=null&&(a.weight=Number(e.weight)),e.lastStickerSentTs!=null&&(l.Long?(a.lastStickerSentTs=l.Long.fromValue(e.lastStickerSentTs)).unsigned=!1:typeof e.lastStickerSentTs=="string"?a.lastStickerSentTs=parseInt(e.lastStickerSentTs,10):typeof e.lastStickerSentTs=="number"?a.lastStickerSentTs=e.lastStickerSentTs:typeof e.lastStickerSentTs=="object"&&(a.lastStickerSentTs=new l.LongBits(e.lastStickerSentTs.low>>>0,e.lastStickerSentTs.high>>>0).toNumber())),e.isLottie!=null&&(a.isLottie=!!e.isLottie),e.imageHash!=null&&(a.imageHash=String(e.imageHash)),e.isAvatarSticker!=null&&(a.isAvatarSticker=!!e.isAvatarSticker),a},r.toObject=function(e,a){a||(a={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,a.oneofs&&(A._url="url")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=a.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,a.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=a.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):a.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,a.oneofs&&(A._fileEncSha256="fileEncSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=a.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):a.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,a.oneofs&&(A._mediaKey="mediaKey")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,a.oneofs&&(A._mimetype="mimetype")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,a.oneofs&&(A._height="height")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,a.oneofs&&(A._width="width")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,a.oneofs&&(A._directPath="directPath")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=a.longs===String?String(e.fileLength):e.fileLength:A.fileLength=a.longs===String?oe(e.fileLength,!0):a.longs===Number?ne(e.fileLength,!0):e.fileLength,a.oneofs&&(A._fileLength="fileLength")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=a.json&&!isFinite(e.weight)?String(e.weight):e.weight,a.oneofs&&(A._weight="weight")),e.lastStickerSentTs!=null&&e.hasOwnProperty("lastStickerSentTs")&&(typeof e.lastStickerSentTs=="number"?A.lastStickerSentTs=a.longs===String?String(e.lastStickerSentTs):e.lastStickerSentTs:A.lastStickerSentTs=a.longs===String?oe(e.lastStickerSentTs):a.longs===Number?ne(e.lastStickerSentTs):e.lastStickerSentTs,a.oneofs&&(A._lastStickerSentTs="lastStickerSentTs")),e.isLottie!=null&&e.hasOwnProperty("isLottie")&&(A.isLottie=e.isLottie,a.oneofs&&(A._isLottie="isLottie")),e.imageHash!=null&&e.hasOwnProperty("imageHash")&&(A.imageHash=e.imageHash,a.oneofs&&(A._imageHash="imageHash")),e.isAvatarSticker!=null&&e.hasOwnProperty("isAvatarSticker")&&(A.isAvatarSticker=e.isAvatarSticker,a.oneofs&&(A._isAvatarSticker="isAvatarSticker")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StickerMetadata"},r})(),n.SyncActionData=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.index=e.bytes();break}case 2:{s.value=p.proto.SyncActionValue.decode(e,e.uint32());break}case 3:{s.padding=e.bytes();break}case 4:{s.version=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SyncActionData)return e;var a=new p.proto.SyncActionData;if(e.index!=null&&(typeof e.index=="string"?l.base64.decode(e.index,a.index=l.newBuffer(l.base64.length(e.index)),0):e.index.length>=0&&(a.index=e.index)),e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncActionData.value: object expected");a.value=p.proto.SyncActionValue.fromObject(e.value)}return e.padding!=null&&(typeof e.padding=="string"?l.base64.decode(e.padding,a.padding=l.newBuffer(l.base64.length(e.padding)),0):e.padding.length>=0&&(a.padding=e.padding)),e.version!=null&&(a.version=e.version|0),a},r.toObject=function(e,a){a||(a={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=a.bytes===String?l.base64.encode(e.index,0,e.index.length):a.bytes===Array?Array.prototype.slice.call(e.index):e.index,a.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=p.proto.SyncActionValue.toObject(e.value,a),a.oneofs&&(A._value="value")),e.padding!=null&&e.hasOwnProperty("padding")&&(A.padding=a.bytes===String?l.base64.encode(e.padding,0,e.padding.length):a.bytes===Array?Array.prototype.slice.call(e.padding):e.padding,a.oneofs&&(A._padding="padding")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,a.oneofs&&(A._version="version")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionData"},r})(),n.SyncActionValue=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.timestamp=e.int64();break}case 2:{s.starAction=p.proto.SyncActionValue.StarAction.decode(e,e.uint32());break}case 3:{s.contactAction=p.proto.SyncActionValue.ContactAction.decode(e,e.uint32());break}case 4:{s.muteAction=p.proto.SyncActionValue.MuteAction.decode(e,e.uint32());break}case 5:{s.pinAction=p.proto.SyncActionValue.PinAction.decode(e,e.uint32());break}case 7:{s.pushNameSetting=p.proto.SyncActionValue.PushNameSetting.decode(e,e.uint32());break}case 8:{s.quickReplyAction=p.proto.SyncActionValue.QuickReplyAction.decode(e,e.uint32());break}case 11:{s.recentEmojiWeightsAction=p.proto.SyncActionValue.RecentEmojiWeightsAction.decode(e,e.uint32());break}case 14:{s.labelEditAction=p.proto.SyncActionValue.LabelEditAction.decode(e,e.uint32());break}case 15:{s.labelAssociationAction=p.proto.SyncActionValue.LabelAssociationAction.decode(e,e.uint32());break}case 16:{s.localeSetting=p.proto.SyncActionValue.LocaleSetting.decode(e,e.uint32());break}case 17:{s.archiveChatAction=p.proto.SyncActionValue.ArchiveChatAction.decode(e,e.uint32());break}case 18:{s.deleteMessageForMeAction=p.proto.SyncActionValue.DeleteMessageForMeAction.decode(e,e.uint32());break}case 19:{s.keyExpiration=p.proto.SyncActionValue.KeyExpiration.decode(e,e.uint32());break}case 20:{s.markChatAsReadAction=p.proto.SyncActionValue.MarkChatAsReadAction.decode(e,e.uint32());break}case 21:{s.clearChatAction=p.proto.SyncActionValue.ClearChatAction.decode(e,e.uint32());break}case 22:{s.deleteChatAction=p.proto.SyncActionValue.DeleteChatAction.decode(e,e.uint32());break}case 23:{s.unarchiveChatsSetting=p.proto.SyncActionValue.UnarchiveChatsSetting.decode(e,e.uint32());break}case 24:{s.primaryFeature=p.proto.SyncActionValue.PrimaryFeature.decode(e,e.uint32());break}case 26:{s.androidUnsupportedActions=p.proto.SyncActionValue.AndroidUnsupportedActions.decode(e,e.uint32());break}case 27:{s.agentAction=p.proto.SyncActionValue.AgentAction.decode(e,e.uint32());break}case 28:{s.subscriptionAction=p.proto.SyncActionValue.SubscriptionAction.decode(e,e.uint32());break}case 29:{s.userStatusMuteAction=p.proto.SyncActionValue.UserStatusMuteAction.decode(e,e.uint32());break}case 30:{s.timeFormatAction=p.proto.SyncActionValue.TimeFormatAction.decode(e,e.uint32());break}case 31:{s.nuxAction=p.proto.SyncActionValue.NuxAction.decode(e,e.uint32());break}case 32:{s.primaryVersionAction=p.proto.SyncActionValue.PrimaryVersionAction.decode(e,e.uint32());break}case 33:{s.stickerAction=p.proto.SyncActionValue.StickerAction.decode(e,e.uint32());break}case 34:{s.removeRecentStickerAction=p.proto.SyncActionValue.RemoveRecentStickerAction.decode(e,e.uint32());break}case 35:{s.chatAssignment=p.proto.SyncActionValue.ChatAssignmentAction.decode(e,e.uint32());break}case 36:{s.chatAssignmentOpenedStatus=p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.decode(e,e.uint32());break}case 37:{s.pnForLidChatAction=p.proto.SyncActionValue.PnForLidChatAction.decode(e,e.uint32());break}case 38:{s.marketingMessageAction=p.proto.SyncActionValue.MarketingMessageAction.decode(e,e.uint32());break}case 39:{s.marketingMessageBroadcastAction=p.proto.SyncActionValue.MarketingMessageBroadcastAction.decode(e,e.uint32());break}case 40:{s.externalWebBetaAction=p.proto.SyncActionValue.ExternalWebBetaAction.decode(e,e.uint32());break}case 41:{s.privacySettingRelayAllCalls=p.proto.SyncActionValue.PrivacySettingRelayAllCalls.decode(e,e.uint32());break}case 42:{s.callLogAction=p.proto.SyncActionValue.CallLogAction.decode(e,e.uint32());break}case 43:{s.ugcBot=p.proto.SyncActionValue.UGCBot.decode(e,e.uint32());break}case 44:{s.statusPrivacy=p.proto.SyncActionValue.StatusPrivacyAction.decode(e,e.uint32());break}case 45:{s.botWelcomeRequestAction=p.proto.SyncActionValue.BotWelcomeRequestAction.decode(e,e.uint32());break}case 46:{s.deleteIndividualCallLog=p.proto.SyncActionValue.DeleteIndividualCallLogAction.decode(e,e.uint32());break}case 47:{s.labelReorderingAction=p.proto.SyncActionValue.LabelReorderingAction.decode(e,e.uint32());break}case 48:{s.paymentInfoAction=p.proto.SyncActionValue.PaymentInfoAction.decode(e,e.uint32());break}case 49:{s.customPaymentMethodsAction=p.proto.SyncActionValue.CustomPaymentMethodsAction.decode(e,e.uint32());break}case 50:{s.lockChatAction=p.proto.SyncActionValue.LockChatAction.decode(e,e.uint32());break}case 51:{s.chatLockSettings=p.proto.ChatLockSettings.decode(e,e.uint32());break}case 52:{s.wamoUserIdentifierAction=p.proto.SyncActionValue.WamoUserIdentifierAction.decode(e,e.uint32());break}case 53:{s.privacySettingDisableLinkPreviewsAction=p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.decode(e,e.uint32());break}case 54:{s.deviceCapabilities=p.proto.DeviceCapabilities.decode(e,e.uint32());break}case 55:{s.noteEditAction=p.proto.SyncActionValue.NoteEditAction.decode(e,e.uint32());break}case 56:{s.favoritesAction=p.proto.SyncActionValue.FavoritesAction.decode(e,e.uint32());break}case 57:{s.merchantPaymentPartnerAction=p.proto.SyncActionValue.MerchantPaymentPartnerAction.decode(e,e.uint32());break}case 58:{s.waffleAccountLinkStateAction=p.proto.SyncActionValue.WaffleAccountLinkStateAction.decode(e,e.uint32());break}case 59:{s.usernameChatStartMode=p.proto.SyncActionValue.UsernameChatStartModeAction.decode(e,e.uint32());break}case 60:{s.notificationActivitySettingAction=p.proto.SyncActionValue.NotificationActivitySettingAction.decode(e,e.uint32());break}case 61:{s.lidContactAction=p.proto.SyncActionValue.LidContactAction.decode(e,e.uint32());break}case 62:{s.ctwaPerCustomerDataSharingAction=p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.decode(e,e.uint32());break}case 63:{s.paymentTosAction=p.proto.SyncActionValue.PaymentTosAction.decode(e,e.uint32());break}case 64:{s.privacySettingChannelsPersonalisedRecommendationAction=p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.decode(e,e.uint32());break}case 65:{s.businessBroadcastAssociationAction=p.proto.SyncActionValue.BusinessBroadcastAssociationAction.decode(e,e.uint32());break}case 66:{s.detectedOutcomesStatusAction=p.proto.SyncActionValue.DetectedOutcomesStatusAction.decode(e,e.uint32());break}case 68:{s.maibaAiFeaturesControlAction=p.proto.SyncActionValue.MaibaAIFeaturesControlAction.decode(e,e.uint32());break}case 69:{s.businessBroadcastListAction=p.proto.SyncActionValue.BusinessBroadcastListAction.decode(e,e.uint32());break}case 70:{s.musicUserIdAction=p.proto.SyncActionValue.MusicUserIdAction.decode(e,e.uint32());break}case 71:{s.statusPostOptInNotificationPreferencesAction=p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.decode(e,e.uint32());break}case 72:{s.avatarUpdatedAction=p.proto.SyncActionValue.AvatarUpdatedAction.decode(e,e.uint32());break}case 74:{s.privateProcessingSettingAction=p.proto.SyncActionValue.PrivateProcessingSettingAction.decode(e,e.uint32());break}case 75:{s.newsletterSavedInterestsAction=p.proto.SyncActionValue.NewsletterSavedInterestsAction.decode(e,e.uint32());break}case 76:{s.aiThreadRenameAction=p.proto.SyncActionValue.AiThreadRenameAction.decode(e,e.uint32());break}case 77:{s.interactiveMessageAction=p.proto.SyncActionValue.InteractiveMessageAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SyncActionValue)return e;var a=new p.proto.SyncActionValue;if(e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),e.starAction!=null){if(typeof e.starAction!="object")throw TypeError(".proto.SyncActionValue.starAction: object expected");a.starAction=p.proto.SyncActionValue.StarAction.fromObject(e.starAction)}if(e.contactAction!=null){if(typeof e.contactAction!="object")throw TypeError(".proto.SyncActionValue.contactAction: object expected");a.contactAction=p.proto.SyncActionValue.ContactAction.fromObject(e.contactAction)}if(e.muteAction!=null){if(typeof e.muteAction!="object")throw TypeError(".proto.SyncActionValue.muteAction: object expected");a.muteAction=p.proto.SyncActionValue.MuteAction.fromObject(e.muteAction)}if(e.pinAction!=null){if(typeof e.pinAction!="object")throw TypeError(".proto.SyncActionValue.pinAction: object expected");a.pinAction=p.proto.SyncActionValue.PinAction.fromObject(e.pinAction)}if(e.pushNameSetting!=null){if(typeof e.pushNameSetting!="object")throw TypeError(".proto.SyncActionValue.pushNameSetting: object expected");a.pushNameSetting=p.proto.SyncActionValue.PushNameSetting.fromObject(e.pushNameSetting)}if(e.quickReplyAction!=null){if(typeof e.quickReplyAction!="object")throw TypeError(".proto.SyncActionValue.quickReplyAction: object expected");a.quickReplyAction=p.proto.SyncActionValue.QuickReplyAction.fromObject(e.quickReplyAction)}if(e.recentEmojiWeightsAction!=null){if(typeof e.recentEmojiWeightsAction!="object")throw TypeError(".proto.SyncActionValue.recentEmojiWeightsAction: object expected");a.recentEmojiWeightsAction=p.proto.SyncActionValue.RecentEmojiWeightsAction.fromObject(e.recentEmojiWeightsAction)}if(e.labelEditAction!=null){if(typeof e.labelEditAction!="object")throw TypeError(".proto.SyncActionValue.labelEditAction: object expected");a.labelEditAction=p.proto.SyncActionValue.LabelEditAction.fromObject(e.labelEditAction)}if(e.labelAssociationAction!=null){if(typeof e.labelAssociationAction!="object")throw TypeError(".proto.SyncActionValue.labelAssociationAction: object expected");a.labelAssociationAction=p.proto.SyncActionValue.LabelAssociationAction.fromObject(e.labelAssociationAction)}if(e.localeSetting!=null){if(typeof e.localeSetting!="object")throw TypeError(".proto.SyncActionValue.localeSetting: object expected");a.localeSetting=p.proto.SyncActionValue.LocaleSetting.fromObject(e.localeSetting)}if(e.archiveChatAction!=null){if(typeof e.archiveChatAction!="object")throw TypeError(".proto.SyncActionValue.archiveChatAction: object expected");a.archiveChatAction=p.proto.SyncActionValue.ArchiveChatAction.fromObject(e.archiveChatAction)}if(e.deleteMessageForMeAction!=null){if(typeof e.deleteMessageForMeAction!="object")throw TypeError(".proto.SyncActionValue.deleteMessageForMeAction: object expected");a.deleteMessageForMeAction=p.proto.SyncActionValue.DeleteMessageForMeAction.fromObject(e.deleteMessageForMeAction)}if(e.keyExpiration!=null){if(typeof e.keyExpiration!="object")throw TypeError(".proto.SyncActionValue.keyExpiration: object expected");a.keyExpiration=p.proto.SyncActionValue.KeyExpiration.fromObject(e.keyExpiration)}if(e.markChatAsReadAction!=null){if(typeof e.markChatAsReadAction!="object")throw TypeError(".proto.SyncActionValue.markChatAsReadAction: object expected");a.markChatAsReadAction=p.proto.SyncActionValue.MarkChatAsReadAction.fromObject(e.markChatAsReadAction)}if(e.clearChatAction!=null){if(typeof e.clearChatAction!="object")throw TypeError(".proto.SyncActionValue.clearChatAction: object expected");a.clearChatAction=p.proto.SyncActionValue.ClearChatAction.fromObject(e.clearChatAction)}if(e.deleteChatAction!=null){if(typeof e.deleteChatAction!="object")throw TypeError(".proto.SyncActionValue.deleteChatAction: object expected");a.deleteChatAction=p.proto.SyncActionValue.DeleteChatAction.fromObject(e.deleteChatAction)}if(e.unarchiveChatsSetting!=null){if(typeof e.unarchiveChatsSetting!="object")throw TypeError(".proto.SyncActionValue.unarchiveChatsSetting: object expected");a.unarchiveChatsSetting=p.proto.SyncActionValue.UnarchiveChatsSetting.fromObject(e.unarchiveChatsSetting)}if(e.primaryFeature!=null){if(typeof e.primaryFeature!="object")throw TypeError(".proto.SyncActionValue.primaryFeature: object expected");a.primaryFeature=p.proto.SyncActionValue.PrimaryFeature.fromObject(e.primaryFeature)}if(e.androidUnsupportedActions!=null){if(typeof e.androidUnsupportedActions!="object")throw TypeError(".proto.SyncActionValue.androidUnsupportedActions: object expected");a.androidUnsupportedActions=p.proto.SyncActionValue.AndroidUnsupportedActions.fromObject(e.androidUnsupportedActions)}if(e.agentAction!=null){if(typeof e.agentAction!="object")throw TypeError(".proto.SyncActionValue.agentAction: object expected");a.agentAction=p.proto.SyncActionValue.AgentAction.fromObject(e.agentAction)}if(e.subscriptionAction!=null){if(typeof e.subscriptionAction!="object")throw TypeError(".proto.SyncActionValue.subscriptionAction: object expected");a.subscriptionAction=p.proto.SyncActionValue.SubscriptionAction.fromObject(e.subscriptionAction)}if(e.userStatusMuteAction!=null){if(typeof e.userStatusMuteAction!="object")throw TypeError(".proto.SyncActionValue.userStatusMuteAction: object expected");a.userStatusMuteAction=p.proto.SyncActionValue.UserStatusMuteAction.fromObject(e.userStatusMuteAction)}if(e.timeFormatAction!=null){if(typeof e.timeFormatAction!="object")throw TypeError(".proto.SyncActionValue.timeFormatAction: object expected");a.timeFormatAction=p.proto.SyncActionValue.TimeFormatAction.fromObject(e.timeFormatAction)}if(e.nuxAction!=null){if(typeof e.nuxAction!="object")throw TypeError(".proto.SyncActionValue.nuxAction: object expected");a.nuxAction=p.proto.SyncActionValue.NuxAction.fromObject(e.nuxAction)}if(e.primaryVersionAction!=null){if(typeof e.primaryVersionAction!="object")throw TypeError(".proto.SyncActionValue.primaryVersionAction: object expected");a.primaryVersionAction=p.proto.SyncActionValue.PrimaryVersionAction.fromObject(e.primaryVersionAction)}if(e.stickerAction!=null){if(typeof e.stickerAction!="object")throw TypeError(".proto.SyncActionValue.stickerAction: object expected");a.stickerAction=p.proto.SyncActionValue.StickerAction.fromObject(e.stickerAction)}if(e.removeRecentStickerAction!=null){if(typeof e.removeRecentStickerAction!="object")throw TypeError(".proto.SyncActionValue.removeRecentStickerAction: object expected");a.removeRecentStickerAction=p.proto.SyncActionValue.RemoveRecentStickerAction.fromObject(e.removeRecentStickerAction)}if(e.chatAssignment!=null){if(typeof e.chatAssignment!="object")throw TypeError(".proto.SyncActionValue.chatAssignment: object expected");a.chatAssignment=p.proto.SyncActionValue.ChatAssignmentAction.fromObject(e.chatAssignment)}if(e.chatAssignmentOpenedStatus!=null){if(typeof e.chatAssignmentOpenedStatus!="object")throw TypeError(".proto.SyncActionValue.chatAssignmentOpenedStatus: object expected");a.chatAssignmentOpenedStatus=p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.fromObject(e.chatAssignmentOpenedStatus)}if(e.pnForLidChatAction!=null){if(typeof e.pnForLidChatAction!="object")throw TypeError(".proto.SyncActionValue.pnForLidChatAction: object expected");a.pnForLidChatAction=p.proto.SyncActionValue.PnForLidChatAction.fromObject(e.pnForLidChatAction)}if(e.marketingMessageAction!=null){if(typeof e.marketingMessageAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageAction: object expected");a.marketingMessageAction=p.proto.SyncActionValue.MarketingMessageAction.fromObject(e.marketingMessageAction)}if(e.marketingMessageBroadcastAction!=null){if(typeof e.marketingMessageBroadcastAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageBroadcastAction: object expected");a.marketingMessageBroadcastAction=p.proto.SyncActionValue.MarketingMessageBroadcastAction.fromObject(e.marketingMessageBroadcastAction)}if(e.externalWebBetaAction!=null){if(typeof e.externalWebBetaAction!="object")throw TypeError(".proto.SyncActionValue.externalWebBetaAction: object expected");a.externalWebBetaAction=p.proto.SyncActionValue.ExternalWebBetaAction.fromObject(e.externalWebBetaAction)}if(e.privacySettingRelayAllCalls!=null){if(typeof e.privacySettingRelayAllCalls!="object")throw TypeError(".proto.SyncActionValue.privacySettingRelayAllCalls: object expected");a.privacySettingRelayAllCalls=p.proto.SyncActionValue.PrivacySettingRelayAllCalls.fromObject(e.privacySettingRelayAllCalls)}if(e.callLogAction!=null){if(typeof e.callLogAction!="object")throw TypeError(".proto.SyncActionValue.callLogAction: object expected");a.callLogAction=p.proto.SyncActionValue.CallLogAction.fromObject(e.callLogAction)}if(e.ugcBot!=null){if(typeof e.ugcBot!="object")throw TypeError(".proto.SyncActionValue.ugcBot: object expected");a.ugcBot=p.proto.SyncActionValue.UGCBot.fromObject(e.ugcBot)}if(e.statusPrivacy!=null){if(typeof e.statusPrivacy!="object")throw TypeError(".proto.SyncActionValue.statusPrivacy: object expected");a.statusPrivacy=p.proto.SyncActionValue.StatusPrivacyAction.fromObject(e.statusPrivacy)}if(e.botWelcomeRequestAction!=null){if(typeof e.botWelcomeRequestAction!="object")throw TypeError(".proto.SyncActionValue.botWelcomeRequestAction: object expected");a.botWelcomeRequestAction=p.proto.SyncActionValue.BotWelcomeRequestAction.fromObject(e.botWelcomeRequestAction)}if(e.deleteIndividualCallLog!=null){if(typeof e.deleteIndividualCallLog!="object")throw TypeError(".proto.SyncActionValue.deleteIndividualCallLog: object expected");a.deleteIndividualCallLog=p.proto.SyncActionValue.DeleteIndividualCallLogAction.fromObject(e.deleteIndividualCallLog)}if(e.labelReorderingAction!=null){if(typeof e.labelReorderingAction!="object")throw TypeError(".proto.SyncActionValue.labelReorderingAction: object expected");a.labelReorderingAction=p.proto.SyncActionValue.LabelReorderingAction.fromObject(e.labelReorderingAction)}if(e.paymentInfoAction!=null){if(typeof e.paymentInfoAction!="object")throw TypeError(".proto.SyncActionValue.paymentInfoAction: object expected");a.paymentInfoAction=p.proto.SyncActionValue.PaymentInfoAction.fromObject(e.paymentInfoAction)}if(e.customPaymentMethodsAction!=null){if(typeof e.customPaymentMethodsAction!="object")throw TypeError(".proto.SyncActionValue.customPaymentMethodsAction: object expected");a.customPaymentMethodsAction=p.proto.SyncActionValue.CustomPaymentMethodsAction.fromObject(e.customPaymentMethodsAction)}if(e.lockChatAction!=null){if(typeof e.lockChatAction!="object")throw TypeError(".proto.SyncActionValue.lockChatAction: object expected");a.lockChatAction=p.proto.SyncActionValue.LockChatAction.fromObject(e.lockChatAction)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.SyncActionValue.chatLockSettings: object expected");a.chatLockSettings=p.proto.ChatLockSettings.fromObject(e.chatLockSettings)}if(e.wamoUserIdentifierAction!=null){if(typeof e.wamoUserIdentifierAction!="object")throw TypeError(".proto.SyncActionValue.wamoUserIdentifierAction: object expected");a.wamoUserIdentifierAction=p.proto.SyncActionValue.WamoUserIdentifierAction.fromObject(e.wamoUserIdentifierAction)}if(e.privacySettingDisableLinkPreviewsAction!=null){if(typeof e.privacySettingDisableLinkPreviewsAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingDisableLinkPreviewsAction: object expected");a.privacySettingDisableLinkPreviewsAction=p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.fromObject(e.privacySettingDisableLinkPreviewsAction)}if(e.deviceCapabilities!=null){if(typeof e.deviceCapabilities!="object")throw TypeError(".proto.SyncActionValue.deviceCapabilities: object expected");a.deviceCapabilities=p.proto.DeviceCapabilities.fromObject(e.deviceCapabilities)}if(e.noteEditAction!=null){if(typeof e.noteEditAction!="object")throw TypeError(".proto.SyncActionValue.noteEditAction: object expected");a.noteEditAction=p.proto.SyncActionValue.NoteEditAction.fromObject(e.noteEditAction)}if(e.favoritesAction!=null){if(typeof e.favoritesAction!="object")throw TypeError(".proto.SyncActionValue.favoritesAction: object expected");a.favoritesAction=p.proto.SyncActionValue.FavoritesAction.fromObject(e.favoritesAction)}if(e.merchantPaymentPartnerAction!=null){if(typeof e.merchantPaymentPartnerAction!="object")throw TypeError(".proto.SyncActionValue.merchantPaymentPartnerAction: object expected");a.merchantPaymentPartnerAction=p.proto.SyncActionValue.MerchantPaymentPartnerAction.fromObject(e.merchantPaymentPartnerAction)}if(e.waffleAccountLinkStateAction!=null){if(typeof e.waffleAccountLinkStateAction!="object")throw TypeError(".proto.SyncActionValue.waffleAccountLinkStateAction: object expected");a.waffleAccountLinkStateAction=p.proto.SyncActionValue.WaffleAccountLinkStateAction.fromObject(e.waffleAccountLinkStateAction)}if(e.usernameChatStartMode!=null){if(typeof e.usernameChatStartMode!="object")throw TypeError(".proto.SyncActionValue.usernameChatStartMode: object expected");a.usernameChatStartMode=p.proto.SyncActionValue.UsernameChatStartModeAction.fromObject(e.usernameChatStartMode)}if(e.notificationActivitySettingAction!=null){if(typeof e.notificationActivitySettingAction!="object")throw TypeError(".proto.SyncActionValue.notificationActivitySettingAction: object expected");a.notificationActivitySettingAction=p.proto.SyncActionValue.NotificationActivitySettingAction.fromObject(e.notificationActivitySettingAction)}if(e.lidContactAction!=null){if(typeof e.lidContactAction!="object")throw TypeError(".proto.SyncActionValue.lidContactAction: object expected");a.lidContactAction=p.proto.SyncActionValue.LidContactAction.fromObject(e.lidContactAction)}if(e.ctwaPerCustomerDataSharingAction!=null){if(typeof e.ctwaPerCustomerDataSharingAction!="object")throw TypeError(".proto.SyncActionValue.ctwaPerCustomerDataSharingAction: object expected");a.ctwaPerCustomerDataSharingAction=p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.fromObject(e.ctwaPerCustomerDataSharingAction)}if(e.paymentTosAction!=null){if(typeof e.paymentTosAction!="object")throw TypeError(".proto.SyncActionValue.paymentTosAction: object expected");a.paymentTosAction=p.proto.SyncActionValue.PaymentTosAction.fromObject(e.paymentTosAction)}if(e.privacySettingChannelsPersonalisedRecommendationAction!=null){if(typeof e.privacySettingChannelsPersonalisedRecommendationAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingChannelsPersonalisedRecommendationAction: object expected");a.privacySettingChannelsPersonalisedRecommendationAction=p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.fromObject(e.privacySettingChannelsPersonalisedRecommendationAction)}if(e.businessBroadcastAssociationAction!=null){if(typeof e.businessBroadcastAssociationAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastAssociationAction: object expected");a.businessBroadcastAssociationAction=p.proto.SyncActionValue.BusinessBroadcastAssociationAction.fromObject(e.businessBroadcastAssociationAction)}if(e.detectedOutcomesStatusAction!=null){if(typeof e.detectedOutcomesStatusAction!="object")throw TypeError(".proto.SyncActionValue.detectedOutcomesStatusAction: object expected");a.detectedOutcomesStatusAction=p.proto.SyncActionValue.DetectedOutcomesStatusAction.fromObject(e.detectedOutcomesStatusAction)}if(e.maibaAiFeaturesControlAction!=null){if(typeof e.maibaAiFeaturesControlAction!="object")throw TypeError(".proto.SyncActionValue.maibaAiFeaturesControlAction: object expected");a.maibaAiFeaturesControlAction=p.proto.SyncActionValue.MaibaAIFeaturesControlAction.fromObject(e.maibaAiFeaturesControlAction)}if(e.businessBroadcastListAction!=null){if(typeof e.businessBroadcastListAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastListAction: object expected");a.businessBroadcastListAction=p.proto.SyncActionValue.BusinessBroadcastListAction.fromObject(e.businessBroadcastListAction)}if(e.musicUserIdAction!=null){if(typeof e.musicUserIdAction!="object")throw TypeError(".proto.SyncActionValue.musicUserIdAction: object expected");a.musicUserIdAction=p.proto.SyncActionValue.MusicUserIdAction.fromObject(e.musicUserIdAction)}if(e.statusPostOptInNotificationPreferencesAction!=null){if(typeof e.statusPostOptInNotificationPreferencesAction!="object")throw TypeError(".proto.SyncActionValue.statusPostOptInNotificationPreferencesAction: object expected");a.statusPostOptInNotificationPreferencesAction=p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.fromObject(e.statusPostOptInNotificationPreferencesAction)}if(e.avatarUpdatedAction!=null){if(typeof e.avatarUpdatedAction!="object")throw TypeError(".proto.SyncActionValue.avatarUpdatedAction: object expected");a.avatarUpdatedAction=p.proto.SyncActionValue.AvatarUpdatedAction.fromObject(e.avatarUpdatedAction)}if(e.privateProcessingSettingAction!=null){if(typeof e.privateProcessingSettingAction!="object")throw TypeError(".proto.SyncActionValue.privateProcessingSettingAction: object expected");a.privateProcessingSettingAction=p.proto.SyncActionValue.PrivateProcessingSettingAction.fromObject(e.privateProcessingSettingAction)}if(e.newsletterSavedInterestsAction!=null){if(typeof e.newsletterSavedInterestsAction!="object")throw TypeError(".proto.SyncActionValue.newsletterSavedInterestsAction: object expected");a.newsletterSavedInterestsAction=p.proto.SyncActionValue.NewsletterSavedInterestsAction.fromObject(e.newsletterSavedInterestsAction)}if(e.aiThreadRenameAction!=null){if(typeof e.aiThreadRenameAction!="object")throw TypeError(".proto.SyncActionValue.aiThreadRenameAction: object expected");a.aiThreadRenameAction=p.proto.SyncActionValue.AiThreadRenameAction.fromObject(e.aiThreadRenameAction)}if(e.interactiveMessageAction!=null){if(typeof e.interactiveMessageAction!="object")throw TypeError(".proto.SyncActionValue.interactiveMessageAction: object expected");a.interactiveMessageAction=p.proto.SyncActionValue.InteractiveMessageAction.fromObject(e.interactiveMessageAction)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=a.longs===String?String(e.timestamp):e.timestamp:A.timestamp=a.longs===String?oe(e.timestamp):a.longs===Number?ne(e.timestamp):e.timestamp,a.oneofs&&(A._timestamp="timestamp")),e.starAction!=null&&e.hasOwnProperty("starAction")&&(A.starAction=p.proto.SyncActionValue.StarAction.toObject(e.starAction,a),a.oneofs&&(A._starAction="starAction")),e.contactAction!=null&&e.hasOwnProperty("contactAction")&&(A.contactAction=p.proto.SyncActionValue.ContactAction.toObject(e.contactAction,a),a.oneofs&&(A._contactAction="contactAction")),e.muteAction!=null&&e.hasOwnProperty("muteAction")&&(A.muteAction=p.proto.SyncActionValue.MuteAction.toObject(e.muteAction,a),a.oneofs&&(A._muteAction="muteAction")),e.pinAction!=null&&e.hasOwnProperty("pinAction")&&(A.pinAction=p.proto.SyncActionValue.PinAction.toObject(e.pinAction,a),a.oneofs&&(A._pinAction="pinAction")),e.pushNameSetting!=null&&e.hasOwnProperty("pushNameSetting")&&(A.pushNameSetting=p.proto.SyncActionValue.PushNameSetting.toObject(e.pushNameSetting,a),a.oneofs&&(A._pushNameSetting="pushNameSetting")),e.quickReplyAction!=null&&e.hasOwnProperty("quickReplyAction")&&(A.quickReplyAction=p.proto.SyncActionValue.QuickReplyAction.toObject(e.quickReplyAction,a),a.oneofs&&(A._quickReplyAction="quickReplyAction")),e.recentEmojiWeightsAction!=null&&e.hasOwnProperty("recentEmojiWeightsAction")&&(A.recentEmojiWeightsAction=p.proto.SyncActionValue.RecentEmojiWeightsAction.toObject(e.recentEmojiWeightsAction,a),a.oneofs&&(A._recentEmojiWeightsAction="recentEmojiWeightsAction")),e.labelEditAction!=null&&e.hasOwnProperty("labelEditAction")&&(A.labelEditAction=p.proto.SyncActionValue.LabelEditAction.toObject(e.labelEditAction,a),a.oneofs&&(A._labelEditAction="labelEditAction")),e.labelAssociationAction!=null&&e.hasOwnProperty("labelAssociationAction")&&(A.labelAssociationAction=p.proto.SyncActionValue.LabelAssociationAction.toObject(e.labelAssociationAction,a),a.oneofs&&(A._labelAssociationAction="labelAssociationAction")),e.localeSetting!=null&&e.hasOwnProperty("localeSetting")&&(A.localeSetting=p.proto.SyncActionValue.LocaleSetting.toObject(e.localeSetting,a),a.oneofs&&(A._localeSetting="localeSetting")),e.archiveChatAction!=null&&e.hasOwnProperty("archiveChatAction")&&(A.archiveChatAction=p.proto.SyncActionValue.ArchiveChatAction.toObject(e.archiveChatAction,a),a.oneofs&&(A._archiveChatAction="archiveChatAction")),e.deleteMessageForMeAction!=null&&e.hasOwnProperty("deleteMessageForMeAction")&&(A.deleteMessageForMeAction=p.proto.SyncActionValue.DeleteMessageForMeAction.toObject(e.deleteMessageForMeAction,a),a.oneofs&&(A._deleteMessageForMeAction="deleteMessageForMeAction")),e.keyExpiration!=null&&e.hasOwnProperty("keyExpiration")&&(A.keyExpiration=p.proto.SyncActionValue.KeyExpiration.toObject(e.keyExpiration,a),a.oneofs&&(A._keyExpiration="keyExpiration")),e.markChatAsReadAction!=null&&e.hasOwnProperty("markChatAsReadAction")&&(A.markChatAsReadAction=p.proto.SyncActionValue.MarkChatAsReadAction.toObject(e.markChatAsReadAction,a),a.oneofs&&(A._markChatAsReadAction="markChatAsReadAction")),e.clearChatAction!=null&&e.hasOwnProperty("clearChatAction")&&(A.clearChatAction=p.proto.SyncActionValue.ClearChatAction.toObject(e.clearChatAction,a),a.oneofs&&(A._clearChatAction="clearChatAction")),e.deleteChatAction!=null&&e.hasOwnProperty("deleteChatAction")&&(A.deleteChatAction=p.proto.SyncActionValue.DeleteChatAction.toObject(e.deleteChatAction,a),a.oneofs&&(A._deleteChatAction="deleteChatAction")),e.unarchiveChatsSetting!=null&&e.hasOwnProperty("unarchiveChatsSetting")&&(A.unarchiveChatsSetting=p.proto.SyncActionValue.UnarchiveChatsSetting.toObject(e.unarchiveChatsSetting,a),a.oneofs&&(A._unarchiveChatsSetting="unarchiveChatsSetting")),e.primaryFeature!=null&&e.hasOwnProperty("primaryFeature")&&(A.primaryFeature=p.proto.SyncActionValue.PrimaryFeature.toObject(e.primaryFeature,a),a.oneofs&&(A._primaryFeature="primaryFeature")),e.androidUnsupportedActions!=null&&e.hasOwnProperty("androidUnsupportedActions")&&(A.androidUnsupportedActions=p.proto.SyncActionValue.AndroidUnsupportedActions.toObject(e.androidUnsupportedActions,a),a.oneofs&&(A._androidUnsupportedActions="androidUnsupportedActions")),e.agentAction!=null&&e.hasOwnProperty("agentAction")&&(A.agentAction=p.proto.SyncActionValue.AgentAction.toObject(e.agentAction,a),a.oneofs&&(A._agentAction="agentAction")),e.subscriptionAction!=null&&e.hasOwnProperty("subscriptionAction")&&(A.subscriptionAction=p.proto.SyncActionValue.SubscriptionAction.toObject(e.subscriptionAction,a),a.oneofs&&(A._subscriptionAction="subscriptionAction")),e.userStatusMuteAction!=null&&e.hasOwnProperty("userStatusMuteAction")&&(A.userStatusMuteAction=p.proto.SyncActionValue.UserStatusMuteAction.toObject(e.userStatusMuteAction,a),a.oneofs&&(A._userStatusMuteAction="userStatusMuteAction")),e.timeFormatAction!=null&&e.hasOwnProperty("timeFormatAction")&&(A.timeFormatAction=p.proto.SyncActionValue.TimeFormatAction.toObject(e.timeFormatAction,a),a.oneofs&&(A._timeFormatAction="timeFormatAction")),e.nuxAction!=null&&e.hasOwnProperty("nuxAction")&&(A.nuxAction=p.proto.SyncActionValue.NuxAction.toObject(e.nuxAction,a),a.oneofs&&(A._nuxAction="nuxAction")),e.primaryVersionAction!=null&&e.hasOwnProperty("primaryVersionAction")&&(A.primaryVersionAction=p.proto.SyncActionValue.PrimaryVersionAction.toObject(e.primaryVersionAction,a),a.oneofs&&(A._primaryVersionAction="primaryVersionAction")),e.stickerAction!=null&&e.hasOwnProperty("stickerAction")&&(A.stickerAction=p.proto.SyncActionValue.StickerAction.toObject(e.stickerAction,a),a.oneofs&&(A._stickerAction="stickerAction")),e.removeRecentStickerAction!=null&&e.hasOwnProperty("removeRecentStickerAction")&&(A.removeRecentStickerAction=p.proto.SyncActionValue.RemoveRecentStickerAction.toObject(e.removeRecentStickerAction,a),a.oneofs&&(A._removeRecentStickerAction="removeRecentStickerAction")),e.chatAssignment!=null&&e.hasOwnProperty("chatAssignment")&&(A.chatAssignment=p.proto.SyncActionValue.ChatAssignmentAction.toObject(e.chatAssignment,a),a.oneofs&&(A._chatAssignment="chatAssignment")),e.chatAssignmentOpenedStatus!=null&&e.hasOwnProperty("chatAssignmentOpenedStatus")&&(A.chatAssignmentOpenedStatus=p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.toObject(e.chatAssignmentOpenedStatus,a),a.oneofs&&(A._chatAssignmentOpenedStatus="chatAssignmentOpenedStatus")),e.pnForLidChatAction!=null&&e.hasOwnProperty("pnForLidChatAction")&&(A.pnForLidChatAction=p.proto.SyncActionValue.PnForLidChatAction.toObject(e.pnForLidChatAction,a),a.oneofs&&(A._pnForLidChatAction="pnForLidChatAction")),e.marketingMessageAction!=null&&e.hasOwnProperty("marketingMessageAction")&&(A.marketingMessageAction=p.proto.SyncActionValue.MarketingMessageAction.toObject(e.marketingMessageAction,a),a.oneofs&&(A._marketingMessageAction="marketingMessageAction")),e.marketingMessageBroadcastAction!=null&&e.hasOwnProperty("marketingMessageBroadcastAction")&&(A.marketingMessageBroadcastAction=p.proto.SyncActionValue.MarketingMessageBroadcastAction.toObject(e.marketingMessageBroadcastAction,a),a.oneofs&&(A._marketingMessageBroadcastAction="marketingMessageBroadcastAction")),e.externalWebBetaAction!=null&&e.hasOwnProperty("externalWebBetaAction")&&(A.externalWebBetaAction=p.proto.SyncActionValue.ExternalWebBetaAction.toObject(e.externalWebBetaAction,a),a.oneofs&&(A._externalWebBetaAction="externalWebBetaAction")),e.privacySettingRelayAllCalls!=null&&e.hasOwnProperty("privacySettingRelayAllCalls")&&(A.privacySettingRelayAllCalls=p.proto.SyncActionValue.PrivacySettingRelayAllCalls.toObject(e.privacySettingRelayAllCalls,a),a.oneofs&&(A._privacySettingRelayAllCalls="privacySettingRelayAllCalls")),e.callLogAction!=null&&e.hasOwnProperty("callLogAction")&&(A.callLogAction=p.proto.SyncActionValue.CallLogAction.toObject(e.callLogAction,a),a.oneofs&&(A._callLogAction="callLogAction")),e.ugcBot!=null&&e.hasOwnProperty("ugcBot")&&(A.ugcBot=p.proto.SyncActionValue.UGCBot.toObject(e.ugcBot,a),a.oneofs&&(A._ugcBot="ugcBot")),e.statusPrivacy!=null&&e.hasOwnProperty("statusPrivacy")&&(A.statusPrivacy=p.proto.SyncActionValue.StatusPrivacyAction.toObject(e.statusPrivacy,a),a.oneofs&&(A._statusPrivacy="statusPrivacy")),e.botWelcomeRequestAction!=null&&e.hasOwnProperty("botWelcomeRequestAction")&&(A.botWelcomeRequestAction=p.proto.SyncActionValue.BotWelcomeRequestAction.toObject(e.botWelcomeRequestAction,a),a.oneofs&&(A._botWelcomeRequestAction="botWelcomeRequestAction")),e.deleteIndividualCallLog!=null&&e.hasOwnProperty("deleteIndividualCallLog")&&(A.deleteIndividualCallLog=p.proto.SyncActionValue.DeleteIndividualCallLogAction.toObject(e.deleteIndividualCallLog,a),a.oneofs&&(A._deleteIndividualCallLog="deleteIndividualCallLog")),e.labelReorderingAction!=null&&e.hasOwnProperty("labelReorderingAction")&&(A.labelReorderingAction=p.proto.SyncActionValue.LabelReorderingAction.toObject(e.labelReorderingAction,a),a.oneofs&&(A._labelReorderingAction="labelReorderingAction")),e.paymentInfoAction!=null&&e.hasOwnProperty("paymentInfoAction")&&(A.paymentInfoAction=p.proto.SyncActionValue.PaymentInfoAction.toObject(e.paymentInfoAction,a),a.oneofs&&(A._paymentInfoAction="paymentInfoAction")),e.customPaymentMethodsAction!=null&&e.hasOwnProperty("customPaymentMethodsAction")&&(A.customPaymentMethodsAction=p.proto.SyncActionValue.CustomPaymentMethodsAction.toObject(e.customPaymentMethodsAction,a),a.oneofs&&(A._customPaymentMethodsAction="customPaymentMethodsAction")),e.lockChatAction!=null&&e.hasOwnProperty("lockChatAction")&&(A.lockChatAction=p.proto.SyncActionValue.LockChatAction.toObject(e.lockChatAction,a),a.oneofs&&(A._lockChatAction="lockChatAction")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=p.proto.ChatLockSettings.toObject(e.chatLockSettings,a),a.oneofs&&(A._chatLockSettings="chatLockSettings")),e.wamoUserIdentifierAction!=null&&e.hasOwnProperty("wamoUserIdentifierAction")&&(A.wamoUserIdentifierAction=p.proto.SyncActionValue.WamoUserIdentifierAction.toObject(e.wamoUserIdentifierAction,a),a.oneofs&&(A._wamoUserIdentifierAction="wamoUserIdentifierAction")),e.privacySettingDisableLinkPreviewsAction!=null&&e.hasOwnProperty("privacySettingDisableLinkPreviewsAction")&&(A.privacySettingDisableLinkPreviewsAction=p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.toObject(e.privacySettingDisableLinkPreviewsAction,a),a.oneofs&&(A._privacySettingDisableLinkPreviewsAction="privacySettingDisableLinkPreviewsAction")),e.deviceCapabilities!=null&&e.hasOwnProperty("deviceCapabilities")&&(A.deviceCapabilities=p.proto.DeviceCapabilities.toObject(e.deviceCapabilities,a),a.oneofs&&(A._deviceCapabilities="deviceCapabilities")),e.noteEditAction!=null&&e.hasOwnProperty("noteEditAction")&&(A.noteEditAction=p.proto.SyncActionValue.NoteEditAction.toObject(e.noteEditAction,a),a.oneofs&&(A._noteEditAction="noteEditAction")),e.favoritesAction!=null&&e.hasOwnProperty("favoritesAction")&&(A.favoritesAction=p.proto.SyncActionValue.FavoritesAction.toObject(e.favoritesAction,a),a.oneofs&&(A._favoritesAction="favoritesAction")),e.merchantPaymentPartnerAction!=null&&e.hasOwnProperty("merchantPaymentPartnerAction")&&(A.merchantPaymentPartnerAction=p.proto.SyncActionValue.MerchantPaymentPartnerAction.toObject(e.merchantPaymentPartnerAction,a),a.oneofs&&(A._merchantPaymentPartnerAction="merchantPaymentPartnerAction")),e.waffleAccountLinkStateAction!=null&&e.hasOwnProperty("waffleAccountLinkStateAction")&&(A.waffleAccountLinkStateAction=p.proto.SyncActionValue.WaffleAccountLinkStateAction.toObject(e.waffleAccountLinkStateAction,a),a.oneofs&&(A._waffleAccountLinkStateAction="waffleAccountLinkStateAction")),e.usernameChatStartMode!=null&&e.hasOwnProperty("usernameChatStartMode")&&(A.usernameChatStartMode=p.proto.SyncActionValue.UsernameChatStartModeAction.toObject(e.usernameChatStartMode,a),a.oneofs&&(A._usernameChatStartMode="usernameChatStartMode")),e.notificationActivitySettingAction!=null&&e.hasOwnProperty("notificationActivitySettingAction")&&(A.notificationActivitySettingAction=p.proto.SyncActionValue.NotificationActivitySettingAction.toObject(e.notificationActivitySettingAction,a),a.oneofs&&(A._notificationActivitySettingAction="notificationActivitySettingAction")),e.lidContactAction!=null&&e.hasOwnProperty("lidContactAction")&&(A.lidContactAction=p.proto.SyncActionValue.LidContactAction.toObject(e.lidContactAction,a),a.oneofs&&(A._lidContactAction="lidContactAction")),e.ctwaPerCustomerDataSharingAction!=null&&e.hasOwnProperty("ctwaPerCustomerDataSharingAction")&&(A.ctwaPerCustomerDataSharingAction=p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.toObject(e.ctwaPerCustomerDataSharingAction,a),a.oneofs&&(A._ctwaPerCustomerDataSharingAction="ctwaPerCustomerDataSharingAction")),e.paymentTosAction!=null&&e.hasOwnProperty("paymentTosAction")&&(A.paymentTosAction=p.proto.SyncActionValue.PaymentTosAction.toObject(e.paymentTosAction,a),a.oneofs&&(A._paymentTosAction="paymentTosAction")),e.privacySettingChannelsPersonalisedRecommendationAction!=null&&e.hasOwnProperty("privacySettingChannelsPersonalisedRecommendationAction")&&(A.privacySettingChannelsPersonalisedRecommendationAction=p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.toObject(e.privacySettingChannelsPersonalisedRecommendationAction,a),a.oneofs&&(A._privacySettingChannelsPersonalisedRecommendationAction="privacySettingChannelsPersonalisedRecommendationAction")),e.businessBroadcastAssociationAction!=null&&e.hasOwnProperty("businessBroadcastAssociationAction")&&(A.businessBroadcastAssociationAction=p.proto.SyncActionValue.BusinessBroadcastAssociationAction.toObject(e.businessBroadcastAssociationAction,a),a.oneofs&&(A._businessBroadcastAssociationAction="businessBroadcastAssociationAction")),e.detectedOutcomesStatusAction!=null&&e.hasOwnProperty("detectedOutcomesStatusAction")&&(A.detectedOutcomesStatusAction=p.proto.SyncActionValue.DetectedOutcomesStatusAction.toObject(e.detectedOutcomesStatusAction,a),a.oneofs&&(A._detectedOutcomesStatusAction="detectedOutcomesStatusAction")),e.maibaAiFeaturesControlAction!=null&&e.hasOwnProperty("maibaAiFeaturesControlAction")&&(A.maibaAiFeaturesControlAction=p.proto.SyncActionValue.MaibaAIFeaturesControlAction.toObject(e.maibaAiFeaturesControlAction,a),a.oneofs&&(A._maibaAiFeaturesControlAction="maibaAiFeaturesControlAction")),e.businessBroadcastListAction!=null&&e.hasOwnProperty("businessBroadcastListAction")&&(A.businessBroadcastListAction=p.proto.SyncActionValue.BusinessBroadcastListAction.toObject(e.businessBroadcastListAction,a),a.oneofs&&(A._businessBroadcastListAction="businessBroadcastListAction")),e.musicUserIdAction!=null&&e.hasOwnProperty("musicUserIdAction")&&(A.musicUserIdAction=p.proto.SyncActionValue.MusicUserIdAction.toObject(e.musicUserIdAction,a),a.oneofs&&(A._musicUserIdAction="musicUserIdAction")),e.statusPostOptInNotificationPreferencesAction!=null&&e.hasOwnProperty("statusPostOptInNotificationPreferencesAction")&&(A.statusPostOptInNotificationPreferencesAction=p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.toObject(e.statusPostOptInNotificationPreferencesAction,a),a.oneofs&&(A._statusPostOptInNotificationPreferencesAction="statusPostOptInNotificationPreferencesAction")),e.avatarUpdatedAction!=null&&e.hasOwnProperty("avatarUpdatedAction")&&(A.avatarUpdatedAction=p.proto.SyncActionValue.AvatarUpdatedAction.toObject(e.avatarUpdatedAction,a),a.oneofs&&(A._avatarUpdatedAction="avatarUpdatedAction")),e.privateProcessingSettingAction!=null&&e.hasOwnProperty("privateProcessingSettingAction")&&(A.privateProcessingSettingAction=p.proto.SyncActionValue.PrivateProcessingSettingAction.toObject(e.privateProcessingSettingAction,a),a.oneofs&&(A._privateProcessingSettingAction="privateProcessingSettingAction")),e.newsletterSavedInterestsAction!=null&&e.hasOwnProperty("newsletterSavedInterestsAction")&&(A.newsletterSavedInterestsAction=p.proto.SyncActionValue.NewsletterSavedInterestsAction.toObject(e.newsletterSavedInterestsAction,a),a.oneofs&&(A._newsletterSavedInterestsAction="newsletterSavedInterestsAction")),e.aiThreadRenameAction!=null&&e.hasOwnProperty("aiThreadRenameAction")&&(A.aiThreadRenameAction=p.proto.SyncActionValue.AiThreadRenameAction.toObject(e.aiThreadRenameAction,a),a.oneofs&&(A._aiThreadRenameAction="aiThreadRenameAction")),e.interactiveMessageAction!=null&&e.hasOwnProperty("interactiveMessageAction")&&(A.interactiveMessageAction=p.proto.SyncActionValue.InteractiveMessageAction.toObject(e.interactiveMessageAction,a),a.oneofs&&(A._interactiveMessageAction="interactiveMessageAction")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionValue"},r.AgentAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.name=A.string();break}case 2:{c.deviceID=A.int32();break}case 3:{c.isDeleted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AgentAction)return A;var t=new p.proto.SyncActionValue.AgentAction;return A.name!=null&&(t.name=String(A.name)),A.deviceID!=null&&(t.deviceID=A.deviceID|0),A.isDeleted!=null&&(t.isDeleted=!!A.isDeleted),t},i.toObject=function(A,t){t||(t={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),A.deviceID!=null&&A.hasOwnProperty("deviceID")&&(s.deviceID=A.deviceID,t.oneofs&&(s._deviceID="deviceID")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,t.oneofs&&(s._isDeleted="isDeleted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AgentAction"},i})(),r.AiThreadRenameAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.newTitle=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AiThreadRenameAction)return A;var t=new p.proto.SyncActionValue.AiThreadRenameAction;return A.newTitle!=null&&(t.newTitle=String(A.newTitle)),t},i.toObject=function(A,t){t||(t={});var s={};return A.newTitle!=null&&A.hasOwnProperty("newTitle")&&(s.newTitle=A.newTitle,t.oneofs&&(s._newTitle="newTitle")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AiThreadRenameAction"},i})(),r.AndroidUnsupportedActions=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.allowed=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AndroidUnsupportedActions)return A;var t=new p.proto.SyncActionValue.AndroidUnsupportedActions;return A.allowed!=null&&(t.allowed=!!A.allowed),t},i.toObject=function(A,t){t||(t={});var s={};return A.allowed!=null&&A.hasOwnProperty("allowed")&&(s.allowed=A.allowed,t.oneofs&&(s._allowed="allowed")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AndroidUnsupportedActions"},i})(),r.ArchiveChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.archived=A.bool();break}case 2:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ArchiveChatAction)return A;var t=new p.proto.SyncActionValue.ArchiveChatAction;if(A.archived!=null&&(t.archived=!!A.archived),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ArchiveChatAction.messageRange: object expected");t.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.archived!=null&&A.hasOwnProperty("archived")&&(s.archived=A.archived,t.oneofs&&(s._archived="archived")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,t),t.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ArchiveChatAction"},i})(),r.AvatarUpdatedAction=(function(){function i(a){if(this.recentAvatarStickers=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.eventType=A.int32();break}case 2:{c.recentAvatarStickers&&c.recentAvatarStickers.length||(c.recentAvatarStickers=[]),c.recentAvatarStickers.push(p.proto.SyncActionValue.StickerAction.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.AvatarUpdatedAction)return A;var t=new p.proto.SyncActionValue.AvatarUpdatedAction;switch(A.eventType){default:if(typeof A.eventType=="number"){t.eventType=A.eventType;break}break;case"UPDATED":case 0:t.eventType=0;break;case"CREATED":case 1:t.eventType=1;break;case"DELETED":case 2:t.eventType=2;break}if(A.recentAvatarStickers){if(!Array.isArray(A.recentAvatarStickers))throw TypeError(".proto.SyncActionValue.AvatarUpdatedAction.recentAvatarStickers: array expected");t.recentAvatarStickers=[];for(var s=0;s>>3){case 1:{c.isSent=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BotWelcomeRequestAction)return A;var t=new p.proto.SyncActionValue.BotWelcomeRequestAction;return A.isSent!=null&&(t.isSent=!!A.isSent),t},i.toObject=function(A,t){t||(t={});var s={};return A.isSent!=null&&A.hasOwnProperty("isSent")&&(s.isSent=A.isSent,t.oneofs&&(s._isSent="isSent")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BotWelcomeRequestAction"},i})(),r.BroadcastListParticipant=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.lidJid=A.string();break}case 2:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BroadcastListParticipant)return A;var t=new p.proto.SyncActionValue.BroadcastListParticipant;return A.lidJid!=null&&(t.lidJid=String(A.lidJid)),A.pnJid!=null&&(t.pnJid=String(A.pnJid)),t},i.toObject=function(A,t){t||(t={});var s={};return t.defaults&&(s.lidJid=""),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,t.oneofs&&(s._pnJid="pnJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BroadcastListParticipant"},i})(),r.BusinessBroadcastAssociationAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BusinessBroadcastAssociationAction)return A;var t=new p.proto.SyncActionValue.BusinessBroadcastAssociationAction;return A.deleted!=null&&(t.deleted=!!A.deleted),t},i.toObject=function(A,t){t||(t={});var s={};return A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,t.oneofs&&(s._deleted="deleted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BusinessBroadcastAssociationAction"},i})(),r.BusinessBroadcastListAction=(function(){function i(a){if(this.participants=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.deleted=A.bool();break}case 2:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(p.proto.SyncActionValue.BroadcastListParticipant.decode(A,A.uint32()));break}case 3:{c.listName=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.BusinessBroadcastListAction)return A;var t=new p.proto.SyncActionValue.BusinessBroadcastListAction;if(A.deleted!=null&&(t.deleted=!!A.deleted),A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.SyncActionValue.BusinessBroadcastListAction.participants: array expected");t.participants=[];for(var s=0;s>>3){case 1:{c.callLogRecord=p.proto.CallLogRecord.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.CallLogAction)return A;var t=new p.proto.SyncActionValue.CallLogAction;if(A.callLogRecord!=null){if(typeof A.callLogRecord!="object")throw TypeError(".proto.SyncActionValue.CallLogAction.callLogRecord: object expected");t.callLogRecord=p.proto.CallLogRecord.fromObject(A.callLogRecord)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.callLogRecord!=null&&A.hasOwnProperty("callLogRecord")&&(s.callLogRecord=p.proto.CallLogRecord.toObject(A.callLogRecord,t),t.oneofs&&(s._callLogRecord="callLogRecord")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CallLogAction"},i})(),r.ChatAssignmentAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.deviceAgentID=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ChatAssignmentAction)return A;var t=new p.proto.SyncActionValue.ChatAssignmentAction;return A.deviceAgentID!=null&&(t.deviceAgentID=String(A.deviceAgentID)),t},i.toObject=function(A,t){t||(t={});var s={};return A.deviceAgentID!=null&&A.hasOwnProperty("deviceAgentID")&&(s.deviceAgentID=A.deviceAgentID,t.oneofs&&(s._deviceAgentID="deviceAgentID")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentAction"},i})(),r.ChatAssignmentOpenedStatusAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.chatOpened=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction)return A;var t=new p.proto.SyncActionValue.ChatAssignmentOpenedStatusAction;return A.chatOpened!=null&&(t.chatOpened=!!A.chatOpened),t},i.toObject=function(A,t){t||(t={});var s={};return A.chatOpened!=null&&A.hasOwnProperty("chatOpened")&&(s.chatOpened=A.chatOpened,t.oneofs&&(s._chatOpened="chatOpened")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentOpenedStatusAction"},i})(),r.ClearChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ClearChatAction)return A;var t=new p.proto.SyncActionValue.ClearChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ClearChatAction.messageRange: object expected");t.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,t),t.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ClearChatAction"},i})(),r.ContactAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.lidJid=A.string();break}case 4:{c.saveOnPrimaryAddressbook=A.bool();break}case 5:{c.pnJid=A.string();break}case 6:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ContactAction)return A;var t=new p.proto.SyncActionValue.ContactAction;return A.fullName!=null&&(t.fullName=String(A.fullName)),A.firstName!=null&&(t.firstName=String(A.firstName)),A.lidJid!=null&&(t.lidJid=String(A.lidJid)),A.saveOnPrimaryAddressbook!=null&&(t.saveOnPrimaryAddressbook=!!A.saveOnPrimaryAddressbook),A.pnJid!=null&&(t.pnJid=String(A.pnJid)),A.username!=null&&(t.username=String(A.username)),t},i.toObject=function(A,t){t||(t={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,t.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,t.oneofs&&(s._firstName="firstName")),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid,t.oneofs&&(s._lidJid="lidJid")),A.saveOnPrimaryAddressbook!=null&&A.hasOwnProperty("saveOnPrimaryAddressbook")&&(s.saveOnPrimaryAddressbook=A.saveOnPrimaryAddressbook,t.oneofs&&(s._saveOnPrimaryAddressbook="saveOnPrimaryAddressbook")),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,t.oneofs&&(s._pnJid="pnJid")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,t.oneofs&&(s._username="username")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ContactAction"},i})(),r.CtwaPerCustomerDataSharingAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.isCtwaPerCustomerDataSharingEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction)return A;var t=new p.proto.SyncActionValue.CtwaPerCustomerDataSharingAction;return A.isCtwaPerCustomerDataSharingEnabled!=null&&(t.isCtwaPerCustomerDataSharingEnabled=!!A.isCtwaPerCustomerDataSharingEnabled),t},i.toObject=function(A,t){t||(t={});var s={};return A.isCtwaPerCustomerDataSharingEnabled!=null&&A.hasOwnProperty("isCtwaPerCustomerDataSharingEnabled")&&(s.isCtwaPerCustomerDataSharingEnabled=A.isCtwaPerCustomerDataSharingEnabled,t.oneofs&&(s._isCtwaPerCustomerDataSharingEnabled="isCtwaPerCustomerDataSharingEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CtwaPerCustomerDataSharingAction"},i})(),r.CustomPaymentMethod=(function(){function i(e){if(this.metadata=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.credentialId=a.string();break}case 2:{g.country=a.string();break}case 3:{g.type=a.string();break}case 4:{g.metadata&&g.metadata.length||(g.metadata=[]),g.metadata.push(p.proto.SyncActionValue.CustomPaymentMethodMetadata.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.CustomPaymentMethod)return a;var A=new p.proto.SyncActionValue.CustomPaymentMethod;if(a.credentialId!=null&&(A.credentialId=String(a.credentialId)),a.country!=null&&(A.country=String(a.country)),a.type!=null&&(A.type=String(a.type)),a.metadata){if(!Array.isArray(a.metadata))throw TypeError(".proto.SyncActionValue.CustomPaymentMethod.metadata: array expected");A.metadata=[];for(var t=0;t>>3){case 1:{g.key=a.string();break}case 2:{g.value=a.string();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.CustomPaymentMethodMetadata)return a;var A=new p.proto.SyncActionValue.CustomPaymentMethodMetadata;return a.key!=null&&(A.key=String(a.key)),a.value!=null&&(A.value=String(a.value)),A},i.toObject=function(a,A){A||(A={});var t={};return A.defaults&&(t.key="",t.value=""),a.key!=null&&a.hasOwnProperty("key")&&(t.key=a.key),a.value!=null&&a.hasOwnProperty("value")&&(t.value=a.value),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.SyncActionValue.CustomPaymentMethodMetadata"},i})(),r.CustomPaymentMethodsAction=(function(){function i(e){if(this.customPaymentMethods=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.customPaymentMethods&&g.customPaymentMethods.length||(g.customPaymentMethods=[]),g.customPaymentMethods.push(p.proto.SyncActionValue.CustomPaymentMethod.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.CustomPaymentMethodsAction)return a;var A=new p.proto.SyncActionValue.CustomPaymentMethodsAction;if(a.customPaymentMethods){if(!Array.isArray(a.customPaymentMethods))throw TypeError(".proto.SyncActionValue.CustomPaymentMethodsAction.customPaymentMethods: array expected");A.customPaymentMethods=[];for(var t=0;t>>3){case 1:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DeleteChatAction)return A;var t=new p.proto.SyncActionValue.DeleteChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.DeleteChatAction.messageRange: object expected");t.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,t),t.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteChatAction"},i})(),r.DeleteIndividualCallLogAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.peerJid=A.string();break}case 2:{c.isIncoming=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DeleteIndividualCallLogAction)return A;var t=new p.proto.SyncActionValue.DeleteIndividualCallLogAction;return A.peerJid!=null&&(t.peerJid=String(A.peerJid)),A.isIncoming!=null&&(t.isIncoming=!!A.isIncoming),t},i.toObject=function(A,t){t||(t={});var s={};return A.peerJid!=null&&A.hasOwnProperty("peerJid")&&(s.peerJid=A.peerJid,t.oneofs&&(s._peerJid="peerJid")),A.isIncoming!=null&&A.hasOwnProperty("isIncoming")&&(s.isIncoming=A.isIncoming,t.oneofs&&(s._isIncoming="isIncoming")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteIndividualCallLogAction"},i})(),r.DeleteMessageForMeAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.deleteMedia=A.bool();break}case 2:{c.messageTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DeleteMessageForMeAction)return A;var t=new p.proto.SyncActionValue.DeleteMessageForMeAction;return A.deleteMedia!=null&&(t.deleteMedia=!!A.deleteMedia),A.messageTimestamp!=null&&(l.Long?(t.messageTimestamp=l.Long.fromValue(A.messageTimestamp)).unsigned=!1:typeof A.messageTimestamp=="string"?t.messageTimestamp=parseInt(A.messageTimestamp,10):typeof A.messageTimestamp=="number"?t.messageTimestamp=A.messageTimestamp:typeof A.messageTimestamp=="object"&&(t.messageTimestamp=new l.LongBits(A.messageTimestamp.low>>>0,A.messageTimestamp.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.deleteMedia!=null&&A.hasOwnProperty("deleteMedia")&&(s.deleteMedia=A.deleteMedia,t.oneofs&&(s._deleteMedia="deleteMedia")),A.messageTimestamp!=null&&A.hasOwnProperty("messageTimestamp")&&(typeof A.messageTimestamp=="number"?s.messageTimestamp=t.longs===String?String(A.messageTimestamp):A.messageTimestamp:s.messageTimestamp=t.longs===String?oe(A.messageTimestamp):t.longs===Number?ne(A.messageTimestamp):A.messageTimestamp,t.oneofs&&(s._messageTimestamp="messageTimestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteMessageForMeAction"},i})(),r.DetectedOutcomesStatusAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.DetectedOutcomesStatusAction)return A;var t=new p.proto.SyncActionValue.DetectedOutcomesStatusAction;return A.isEnabled!=null&&(t.isEnabled=!!A.isEnabled),t},i.toObject=function(A,t){t||(t={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,t.oneofs&&(s._isEnabled="isEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DetectedOutcomesStatusAction"},i})(),r.ExternalWebBetaAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.isOptIn=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.ExternalWebBetaAction)return A;var t=new p.proto.SyncActionValue.ExternalWebBetaAction;return A.isOptIn!=null&&(t.isOptIn=!!A.isOptIn),t},i.toObject=function(A,t){t||(t={});var s={};return A.isOptIn!=null&&A.hasOwnProperty("isOptIn")&&(s.isOptIn=A.isOptIn,t.oneofs&&(s._isOptIn="isOptIn")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ExternalWebBetaAction"},i})(),r.FavoritesAction=(function(){function i(e){if(this.favorites=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.favorites&&g.favorites.length||(g.favorites=[]),g.favorites.push(p.proto.SyncActionValue.FavoritesAction.Favorite.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.FavoritesAction)return a;var A=new p.proto.SyncActionValue.FavoritesAction;if(a.favorites){if(!Array.isArray(a.favorites))throw TypeError(".proto.SyncActionValue.FavoritesAction.favorites: array expected");A.favorites=[];for(var t=0;t>>3){case 1:{I.id=t.string();break}default:t.skipType(d&7);break}}return I},e.fromObject=function(t){if(t instanceof p.proto.SyncActionValue.FavoritesAction.Favorite)return t;var s=new p.proto.SyncActionValue.FavoritesAction.Favorite;return t.id!=null&&(s.id=String(t.id)),s},e.toObject=function(t,s){s||(s={});var g={};return t.id!=null&&t.hasOwnProperty("id")&&(g.id=t.id,s.oneofs&&(g._id="id")),g},e.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},e.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/proto.SyncActionValue.FavoritesAction.Favorite"},e})(),i})(),r.InteractiveMessageAction=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.type=a.int32();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.InteractiveMessageAction)return a;var A=new p.proto.SyncActionValue.InteractiveMessageAction;switch(a.type){default:if(typeof a.type=="number"){A.type=a.type;break}break;case"DISABLE_CTA":case 1:A.type=1;break}return A},i.toObject=function(a,A){A||(A={});var t={};return A.defaults&&(t.type=A.enums===String?"DISABLE_CTA":1),a.type!=null&&a.hasOwnProperty("type")&&(t.type=A.enums===String?p.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[a.type]===void 0?a.type:p.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[a.type]:a.type),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.SyncActionValue.InteractiveMessageAction"},i.InteractiveMessageActionMode=(function(){let e={},a=Object.create(e);return a[e[1]="DISABLE_CTA"]=1,a})(),i})(),r.KeyExpiration=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.expiredKeyEpoch=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.KeyExpiration)return A;var t=new p.proto.SyncActionValue.KeyExpiration;return A.expiredKeyEpoch!=null&&(t.expiredKeyEpoch=A.expiredKeyEpoch|0),t},i.toObject=function(A,t){t||(t={});var s={};return A.expiredKeyEpoch!=null&&A.hasOwnProperty("expiredKeyEpoch")&&(s.expiredKeyEpoch=A.expiredKeyEpoch,t.oneofs&&(s._expiredKeyEpoch="expiredKeyEpoch")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.KeyExpiration"},i})(),r.LabelAssociationAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.labeled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LabelAssociationAction)return A;var t=new p.proto.SyncActionValue.LabelAssociationAction;return A.labeled!=null&&(t.labeled=!!A.labeled),t},i.toObject=function(A,t){t||(t={});var s={};return A.labeled!=null&&A.hasOwnProperty("labeled")&&(s.labeled=A.labeled,t.oneofs&&(s._labeled="labeled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelAssociationAction"},i})(),r.LabelEditAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.name=A.string();break}case 2:{c.color=A.int32();break}case 3:{c.predefinedId=A.int32();break}case 4:{c.deleted=A.bool();break}case 5:{c.orderIndex=A.int32();break}case 6:{c.isActive=A.bool();break}case 7:{c.type=A.int32();break}case 8:{c.isImmutable=A.bool();break}case 9:{c.muteEndTimeMs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LabelEditAction)return A;var t=new p.proto.SyncActionValue.LabelEditAction;switch(A.name!=null&&(t.name=String(A.name)),A.color!=null&&(t.color=A.color|0),A.predefinedId!=null&&(t.predefinedId=A.predefinedId|0),A.deleted!=null&&(t.deleted=!!A.deleted),A.orderIndex!=null&&(t.orderIndex=A.orderIndex|0),A.isActive!=null&&(t.isActive=!!A.isActive),A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"NONE":case 0:t.type=0;break;case"UNREAD":case 1:t.type=1;break;case"GROUPS":case 2:t.type=2;break;case"FAVORITES":case 3:t.type=3;break;case"PREDEFINED":case 4:t.type=4;break;case"CUSTOM":case 5:t.type=5;break;case"COMMUNITY":case 6:t.type=6;break;case"SERVER_ASSIGNED":case 7:t.type=7;break;case"DRAFTED":case 8:t.type=8;break;case"AI_HANDOFF":case 9:t.type=9;break}return A.isImmutable!=null&&(t.isImmutable=!!A.isImmutable),A.muteEndTimeMs!=null&&(l.Long?(t.muteEndTimeMs=l.Long.fromValue(A.muteEndTimeMs)).unsigned=!1:typeof A.muteEndTimeMs=="string"?t.muteEndTimeMs=parseInt(A.muteEndTimeMs,10):typeof A.muteEndTimeMs=="number"?t.muteEndTimeMs=A.muteEndTimeMs:typeof A.muteEndTimeMs=="object"&&(t.muteEndTimeMs=new l.LongBits(A.muteEndTimeMs.low>>>0,A.muteEndTimeMs.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),A.color!=null&&A.hasOwnProperty("color")&&(s.color=A.color,t.oneofs&&(s._color="color")),A.predefinedId!=null&&A.hasOwnProperty("predefinedId")&&(s.predefinedId=A.predefinedId,t.oneofs&&(s._predefinedId="predefinedId")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,t.oneofs&&(s._deleted="deleted")),A.orderIndex!=null&&A.hasOwnProperty("orderIndex")&&(s.orderIndex=A.orderIndex,t.oneofs&&(s._orderIndex="orderIndex")),A.isActive!=null&&A.hasOwnProperty("isActive")&&(s.isActive=A.isActive,t.oneofs&&(s._isActive="isActive")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.SyncActionValue.LabelEditAction.ListType[A.type]===void 0?A.type:p.proto.SyncActionValue.LabelEditAction.ListType[A.type]:A.type,t.oneofs&&(s._type="type")),A.isImmutable!=null&&A.hasOwnProperty("isImmutable")&&(s.isImmutable=A.isImmutable,t.oneofs&&(s._isImmutable="isImmutable")),A.muteEndTimeMs!=null&&A.hasOwnProperty("muteEndTimeMs")&&(typeof A.muteEndTimeMs=="number"?s.muteEndTimeMs=t.longs===String?String(A.muteEndTimeMs):A.muteEndTimeMs:s.muteEndTimeMs=t.longs===String?oe(A.muteEndTimeMs):t.longs===Number?ne(A.muteEndTimeMs):A.muteEndTimeMs,t.oneofs&&(s._muteEndTimeMs="muteEndTimeMs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelEditAction"},i.ListType=(function(){let a={},A=Object.create(a);return A[a[0]="NONE"]=0,A[a[1]="UNREAD"]=1,A[a[2]="GROUPS"]=2,A[a[3]="FAVORITES"]=3,A[a[4]="PREDEFINED"]=4,A[a[5]="CUSTOM"]=5,A[a[6]="COMMUNITY"]=6,A[a[7]="SERVER_ASSIGNED"]=7,A[a[8]="DRAFTED"]=8,A[a[9]="AI_HANDOFF"]=9,A})(),i})(),r.LabelReorderingAction=(function(){function i(e){if(this.sortedLabelIds=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{if(g.sortedLabelIds&&g.sortedLabelIds.length||(g.sortedLabelIds=[]),(c&7)===2)for(var I=a.uint32()+a.pos;a.pos>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LidContactAction)return A;var t=new p.proto.SyncActionValue.LidContactAction;return A.fullName!=null&&(t.fullName=String(A.fullName)),A.firstName!=null&&(t.firstName=String(A.firstName)),A.username!=null&&(t.username=String(A.username)),t},i.toObject=function(A,t){t||(t={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,t.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,t.oneofs&&(s._firstName="firstName")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,t.oneofs&&(s._username="username")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LidContactAction"},i})(),r.LocaleSetting=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.locale=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LocaleSetting)return A;var t=new p.proto.SyncActionValue.LocaleSetting;return A.locale!=null&&(t.locale=String(A.locale)),t},i.toObject=function(A,t){t||(t={});var s={};return A.locale!=null&&A.hasOwnProperty("locale")&&(s.locale=A.locale,t.oneofs&&(s._locale="locale")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LocaleSetting"},i})(),r.LockChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.locked=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.LockChatAction)return A;var t=new p.proto.SyncActionValue.LockChatAction;return A.locked!=null&&(t.locked=!!A.locked),t},i.toObject=function(A,t){t||(t={});var s={};return A.locked!=null&&A.hasOwnProperty("locked")&&(s.locked=A.locked,t.oneofs&&(s._locked="locked")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LockChatAction"},i})(),r.MaibaAIFeaturesControlAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.aiFeatureStatus=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MaibaAIFeaturesControlAction)return A;var t=new p.proto.SyncActionValue.MaibaAIFeaturesControlAction;switch(A.aiFeatureStatus){default:if(typeof A.aiFeatureStatus=="number"){t.aiFeatureStatus=A.aiFeatureStatus;break}break;case"ENABLED":case 0:t.aiFeatureStatus=0;break;case"ENABLED_HAS_LEARNING":case 1:t.aiFeatureStatus=1;break;case"DISABLED":case 2:t.aiFeatureStatus=2;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.aiFeatureStatus!=null&&A.hasOwnProperty("aiFeatureStatus")&&(s.aiFeatureStatus=t.enums===String?p.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]===void 0?A.aiFeatureStatus:p.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]:A.aiFeatureStatus,t.oneofs&&(s._aiFeatureStatus="aiFeatureStatus")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MaibaAIFeaturesControlAction"},i.MaibaAIFeatureStatus=(function(){let a={},A=Object.create(a);return A[a[0]="ENABLED"]=0,A[a[1]="ENABLED_HAS_LEARNING"]=1,A[a[2]="DISABLED"]=2,A})(),i})(),r.MarkChatAsReadAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.read=A.bool();break}case 2:{c.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MarkChatAsReadAction)return A;var t=new p.proto.SyncActionValue.MarkChatAsReadAction;if(A.read!=null&&(t.read=!!A.read),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.MarkChatAsReadAction.messageRange: object expected");t.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.read!=null&&A.hasOwnProperty("read")&&(s.read=A.read,t.oneofs&&(s._read="read")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=p.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,t),t.oneofs&&(s._messageRange="messageRange")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarkChatAsReadAction"},i})(),r.MarketingMessageAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.name=A.string();break}case 2:{c.message=A.string();break}case 3:{c.type=A.int32();break}case 4:{c.createdAt=A.int64();break}case 5:{c.lastSentAt=A.int64();break}case 6:{c.isDeleted=A.bool();break}case 7:{c.mediaId=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MarketingMessageAction)return A;var t=new p.proto.SyncActionValue.MarketingMessageAction;switch(A.name!=null&&(t.name=String(A.name)),A.message!=null&&(t.message=String(A.message)),A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"PERSONALIZED":case 0:t.type=0;break}return A.createdAt!=null&&(l.Long?(t.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?t.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?t.createdAt=A.createdAt:typeof A.createdAt=="object"&&(t.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.lastSentAt!=null&&(l.Long?(t.lastSentAt=l.Long.fromValue(A.lastSentAt)).unsigned=!1:typeof A.lastSentAt=="string"?t.lastSentAt=parseInt(A.lastSentAt,10):typeof A.lastSentAt=="number"?t.lastSentAt=A.lastSentAt:typeof A.lastSentAt=="object"&&(t.lastSentAt=new l.LongBits(A.lastSentAt.low>>>0,A.lastSentAt.high>>>0).toNumber())),A.isDeleted!=null&&(t.isDeleted=!!A.isDeleted),A.mediaId!=null&&(t.mediaId=String(A.mediaId)),t},i.toObject=function(A,t){t||(t={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,t.oneofs&&(s._message="message")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]===void 0?A.type:p.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]:A.type,t.oneofs&&(s._type="type")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=t.longs===String?String(A.createdAt):A.createdAt:s.createdAt=t.longs===String?oe(A.createdAt):t.longs===Number?ne(A.createdAt):A.createdAt,t.oneofs&&(s._createdAt="createdAt")),A.lastSentAt!=null&&A.hasOwnProperty("lastSentAt")&&(typeof A.lastSentAt=="number"?s.lastSentAt=t.longs===String?String(A.lastSentAt):A.lastSentAt:s.lastSentAt=t.longs===String?oe(A.lastSentAt):t.longs===Number?ne(A.lastSentAt):A.lastSentAt,t.oneofs&&(s._lastSentAt="lastSentAt")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,t.oneofs&&(s._isDeleted="isDeleted")),A.mediaId!=null&&A.hasOwnProperty("mediaId")&&(s.mediaId=A.mediaId,t.oneofs&&(s._mediaId="mediaId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageAction"},i.MarketingMessagePrototypeType=(function(){let a={},A=Object.create(a);return A[a[0]="PERSONALIZED"]=0,A})(),i})(),r.MarketingMessageBroadcastAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.repliedCount=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MarketingMessageBroadcastAction)return A;var t=new p.proto.SyncActionValue.MarketingMessageBroadcastAction;return A.repliedCount!=null&&(t.repliedCount=A.repliedCount|0),t},i.toObject=function(A,t){t||(t={});var s={};return A.repliedCount!=null&&A.hasOwnProperty("repliedCount")&&(s.repliedCount=A.repliedCount,t.oneofs&&(s._repliedCount="repliedCount")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageBroadcastAction"},i})(),r.MerchantPaymentPartnerAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.status=A.int32();break}case 2:{c.country=A.string();break}case 3:{c.gatewayName=A.string();break}case 4:{c.credentialId=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MerchantPaymentPartnerAction)return A;var t=new p.proto.SyncActionValue.MerchantPaymentPartnerAction;switch(A.status){default:if(typeof A.status=="number"){t.status=A.status;break}break;case"ACTIVE":case 0:t.status=0;break;case"INACTIVE":case 1:t.status=1;break}return A.country!=null&&(t.country=String(A.country)),A.gatewayName!=null&&(t.gatewayName=String(A.gatewayName)),A.credentialId!=null&&(t.credentialId=String(A.credentialId)),t},i.toObject=function(A,t){t||(t={});var s={};return t.defaults&&(s.status=t.enums===String?"ACTIVE":0,s.country=""),A.status!=null&&A.hasOwnProperty("status")&&(s.status=t.enums===String?p.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]===void 0?A.status:p.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]:A.status),A.country!=null&&A.hasOwnProperty("country")&&(s.country=A.country),A.gatewayName!=null&&A.hasOwnProperty("gatewayName")&&(s.gatewayName=A.gatewayName,t.oneofs&&(s._gatewayName="gatewayName")),A.credentialId!=null&&A.hasOwnProperty("credentialId")&&(s.credentialId=A.credentialId,t.oneofs&&(s._credentialId="credentialId")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MerchantPaymentPartnerAction"},i.Status=(function(){let a={},A=Object.create(a);return A[a[0]="ACTIVE"]=0,A[a[1]="INACTIVE"]=1,A})(),i})(),r.MusicUserIdAction=(function(){function i(a){if(this.musicUserIdMap={},a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.musicUserId=A.string();break}case 2:{c.musicUserIdMap===l.emptyObject&&(c.musicUserIdMap={});var f=A.uint32()+A.pos;for(I="",d="";A.pos>>3){case 1:I=A.string();break;case 2:d=A.string();break;default:A.skipType(Q&7);break}}c.musicUserIdMap[I]=d;break}default:A.skipType(B&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MusicUserIdAction)return A;var t=new p.proto.SyncActionValue.MusicUserIdAction;if(A.musicUserId!=null&&(t.musicUserId=String(A.musicUserId)),A.musicUserIdMap){if(typeof A.musicUserIdMap!="object")throw TypeError(".proto.SyncActionValue.MusicUserIdAction.musicUserIdMap: object expected");t.musicUserIdMap={};for(var s=Object.keys(A.musicUserIdMap),g=0;g>>3){case 1:{c.muted=A.bool();break}case 2:{c.muteEndTimestamp=A.int64();break}case 3:{c.autoMuted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.MuteAction)return A;var t=new p.proto.SyncActionValue.MuteAction;return A.muted!=null&&(t.muted=!!A.muted),A.muteEndTimestamp!=null&&(l.Long?(t.muteEndTimestamp=l.Long.fromValue(A.muteEndTimestamp)).unsigned=!1:typeof A.muteEndTimestamp=="string"?t.muteEndTimestamp=parseInt(A.muteEndTimestamp,10):typeof A.muteEndTimestamp=="number"?t.muteEndTimestamp=A.muteEndTimestamp:typeof A.muteEndTimestamp=="object"&&(t.muteEndTimestamp=new l.LongBits(A.muteEndTimestamp.low>>>0,A.muteEndTimestamp.high>>>0).toNumber())),A.autoMuted!=null&&(t.autoMuted=!!A.autoMuted),t},i.toObject=function(A,t){t||(t={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,t.oneofs&&(s._muted="muted")),A.muteEndTimestamp!=null&&A.hasOwnProperty("muteEndTimestamp")&&(typeof A.muteEndTimestamp=="number"?s.muteEndTimestamp=t.longs===String?String(A.muteEndTimestamp):A.muteEndTimestamp:s.muteEndTimestamp=t.longs===String?oe(A.muteEndTimestamp):t.longs===Number?ne(A.muteEndTimestamp):A.muteEndTimestamp,t.oneofs&&(s._muteEndTimestamp="muteEndTimestamp")),A.autoMuted!=null&&A.hasOwnProperty("autoMuted")&&(s.autoMuted=A.autoMuted,t.oneofs&&(s._autoMuted="autoMuted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MuteAction"},i})(),r.NewsletterSavedInterestsAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.newsletterSavedInterests=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NewsletterSavedInterestsAction)return A;var t=new p.proto.SyncActionValue.NewsletterSavedInterestsAction;return A.newsletterSavedInterests!=null&&(t.newsletterSavedInterests=String(A.newsletterSavedInterests)),t},i.toObject=function(A,t){t||(t={});var s={};return A.newsletterSavedInterests!=null&&A.hasOwnProperty("newsletterSavedInterests")&&(s.newsletterSavedInterests=A.newsletterSavedInterests,t.oneofs&&(s._newsletterSavedInterests="newsletterSavedInterests")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NewsletterSavedInterestsAction"},i})(),r.NoteEditAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.type=A.int32();break}case 2:{c.chatJid=A.string();break}case 3:{c.createdAt=A.int64();break}case 4:{c.deleted=A.bool();break}case 5:{c.unstructuredContent=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NoteEditAction)return A;var t=new p.proto.SyncActionValue.NoteEditAction;switch(A.type){default:if(typeof A.type=="number"){t.type=A.type;break}break;case"UNSTRUCTURED":case 1:t.type=1;break;case"STRUCTURED":case 2:t.type=2;break}return A.chatJid!=null&&(t.chatJid=String(A.chatJid)),A.createdAt!=null&&(l.Long?(t.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?t.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?t.createdAt=A.createdAt:typeof A.createdAt=="object"&&(t.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.deleted!=null&&(t.deleted=!!A.deleted),A.unstructuredContent!=null&&(t.unstructuredContent=String(A.unstructuredContent)),t},i.toObject=function(A,t){t||(t={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=t.enums===String?p.proto.SyncActionValue.NoteEditAction.NoteType[A.type]===void 0?A.type:p.proto.SyncActionValue.NoteEditAction.NoteType[A.type]:A.type,t.oneofs&&(s._type="type")),A.chatJid!=null&&A.hasOwnProperty("chatJid")&&(s.chatJid=A.chatJid,t.oneofs&&(s._chatJid="chatJid")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=t.longs===String?String(A.createdAt):A.createdAt:s.createdAt=t.longs===String?oe(A.createdAt):t.longs===Number?ne(A.createdAt):A.createdAt,t.oneofs&&(s._createdAt="createdAt")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,t.oneofs&&(s._deleted="deleted")),A.unstructuredContent!=null&&A.hasOwnProperty("unstructuredContent")&&(s.unstructuredContent=A.unstructuredContent,t.oneofs&&(s._unstructuredContent="unstructuredContent")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NoteEditAction"},i.NoteType=(function(){let a={},A=Object.create(a);return A[a[1]="UNSTRUCTURED"]=1,A[a[2]="STRUCTURED"]=2,A})(),i})(),r.NotificationActivitySettingAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.notificationActivitySetting=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NotificationActivitySettingAction)return A;var t=new p.proto.SyncActionValue.NotificationActivitySettingAction;switch(A.notificationActivitySetting){default:if(typeof A.notificationActivitySetting=="number"){t.notificationActivitySetting=A.notificationActivitySetting;break}break;case"DEFAULT_ALL_MESSAGES":case 0:t.notificationActivitySetting=0;break;case"ALL_MESSAGES":case 1:t.notificationActivitySetting=1;break;case"HIGHLIGHTS":case 2:t.notificationActivitySetting=2;break;case"DEFAULT_HIGHLIGHTS":case 3:t.notificationActivitySetting=3;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.notificationActivitySetting!=null&&A.hasOwnProperty("notificationActivitySetting")&&(s.notificationActivitySetting=t.enums===String?p.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]===void 0?A.notificationActivitySetting:p.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]:A.notificationActivitySetting,t.oneofs&&(s._notificationActivitySetting="notificationActivitySetting")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NotificationActivitySettingAction"},i.NotificationActivitySetting=(function(){let a={},A=Object.create(a);return A[a[0]="DEFAULT_ALL_MESSAGES"]=0,A[a[1]="ALL_MESSAGES"]=1,A[a[2]="HIGHLIGHTS"]=2,A[a[3]="DEFAULT_HIGHLIGHTS"]=3,A})(),i})(),r.NuxAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.acknowledged=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.NuxAction)return A;var t=new p.proto.SyncActionValue.NuxAction;return A.acknowledged!=null&&(t.acknowledged=!!A.acknowledged),t},i.toObject=function(A,t){t||(t={});var s={};return A.acknowledged!=null&&A.hasOwnProperty("acknowledged")&&(s.acknowledged=A.acknowledged,t.oneofs&&(s._acknowledged="acknowledged")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NuxAction"},i})(),r.PaymentInfoAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.cpi=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PaymentInfoAction)return A;var t=new p.proto.SyncActionValue.PaymentInfoAction;return A.cpi!=null&&(t.cpi=String(A.cpi)),t},i.toObject=function(A,t){t||(t={});var s={};return A.cpi!=null&&A.hasOwnProperty("cpi")&&(s.cpi=A.cpi,t.oneofs&&(s._cpi="cpi")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PaymentInfoAction"},i})(),r.PaymentTosAction=(function(){function i(e){if(e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.paymentNotice=a.int32();break}case 2:{g.accepted=a.bool();break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.PaymentTosAction)return a;var A=new p.proto.SyncActionValue.PaymentTosAction;switch(a.paymentNotice){default:if(typeof a.paymentNotice=="number"){A.paymentNotice=a.paymentNotice;break}break;case"BR_PAY_PRIVACY_POLICY":case 0:A.paymentNotice=0;break}return a.accepted!=null&&(A.accepted=!!a.accepted),A},i.toObject=function(a,A){A||(A={});var t={};return A.defaults&&(t.paymentNotice=A.enums===String?"BR_PAY_PRIVACY_POLICY":0,t.accepted=!1),a.paymentNotice!=null&&a.hasOwnProperty("paymentNotice")&&(t.paymentNotice=A.enums===String?p.proto.SyncActionValue.PaymentTosAction.PaymentNotice[a.paymentNotice]===void 0?a.paymentNotice:p.proto.SyncActionValue.PaymentTosAction.PaymentNotice[a.paymentNotice]:a.paymentNotice),a.accepted!=null&&a.hasOwnProperty("accepted")&&(t.accepted=a.accepted),t},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.SyncActionValue.PaymentTosAction"},i.PaymentNotice=(function(){let e={},a=Object.create(e);return a[e[0]="BR_PAY_PRIVACY_POLICY"]=0,a})(),i})(),r.PinAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.pinned=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PinAction)return A;var t=new p.proto.SyncActionValue.PinAction;return A.pinned!=null&&(t.pinned=!!A.pinned),t},i.toObject=function(A,t){t||(t={});var s={};return A.pinned!=null&&A.hasOwnProperty("pinned")&&(s.pinned=A.pinned,t.oneofs&&(s._pinned="pinned")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PinAction"},i})(),r.PnForLidChatAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PnForLidChatAction)return A;var t=new p.proto.SyncActionValue.PnForLidChatAction;return A.pnJid!=null&&(t.pnJid=String(A.pnJid)),t},i.toObject=function(A,t){t||(t={});var s={};return A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,t.oneofs&&(s._pnJid="pnJid")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PnForLidChatAction"},i})(),r.PrimaryFeature=(function(){function i(e){if(this.flags=[],e)for(var a=Object.keys(e),A=0;A>>3){case 1:{g.flags&&g.flags.length||(g.flags=[]),g.flags.push(a.string());break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.PrimaryFeature)return a;var A=new p.proto.SyncActionValue.PrimaryFeature;if(a.flags){if(!Array.isArray(a.flags))throw TypeError(".proto.SyncActionValue.PrimaryFeature.flags: array expected");A.flags=[];for(var t=0;t>>3){case 1:{c.version=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrimaryVersionAction)return A;var t=new p.proto.SyncActionValue.PrimaryVersionAction;return A.version!=null&&(t.version=String(A.version)),t},i.toObject=function(A,t){t||(t={});var s={};return A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,t.oneofs&&(s._version="version")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrimaryVersionAction"},i})(),r.PrivacySettingChannelsPersonalisedRecommendationAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.isUserOptedOut=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction)return A;var t=new p.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction;return A.isUserOptedOut!=null&&(t.isUserOptedOut=!!A.isUserOptedOut),t},i.toObject=function(A,t){t||(t={});var s={};return A.isUserOptedOut!=null&&A.hasOwnProperty("isUserOptedOut")&&(s.isUserOptedOut=A.isUserOptedOut,t.oneofs&&(s._isUserOptedOut="isUserOptedOut")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction"},i})(),r.PrivacySettingDisableLinkPreviewsAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.isPreviewsDisabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction)return A;var t=new p.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction;return A.isPreviewsDisabled!=null&&(t.isPreviewsDisabled=!!A.isPreviewsDisabled),t},i.toObject=function(A,t){t||(t={});var s={};return A.isPreviewsDisabled!=null&&A.hasOwnProperty("isPreviewsDisabled")&&(s.isPreviewsDisabled=A.isPreviewsDisabled,t.oneofs&&(s._isPreviewsDisabled="isPreviewsDisabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction"},i})(),r.PrivacySettingRelayAllCalls=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivacySettingRelayAllCalls)return A;var t=new p.proto.SyncActionValue.PrivacySettingRelayAllCalls;return A.isEnabled!=null&&(t.isEnabled=!!A.isEnabled),t},i.toObject=function(A,t){t||(t={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,t.oneofs&&(s._isEnabled="isEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingRelayAllCalls"},i})(),r.PrivateProcessingSettingAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.privateProcessingStatus=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PrivateProcessingSettingAction)return A;var t=new p.proto.SyncActionValue.PrivateProcessingSettingAction;switch(A.privateProcessingStatus){default:if(typeof A.privateProcessingStatus=="number"){t.privateProcessingStatus=A.privateProcessingStatus;break}break;case"UNDEFINED":case 0:t.privateProcessingStatus=0;break;case"ENABLED":case 1:t.privateProcessingStatus=1;break;case"DISABLED":case 2:t.privateProcessingStatus=2;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.privateProcessingStatus!=null&&A.hasOwnProperty("privateProcessingStatus")&&(s.privateProcessingStatus=t.enums===String?p.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]===void 0?A.privateProcessingStatus:p.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]:A.privateProcessingStatus,t.oneofs&&(s._privateProcessingStatus="privateProcessingStatus")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivateProcessingSettingAction"},i.PrivateProcessingStatus=(function(){let a={},A=Object.create(a);return A[a[0]="UNDEFINED"]=0,A[a[1]="ENABLED"]=1,A[a[2]="DISABLED"]=2,A})(),i})(),r.PushNameSetting=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.name=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.PushNameSetting)return A;var t=new p.proto.SyncActionValue.PushNameSetting;return A.name!=null&&(t.name=String(A.name)),t},i.toObject=function(A,t){t||(t={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,t.oneofs&&(s._name="name")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PushNameSetting"},i})(),r.QuickReplyAction=(function(){function i(a){if(this.keywords=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.shortcut=A.string();break}case 2:{c.message=A.string();break}case 3:{c.keywords&&c.keywords.length||(c.keywords=[]),c.keywords.push(A.string());break}case 4:{c.count=A.int32();break}case 5:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.QuickReplyAction)return A;var t=new p.proto.SyncActionValue.QuickReplyAction;if(A.shortcut!=null&&(t.shortcut=String(A.shortcut)),A.message!=null&&(t.message=String(A.message)),A.keywords){if(!Array.isArray(A.keywords))throw TypeError(".proto.SyncActionValue.QuickReplyAction.keywords: array expected");t.keywords=[];for(var s=0;s>>3){case 1:{g.weights&&g.weights.length||(g.weights=[]),g.weights.push(p.proto.RecentEmojiWeight.decode(a,a.uint32()));break}default:a.skipType(c&7);break}}return g},i.fromObject=function(a){if(a instanceof p.proto.SyncActionValue.RecentEmojiWeightsAction)return a;var A=new p.proto.SyncActionValue.RecentEmojiWeightsAction;if(a.weights){if(!Array.isArray(a.weights))throw TypeError(".proto.SyncActionValue.RecentEmojiWeightsAction.weights: array expected");A.weights=[];for(var t=0;t>>3){case 1:{c.lastStickerSentTs=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.RemoveRecentStickerAction)return A;var t=new p.proto.SyncActionValue.RemoveRecentStickerAction;return A.lastStickerSentTs!=null&&(l.Long?(t.lastStickerSentTs=l.Long.fromValue(A.lastStickerSentTs)).unsigned=!1:typeof A.lastStickerSentTs=="string"?t.lastStickerSentTs=parseInt(A.lastStickerSentTs,10):typeof A.lastStickerSentTs=="number"?t.lastStickerSentTs=A.lastStickerSentTs:typeof A.lastStickerSentTs=="object"&&(t.lastStickerSentTs=new l.LongBits(A.lastStickerSentTs.low>>>0,A.lastStickerSentTs.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.lastStickerSentTs!=null&&A.hasOwnProperty("lastStickerSentTs")&&(typeof A.lastStickerSentTs=="number"?s.lastStickerSentTs=t.longs===String?String(A.lastStickerSentTs):A.lastStickerSentTs:s.lastStickerSentTs=t.longs===String?oe(A.lastStickerSentTs):t.longs===Number?ne(A.lastStickerSentTs):A.lastStickerSentTs,t.oneofs&&(s._lastStickerSentTs="lastStickerSentTs")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.RemoveRecentStickerAction"},i})(),r.StarAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.starred=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StarAction)return A;var t=new p.proto.SyncActionValue.StarAction;return A.starred!=null&&(t.starred=!!A.starred),t},i.toObject=function(A,t){t||(t={});var s={};return A.starred!=null&&A.hasOwnProperty("starred")&&(s.starred=A.starred,t.oneofs&&(s._starred="starred")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StarAction"},i})(),r.StatusPostOptInNotificationPreferencesAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.enabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction)return A;var t=new p.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction;return A.enabled!=null&&(t.enabled=!!A.enabled),t},i.toObject=function(A,t){t||(t={});var s={};return A.enabled!=null&&A.hasOwnProperty("enabled")&&(s.enabled=A.enabled,t.oneofs&&(s._enabled="enabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction"},i})(),r.StatusPrivacyAction=(function(){function i(a){if(this.userJid=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.mode=A.int32();break}case 2:{c.userJid&&c.userJid.length||(c.userJid=[]),c.userJid.push(A.string());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StatusPrivacyAction)return A;var t=new p.proto.SyncActionValue.StatusPrivacyAction;switch(A.mode){default:if(typeof A.mode=="number"){t.mode=A.mode;break}break;case"ALLOW_LIST":case 0:t.mode=0;break;case"DENY_LIST":case 1:t.mode=1;break;case"CONTACTS":case 2:t.mode=2;break;case"CLOSE_FRIENDS":case 3:t.mode=3;break}if(A.userJid){if(!Array.isArray(A.userJid))throw TypeError(".proto.SyncActionValue.StatusPrivacyAction.userJid: array expected");t.userJid=[];for(var s=0;s>>3){case 1:{c.url=A.string();break}case 2:{c.fileEncSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.mimetype=A.string();break}case 5:{c.height=A.uint32();break}case 6:{c.width=A.uint32();break}case 7:{c.directPath=A.string();break}case 8:{c.fileLength=A.uint64();break}case 9:{c.isFavorite=A.bool();break}case 10:{c.deviceIdHint=A.uint32();break}case 11:{c.isLottie=A.bool();break}case 12:{c.imageHash=A.string();break}case 13:{c.isAvatarSticker=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.StickerAction)return A;var t=new p.proto.SyncActionValue.StickerAction;return A.url!=null&&(t.url=String(A.url)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,t.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(t.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,t.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(t.mediaKey=A.mediaKey)),A.mimetype!=null&&(t.mimetype=String(A.mimetype)),A.height!=null&&(t.height=A.height>>>0),A.width!=null&&(t.width=A.width>>>0),A.directPath!=null&&(t.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(t.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?t.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?t.fileLength=A.fileLength:typeof A.fileLength=="object"&&(t.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.isFavorite!=null&&(t.isFavorite=!!A.isFavorite),A.deviceIdHint!=null&&(t.deviceIdHint=A.deviceIdHint>>>0),A.isLottie!=null&&(t.isLottie=!!A.isLottie),A.imageHash!=null&&(t.imageHash=String(A.imageHash)),A.isAvatarSticker!=null&&(t.isAvatarSticker=!!A.isAvatarSticker),t},i.toObject=function(A,t){t||(t={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,t.oneofs&&(s._url="url")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=t.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):t.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,t.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=t.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):t.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,t.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,t.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,t.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,t.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,t.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=t.longs===String?String(A.fileLength):A.fileLength:s.fileLength=t.longs===String?oe(A.fileLength,!0):t.longs===Number?ne(A.fileLength,!0):A.fileLength,t.oneofs&&(s._fileLength="fileLength")),A.isFavorite!=null&&A.hasOwnProperty("isFavorite")&&(s.isFavorite=A.isFavorite,t.oneofs&&(s._isFavorite="isFavorite")),A.deviceIdHint!=null&&A.hasOwnProperty("deviceIdHint")&&(s.deviceIdHint=A.deviceIdHint,t.oneofs&&(s._deviceIdHint="deviceIdHint")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,t.oneofs&&(s._isLottie="isLottie")),A.imageHash!=null&&A.hasOwnProperty("imageHash")&&(s.imageHash=A.imageHash,t.oneofs&&(s._imageHash="imageHash")),A.isAvatarSticker!=null&&A.hasOwnProperty("isAvatarSticker")&&(s.isAvatarSticker=A.isAvatarSticker,t.oneofs&&(s._isAvatarSticker="isAvatarSticker")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StickerAction"},i})(),r.SubscriptionAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.isDeactivated=A.bool();break}case 2:{c.isAutoRenewing=A.bool();break}case 3:{c.expirationDate=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.SubscriptionAction)return A;var t=new p.proto.SyncActionValue.SubscriptionAction;return A.isDeactivated!=null&&(t.isDeactivated=!!A.isDeactivated),A.isAutoRenewing!=null&&(t.isAutoRenewing=!!A.isAutoRenewing),A.expirationDate!=null&&(l.Long?(t.expirationDate=l.Long.fromValue(A.expirationDate)).unsigned=!1:typeof A.expirationDate=="string"?t.expirationDate=parseInt(A.expirationDate,10):typeof A.expirationDate=="number"?t.expirationDate=A.expirationDate:typeof A.expirationDate=="object"&&(t.expirationDate=new l.LongBits(A.expirationDate.low>>>0,A.expirationDate.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.isDeactivated!=null&&A.hasOwnProperty("isDeactivated")&&(s.isDeactivated=A.isDeactivated,t.oneofs&&(s._isDeactivated="isDeactivated")),A.isAutoRenewing!=null&&A.hasOwnProperty("isAutoRenewing")&&(s.isAutoRenewing=A.isAutoRenewing,t.oneofs&&(s._isAutoRenewing="isAutoRenewing")),A.expirationDate!=null&&A.hasOwnProperty("expirationDate")&&(typeof A.expirationDate=="number"?s.expirationDate=t.longs===String?String(A.expirationDate):A.expirationDate:s.expirationDate=t.longs===String?oe(A.expirationDate):t.longs===Number?ne(A.expirationDate):A.expirationDate,t.oneofs&&(s._expirationDate="expirationDate")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SubscriptionAction"},i})(),r.SyncActionMessage=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.key=p.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.SyncActionMessage)return A;var t=new p.proto.SyncActionValue.SyncActionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.SyncActionValue.SyncActionMessage.key: object expected");t.key=p.proto.MessageKey.fromObject(A.key)}return A.timestamp!=null&&(l.Long?(t.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?t.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?t.timestamp=A.timestamp:typeof A.timestamp=="object"&&(t.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=p.proto.MessageKey.toObject(A.key,t),t.oneofs&&(s._key="key")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=t.longs===String?String(A.timestamp):A.timestamp:s.timestamp=t.longs===String?oe(A.timestamp):t.longs===Number?ne(A.timestamp):A.timestamp,t.oneofs&&(s._timestamp="timestamp")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SyncActionMessage"},i})(),r.SyncActionMessageRange=(function(){function i(a){if(this.messages=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.lastMessageTimestamp=A.int64();break}case 2:{c.lastSystemMessageTimestamp=A.int64();break}case 3:{c.messages&&c.messages.length||(c.messages=[]),c.messages.push(p.proto.SyncActionValue.SyncActionMessage.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.SyncActionMessageRange)return A;var t=new p.proto.SyncActionValue.SyncActionMessageRange;if(A.lastMessageTimestamp!=null&&(l.Long?(t.lastMessageTimestamp=l.Long.fromValue(A.lastMessageTimestamp)).unsigned=!1:typeof A.lastMessageTimestamp=="string"?t.lastMessageTimestamp=parseInt(A.lastMessageTimestamp,10):typeof A.lastMessageTimestamp=="number"?t.lastMessageTimestamp=A.lastMessageTimestamp:typeof A.lastMessageTimestamp=="object"&&(t.lastMessageTimestamp=new l.LongBits(A.lastMessageTimestamp.low>>>0,A.lastMessageTimestamp.high>>>0).toNumber())),A.lastSystemMessageTimestamp!=null&&(l.Long?(t.lastSystemMessageTimestamp=l.Long.fromValue(A.lastSystemMessageTimestamp)).unsigned=!1:typeof A.lastSystemMessageTimestamp=="string"?t.lastSystemMessageTimestamp=parseInt(A.lastSystemMessageTimestamp,10):typeof A.lastSystemMessageTimestamp=="number"?t.lastSystemMessageTimestamp=A.lastSystemMessageTimestamp:typeof A.lastSystemMessageTimestamp=="object"&&(t.lastSystemMessageTimestamp=new l.LongBits(A.lastSystemMessageTimestamp.low>>>0,A.lastSystemMessageTimestamp.high>>>0).toNumber())),A.messages){if(!Array.isArray(A.messages))throw TypeError(".proto.SyncActionValue.SyncActionMessageRange.messages: array expected");t.messages=[];for(var s=0;s>>3){case 1:{c.isTwentyFourHourFormatEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.TimeFormatAction)return A;var t=new p.proto.SyncActionValue.TimeFormatAction;return A.isTwentyFourHourFormatEnabled!=null&&(t.isTwentyFourHourFormatEnabled=!!A.isTwentyFourHourFormatEnabled),t},i.toObject=function(A,t){t||(t={});var s={};return A.isTwentyFourHourFormatEnabled!=null&&A.hasOwnProperty("isTwentyFourHourFormatEnabled")&&(s.isTwentyFourHourFormatEnabled=A.isTwentyFourHourFormatEnabled,t.oneofs&&(s._isTwentyFourHourFormatEnabled="isTwentyFourHourFormatEnabled")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.TimeFormatAction"},i})(),r.UGCBot=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.definition=A.bytes();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UGCBot)return A;var t=new p.proto.SyncActionValue.UGCBot;return A.definition!=null&&(typeof A.definition=="string"?l.base64.decode(A.definition,t.definition=l.newBuffer(l.base64.length(A.definition)),0):A.definition.length>=0&&(t.definition=A.definition)),t},i.toObject=function(A,t){t||(t={});var s={};return A.definition!=null&&A.hasOwnProperty("definition")&&(s.definition=t.bytes===String?l.base64.encode(A.definition,0,A.definition.length):t.bytes===Array?Array.prototype.slice.call(A.definition):A.definition,t.oneofs&&(s._definition="definition")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UGCBot"},i})(),r.UnarchiveChatsSetting=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.unarchiveChats=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UnarchiveChatsSetting)return A;var t=new p.proto.SyncActionValue.UnarchiveChatsSetting;return A.unarchiveChats!=null&&(t.unarchiveChats=!!A.unarchiveChats),t},i.toObject=function(A,t){t||(t={});var s={};return A.unarchiveChats!=null&&A.hasOwnProperty("unarchiveChats")&&(s.unarchiveChats=A.unarchiveChats,t.oneofs&&(s._unarchiveChats="unarchiveChats")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UnarchiveChatsSetting"},i})(),r.UserStatusMuteAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.muted=A.bool();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UserStatusMuteAction)return A;var t=new p.proto.SyncActionValue.UserStatusMuteAction;return A.muted!=null&&(t.muted=!!A.muted),t},i.toObject=function(A,t){t||(t={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,t.oneofs&&(s._muted="muted")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UserStatusMuteAction"},i})(),r.UsernameChatStartModeAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.chatStartMode=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.UsernameChatStartModeAction)return A;var t=new p.proto.SyncActionValue.UsernameChatStartModeAction;switch(A.chatStartMode){default:if(typeof A.chatStartMode=="number"){t.chatStartMode=A.chatStartMode;break}break;case"LID":case 1:t.chatStartMode=1;break;case"PN":case 2:t.chatStartMode=2;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.chatStartMode!=null&&A.hasOwnProperty("chatStartMode")&&(s.chatStartMode=t.enums===String?p.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]===void 0?A.chatStartMode:p.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]:A.chatStartMode,t.oneofs&&(s._chatStartMode="chatStartMode")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UsernameChatStartModeAction"},i.ChatStartMode=(function(){let a={},A=Object.create(a);return A[a[1]="LID"]=1,A[a[2]="PN"]=2,A})(),i})(),r.WaffleAccountLinkStateAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 2:{c.linkState=A.int32();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.WaffleAccountLinkStateAction)return A;var t=new p.proto.SyncActionValue.WaffleAccountLinkStateAction;switch(A.linkState){default:if(typeof A.linkState=="number"){t.linkState=A.linkState;break}break;case"ACTIVE":case 0:t.linkState=0;break;case"PAUSED":case 1:t.linkState=1;break;case"UNLINKED":case 2:t.linkState=2;break}return t},i.toObject=function(A,t){t||(t={});var s={};return A.linkState!=null&&A.hasOwnProperty("linkState")&&(s.linkState=t.enums===String?p.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]===void 0?A.linkState:p.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]:A.linkState,t.oneofs&&(s._linkState="linkState")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WaffleAccountLinkStateAction"},i.AccountLinkState=(function(){let a={},A=Object.create(a);return A[a[0]="ACTIVE"]=0,A[a[1]="PAUSED"]=1,A[a[2]="UNLINKED"]=2,A})(),i})(),r.WamoUserIdentifierAction=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.identifier=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.SyncActionValue.WamoUserIdentifierAction)return A;var t=new p.proto.SyncActionValue.WamoUserIdentifierAction;return A.identifier!=null&&(t.identifier=String(A.identifier)),t},i.toObject=function(A,t){t||(t={});var s={};return A.identifier!=null&&A.hasOwnProperty("identifier")&&(s.identifier=A.identifier,t.oneofs&&(s._identifier="identifier")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WamoUserIdentifierAction"},i})(),r})(),n.SyncdIndex=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SyncdIndex)return e;var a=new p.proto.SyncdIndex;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,a.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(a.blob=e.blob)),a},r.toObject=function(e,a){a||(a={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=a.bytes===String?l.base64.encode(e.blob,0,e.blob.length):a.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,a.oneofs&&(A._blob="blob")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdIndex"},r})(),n.SyncdMutation=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.operation=e.int32();break}case 2:{s.record=p.proto.SyncdRecord.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SyncdMutation)return e;var a=new p.proto.SyncdMutation;switch(e.operation){default:if(typeof e.operation=="number"){a.operation=e.operation;break}break;case"SET":case 0:a.operation=0;break;case"REMOVE":case 1:a.operation=1;break}if(e.record!=null){if(typeof e.record!="object")throw TypeError(".proto.SyncdMutation.record: object expected");a.record=p.proto.SyncdRecord.fromObject(e.record)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.operation!=null&&e.hasOwnProperty("operation")&&(A.operation=a.enums===String?p.proto.SyncdMutation.SyncdOperation[e.operation]===void 0?e.operation:p.proto.SyncdMutation.SyncdOperation[e.operation]:e.operation,a.oneofs&&(A._operation="operation")),e.record!=null&&e.hasOwnProperty("record")&&(A.record=p.proto.SyncdRecord.toObject(e.record,a),a.oneofs&&(A._record="record")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdMutation"},r.SyncdOperation=(function(){let i={},e=Object.create(i);return e[i[0]="SET"]=0,e[i[1]="REMOVE"]=1,e})(),r})(),n.SyncdMutations=(function(){function r(o){if(this.mutations=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{t.mutations&&t.mutations.length||(t.mutations=[]),t.mutations.push(p.proto.SyncdMutation.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.SyncdMutations)return i;var e=new p.proto.SyncdMutations;if(i.mutations){if(!Array.isArray(i.mutations))throw TypeError(".proto.SyncdMutations.mutations: array expected");e.mutations=[];for(var a=0;a>>3){case 1:{s.version=p.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.mutations&&s.mutations.length||(s.mutations=[]),s.mutations.push(p.proto.SyncdMutation.decode(e,e.uint32()));break}case 3:{s.externalMutations=p.proto.ExternalBlobReference.decode(e,e.uint32());break}case 4:{s.snapshotMac=e.bytes();break}case 5:{s.patchMac=e.bytes();break}case 6:{s.keyId=p.proto.KeyId.decode(e,e.uint32());break}case 7:{s.exitCode=p.proto.ExitCode.decode(e,e.uint32());break}case 8:{s.deviceIndex=e.uint32();break}case 9:{s.clientDebugData=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SyncdPatch)return e;var a=new p.proto.SyncdPatch;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdPatch.version: object expected");a.version=p.proto.SyncdVersion.fromObject(e.version)}if(e.mutations){if(!Array.isArray(e.mutations))throw TypeError(".proto.SyncdPatch.mutations: array expected");a.mutations=[];for(var A=0;A=0&&(a.snapshotMac=e.snapshotMac)),e.patchMac!=null&&(typeof e.patchMac=="string"?l.base64.decode(e.patchMac,a.patchMac=l.newBuffer(l.base64.length(e.patchMac)),0):e.patchMac.length>=0&&(a.patchMac=e.patchMac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdPatch.keyId: object expected");a.keyId=p.proto.KeyId.fromObject(e.keyId)}if(e.exitCode!=null){if(typeof e.exitCode!="object")throw TypeError(".proto.SyncdPatch.exitCode: object expected");a.exitCode=p.proto.ExitCode.fromObject(e.exitCode)}return e.deviceIndex!=null&&(a.deviceIndex=e.deviceIndex>>>0),e.clientDebugData!=null&&(typeof e.clientDebugData=="string"?l.base64.decode(e.clientDebugData,a.clientDebugData=l.newBuffer(l.base64.length(e.clientDebugData)),0):e.clientDebugData.length>=0&&(a.clientDebugData=e.clientDebugData)),a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.mutations=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=p.proto.SyncdVersion.toObject(e.version,a),a.oneofs&&(A._version="version")),e.mutations&&e.mutations.length){A.mutations=[];for(var t=0;t>>3){case 1:{s.index=p.proto.SyncdIndex.decode(e,e.uint32());break}case 2:{s.value=p.proto.SyncdValue.decode(e,e.uint32());break}case 3:{s.keyId=p.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SyncdRecord)return e;var a=new p.proto.SyncdRecord;if(e.index!=null){if(typeof e.index!="object")throw TypeError(".proto.SyncdRecord.index: object expected");a.index=p.proto.SyncdIndex.fromObject(e.index)}if(e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncdRecord.value: object expected");a.value=p.proto.SyncdValue.fromObject(e.value)}if(e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdRecord.keyId: object expected");a.keyId=p.proto.KeyId.fromObject(e.keyId)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=p.proto.SyncdIndex.toObject(e.index,a),a.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=p.proto.SyncdValue.toObject(e.value,a),a.oneofs&&(A._value="value")),e.keyId!=null&&e.hasOwnProperty("keyId")&&(A.keyId=p.proto.KeyId.toObject(e.keyId,a),a.oneofs&&(A._keyId="keyId")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdRecord"},r})(),n.SyncdSnapshot=(function(){function r(i){if(this.records=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.version=p.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.records&&s.records.length||(s.records=[]),s.records.push(p.proto.SyncdRecord.decode(e,e.uint32()));break}case 3:{s.mac=e.bytes();break}case 4:{s.keyId=p.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SyncdSnapshot)return e;var a=new p.proto.SyncdSnapshot;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdSnapshot.version: object expected");a.version=p.proto.SyncdVersion.fromObject(e.version)}if(e.records){if(!Array.isArray(e.records))throw TypeError(".proto.SyncdSnapshot.records: array expected");a.records=[];for(var A=0;A=0&&(a.mac=e.mac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdSnapshot.keyId: object expected");a.keyId=p.proto.KeyId.fromObject(e.keyId)}return a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.records=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=p.proto.SyncdVersion.toObject(e.version,a),a.oneofs&&(A._version="version")),e.records&&e.records.length){A.records=[];for(var t=0;t>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SyncdValue)return e;var a=new p.proto.SyncdValue;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,a.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(a.blob=e.blob)),a},r.toObject=function(e,a){a||(a={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=a.bytes===String?l.base64.encode(e.blob,0,e.blob.length):a.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,a.oneofs&&(A._blob="blob")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdValue"},r})(),n.SyncdVersion=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.version=e.uint64();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.SyncdVersion)return e;var a=new p.proto.SyncdVersion;return e.version!=null&&(l.Long?(a.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?a.version=parseInt(e.version,10):typeof e.version=="number"?a.version=e.version:typeof e.version=="object"&&(a.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),a},r.toObject=function(e,a){a||(a={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=a.longs===String?String(e.version):e.version:A.version=a.longs===String?oe(e.version,!0):a.longs===Number?ne(e.version,!0):e.version,a.oneofs&&(A._version="version")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdVersion"},r})(),n.TapLinkAction=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.title=e.string();break}case 2:{s.tapUrl=e.string();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.TapLinkAction)return e;var a=new p.proto.TapLinkAction;return e.title!=null&&(a.title=String(e.title)),e.tapUrl!=null&&(a.tapUrl=String(e.tapUrl)),a},r.toObject=function(e,a){a||(a={});var A={};return e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,a.oneofs&&(A._title="title")),e.tapUrl!=null&&e.hasOwnProperty("tapUrl")&&(A.tapUrl=e.tapUrl,a.oneofs&&(A._tapUrl="tapUrl")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TapLinkAction"},r})(),n.TemplateButton=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=p.proto.TemplateButton.QuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=p.proto.TemplateButton.URLButton.decode(e,e.uint32());break}case 3:{s.callButton=p.proto.TemplateButton.CallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.TemplateButton)return e;var a=new p.proto.TemplateButton;if(e.index!=null&&(a.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.TemplateButton.quickReplyButton: object expected");a.quickReplyButton=p.proto.TemplateButton.QuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.TemplateButton.urlButton: object expected");a.urlButton=p.proto.TemplateButton.URLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.TemplateButton.callButton: object expected");a.callButton=p.proto.TemplateButton.CallButton.fromObject(e.callButton)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=p.proto.TemplateButton.QuickReplyButton.toObject(e.quickReplyButton,a),a.oneofs&&(A.button="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=p.proto.TemplateButton.URLButton.toObject(e.urlButton,a),a.oneofs&&(A.button="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=p.proto.TemplateButton.CallButton.toObject(e.callButton,a),a.oneofs&&(A.button="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,a.oneofs&&(A._index="index")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TemplateButton"},r.CallButton=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.displayText=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.phoneNumber=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.TemplateButton.CallButton)return A;var t=new p.proto.TemplateButton.CallButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.CallButton.displayText: object expected");t.displayText=p.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.phoneNumber!=null){if(typeof A.phoneNumber!="object")throw TypeError(".proto.TemplateButton.CallButton.phoneNumber: object expected");t.phoneNumber=p.proto.Message.HighlyStructuredMessage.fromObject(A.phoneNumber)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=p.proto.Message.HighlyStructuredMessage.toObject(A.displayText,t),t.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=p.proto.Message.HighlyStructuredMessage.toObject(A.phoneNumber,t),t.oneofs&&(s._phoneNumber="phoneNumber")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.CallButton"},i})(),r.QuickReplyButton=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.displayText=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.TemplateButton.QuickReplyButton)return A;var t=new p.proto.TemplateButton.QuickReplyButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.QuickReplyButton.displayText: object expected");t.displayText=p.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}return A.id!=null&&(t.id=String(A.id)),t},i.toObject=function(A,t){t||(t={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=p.proto.Message.HighlyStructuredMessage.toObject(A.displayText,t),t.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,t.oneofs&&(s._id="id")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.QuickReplyButton"},i})(),r.URLButton=(function(){function i(a){if(a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.displayText=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.url=p.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.TemplateButton.URLButton)return A;var t=new p.proto.TemplateButton.URLButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.URLButton.displayText: object expected");t.displayText=p.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.url!=null){if(typeof A.url!="object")throw TypeError(".proto.TemplateButton.URLButton.url: object expected");t.url=p.proto.Message.HighlyStructuredMessage.fromObject(A.url)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=p.proto.Message.HighlyStructuredMessage.toObject(A.displayText,t),t.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=p.proto.Message.HighlyStructuredMessage.toObject(A.url,t),t.oneofs&&(s._url="url")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.URLButton"},i})(),r})(),n.ThreadID=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.threadType=e.int32();break}case 2:{s.threadKey=p.proto.MessageKey.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.ThreadID)return e;var a=new p.proto.ThreadID;switch(e.threadType){default:if(typeof e.threadType=="number"){a.threadType=e.threadType;break}break;case"UNKNOWN":case 0:a.threadType=0;break;case"VIEW_REPLIES":case 1:a.threadType=1;break;case"AI_THREAD":case 2:a.threadType=2;break}if(e.threadKey!=null){if(typeof e.threadKey!="object")throw TypeError(".proto.ThreadID.threadKey: object expected");a.threadKey=p.proto.MessageKey.fromObject(e.threadKey)}return a},r.toObject=function(e,a){a||(a={});var A={};return e.threadType!=null&&e.hasOwnProperty("threadType")&&(A.threadType=a.enums===String?p.proto.ThreadID.ThreadType[e.threadType]===void 0?e.threadType:p.proto.ThreadID.ThreadType[e.threadType]:e.threadType,a.oneofs&&(A._threadType="threadType")),e.threadKey!=null&&e.hasOwnProperty("threadKey")&&(A.threadKey=p.proto.MessageKey.toObject(e.threadKey,a),a.oneofs&&(A._threadKey="threadKey")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ThreadID"},r.ThreadType=(function(){let i={},e=Object.create(i);return e[i[0]="UNKNOWN"]=0,e[i[1]="VIEW_REPLIES"]=1,e[i[2]="AI_THREAD"]=2,e})(),r})(),n.UrlTrackingMap=(function(){function r(o){if(this.urlTrackingMapElements=[],o)for(var i=Object.keys(o),e=0;e>>3){case 1:{t.urlTrackingMapElements&&t.urlTrackingMapElements.length||(t.urlTrackingMapElements=[]),t.urlTrackingMapElements.push(p.proto.UrlTrackingMap.UrlTrackingMapElement.decode(i,i.uint32()));break}default:i.skipType(s&7);break}}return t},r.fromObject=function(i){if(i instanceof p.proto.UrlTrackingMap)return i;var e=new p.proto.UrlTrackingMap;if(i.urlTrackingMapElements){if(!Array.isArray(i.urlTrackingMapElements))throw TypeError(".proto.UrlTrackingMap.urlTrackingMapElements: array expected");e.urlTrackingMapElements=[];for(var a=0;a>>3){case 1:{g.originalUrl=a.string();break}case 2:{g.unconsentedUsersUrl=a.string();break}case 3:{g.consentedUsersUrl=a.string();break}case 4:{g.cardIndex=a.uint32();break}default:a.skipType(c&7);break}}return g},o.fromObject=function(a){if(a instanceof p.proto.UrlTrackingMap.UrlTrackingMapElement)return a;var A=new p.proto.UrlTrackingMap.UrlTrackingMapElement;return a.originalUrl!=null&&(A.originalUrl=String(a.originalUrl)),a.unconsentedUsersUrl!=null&&(A.unconsentedUsersUrl=String(a.unconsentedUsersUrl)),a.consentedUsersUrl!=null&&(A.consentedUsersUrl=String(a.consentedUsersUrl)),a.cardIndex!=null&&(A.cardIndex=a.cardIndex>>>0),A},o.toObject=function(a,A){A||(A={});var t={};return a.originalUrl!=null&&a.hasOwnProperty("originalUrl")&&(t.originalUrl=a.originalUrl,A.oneofs&&(t._originalUrl="originalUrl")),a.unconsentedUsersUrl!=null&&a.hasOwnProperty("unconsentedUsersUrl")&&(t.unconsentedUsersUrl=a.unconsentedUsersUrl,A.oneofs&&(t._unconsentedUsersUrl="unconsentedUsersUrl")),a.consentedUsersUrl!=null&&a.hasOwnProperty("consentedUsersUrl")&&(t.consentedUsersUrl=a.consentedUsersUrl,A.oneofs&&(t._consentedUsersUrl="consentedUsersUrl")),a.cardIndex!=null&&a.hasOwnProperty("cardIndex")&&(t.cardIndex=a.cardIndex,A.oneofs&&(t._cardIndex="cardIndex")),t},o.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.UrlTrackingMap.UrlTrackingMapElement"},o})(),r})(),n.UserPassword=(function(){function r(i){if(this.transformerArg=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.encoding=e.int32();break}case 2:{s.transformer=e.int32();break}case 3:{s.transformerArg&&s.transformerArg.length||(s.transformerArg=[]),s.transformerArg.push(p.proto.UserPassword.TransformerArg.decode(e,e.uint32()));break}case 4:{s.transformedData=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.UserPassword)return e;var a=new p.proto.UserPassword;switch(e.encoding){default:if(typeof e.encoding=="number"){a.encoding=e.encoding;break}break;case"UTF8":case 0:a.encoding=0;break;case"UTF8_BROKEN":case 1:a.encoding=1;break}switch(e.transformer){default:if(typeof e.transformer=="number"){a.transformer=e.transformer;break}break;case"NONE":case 0:a.transformer=0;break;case"PBKDF2_HMAC_SHA512":case 1:a.transformer=1;break;case"PBKDF2_HMAC_SHA384":case 2:a.transformer=2;break}if(e.transformerArg){if(!Array.isArray(e.transformerArg))throw TypeError(".proto.UserPassword.transformerArg: array expected");a.transformerArg=[];for(var A=0;A=0&&(a.transformedData=e.transformedData)),a},r.toObject=function(e,a){a||(a={});var A={};if((a.arrays||a.defaults)&&(A.transformerArg=[]),e.encoding!=null&&e.hasOwnProperty("encoding")&&(A.encoding=a.enums===String?p.proto.UserPassword.Encoding[e.encoding]===void 0?e.encoding:p.proto.UserPassword.Encoding[e.encoding]:e.encoding,a.oneofs&&(A._encoding="encoding")),e.transformer!=null&&e.hasOwnProperty("transformer")&&(A.transformer=a.enums===String?p.proto.UserPassword.Transformer[e.transformer]===void 0?e.transformer:p.proto.UserPassword.Transformer[e.transformer]:e.transformer,a.oneofs&&(A._transformer="transformer")),e.transformerArg&&e.transformerArg.length){A.transformerArg=[];for(var t=0;t>>3){case 1:{c.key=A.string();break}case 2:{c.value=p.proto.UserPassword.TransformerArg.Value.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.UserPassword.TransformerArg)return A;var t=new p.proto.UserPassword.TransformerArg;if(A.key!=null&&(t.key=String(A.key)),A.value!=null){if(typeof A.value!="object")throw TypeError(".proto.UserPassword.TransformerArg.value: object expected");t.value=p.proto.UserPassword.TransformerArg.Value.fromObject(A.value)}return t},i.toObject=function(A,t){t||(t={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=A.key,t.oneofs&&(s._key="key")),A.value!=null&&A.hasOwnProperty("value")&&(s.value=p.proto.UserPassword.TransformerArg.Value.toObject(A.value,t),t.oneofs&&(s._value="value")),s},i.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},i.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.UserPassword.TransformerArg"},i.Value=(function(){function a(t){if(t)for(var s=Object.keys(t),g=0;g>>3){case 1:{d.asBlob=s.bytes();break}case 2:{d.asUnsignedInteger=s.uint32();break}default:s.skipType(B&7);break}}return d},a.fromObject=function(s){if(s instanceof p.proto.UserPassword.TransformerArg.Value)return s;var g=new p.proto.UserPassword.TransformerArg.Value;return s.asBlob!=null&&(typeof s.asBlob=="string"?l.base64.decode(s.asBlob,g.asBlob=l.newBuffer(l.base64.length(s.asBlob)),0):s.asBlob.length>=0&&(g.asBlob=s.asBlob)),s.asUnsignedInteger!=null&&(g.asUnsignedInteger=s.asUnsignedInteger>>>0),g},a.toObject=function(s,g){g||(g={});var c={};return s.asBlob!=null&&s.hasOwnProperty("asBlob")&&(c.asBlob=g.bytes===String?l.base64.encode(s.asBlob,0,s.asBlob.length):g.bytes===Array?Array.prototype.slice.call(s.asBlob):s.asBlob,g.oneofs&&(c.value="asBlob")),s.asUnsignedInteger!=null&&s.hasOwnProperty("asUnsignedInteger")&&(c.asUnsignedInteger=s.asUnsignedInteger,g.oneofs&&(c.value="asUnsignedInteger")),c},a.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},a.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.UserPassword.TransformerArg.Value"},a})(),i})(),r})(),n.UserReceipt=(function(){function r(i){if(this.pendingDeviceJid=[],this.deliveredDeviceJid=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.userJid=e.string();break}case 2:{s.receiptTimestamp=e.int64();break}case 3:{s.readTimestamp=e.int64();break}case 4:{s.playedTimestamp=e.int64();break}case 5:{s.pendingDeviceJid&&s.pendingDeviceJid.length||(s.pendingDeviceJid=[]),s.pendingDeviceJid.push(e.string());break}case 6:{s.deliveredDeviceJid&&s.deliveredDeviceJid.length||(s.deliveredDeviceJid=[]),s.deliveredDeviceJid.push(e.string());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.UserReceipt)return e;var a=new p.proto.UserReceipt;if(e.userJid!=null&&(a.userJid=String(e.userJid)),e.receiptTimestamp!=null&&(l.Long?(a.receiptTimestamp=l.Long.fromValue(e.receiptTimestamp)).unsigned=!1:typeof e.receiptTimestamp=="string"?a.receiptTimestamp=parseInt(e.receiptTimestamp,10):typeof e.receiptTimestamp=="number"?a.receiptTimestamp=e.receiptTimestamp:typeof e.receiptTimestamp=="object"&&(a.receiptTimestamp=new l.LongBits(e.receiptTimestamp.low>>>0,e.receiptTimestamp.high>>>0).toNumber())),e.readTimestamp!=null&&(l.Long?(a.readTimestamp=l.Long.fromValue(e.readTimestamp)).unsigned=!1:typeof e.readTimestamp=="string"?a.readTimestamp=parseInt(e.readTimestamp,10):typeof e.readTimestamp=="number"?a.readTimestamp=e.readTimestamp:typeof e.readTimestamp=="object"&&(a.readTimestamp=new l.LongBits(e.readTimestamp.low>>>0,e.readTimestamp.high>>>0).toNumber())),e.playedTimestamp!=null&&(l.Long?(a.playedTimestamp=l.Long.fromValue(e.playedTimestamp)).unsigned=!1:typeof e.playedTimestamp=="string"?a.playedTimestamp=parseInt(e.playedTimestamp,10):typeof e.playedTimestamp=="number"?a.playedTimestamp=e.playedTimestamp:typeof e.playedTimestamp=="object"&&(a.playedTimestamp=new l.LongBits(e.playedTimestamp.low>>>0,e.playedTimestamp.high>>>0).toNumber())),e.pendingDeviceJid){if(!Array.isArray(e.pendingDeviceJid))throw TypeError(".proto.UserReceipt.pendingDeviceJid: array expected");a.pendingDeviceJid=[];for(var A=0;A>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}case 3:{s.serverSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.VerifiedNameCertificate)return e;var a=new p.proto.VerifiedNameCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,a.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(a.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,a.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(a.signature=e.signature)),e.serverSignature!=null&&(typeof e.serverSignature=="string"?l.base64.decode(e.serverSignature,a.serverSignature=l.newBuffer(l.base64.length(e.serverSignature)),0):e.serverSignature.length>=0&&(a.serverSignature=e.serverSignature)),a},r.toObject=function(e,a){a||(a={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=a.bytes===String?l.base64.encode(e.details,0,e.details.length):a.bytes===Array?Array.prototype.slice.call(e.details):e.details,a.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=a.bytes===String?l.base64.encode(e.signature,0,e.signature.length):a.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,a.oneofs&&(A._signature="signature")),e.serverSignature!=null&&e.hasOwnProperty("serverSignature")&&(A.serverSignature=a.bytes===String?l.base64.encode(e.serverSignature,0,e.serverSignature.length):a.bytes===Array?Array.prototype.slice.call(e.serverSignature):e.serverSignature,a.oneofs&&(A._serverSignature="serverSignature")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.VerifiedNameCertificate"},r.Details=(function(){function i(a){if(this.localizedNames=[],a)for(var A=Object.keys(a),t=0;t>>3){case 1:{c.serial=A.uint64();break}case 2:{c.issuer=A.string();break}case 4:{c.verifiedName=A.string();break}case 8:{c.localizedNames&&c.localizedNames.length||(c.localizedNames=[]),c.localizedNames.push(p.proto.LocalizedName.decode(A,A.uint32()));break}case 10:{c.issueTime=A.uint64();break}default:A.skipType(I&7);break}}return c},i.fromObject=function(A){if(A instanceof p.proto.VerifiedNameCertificate.Details)return A;var t=new p.proto.VerifiedNameCertificate.Details;if(A.serial!=null&&(l.Long?(t.serial=l.Long.fromValue(A.serial)).unsigned=!0:typeof A.serial=="string"?t.serial=parseInt(A.serial,10):typeof A.serial=="number"?t.serial=A.serial:typeof A.serial=="object"&&(t.serial=new l.LongBits(A.serial.low>>>0,A.serial.high>>>0).toNumber(!0))),A.issuer!=null&&(t.issuer=String(A.issuer)),A.verifiedName!=null&&(t.verifiedName=String(A.verifiedName)),A.localizedNames){if(!Array.isArray(A.localizedNames))throw TypeError(".proto.VerifiedNameCertificate.Details.localizedNames: array expected");t.localizedNames=[];for(var s=0;s>>0,A.issueTime.high>>>0).toNumber(!0))),t},i.toObject=function(A,t){t||(t={});var s={};if((t.arrays||t.defaults)&&(s.localizedNames=[]),A.serial!=null&&A.hasOwnProperty("serial")&&(typeof A.serial=="number"?s.serial=t.longs===String?String(A.serial):A.serial:s.serial=t.longs===String?oe(A.serial,!0):t.longs===Number?ne(A.serial,!0):A.serial,t.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,t.oneofs&&(s._issuer="issuer")),A.verifiedName!=null&&A.hasOwnProperty("verifiedName")&&(s.verifiedName=A.verifiedName,t.oneofs&&(s._verifiedName="verifiedName")),A.localizedNames&&A.localizedNames.length){s.localizedNames=[];for(var g=0;g>>3){case 1:{s.filename=e.string();break}case 2:{s.opacity=e.uint32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.WallpaperSettings)return e;var a=new p.proto.WallpaperSettings;return e.filename!=null&&(a.filename=String(e.filename)),e.opacity!=null&&(a.opacity=e.opacity>>>0),a},r.toObject=function(e,a){a||(a={});var A={};return e.filename!=null&&e.hasOwnProperty("filename")&&(A.filename=e.filename,a.oneofs&&(A._filename="filename")),e.opacity!=null&&e.hasOwnProperty("opacity")&&(A.opacity=e.opacity,a.oneofs&&(A._opacity="opacity")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WallpaperSettings"},r})(),n.WebFeatures=(function(){function r(i){if(i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.labelsDisplay=e.int32();break}case 2:{s.voipIndividualOutgoing=e.int32();break}case 3:{s.groupsV3=e.int32();break}case 4:{s.groupsV3Create=e.int32();break}case 5:{s.changeNumberV2=e.int32();break}case 6:{s.queryStatusV3Thumbnail=e.int32();break}case 7:{s.liveLocations=e.int32();break}case 8:{s.queryVname=e.int32();break}case 9:{s.voipIndividualIncoming=e.int32();break}case 10:{s.quickRepliesQuery=e.int32();break}case 11:{s.payments=e.int32();break}case 12:{s.stickerPackQuery=e.int32();break}case 13:{s.liveLocationsFinal=e.int32();break}case 14:{s.labelsEdit=e.int32();break}case 15:{s.mediaUpload=e.int32();break}case 18:{s.mediaUploadRichQuickReplies=e.int32();break}case 19:{s.vnameV2=e.int32();break}case 20:{s.videoPlaybackUrl=e.int32();break}case 21:{s.statusRanking=e.int32();break}case 22:{s.voipIndividualVideo=e.int32();break}case 23:{s.thirdPartyStickers=e.int32();break}case 24:{s.frequentlyForwardedSetting=e.int32();break}case 25:{s.groupsV4JoinPermission=e.int32();break}case 26:{s.recentStickers=e.int32();break}case 27:{s.catalog=e.int32();break}case 28:{s.starredStickers=e.int32();break}case 29:{s.voipGroupCall=e.int32();break}case 30:{s.templateMessage=e.int32();break}case 31:{s.templateMessageInteractivity=e.int32();break}case 32:{s.ephemeralMessages=e.int32();break}case 33:{s.e2ENotificationSync=e.int32();break}case 34:{s.recentStickersV2=e.int32();break}case 36:{s.recentStickersV3=e.int32();break}case 37:{s.userNotice=e.int32();break}case 39:{s.support=e.int32();break}case 40:{s.groupUiiCleanup=e.int32();break}case 41:{s.groupDogfoodingInternalOnly=e.int32();break}case 42:{s.settingsSync=e.int32();break}case 43:{s.archiveV2=e.int32();break}case 44:{s.ephemeralAllowGroupMembers=e.int32();break}case 45:{s.ephemeral24HDuration=e.int32();break}case 46:{s.mdForceUpgrade=e.int32();break}case 47:{s.disappearingMode=e.int32();break}case 48:{s.externalMdOptInAvailable=e.int32();break}case 49:{s.noDeleteMessageTimeLimit=e.int32();break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.WebFeatures)return e;var a=new p.proto.WebFeatures;switch(e.labelsDisplay){default:if(typeof e.labelsDisplay=="number"){a.labelsDisplay=e.labelsDisplay;break}break;case"NOT_STARTED":case 0:a.labelsDisplay=0;break;case"FORCE_UPGRADE":case 1:a.labelsDisplay=1;break;case"DEVELOPMENT":case 2:a.labelsDisplay=2;break;case"PRODUCTION":case 3:a.labelsDisplay=3;break}switch(e.voipIndividualOutgoing){default:if(typeof e.voipIndividualOutgoing=="number"){a.voipIndividualOutgoing=e.voipIndividualOutgoing;break}break;case"NOT_STARTED":case 0:a.voipIndividualOutgoing=0;break;case"FORCE_UPGRADE":case 1:a.voipIndividualOutgoing=1;break;case"DEVELOPMENT":case 2:a.voipIndividualOutgoing=2;break;case"PRODUCTION":case 3:a.voipIndividualOutgoing=3;break}switch(e.groupsV3){default:if(typeof e.groupsV3=="number"){a.groupsV3=e.groupsV3;break}break;case"NOT_STARTED":case 0:a.groupsV3=0;break;case"FORCE_UPGRADE":case 1:a.groupsV3=1;break;case"DEVELOPMENT":case 2:a.groupsV3=2;break;case"PRODUCTION":case 3:a.groupsV3=3;break}switch(e.groupsV3Create){default:if(typeof e.groupsV3Create=="number"){a.groupsV3Create=e.groupsV3Create;break}break;case"NOT_STARTED":case 0:a.groupsV3Create=0;break;case"FORCE_UPGRADE":case 1:a.groupsV3Create=1;break;case"DEVELOPMENT":case 2:a.groupsV3Create=2;break;case"PRODUCTION":case 3:a.groupsV3Create=3;break}switch(e.changeNumberV2){default:if(typeof e.changeNumberV2=="number"){a.changeNumberV2=e.changeNumberV2;break}break;case"NOT_STARTED":case 0:a.changeNumberV2=0;break;case"FORCE_UPGRADE":case 1:a.changeNumberV2=1;break;case"DEVELOPMENT":case 2:a.changeNumberV2=2;break;case"PRODUCTION":case 3:a.changeNumberV2=3;break}switch(e.queryStatusV3Thumbnail){default:if(typeof e.queryStatusV3Thumbnail=="number"){a.queryStatusV3Thumbnail=e.queryStatusV3Thumbnail;break}break;case"NOT_STARTED":case 0:a.queryStatusV3Thumbnail=0;break;case"FORCE_UPGRADE":case 1:a.queryStatusV3Thumbnail=1;break;case"DEVELOPMENT":case 2:a.queryStatusV3Thumbnail=2;break;case"PRODUCTION":case 3:a.queryStatusV3Thumbnail=3;break}switch(e.liveLocations){default:if(typeof e.liveLocations=="number"){a.liveLocations=e.liveLocations;break}break;case"NOT_STARTED":case 0:a.liveLocations=0;break;case"FORCE_UPGRADE":case 1:a.liveLocations=1;break;case"DEVELOPMENT":case 2:a.liveLocations=2;break;case"PRODUCTION":case 3:a.liveLocations=3;break}switch(e.queryVname){default:if(typeof e.queryVname=="number"){a.queryVname=e.queryVname;break}break;case"NOT_STARTED":case 0:a.queryVname=0;break;case"FORCE_UPGRADE":case 1:a.queryVname=1;break;case"DEVELOPMENT":case 2:a.queryVname=2;break;case"PRODUCTION":case 3:a.queryVname=3;break}switch(e.voipIndividualIncoming){default:if(typeof e.voipIndividualIncoming=="number"){a.voipIndividualIncoming=e.voipIndividualIncoming;break}break;case"NOT_STARTED":case 0:a.voipIndividualIncoming=0;break;case"FORCE_UPGRADE":case 1:a.voipIndividualIncoming=1;break;case"DEVELOPMENT":case 2:a.voipIndividualIncoming=2;break;case"PRODUCTION":case 3:a.voipIndividualIncoming=3;break}switch(e.quickRepliesQuery){default:if(typeof e.quickRepliesQuery=="number"){a.quickRepliesQuery=e.quickRepliesQuery;break}break;case"NOT_STARTED":case 0:a.quickRepliesQuery=0;break;case"FORCE_UPGRADE":case 1:a.quickRepliesQuery=1;break;case"DEVELOPMENT":case 2:a.quickRepliesQuery=2;break;case"PRODUCTION":case 3:a.quickRepliesQuery=3;break}switch(e.payments){default:if(typeof e.payments=="number"){a.payments=e.payments;break}break;case"NOT_STARTED":case 0:a.payments=0;break;case"FORCE_UPGRADE":case 1:a.payments=1;break;case"DEVELOPMENT":case 2:a.payments=2;break;case"PRODUCTION":case 3:a.payments=3;break}switch(e.stickerPackQuery){default:if(typeof e.stickerPackQuery=="number"){a.stickerPackQuery=e.stickerPackQuery;break}break;case"NOT_STARTED":case 0:a.stickerPackQuery=0;break;case"FORCE_UPGRADE":case 1:a.stickerPackQuery=1;break;case"DEVELOPMENT":case 2:a.stickerPackQuery=2;break;case"PRODUCTION":case 3:a.stickerPackQuery=3;break}switch(e.liveLocationsFinal){default:if(typeof e.liveLocationsFinal=="number"){a.liveLocationsFinal=e.liveLocationsFinal;break}break;case"NOT_STARTED":case 0:a.liveLocationsFinal=0;break;case"FORCE_UPGRADE":case 1:a.liveLocationsFinal=1;break;case"DEVELOPMENT":case 2:a.liveLocationsFinal=2;break;case"PRODUCTION":case 3:a.liveLocationsFinal=3;break}switch(e.labelsEdit){default:if(typeof e.labelsEdit=="number"){a.labelsEdit=e.labelsEdit;break}break;case"NOT_STARTED":case 0:a.labelsEdit=0;break;case"FORCE_UPGRADE":case 1:a.labelsEdit=1;break;case"DEVELOPMENT":case 2:a.labelsEdit=2;break;case"PRODUCTION":case 3:a.labelsEdit=3;break}switch(e.mediaUpload){default:if(typeof e.mediaUpload=="number"){a.mediaUpload=e.mediaUpload;break}break;case"NOT_STARTED":case 0:a.mediaUpload=0;break;case"FORCE_UPGRADE":case 1:a.mediaUpload=1;break;case"DEVELOPMENT":case 2:a.mediaUpload=2;break;case"PRODUCTION":case 3:a.mediaUpload=3;break}switch(e.mediaUploadRichQuickReplies){default:if(typeof e.mediaUploadRichQuickReplies=="number"){a.mediaUploadRichQuickReplies=e.mediaUploadRichQuickReplies;break}break;case"NOT_STARTED":case 0:a.mediaUploadRichQuickReplies=0;break;case"FORCE_UPGRADE":case 1:a.mediaUploadRichQuickReplies=1;break;case"DEVELOPMENT":case 2:a.mediaUploadRichQuickReplies=2;break;case"PRODUCTION":case 3:a.mediaUploadRichQuickReplies=3;break}switch(e.vnameV2){default:if(typeof e.vnameV2=="number"){a.vnameV2=e.vnameV2;break}break;case"NOT_STARTED":case 0:a.vnameV2=0;break;case"FORCE_UPGRADE":case 1:a.vnameV2=1;break;case"DEVELOPMENT":case 2:a.vnameV2=2;break;case"PRODUCTION":case 3:a.vnameV2=3;break}switch(e.videoPlaybackUrl){default:if(typeof e.videoPlaybackUrl=="number"){a.videoPlaybackUrl=e.videoPlaybackUrl;break}break;case"NOT_STARTED":case 0:a.videoPlaybackUrl=0;break;case"FORCE_UPGRADE":case 1:a.videoPlaybackUrl=1;break;case"DEVELOPMENT":case 2:a.videoPlaybackUrl=2;break;case"PRODUCTION":case 3:a.videoPlaybackUrl=3;break}switch(e.statusRanking){default:if(typeof e.statusRanking=="number"){a.statusRanking=e.statusRanking;break}break;case"NOT_STARTED":case 0:a.statusRanking=0;break;case"FORCE_UPGRADE":case 1:a.statusRanking=1;break;case"DEVELOPMENT":case 2:a.statusRanking=2;break;case"PRODUCTION":case 3:a.statusRanking=3;break}switch(e.voipIndividualVideo){default:if(typeof e.voipIndividualVideo=="number"){a.voipIndividualVideo=e.voipIndividualVideo;break}break;case"NOT_STARTED":case 0:a.voipIndividualVideo=0;break;case"FORCE_UPGRADE":case 1:a.voipIndividualVideo=1;break;case"DEVELOPMENT":case 2:a.voipIndividualVideo=2;break;case"PRODUCTION":case 3:a.voipIndividualVideo=3;break}switch(e.thirdPartyStickers){default:if(typeof e.thirdPartyStickers=="number"){a.thirdPartyStickers=e.thirdPartyStickers;break}break;case"NOT_STARTED":case 0:a.thirdPartyStickers=0;break;case"FORCE_UPGRADE":case 1:a.thirdPartyStickers=1;break;case"DEVELOPMENT":case 2:a.thirdPartyStickers=2;break;case"PRODUCTION":case 3:a.thirdPartyStickers=3;break}switch(e.frequentlyForwardedSetting){default:if(typeof e.frequentlyForwardedSetting=="number"){a.frequentlyForwardedSetting=e.frequentlyForwardedSetting;break}break;case"NOT_STARTED":case 0:a.frequentlyForwardedSetting=0;break;case"FORCE_UPGRADE":case 1:a.frequentlyForwardedSetting=1;break;case"DEVELOPMENT":case 2:a.frequentlyForwardedSetting=2;break;case"PRODUCTION":case 3:a.frequentlyForwardedSetting=3;break}switch(e.groupsV4JoinPermission){default:if(typeof e.groupsV4JoinPermission=="number"){a.groupsV4JoinPermission=e.groupsV4JoinPermission;break}break;case"NOT_STARTED":case 0:a.groupsV4JoinPermission=0;break;case"FORCE_UPGRADE":case 1:a.groupsV4JoinPermission=1;break;case"DEVELOPMENT":case 2:a.groupsV4JoinPermission=2;break;case"PRODUCTION":case 3:a.groupsV4JoinPermission=3;break}switch(e.recentStickers){default:if(typeof e.recentStickers=="number"){a.recentStickers=e.recentStickers;break}break;case"NOT_STARTED":case 0:a.recentStickers=0;break;case"FORCE_UPGRADE":case 1:a.recentStickers=1;break;case"DEVELOPMENT":case 2:a.recentStickers=2;break;case"PRODUCTION":case 3:a.recentStickers=3;break}switch(e.catalog){default:if(typeof e.catalog=="number"){a.catalog=e.catalog;break}break;case"NOT_STARTED":case 0:a.catalog=0;break;case"FORCE_UPGRADE":case 1:a.catalog=1;break;case"DEVELOPMENT":case 2:a.catalog=2;break;case"PRODUCTION":case 3:a.catalog=3;break}switch(e.starredStickers){default:if(typeof e.starredStickers=="number"){a.starredStickers=e.starredStickers;break}break;case"NOT_STARTED":case 0:a.starredStickers=0;break;case"FORCE_UPGRADE":case 1:a.starredStickers=1;break;case"DEVELOPMENT":case 2:a.starredStickers=2;break;case"PRODUCTION":case 3:a.starredStickers=3;break}switch(e.voipGroupCall){default:if(typeof e.voipGroupCall=="number"){a.voipGroupCall=e.voipGroupCall;break}break;case"NOT_STARTED":case 0:a.voipGroupCall=0;break;case"FORCE_UPGRADE":case 1:a.voipGroupCall=1;break;case"DEVELOPMENT":case 2:a.voipGroupCall=2;break;case"PRODUCTION":case 3:a.voipGroupCall=3;break}switch(e.templateMessage){default:if(typeof e.templateMessage=="number"){a.templateMessage=e.templateMessage;break}break;case"NOT_STARTED":case 0:a.templateMessage=0;break;case"FORCE_UPGRADE":case 1:a.templateMessage=1;break;case"DEVELOPMENT":case 2:a.templateMessage=2;break;case"PRODUCTION":case 3:a.templateMessage=3;break}switch(e.templateMessageInteractivity){default:if(typeof e.templateMessageInteractivity=="number"){a.templateMessageInteractivity=e.templateMessageInteractivity;break}break;case"NOT_STARTED":case 0:a.templateMessageInteractivity=0;break;case"FORCE_UPGRADE":case 1:a.templateMessageInteractivity=1;break;case"DEVELOPMENT":case 2:a.templateMessageInteractivity=2;break;case"PRODUCTION":case 3:a.templateMessageInteractivity=3;break}switch(e.ephemeralMessages){default:if(typeof e.ephemeralMessages=="number"){a.ephemeralMessages=e.ephemeralMessages;break}break;case"NOT_STARTED":case 0:a.ephemeralMessages=0;break;case"FORCE_UPGRADE":case 1:a.ephemeralMessages=1;break;case"DEVELOPMENT":case 2:a.ephemeralMessages=2;break;case"PRODUCTION":case 3:a.ephemeralMessages=3;break}switch(e.e2ENotificationSync){default:if(typeof e.e2ENotificationSync=="number"){a.e2ENotificationSync=e.e2ENotificationSync;break}break;case"NOT_STARTED":case 0:a.e2ENotificationSync=0;break;case"FORCE_UPGRADE":case 1:a.e2ENotificationSync=1;break;case"DEVELOPMENT":case 2:a.e2ENotificationSync=2;break;case"PRODUCTION":case 3:a.e2ENotificationSync=3;break}switch(e.recentStickersV2){default:if(typeof e.recentStickersV2=="number"){a.recentStickersV2=e.recentStickersV2;break}break;case"NOT_STARTED":case 0:a.recentStickersV2=0;break;case"FORCE_UPGRADE":case 1:a.recentStickersV2=1;break;case"DEVELOPMENT":case 2:a.recentStickersV2=2;break;case"PRODUCTION":case 3:a.recentStickersV2=3;break}switch(e.recentStickersV3){default:if(typeof e.recentStickersV3=="number"){a.recentStickersV3=e.recentStickersV3;break}break;case"NOT_STARTED":case 0:a.recentStickersV3=0;break;case"FORCE_UPGRADE":case 1:a.recentStickersV3=1;break;case"DEVELOPMENT":case 2:a.recentStickersV3=2;break;case"PRODUCTION":case 3:a.recentStickersV3=3;break}switch(e.userNotice){default:if(typeof e.userNotice=="number"){a.userNotice=e.userNotice;break}break;case"NOT_STARTED":case 0:a.userNotice=0;break;case"FORCE_UPGRADE":case 1:a.userNotice=1;break;case"DEVELOPMENT":case 2:a.userNotice=2;break;case"PRODUCTION":case 3:a.userNotice=3;break}switch(e.support){default:if(typeof e.support=="number"){a.support=e.support;break}break;case"NOT_STARTED":case 0:a.support=0;break;case"FORCE_UPGRADE":case 1:a.support=1;break;case"DEVELOPMENT":case 2:a.support=2;break;case"PRODUCTION":case 3:a.support=3;break}switch(e.groupUiiCleanup){default:if(typeof e.groupUiiCleanup=="number"){a.groupUiiCleanup=e.groupUiiCleanup;break}break;case"NOT_STARTED":case 0:a.groupUiiCleanup=0;break;case"FORCE_UPGRADE":case 1:a.groupUiiCleanup=1;break;case"DEVELOPMENT":case 2:a.groupUiiCleanup=2;break;case"PRODUCTION":case 3:a.groupUiiCleanup=3;break}switch(e.groupDogfoodingInternalOnly){default:if(typeof e.groupDogfoodingInternalOnly=="number"){a.groupDogfoodingInternalOnly=e.groupDogfoodingInternalOnly;break}break;case"NOT_STARTED":case 0:a.groupDogfoodingInternalOnly=0;break;case"FORCE_UPGRADE":case 1:a.groupDogfoodingInternalOnly=1;break;case"DEVELOPMENT":case 2:a.groupDogfoodingInternalOnly=2;break;case"PRODUCTION":case 3:a.groupDogfoodingInternalOnly=3;break}switch(e.settingsSync){default:if(typeof e.settingsSync=="number"){a.settingsSync=e.settingsSync;break}break;case"NOT_STARTED":case 0:a.settingsSync=0;break;case"FORCE_UPGRADE":case 1:a.settingsSync=1;break;case"DEVELOPMENT":case 2:a.settingsSync=2;break;case"PRODUCTION":case 3:a.settingsSync=3;break}switch(e.archiveV2){default:if(typeof e.archiveV2=="number"){a.archiveV2=e.archiveV2;break}break;case"NOT_STARTED":case 0:a.archiveV2=0;break;case"FORCE_UPGRADE":case 1:a.archiveV2=1;break;case"DEVELOPMENT":case 2:a.archiveV2=2;break;case"PRODUCTION":case 3:a.archiveV2=3;break}switch(e.ephemeralAllowGroupMembers){default:if(typeof e.ephemeralAllowGroupMembers=="number"){a.ephemeralAllowGroupMembers=e.ephemeralAllowGroupMembers;break}break;case"NOT_STARTED":case 0:a.ephemeralAllowGroupMembers=0;break;case"FORCE_UPGRADE":case 1:a.ephemeralAllowGroupMembers=1;break;case"DEVELOPMENT":case 2:a.ephemeralAllowGroupMembers=2;break;case"PRODUCTION":case 3:a.ephemeralAllowGroupMembers=3;break}switch(e.ephemeral24HDuration){default:if(typeof e.ephemeral24HDuration=="number"){a.ephemeral24HDuration=e.ephemeral24HDuration;break}break;case"NOT_STARTED":case 0:a.ephemeral24HDuration=0;break;case"FORCE_UPGRADE":case 1:a.ephemeral24HDuration=1;break;case"DEVELOPMENT":case 2:a.ephemeral24HDuration=2;break;case"PRODUCTION":case 3:a.ephemeral24HDuration=3;break}switch(e.mdForceUpgrade){default:if(typeof e.mdForceUpgrade=="number"){a.mdForceUpgrade=e.mdForceUpgrade;break}break;case"NOT_STARTED":case 0:a.mdForceUpgrade=0;break;case"FORCE_UPGRADE":case 1:a.mdForceUpgrade=1;break;case"DEVELOPMENT":case 2:a.mdForceUpgrade=2;break;case"PRODUCTION":case 3:a.mdForceUpgrade=3;break}switch(e.disappearingMode){default:if(typeof e.disappearingMode=="number"){a.disappearingMode=e.disappearingMode;break}break;case"NOT_STARTED":case 0:a.disappearingMode=0;break;case"FORCE_UPGRADE":case 1:a.disappearingMode=1;break;case"DEVELOPMENT":case 2:a.disappearingMode=2;break;case"PRODUCTION":case 3:a.disappearingMode=3;break}switch(e.externalMdOptInAvailable){default:if(typeof e.externalMdOptInAvailable=="number"){a.externalMdOptInAvailable=e.externalMdOptInAvailable;break}break;case"NOT_STARTED":case 0:a.externalMdOptInAvailable=0;break;case"FORCE_UPGRADE":case 1:a.externalMdOptInAvailable=1;break;case"DEVELOPMENT":case 2:a.externalMdOptInAvailable=2;break;case"PRODUCTION":case 3:a.externalMdOptInAvailable=3;break}switch(e.noDeleteMessageTimeLimit){default:if(typeof e.noDeleteMessageTimeLimit=="number"){a.noDeleteMessageTimeLimit=e.noDeleteMessageTimeLimit;break}break;case"NOT_STARTED":case 0:a.noDeleteMessageTimeLimit=0;break;case"FORCE_UPGRADE":case 1:a.noDeleteMessageTimeLimit=1;break;case"DEVELOPMENT":case 2:a.noDeleteMessageTimeLimit=2;break;case"PRODUCTION":case 3:a.noDeleteMessageTimeLimit=3;break}return a},r.toObject=function(e,a){a||(a={});var A={};return e.labelsDisplay!=null&&e.hasOwnProperty("labelsDisplay")&&(A.labelsDisplay=a.enums===String?p.proto.WebFeatures.Flag[e.labelsDisplay]===void 0?e.labelsDisplay:p.proto.WebFeatures.Flag[e.labelsDisplay]:e.labelsDisplay,a.oneofs&&(A._labelsDisplay="labelsDisplay")),e.voipIndividualOutgoing!=null&&e.hasOwnProperty("voipIndividualOutgoing")&&(A.voipIndividualOutgoing=a.enums===String?p.proto.WebFeatures.Flag[e.voipIndividualOutgoing]===void 0?e.voipIndividualOutgoing:p.proto.WebFeatures.Flag[e.voipIndividualOutgoing]:e.voipIndividualOutgoing,a.oneofs&&(A._voipIndividualOutgoing="voipIndividualOutgoing")),e.groupsV3!=null&&e.hasOwnProperty("groupsV3")&&(A.groupsV3=a.enums===String?p.proto.WebFeatures.Flag[e.groupsV3]===void 0?e.groupsV3:p.proto.WebFeatures.Flag[e.groupsV3]:e.groupsV3,a.oneofs&&(A._groupsV3="groupsV3")),e.groupsV3Create!=null&&e.hasOwnProperty("groupsV3Create")&&(A.groupsV3Create=a.enums===String?p.proto.WebFeatures.Flag[e.groupsV3Create]===void 0?e.groupsV3Create:p.proto.WebFeatures.Flag[e.groupsV3Create]:e.groupsV3Create,a.oneofs&&(A._groupsV3Create="groupsV3Create")),e.changeNumberV2!=null&&e.hasOwnProperty("changeNumberV2")&&(A.changeNumberV2=a.enums===String?p.proto.WebFeatures.Flag[e.changeNumberV2]===void 0?e.changeNumberV2:p.proto.WebFeatures.Flag[e.changeNumberV2]:e.changeNumberV2,a.oneofs&&(A._changeNumberV2="changeNumberV2")),e.queryStatusV3Thumbnail!=null&&e.hasOwnProperty("queryStatusV3Thumbnail")&&(A.queryStatusV3Thumbnail=a.enums===String?p.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]===void 0?e.queryStatusV3Thumbnail:p.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]:e.queryStatusV3Thumbnail,a.oneofs&&(A._queryStatusV3Thumbnail="queryStatusV3Thumbnail")),e.liveLocations!=null&&e.hasOwnProperty("liveLocations")&&(A.liveLocations=a.enums===String?p.proto.WebFeatures.Flag[e.liveLocations]===void 0?e.liveLocations:p.proto.WebFeatures.Flag[e.liveLocations]:e.liveLocations,a.oneofs&&(A._liveLocations="liveLocations")),e.queryVname!=null&&e.hasOwnProperty("queryVname")&&(A.queryVname=a.enums===String?p.proto.WebFeatures.Flag[e.queryVname]===void 0?e.queryVname:p.proto.WebFeatures.Flag[e.queryVname]:e.queryVname,a.oneofs&&(A._queryVname="queryVname")),e.voipIndividualIncoming!=null&&e.hasOwnProperty("voipIndividualIncoming")&&(A.voipIndividualIncoming=a.enums===String?p.proto.WebFeatures.Flag[e.voipIndividualIncoming]===void 0?e.voipIndividualIncoming:p.proto.WebFeatures.Flag[e.voipIndividualIncoming]:e.voipIndividualIncoming,a.oneofs&&(A._voipIndividualIncoming="voipIndividualIncoming")),e.quickRepliesQuery!=null&&e.hasOwnProperty("quickRepliesQuery")&&(A.quickRepliesQuery=a.enums===String?p.proto.WebFeatures.Flag[e.quickRepliesQuery]===void 0?e.quickRepliesQuery:p.proto.WebFeatures.Flag[e.quickRepliesQuery]:e.quickRepliesQuery,a.oneofs&&(A._quickRepliesQuery="quickRepliesQuery")),e.payments!=null&&e.hasOwnProperty("payments")&&(A.payments=a.enums===String?p.proto.WebFeatures.Flag[e.payments]===void 0?e.payments:p.proto.WebFeatures.Flag[e.payments]:e.payments,a.oneofs&&(A._payments="payments")),e.stickerPackQuery!=null&&e.hasOwnProperty("stickerPackQuery")&&(A.stickerPackQuery=a.enums===String?p.proto.WebFeatures.Flag[e.stickerPackQuery]===void 0?e.stickerPackQuery:p.proto.WebFeatures.Flag[e.stickerPackQuery]:e.stickerPackQuery,a.oneofs&&(A._stickerPackQuery="stickerPackQuery")),e.liveLocationsFinal!=null&&e.hasOwnProperty("liveLocationsFinal")&&(A.liveLocationsFinal=a.enums===String?p.proto.WebFeatures.Flag[e.liveLocationsFinal]===void 0?e.liveLocationsFinal:p.proto.WebFeatures.Flag[e.liveLocationsFinal]:e.liveLocationsFinal,a.oneofs&&(A._liveLocationsFinal="liveLocationsFinal")),e.labelsEdit!=null&&e.hasOwnProperty("labelsEdit")&&(A.labelsEdit=a.enums===String?p.proto.WebFeatures.Flag[e.labelsEdit]===void 0?e.labelsEdit:p.proto.WebFeatures.Flag[e.labelsEdit]:e.labelsEdit,a.oneofs&&(A._labelsEdit="labelsEdit")),e.mediaUpload!=null&&e.hasOwnProperty("mediaUpload")&&(A.mediaUpload=a.enums===String?p.proto.WebFeatures.Flag[e.mediaUpload]===void 0?e.mediaUpload:p.proto.WebFeatures.Flag[e.mediaUpload]:e.mediaUpload,a.oneofs&&(A._mediaUpload="mediaUpload")),e.mediaUploadRichQuickReplies!=null&&e.hasOwnProperty("mediaUploadRichQuickReplies")&&(A.mediaUploadRichQuickReplies=a.enums===String?p.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]===void 0?e.mediaUploadRichQuickReplies:p.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]:e.mediaUploadRichQuickReplies,a.oneofs&&(A._mediaUploadRichQuickReplies="mediaUploadRichQuickReplies")),e.vnameV2!=null&&e.hasOwnProperty("vnameV2")&&(A.vnameV2=a.enums===String?p.proto.WebFeatures.Flag[e.vnameV2]===void 0?e.vnameV2:p.proto.WebFeatures.Flag[e.vnameV2]:e.vnameV2,a.oneofs&&(A._vnameV2="vnameV2")),e.videoPlaybackUrl!=null&&e.hasOwnProperty("videoPlaybackUrl")&&(A.videoPlaybackUrl=a.enums===String?p.proto.WebFeatures.Flag[e.videoPlaybackUrl]===void 0?e.videoPlaybackUrl:p.proto.WebFeatures.Flag[e.videoPlaybackUrl]:e.videoPlaybackUrl,a.oneofs&&(A._videoPlaybackUrl="videoPlaybackUrl")),e.statusRanking!=null&&e.hasOwnProperty("statusRanking")&&(A.statusRanking=a.enums===String?p.proto.WebFeatures.Flag[e.statusRanking]===void 0?e.statusRanking:p.proto.WebFeatures.Flag[e.statusRanking]:e.statusRanking,a.oneofs&&(A._statusRanking="statusRanking")),e.voipIndividualVideo!=null&&e.hasOwnProperty("voipIndividualVideo")&&(A.voipIndividualVideo=a.enums===String?p.proto.WebFeatures.Flag[e.voipIndividualVideo]===void 0?e.voipIndividualVideo:p.proto.WebFeatures.Flag[e.voipIndividualVideo]:e.voipIndividualVideo,a.oneofs&&(A._voipIndividualVideo="voipIndividualVideo")),e.thirdPartyStickers!=null&&e.hasOwnProperty("thirdPartyStickers")&&(A.thirdPartyStickers=a.enums===String?p.proto.WebFeatures.Flag[e.thirdPartyStickers]===void 0?e.thirdPartyStickers:p.proto.WebFeatures.Flag[e.thirdPartyStickers]:e.thirdPartyStickers,a.oneofs&&(A._thirdPartyStickers="thirdPartyStickers")),e.frequentlyForwardedSetting!=null&&e.hasOwnProperty("frequentlyForwardedSetting")&&(A.frequentlyForwardedSetting=a.enums===String?p.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]===void 0?e.frequentlyForwardedSetting:p.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]:e.frequentlyForwardedSetting,a.oneofs&&(A._frequentlyForwardedSetting="frequentlyForwardedSetting")),e.groupsV4JoinPermission!=null&&e.hasOwnProperty("groupsV4JoinPermission")&&(A.groupsV4JoinPermission=a.enums===String?p.proto.WebFeatures.Flag[e.groupsV4JoinPermission]===void 0?e.groupsV4JoinPermission:p.proto.WebFeatures.Flag[e.groupsV4JoinPermission]:e.groupsV4JoinPermission,a.oneofs&&(A._groupsV4JoinPermission="groupsV4JoinPermission")),e.recentStickers!=null&&e.hasOwnProperty("recentStickers")&&(A.recentStickers=a.enums===String?p.proto.WebFeatures.Flag[e.recentStickers]===void 0?e.recentStickers:p.proto.WebFeatures.Flag[e.recentStickers]:e.recentStickers,a.oneofs&&(A._recentStickers="recentStickers")),e.catalog!=null&&e.hasOwnProperty("catalog")&&(A.catalog=a.enums===String?p.proto.WebFeatures.Flag[e.catalog]===void 0?e.catalog:p.proto.WebFeatures.Flag[e.catalog]:e.catalog,a.oneofs&&(A._catalog="catalog")),e.starredStickers!=null&&e.hasOwnProperty("starredStickers")&&(A.starredStickers=a.enums===String?p.proto.WebFeatures.Flag[e.starredStickers]===void 0?e.starredStickers:p.proto.WebFeatures.Flag[e.starredStickers]:e.starredStickers,a.oneofs&&(A._starredStickers="starredStickers")),e.voipGroupCall!=null&&e.hasOwnProperty("voipGroupCall")&&(A.voipGroupCall=a.enums===String?p.proto.WebFeatures.Flag[e.voipGroupCall]===void 0?e.voipGroupCall:p.proto.WebFeatures.Flag[e.voipGroupCall]:e.voipGroupCall,a.oneofs&&(A._voipGroupCall="voipGroupCall")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=a.enums===String?p.proto.WebFeatures.Flag[e.templateMessage]===void 0?e.templateMessage:p.proto.WebFeatures.Flag[e.templateMessage]:e.templateMessage,a.oneofs&&(A._templateMessage="templateMessage")),e.templateMessageInteractivity!=null&&e.hasOwnProperty("templateMessageInteractivity")&&(A.templateMessageInteractivity=a.enums===String?p.proto.WebFeatures.Flag[e.templateMessageInteractivity]===void 0?e.templateMessageInteractivity:p.proto.WebFeatures.Flag[e.templateMessageInteractivity]:e.templateMessageInteractivity,a.oneofs&&(A._templateMessageInteractivity="templateMessageInteractivity")),e.ephemeralMessages!=null&&e.hasOwnProperty("ephemeralMessages")&&(A.ephemeralMessages=a.enums===String?p.proto.WebFeatures.Flag[e.ephemeralMessages]===void 0?e.ephemeralMessages:p.proto.WebFeatures.Flag[e.ephemeralMessages]:e.ephemeralMessages,a.oneofs&&(A._ephemeralMessages="ephemeralMessages")),e.e2ENotificationSync!=null&&e.hasOwnProperty("e2ENotificationSync")&&(A.e2ENotificationSync=a.enums===String?p.proto.WebFeatures.Flag[e.e2ENotificationSync]===void 0?e.e2ENotificationSync:p.proto.WebFeatures.Flag[e.e2ENotificationSync]:e.e2ENotificationSync,a.oneofs&&(A._e2ENotificationSync="e2ENotificationSync")),e.recentStickersV2!=null&&e.hasOwnProperty("recentStickersV2")&&(A.recentStickersV2=a.enums===String?p.proto.WebFeatures.Flag[e.recentStickersV2]===void 0?e.recentStickersV2:p.proto.WebFeatures.Flag[e.recentStickersV2]:e.recentStickersV2,a.oneofs&&(A._recentStickersV2="recentStickersV2")),e.recentStickersV3!=null&&e.hasOwnProperty("recentStickersV3")&&(A.recentStickersV3=a.enums===String?p.proto.WebFeatures.Flag[e.recentStickersV3]===void 0?e.recentStickersV3:p.proto.WebFeatures.Flag[e.recentStickersV3]:e.recentStickersV3,a.oneofs&&(A._recentStickersV3="recentStickersV3")),e.userNotice!=null&&e.hasOwnProperty("userNotice")&&(A.userNotice=a.enums===String?p.proto.WebFeatures.Flag[e.userNotice]===void 0?e.userNotice:p.proto.WebFeatures.Flag[e.userNotice]:e.userNotice,a.oneofs&&(A._userNotice="userNotice")),e.support!=null&&e.hasOwnProperty("support")&&(A.support=a.enums===String?p.proto.WebFeatures.Flag[e.support]===void 0?e.support:p.proto.WebFeatures.Flag[e.support]:e.support,a.oneofs&&(A._support="support")),e.groupUiiCleanup!=null&&e.hasOwnProperty("groupUiiCleanup")&&(A.groupUiiCleanup=a.enums===String?p.proto.WebFeatures.Flag[e.groupUiiCleanup]===void 0?e.groupUiiCleanup:p.proto.WebFeatures.Flag[e.groupUiiCleanup]:e.groupUiiCleanup,a.oneofs&&(A._groupUiiCleanup="groupUiiCleanup")),e.groupDogfoodingInternalOnly!=null&&e.hasOwnProperty("groupDogfoodingInternalOnly")&&(A.groupDogfoodingInternalOnly=a.enums===String?p.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]===void 0?e.groupDogfoodingInternalOnly:p.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]:e.groupDogfoodingInternalOnly,a.oneofs&&(A._groupDogfoodingInternalOnly="groupDogfoodingInternalOnly")),e.settingsSync!=null&&e.hasOwnProperty("settingsSync")&&(A.settingsSync=a.enums===String?p.proto.WebFeatures.Flag[e.settingsSync]===void 0?e.settingsSync:p.proto.WebFeatures.Flag[e.settingsSync]:e.settingsSync,a.oneofs&&(A._settingsSync="settingsSync")),e.archiveV2!=null&&e.hasOwnProperty("archiveV2")&&(A.archiveV2=a.enums===String?p.proto.WebFeatures.Flag[e.archiveV2]===void 0?e.archiveV2:p.proto.WebFeatures.Flag[e.archiveV2]:e.archiveV2,a.oneofs&&(A._archiveV2="archiveV2")),e.ephemeralAllowGroupMembers!=null&&e.hasOwnProperty("ephemeralAllowGroupMembers")&&(A.ephemeralAllowGroupMembers=a.enums===String?p.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]===void 0?e.ephemeralAllowGroupMembers:p.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]:e.ephemeralAllowGroupMembers,a.oneofs&&(A._ephemeralAllowGroupMembers="ephemeralAllowGroupMembers")),e.ephemeral24HDuration!=null&&e.hasOwnProperty("ephemeral24HDuration")&&(A.ephemeral24HDuration=a.enums===String?p.proto.WebFeatures.Flag[e.ephemeral24HDuration]===void 0?e.ephemeral24HDuration:p.proto.WebFeatures.Flag[e.ephemeral24HDuration]:e.ephemeral24HDuration,a.oneofs&&(A._ephemeral24HDuration="ephemeral24HDuration")),e.mdForceUpgrade!=null&&e.hasOwnProperty("mdForceUpgrade")&&(A.mdForceUpgrade=a.enums===String?p.proto.WebFeatures.Flag[e.mdForceUpgrade]===void 0?e.mdForceUpgrade:p.proto.WebFeatures.Flag[e.mdForceUpgrade]:e.mdForceUpgrade,a.oneofs&&(A._mdForceUpgrade="mdForceUpgrade")),e.disappearingMode!=null&&e.hasOwnProperty("disappearingMode")&&(A.disappearingMode=a.enums===String?p.proto.WebFeatures.Flag[e.disappearingMode]===void 0?e.disappearingMode:p.proto.WebFeatures.Flag[e.disappearingMode]:e.disappearingMode,a.oneofs&&(A._disappearingMode="disappearingMode")),e.externalMdOptInAvailable!=null&&e.hasOwnProperty("externalMdOptInAvailable")&&(A.externalMdOptInAvailable=a.enums===String?p.proto.WebFeatures.Flag[e.externalMdOptInAvailable]===void 0?e.externalMdOptInAvailable:p.proto.WebFeatures.Flag[e.externalMdOptInAvailable]:e.externalMdOptInAvailable,a.oneofs&&(A._externalMdOptInAvailable="externalMdOptInAvailable")),e.noDeleteMessageTimeLimit!=null&&e.hasOwnProperty("noDeleteMessageTimeLimit")&&(A.noDeleteMessageTimeLimit=a.enums===String?p.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]===void 0?e.noDeleteMessageTimeLimit:p.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]:e.noDeleteMessageTimeLimit,a.oneofs&&(A._noDeleteMessageTimeLimit="noDeleteMessageTimeLimit")),A},r.prototype.toJSON=function(){return this.constructor.toObject(this,R.default.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WebFeatures"},r.Flag=(function(){let i={},e=Object.create(i);return e[i[0]="NOT_STARTED"]=0,e[i[1]="FORCE_UPGRADE"]=1,e[i[2]="DEVELOPMENT"]=2,e[i[3]="PRODUCTION"]=3,e})(),r})(),n.WebLinkRenderConfig=(function(){let r={},o=Object.create(r);return o[r[0]="WEBVIEW"]=0,o[r[1]="SYSTEM"]=1,o})(),n.WebMessageInfo=(function(){function r(i){if(this.messageStubParameters=[],this.labels=[],this.userReceipt=[],this.reactions=[],this.pollUpdates=[],this.eventResponses=[],this.statusMentions=[],this.messageAddOns=[],this.statusMentionSources=[],this.supportAiCitations=[],i)for(var e=Object.keys(i),a=0;a>>3){case 1:{s.key=p.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=p.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.status=e.int32();break}case 5:{s.participant=e.string();break}case 6:{s.messageC2STimestamp=e.uint64();break}case 16:{s.ignore=e.bool();break}case 17:{s.starred=e.bool();break}case 18:{s.broadcast=e.bool();break}case 19:{s.pushName=e.string();break}case 20:{s.mediaCiphertextSha256=e.bytes();break}case 21:{s.multicast=e.bool();break}case 22:{s.urlText=e.bool();break}case 23:{s.urlNumber=e.bool();break}case 24:{s.messageStubType=e.int32();break}case 25:{s.clearMedia=e.bool();break}case 26:{s.messageStubParameters&&s.messageStubParameters.length||(s.messageStubParameters=[]),s.messageStubParameters.push(e.string());break}case 27:{s.duration=e.uint32();break}case 28:{s.labels&&s.labels.length||(s.labels=[]),s.labels.push(e.string());break}case 29:{s.paymentInfo=p.proto.PaymentInfo.decode(e,e.uint32());break}case 30:{s.finalLiveLocation=p.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 31:{s.quotedPaymentInfo=p.proto.PaymentInfo.decode(e,e.uint32());break}case 32:{s.ephemeralStartTimestamp=e.uint64();break}case 33:{s.ephemeralDuration=e.uint32();break}case 34:{s.ephemeralOffToOn=e.bool();break}case 35:{s.ephemeralOutOfSync=e.bool();break}case 36:{s.bizPrivacyStatus=e.int32();break}case 37:{s.verifiedBizName=e.string();break}case 38:{s.mediaData=p.proto.MediaData.decode(e,e.uint32());break}case 39:{s.photoChange=p.proto.PhotoChange.decode(e,e.uint32());break}case 40:{s.userReceipt&&s.userReceipt.length||(s.userReceipt=[]),s.userReceipt.push(p.proto.UserReceipt.decode(e,e.uint32()));break}case 41:{s.reactions&&s.reactions.length||(s.reactions=[]),s.reactions.push(p.proto.Reaction.decode(e,e.uint32()));break}case 42:{s.quotedStickerData=p.proto.MediaData.decode(e,e.uint32());break}case 43:{s.futureproofData=e.bytes();break}case 44:{s.statusPsa=p.proto.StatusPSA.decode(e,e.uint32());break}case 45:{s.pollUpdates&&s.pollUpdates.length||(s.pollUpdates=[]),s.pollUpdates.push(p.proto.PollUpdate.decode(e,e.uint32()));break}case 46:{s.pollAdditionalMetadata=p.proto.PollAdditionalMetadata.decode(e,e.uint32());break}case 47:{s.agentId=e.string();break}case 48:{s.statusAlreadyViewed=e.bool();break}case 49:{s.messageSecret=e.bytes();break}case 50:{s.keepInChat=p.proto.KeepInChat.decode(e,e.uint32());break}case 51:{s.originalSelfAuthorUserJidString=e.string();break}case 52:{s.revokeMessageTimestamp=e.uint64();break}case 54:{s.pinInChat=p.proto.PinInChat.decode(e,e.uint32());break}case 55:{s.premiumMessageInfo=p.proto.PremiumMessageInfo.decode(e,e.uint32());break}case 56:{s.is1PBizBotMessage=e.bool();break}case 57:{s.isGroupHistoryMessage=e.bool();break}case 58:{s.botMessageInvokerJid=e.string();break}case 59:{s.commentMetadata=p.proto.CommentMetadata.decode(e,e.uint32());break}case 61:{s.eventResponses&&s.eventResponses.length||(s.eventResponses=[]),s.eventResponses.push(p.proto.EventResponse.decode(e,e.uint32()));break}case 62:{s.reportingTokenInfo=p.proto.ReportingTokenInfo.decode(e,e.uint32());break}case 63:{s.newsletterServerId=e.uint64();break}case 64:{s.eventAdditionalMetadata=p.proto.EventAdditionalMetadata.decode(e,e.uint32());break}case 65:{s.isMentionedInStatus=e.bool();break}case 66:{s.statusMentions&&s.statusMentions.length||(s.statusMentions=[]),s.statusMentions.push(e.string());break}case 67:{s.targetMessageId=p.proto.MessageKey.decode(e,e.uint32());break}case 68:{s.messageAddOns&&s.messageAddOns.length||(s.messageAddOns=[]),s.messageAddOns.push(p.proto.MessageAddOn.decode(e,e.uint32()));break}case 69:{s.statusMentionMessageInfo=p.proto.StatusMentionMessage.decode(e,e.uint32());break}case 70:{s.isSupportAiMessage=e.bool();break}case 71:{s.statusMentionSources&&s.statusMentionSources.length||(s.statusMentionSources=[]),s.statusMentionSources.push(e.string());break}case 72:{s.supportAiCitations&&s.supportAiCitations.length||(s.supportAiCitations=[]),s.supportAiCitations.push(p.proto.Citation.decode(e,e.uint32()));break}case 73:{s.botTargetId=e.string();break}case 74:{s.groupHistoryIndividualMessageInfo=p.proto.GroupHistoryIndividualMessageInfo.decode(e,e.uint32());break}case 75:{s.groupHistoryBundleInfo=p.proto.GroupHistoryBundleInfo.decode(e,e.uint32());break}case 76:{s.interactiveMessageAdditionalMetadata=p.proto.InteractiveMessageAdditionalMetadata.decode(e,e.uint32());break}case 77:{s.quarantinedMessage=p.proto.QuarantinedMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.WebMessageInfo)return e;var a=new p.proto.WebMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.WebMessageInfo.key: object expected");a.key=p.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.WebMessageInfo.message: object expected");a.message=p.proto.Message.fromObject(e.message)}switch(e.messageTimestamp!=null&&(l.Long?(a.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?a.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?a.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(a.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.status){default:if(typeof e.status=="number"){a.status=e.status;break}break;case"ERROR":case 0:a.status=0;break;case"PENDING":case 1:a.status=1;break;case"SERVER_ACK":case 2:a.status=2;break;case"DELIVERY_ACK":case 3:a.status=3;break;case"READ":case 4:a.status=4;break;case"PLAYED":case 5:a.status=5;break}switch(e.participant!=null&&(a.participant=String(e.participant)),e.messageC2STimestamp!=null&&(l.Long?(a.messageC2STimestamp=l.Long.fromValue(e.messageC2STimestamp)).unsigned=!0:typeof e.messageC2STimestamp=="string"?a.messageC2STimestamp=parseInt(e.messageC2STimestamp,10):typeof e.messageC2STimestamp=="number"?a.messageC2STimestamp=e.messageC2STimestamp:typeof e.messageC2STimestamp=="object"&&(a.messageC2STimestamp=new l.LongBits(e.messageC2STimestamp.low>>>0,e.messageC2STimestamp.high>>>0).toNumber(!0))),e.ignore!=null&&(a.ignore=!!e.ignore),e.starred!=null&&(a.starred=!!e.starred),e.broadcast!=null&&(a.broadcast=!!e.broadcast),e.pushName!=null&&(a.pushName=String(e.pushName)),e.mediaCiphertextSha256!=null&&(typeof e.mediaCiphertextSha256=="string"?l.base64.decode(e.mediaCiphertextSha256,a.mediaCiphertextSha256=l.newBuffer(l.base64.length(e.mediaCiphertextSha256)),0):e.mediaCiphertextSha256.length>=0&&(a.mediaCiphertextSha256=e.mediaCiphertextSha256)),e.multicast!=null&&(a.multicast=!!e.multicast),e.urlText!=null&&(a.urlText=!!e.urlText),e.urlNumber!=null&&(a.urlNumber=!!e.urlNumber),e.messageStubType){default:if(typeof e.messageStubType=="number"){a.messageStubType=e.messageStubType;break}break;case"UNKNOWN":case 0:a.messageStubType=0;break;case"REVOKE":case 1:a.messageStubType=1;break;case"CIPHERTEXT":case 2:a.messageStubType=2;break;case"FUTUREPROOF":case 3:a.messageStubType=3;break;case"NON_VERIFIED_TRANSITION":case 4:a.messageStubType=4;break;case"UNVERIFIED_TRANSITION":case 5:a.messageStubType=5;break;case"VERIFIED_TRANSITION":case 6:a.messageStubType=6;break;case"VERIFIED_LOW_UNKNOWN":case 7:a.messageStubType=7;break;case"VERIFIED_HIGH":case 8:a.messageStubType=8;break;case"VERIFIED_INITIAL_UNKNOWN":case 9:a.messageStubType=9;break;case"VERIFIED_INITIAL_LOW":case 10:a.messageStubType=10;break;case"VERIFIED_INITIAL_HIGH":case 11:a.messageStubType=11;break;case"VERIFIED_TRANSITION_ANY_TO_NONE":case 12:a.messageStubType=12;break;case"VERIFIED_TRANSITION_ANY_TO_HIGH":case 13:a.messageStubType=13;break;case"VERIFIED_TRANSITION_HIGH_TO_LOW":case 14:a.messageStubType=14;break;case"VERIFIED_TRANSITION_HIGH_TO_UNKNOWN":case 15:a.messageStubType=15;break;case"VERIFIED_TRANSITION_UNKNOWN_TO_LOW":case 16:a.messageStubType=16;break;case"VERIFIED_TRANSITION_LOW_TO_UNKNOWN":case 17:a.messageStubType=17;break;case"VERIFIED_TRANSITION_NONE_TO_LOW":case 18:a.messageStubType=18;break;case"VERIFIED_TRANSITION_NONE_TO_UNKNOWN":case 19:a.messageStubType=19;break;case"GROUP_CREATE":case 20:a.messageStubType=20;break;case"GROUP_CHANGE_SUBJECT":case 21:a.messageStubType=21;break;case"GROUP_CHANGE_ICON":case 22:a.messageStubType=22;break;case"GROUP_CHANGE_INVITE_LINK":case 23:a.messageStubType=23;break;case"GROUP_CHANGE_DESCRIPTION":case 24:a.messageStubType=24;break;case"GROUP_CHANGE_RESTRICT":case 25:a.messageStubType=25;break;case"GROUP_CHANGE_ANNOUNCE":case 26:a.messageStubType=26;break;case"GROUP_PARTICIPANT_ADD":case 27:a.messageStubType=27;break;case"GROUP_PARTICIPANT_REMOVE":case 28:a.messageStubType=28;break;case"GROUP_PARTICIPANT_PROMOTE":case 29:a.messageStubType=29;break;case"GROUP_PARTICIPANT_DEMOTE":case 30:a.messageStubType=30;break;case"GROUP_PARTICIPANT_INVITE":case 31:a.messageStubType=31;break;case"GROUP_PARTICIPANT_LEAVE":case 32:a.messageStubType=32;break;case"GROUP_PARTICIPANT_CHANGE_NUMBER":case 33:a.messageStubType=33;break;case"BROADCAST_CREATE":case 34:a.messageStubType=34;break;case"BROADCAST_ADD":case 35:a.messageStubType=35;break;case"BROADCAST_REMOVE":case 36:a.messageStubType=36;break;case"GENERIC_NOTIFICATION":case 37:a.messageStubType=37;break;case"E2E_IDENTITY_CHANGED":case 38:a.messageStubType=38;break;case"E2E_ENCRYPTED":case 39:a.messageStubType=39;break;case"CALL_MISSED_VOICE":case 40:a.messageStubType=40;break;case"CALL_MISSED_VIDEO":case 41:a.messageStubType=41;break;case"INDIVIDUAL_CHANGE_NUMBER":case 42:a.messageStubType=42;break;case"GROUP_DELETE":case 43:a.messageStubType=43;break;case"GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE":case 44:a.messageStubType=44;break;case"CALL_MISSED_GROUP_VOICE":case 45:a.messageStubType=45;break;case"CALL_MISSED_GROUP_VIDEO":case 46:a.messageStubType=46;break;case"PAYMENT_CIPHERTEXT":case 47:a.messageStubType=47;break;case"PAYMENT_FUTUREPROOF":case 48:a.messageStubType=48;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED":case 49:a.messageStubType=49;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED":case 50:a.messageStubType=50;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED":case 51:a.messageStubType=51;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP":case 52:a.messageStubType=52;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP":case 53:a.messageStubType=53;break;case"PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER":case 54:a.messageStubType=54;break;case"PAYMENT_ACTION_SEND_PAYMENT_REMINDER":case 55:a.messageStubType=55;break;case"PAYMENT_ACTION_SEND_PAYMENT_INVITATION":case 56:a.messageStubType=56;break;case"PAYMENT_ACTION_REQUEST_DECLINED":case 57:a.messageStubType=57;break;case"PAYMENT_ACTION_REQUEST_EXPIRED":case 58:a.messageStubType=58;break;case"PAYMENT_ACTION_REQUEST_CANCELLED":case 59:a.messageStubType=59;break;case"BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM":case 60:a.messageStubType=60;break;case"BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP":case 61:a.messageStubType=61;break;case"BIZ_INTRO_TOP":case 62:a.messageStubType=62;break;case"BIZ_INTRO_BOTTOM":case 63:a.messageStubType=63;break;case"BIZ_NAME_CHANGE":case 64:a.messageStubType=64;break;case"BIZ_MOVE_TO_CONSUMER_APP":case 65:a.messageStubType=65;break;case"BIZ_TWO_TIER_MIGRATION_TOP":case 66:a.messageStubType=66;break;case"BIZ_TWO_TIER_MIGRATION_BOTTOM":case 67:a.messageStubType=67;break;case"OVERSIZED":case 68:a.messageStubType=68;break;case"GROUP_CHANGE_NO_FREQUENTLY_FORWARDED":case 69:a.messageStubType=69;break;case"GROUP_V4_ADD_INVITE_SENT":case 70:a.messageStubType=70;break;case"GROUP_PARTICIPANT_ADD_REQUEST_JOIN":case 71:a.messageStubType=71;break;case"CHANGE_EPHEMERAL_SETTING":case 72:a.messageStubType=72;break;case"E2E_DEVICE_CHANGED":case 73:a.messageStubType=73;break;case"VIEWED_ONCE":case 74:a.messageStubType=74;break;case"E2E_ENCRYPTED_NOW":case 75:a.messageStubType=75;break;case"BLUE_MSG_BSP_FB_TO_BSP_PREMISE":case 76:a.messageStubType=76;break;case"BLUE_MSG_BSP_FB_TO_SELF_FB":case 77:a.messageStubType=77;break;case"BLUE_MSG_BSP_FB_TO_SELF_PREMISE":case 78:a.messageStubType=78;break;case"BLUE_MSG_BSP_FB_UNVERIFIED":case 79:a.messageStubType=79;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 80:a.messageStubType=80;break;case"BLUE_MSG_BSP_FB_VERIFIED":case 81:a.messageStubType=81;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 82:a.messageStubType=82;break;case"BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE":case 83:a.messageStubType=83;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED":case 84:a.messageStubType=84;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 85:a.messageStubType=85;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED":case 86:a.messageStubType=86;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 87:a.messageStubType=87;break;case"BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED":case 88:a.messageStubType=88;break;case"BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED":case 89:a.messageStubType=89;break;case"BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED":case 90:a.messageStubType=90;break;case"BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED":case 91:a.messageStubType=91;break;case"BLUE_MSG_SELF_FB_TO_BSP_PREMISE":case 92:a.messageStubType=92;break;case"BLUE_MSG_SELF_FB_TO_SELF_PREMISE":case 93:a.messageStubType=93;break;case"BLUE_MSG_SELF_FB_UNVERIFIED":case 94:a.messageStubType=94;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 95:a.messageStubType=95;break;case"BLUE_MSG_SELF_FB_VERIFIED":case 96:a.messageStubType=96;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 97:a.messageStubType=97;break;case"BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE":case 98:a.messageStubType=98;break;case"BLUE_MSG_SELF_PREMISE_UNVERIFIED":case 99:a.messageStubType=99;break;case"BLUE_MSG_SELF_PREMISE_VERIFIED":case 100:a.messageStubType=100;break;case"BLUE_MSG_TO_BSP_FB":case 101:a.messageStubType=101;break;case"BLUE_MSG_TO_CONSUMER":case 102:a.messageStubType=102;break;case"BLUE_MSG_TO_SELF_FB":case 103:a.messageStubType=103;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED":case 104:a.messageStubType=104;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 105:a.messageStubType=105;break;case"BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED":case 106:a.messageStubType=106;break;case"BLUE_MSG_UNVERIFIED_TO_VERIFIED":case 107:a.messageStubType=107;break;case"BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED":case 108:a.messageStubType=108;break;case"BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 109:a.messageStubType=109;break;case"BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED":case 110:a.messageStubType=110;break;case"BLUE_MSG_VERIFIED_TO_UNVERIFIED":case 111:a.messageStubType=111;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 112:a.messageStubType=112;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED":case 113:a.messageStubType=113;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 114:a.messageStubType=114;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED":case 115:a.messageStubType=115;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 116:a.messageStubType=116;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 117:a.messageStubType=117;break;case"E2E_IDENTITY_UNAVAILABLE":case 118:a.messageStubType=118;break;case"GROUP_CREATING":case 119:a.messageStubType=119;break;case"GROUP_CREATE_FAILED":case 120:a.messageStubType=120;break;case"GROUP_BOUNCED":case 121:a.messageStubType=121;break;case"BLOCK_CONTACT":case 122:a.messageStubType=122;break;case"EPHEMERAL_SETTING_NOT_APPLIED":case 123:a.messageStubType=123;break;case"SYNC_FAILED":case 124:a.messageStubType=124;break;case"SYNCING":case 125:a.messageStubType=125;break;case"BIZ_PRIVACY_MODE_INIT_FB":case 126:a.messageStubType=126;break;case"BIZ_PRIVACY_MODE_INIT_BSP":case 127:a.messageStubType=127;break;case"BIZ_PRIVACY_MODE_TO_FB":case 128:a.messageStubType=128;break;case"BIZ_PRIVACY_MODE_TO_BSP":case 129:a.messageStubType=129;break;case"DISAPPEARING_MODE":case 130:a.messageStubType=130;break;case"E2E_DEVICE_FETCH_FAILED":case 131:a.messageStubType=131;break;case"ADMIN_REVOKE":case 132:a.messageStubType=132;break;case"GROUP_INVITE_LINK_GROWTH_LOCKED":case 133:a.messageStubType=133;break;case"COMMUNITY_LINK_PARENT_GROUP":case 134:a.messageStubType=134;break;case"COMMUNITY_LINK_SIBLING_GROUP":case 135:a.messageStubType=135;break;case"COMMUNITY_LINK_SUB_GROUP":case 136:a.messageStubType=136;break;case"COMMUNITY_UNLINK_PARENT_GROUP":case 137:a.messageStubType=137;break;case"COMMUNITY_UNLINK_SIBLING_GROUP":case 138:a.messageStubType=138;break;case"COMMUNITY_UNLINK_SUB_GROUP":case 139:a.messageStubType=139;break;case"GROUP_PARTICIPANT_ACCEPT":case 140:a.messageStubType=140;break;case"GROUP_PARTICIPANT_LINKED_GROUP_JOIN":case 141:a.messageStubType=141;break;case"COMMUNITY_CREATE":case 142:a.messageStubType=142;break;case"EPHEMERAL_KEEP_IN_CHAT":case 143:a.messageStubType=143;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST":case 144:a.messageStubType=144;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE":case 145:a.messageStubType=145;break;case"INTEGRITY_UNLINK_PARENT_GROUP":case 146:a.messageStubType=146;break;case"COMMUNITY_PARTICIPANT_PROMOTE":case 147:a.messageStubType=147;break;case"COMMUNITY_PARTICIPANT_DEMOTE":case 148:a.messageStubType=148;break;case"COMMUNITY_PARENT_GROUP_DELETED":case 149:a.messageStubType=149;break;case"COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL":case 150:a.messageStubType=150;break;case"GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP":case 151:a.messageStubType=151;break;case"MASKED_THREAD_CREATED":case 152:a.messageStubType=152;break;case"MASKED_THREAD_UNMASKED":case 153:a.messageStubType=153;break;case"BIZ_CHAT_ASSIGNMENT":case 154:a.messageStubType=154;break;case"CHAT_PSA":case 155:a.messageStubType=155;break;case"CHAT_POLL_CREATION_MESSAGE":case 156:a.messageStubType=156;break;case"CAG_MASKED_THREAD_CREATED":case 157:a.messageStubType=157;break;case"COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED":case 158:a.messageStubType=158;break;case"CAG_INVITE_AUTO_ADD":case 159:a.messageStubType=159;break;case"BIZ_CHAT_ASSIGNMENT_UNASSIGN":case 160:a.messageStubType=160;break;case"CAG_INVITE_AUTO_JOINED":case 161:a.messageStubType=161;break;case"SCHEDULED_CALL_START_MESSAGE":case 162:a.messageStubType=162;break;case"COMMUNITY_INVITE_RICH":case 163:a.messageStubType=163;break;case"COMMUNITY_INVITE_AUTO_ADD_RICH":case 164:a.messageStubType=164;break;case"SUB_GROUP_INVITE_RICH":case 165:a.messageStubType=165;break;case"SUB_GROUP_PARTICIPANT_ADD_RICH":case 166:a.messageStubType=166;break;case"COMMUNITY_LINK_PARENT_GROUP_RICH":case 167:a.messageStubType=167;break;case"COMMUNITY_PARTICIPANT_ADD_RICH":case 168:a.messageStubType=168;break;case"SILENCED_UNKNOWN_CALLER_AUDIO":case 169:a.messageStubType=169;break;case"SILENCED_UNKNOWN_CALLER_VIDEO":case 170:a.messageStubType=170;break;case"GROUP_MEMBER_ADD_MODE":case 171:a.messageStubType=171;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD":case 172:a.messageStubType=172;break;case"COMMUNITY_CHANGE_DESCRIPTION":case 173:a.messageStubType=173;break;case"SENDER_INVITE":case 174:a.messageStubType=174;break;case"RECEIVER_INVITE":case 175:a.messageStubType=175;break;case"COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS":case 176:a.messageStubType=176;break;case"PINNED_MESSAGE_IN_CHAT":case 177:a.messageStubType=177;break;case"PAYMENT_INVITE_SETUP_INVITER":case 178:a.messageStubType=178;break;case"PAYMENT_INVITE_SETUP_INVITEE_RECEIVE_ONLY":case 179:a.messageStubType=179;break;case"PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE":case 180:a.messageStubType=180;break;case"LINKED_GROUP_CALL_START":case 181:a.messageStubType=181;break;case"REPORT_TO_ADMIN_ENABLED_STATUS":case 182:a.messageStubType=182;break;case"EMPTY_SUBGROUP_CREATE":case 183:a.messageStubType=183;break;case"SCHEDULED_CALL_CANCEL":case 184:a.messageStubType=184;break;case"SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH":case 185:a.messageStubType=185;break;case"GROUP_CHANGE_RECENT_HISTORY_SHARING":case 186:a.messageStubType=186;break;case"PAID_MESSAGE_SERVER_CAMPAIGN_ID":case 187:a.messageStubType=187;break;case"GENERAL_CHAT_CREATE":case 188:a.messageStubType=188;break;case"GENERAL_CHAT_ADD":case 189:a.messageStubType=189;break;case"GENERAL_CHAT_AUTO_ADD_DISABLED":case 190:a.messageStubType=190;break;case"SUGGESTED_SUBGROUP_ANNOUNCE":case 191:a.messageStubType=191;break;case"BIZ_BOT_1P_MESSAGING_ENABLED":case 192:a.messageStubType=192;break;case"CHANGE_USERNAME":case 193:a.messageStubType=193;break;case"BIZ_COEX_PRIVACY_INIT_SELF":case 194:a.messageStubType=194;break;case"BIZ_COEX_PRIVACY_TRANSITION_SELF":case 195:a.messageStubType=195;break;case"SUPPORT_AI_EDUCATION":case 196:a.messageStubType=196;break;case"BIZ_BOT_3P_MESSAGING_ENABLED":case 197:a.messageStubType=197;break;case"REMINDER_SETUP_MESSAGE":case 198:a.messageStubType=198;break;case"REMINDER_SENT_MESSAGE":case 199:a.messageStubType=199;break;case"REMINDER_CANCEL_MESSAGE":case 200:a.messageStubType=200;break;case"BIZ_COEX_PRIVACY_INIT":case 201:a.messageStubType=201;break;case"BIZ_COEX_PRIVACY_TRANSITION":case 202:a.messageStubType=202;break;case"GROUP_DEACTIVATED":case 203:a.messageStubType=203;break;case"COMMUNITY_DEACTIVATE_SIBLING_GROUP":case 204:a.messageStubType=204;break;case"EVENT_UPDATED":case 205:a.messageStubType=205;break;case"EVENT_CANCELED":case 206:a.messageStubType=206;break;case"COMMUNITY_OWNER_UPDATED":case 207:a.messageStubType=207;break;case"COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN":case 208:a.messageStubType=208;break;case"CAPI_GROUP_NE2EE_SYSTEM_MESSAGE":case 209:a.messageStubType=209;break;case"STATUS_MENTION":case 210:a.messageStubType=210;break;case"USER_CONTROLS_SYSTEM_MESSAGE":case 211:a.messageStubType=211;break;case"SUPPORT_SYSTEM_MESSAGE":case 212:a.messageStubType=212;break;case"CHANGE_LID":case 213:a.messageStubType=213;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE":case 214:a.messageStubType=214;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE":case 215:a.messageStubType=215;break;case"CHANGE_LIMIT_SHARING":case 216:a.messageStubType=216;break;case"GROUP_MEMBER_LINK_MODE":case 217:a.messageStubType=217;break;case"BIZ_AUTOMATICALLY_LABELED_CHAT_SYSTEM_MESSAGE":case 218:a.messageStubType=218;break;case"PHONE_NUMBER_HIDING_CHAT_DEPRECATED_MESSAGE":case 219:a.messageStubType=219;break;case"QUARANTINED_MESSAGE":case 220:a.messageStubType=220;break;case"GROUP_MEMBER_SHARE_GROUP_HISTORY_MODE":case 221:a.messageStubType=221;break}if(e.clearMedia!=null&&(a.clearMedia=!!e.clearMedia),e.messageStubParameters){if(!Array.isArray(e.messageStubParameters))throw TypeError(".proto.WebMessageInfo.messageStubParameters: array expected");a.messageStubParameters=[];for(var A=0;A>>0),e.labels){if(!Array.isArray(e.labels))throw TypeError(".proto.WebMessageInfo.labels: array expected");a.labels=[];for(var A=0;A>>0,e.ephemeralStartTimestamp.high>>>0).toNumber(!0))),e.ephemeralDuration!=null&&(a.ephemeralDuration=e.ephemeralDuration>>>0),e.ephemeralOffToOn!=null&&(a.ephemeralOffToOn=!!e.ephemeralOffToOn),e.ephemeralOutOfSync!=null&&(a.ephemeralOutOfSync=!!e.ephemeralOutOfSync),e.bizPrivacyStatus){default:if(typeof e.bizPrivacyStatus=="number"){a.bizPrivacyStatus=e.bizPrivacyStatus;break}break;case"E2EE":case 0:a.bizPrivacyStatus=0;break;case"FB":case 2:a.bizPrivacyStatus=2;break;case"BSP":case 1:a.bizPrivacyStatus=1;break;case"BSP_AND_FB":case 3:a.bizPrivacyStatus=3;break}if(e.verifiedBizName!=null&&(a.verifiedBizName=String(e.verifiedBizName)),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.WebMessageInfo.mediaData: object expected");a.mediaData=p.proto.MediaData.fromObject(e.mediaData)}if(e.photoChange!=null){if(typeof e.photoChange!="object")throw TypeError(".proto.WebMessageInfo.photoChange: object expected");a.photoChange=p.proto.PhotoChange.fromObject(e.photoChange)}if(e.userReceipt){if(!Array.isArray(e.userReceipt))throw TypeError(".proto.WebMessageInfo.userReceipt: array expected");a.userReceipt=[];for(var A=0;A=0&&(a.futureproofData=e.futureproofData)),e.statusPsa!=null){if(typeof e.statusPsa!="object")throw TypeError(".proto.WebMessageInfo.statusPsa: object expected");a.statusPsa=p.proto.StatusPSA.fromObject(e.statusPsa)}if(e.pollUpdates){if(!Array.isArray(e.pollUpdates))throw TypeError(".proto.WebMessageInfo.pollUpdates: array expected");a.pollUpdates=[];for(var A=0;A=0&&(a.messageSecret=e.messageSecret)),e.keepInChat!=null){if(typeof e.keepInChat!="object")throw TypeError(".proto.WebMessageInfo.keepInChat: object expected");a.keepInChat=p.proto.KeepInChat.fromObject(e.keepInChat)}if(e.originalSelfAuthorUserJidString!=null&&(a.originalSelfAuthorUserJidString=String(e.originalSelfAuthorUserJidString)),e.revokeMessageTimestamp!=null&&(l.Long?(a.revokeMessageTimestamp=l.Long.fromValue(e.revokeMessageTimestamp)).unsigned=!0:typeof e.revokeMessageTimestamp=="string"?a.revokeMessageTimestamp=parseInt(e.revokeMessageTimestamp,10):typeof e.revokeMessageTimestamp=="number"?a.revokeMessageTimestamp=e.revokeMessageTimestamp:typeof e.revokeMessageTimestamp=="object"&&(a.revokeMessageTimestamp=new l.LongBits(e.revokeMessageTimestamp.low>>>0,e.revokeMessageTimestamp.high>>>0).toNumber(!0))),e.pinInChat!=null){if(typeof e.pinInChat!="object")throw TypeError(".proto.WebMessageInfo.pinInChat: object expected");a.pinInChat=p.proto.PinInChat.fromObject(e.pinInChat)}if(e.premiumMessageInfo!=null){if(typeof e.premiumMessageInfo!="object")throw TypeError(".proto.WebMessageInfo.premiumMessageInfo: object expected");a.premiumMessageInfo=p.proto.PremiumMessageInfo.fromObject(e.premiumMessageInfo)}if(e.is1PBizBotMessage!=null&&(a.is1PBizBotMessage=!!e.is1PBizBotMessage),e.isGroupHistoryMessage!=null&&(a.isGroupHistoryMessage=!!e.isGroupHistoryMessage),e.botMessageInvokerJid!=null&&(a.botMessageInvokerJid=String(e.botMessageInvokerJid)),e.commentMetadata!=null){if(typeof e.commentMetadata!="object")throw TypeError(".proto.WebMessageInfo.commentMetadata: object expected");a.commentMetadata=p.proto.CommentMetadata.fromObject(e.commentMetadata)}if(e.eventResponses){if(!Array.isArray(e.eventResponses))throw TypeError(".proto.WebMessageInfo.eventResponses: array expected");a.eventResponses=[];for(var A=0;A>>0,e.newsletterServerId.high>>>0).toNumber(!0))),e.eventAdditionalMetadata!=null){if(typeof e.eventAdditionalMetadata!="object")throw TypeError(".proto.WebMessageInfo.eventAdditionalMetadata: object expected");a.eventAdditionalMetadata=p.proto.EventAdditionalMetadata.fromObject(e.eventAdditionalMetadata)}if(e.isMentionedInStatus!=null&&(a.isMentionedInStatus=!!e.isMentionedInStatus),e.statusMentions){if(!Array.isArray(e.statusMentions))throw TypeError(".proto.WebMessageInfo.statusMentions: array expected");a.statusMentions=[];for(var A=0;A>>3){case 2:{s.timestamp=e.uint64();break}case 3:{s.unreadChats=e.uint32();break}case 4:{s.notifyMessageCount=e.uint32();break}case 5:{s.notifyMessages&&s.notifyMessages.length||(s.notifyMessages=[]),s.notifyMessages.push(p.proto.WebMessageInfo.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},r.fromObject=function(e){if(e instanceof p.proto.WebNotificationsInfo)return e;var a=new p.proto.WebNotificationsInfo;if(e.timestamp!=null&&(l.Long?(a.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?a.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?a.timestamp=e.timestamp:typeof e.timestamp=="object"&&(a.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.unreadChats!=null&&(a.unreadChats=e.unreadChats>>>0),e.notifyMessageCount!=null&&(a.notifyMessageCount=e.notifyMessageCount>>>0),e.notifyMessages){if(!Array.isArray(e.notifyMessages))throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected");a.notifyMessages=[];for(var A=0;Aaa.hasSubscribers||KC.hasSubscribers,c6=new Set,g6=typeof process=="object"&&process?process:{},Kke=(n,r,o,i)=>{typeof g6.emitWarning=="function"?g6.emitWarning(n,r,o,i):console.error(`[${o}] ${r}: ${n}`)},xke=n=>!c6.has(n),qg=n=>!!n&&n===Math.floor(n)&&n>0&&isFinite(n),I6=n=>qg(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?iS:null:null,iS=class extends Array{constructor(n){super(n),this.fill(0)}},Yke=class xC{heap;length;static#e=!1;static create(r){let o=I6(r);if(!o)return[];xC.#e=!0;let i=new xC(r,o);return xC.#e=!1,i}constructor(r,o){if(!xC.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new o(r),this.length=0}push(r){this.heap[this.length++]=r}pop(){return this.heap[--this.length]}},Us=class l6{#e;#A;#t;#r;#o;#i;#I;#s;get perf(){return this.#s}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#l;#a;#n;#g;#c;#p;#h;#E;#d;#C;#u;#B;#Q;#m;#f;#y;#D;#w;#_;static unsafeExposeInternals(r){return{starts:r.#Q,ttls:r.#m,autopurgeTimers:r.#f,sizes:r.#B,keyMap:r.#n,keyList:r.#g,valList:r.#c,next:r.#p,prev:r.#h,get head(){return r.#E},get tail(){return r.#d},free:r.#C,isBackgroundFetch:o=>r.#v(o),backgroundFetch:(o,i,e,a)=>r.#z(o,i,e,a),moveToTail:o=>r.#q(o),indexes:o=>r.#L(o),rindexes:o=>r.#F(o),isStale:o=>r.#N(o)}}get max(){return this.#e}get maxSize(){return this.#A}get calculatedSize(){return this.#a}get size(){return this.#l}get fetchMethod(){return this.#i}get memoMethod(){return this.#I}get dispose(){return this.#t}get onInsert(){return this.#r}get disposeAfter(){return this.#o}constructor(r){let{max:o=0,ttl:i,ttlResolution:e=1,ttlAutopurge:a,updateAgeOnGet:A,updateAgeOnHas:t,allowStale:s,dispose:g,onInsert:c,disposeAfter:I,noDisposeOnSet:d,noUpdateTTL:B,maxSize:f=0,maxEntrySize:Q=0,sizeCalculation:y,fetchMethod:m,memoMethod:T,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:F,allowStaleOnFetchRejection:J,allowStaleOnFetchAbort:j,ignoreFetchAbort:x,backgroundFetchSize:q=1,perf:Y}=r;if(this.backgroundFetchSize=q,Y!==void 0&&typeof Y?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#s=Y??Hke,o!==0&&!qg(o))throw new TypeError("max option must be a nonnegative integer");let L=o?I6(o):Array;if(!L)throw new Error("invalid max value: "+o);if(this.#e=o,this.#A=f,this.maxEntrySize=Q||this.#A,this.sizeCalculation=y,this.sizeCalculation){if(!this.#A&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=T,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#i=m,this.#D=!!m,this.#n=new Map,this.#g=Array.from({length:o}).fill(void 0),this.#c=Array.from({length:o}).fill(void 0),this.#p=new L(o),this.#h=new L(o),this.#E=0,this.#d=0,this.#C=Yke.create(o),this.#l=0,this.#a=0,typeof g=="function"&&(this.#t=g),typeof c=="function"&&(this.#r=c),typeof I=="function"?(this.#o=I,this.#u=[]):(this.#o=void 0,this.#u=void 0),this.#y=!!this.#t,this.#_=!!this.#r,this.#w=!!this.#o,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!B,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!J,this.allowStaleOnFetchAbort=!!j,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#A!==0&&!qg(this.#A))throw new TypeError("maxSize must be a positive integer if specified");if(!qg(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#G()}if(this.allowStale=!!s,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!A,this.updateAgeOnHas=!!t,this.ttlResolution=qg(e)||e===0?e:1,this.ttlAutopurge=!!a,this.ttl=i||0,this.ttl){if(!qg(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#e===0&&this.ttl===0&&this.#A===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#A){let v="LRU_CACHE_UNBOUNDED";xke(v)&&(c6.add(v),Kke("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",v,l6))}}getRemainingTTL(r){return this.#n.has(r)?1/0:0}#M(){let r=new iS(this.#e),o=new iS(this.#e);this.#m=r,this.#Q=o;let i=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#f=i,this.#b=(s,g,c=this.#s.now())=>{o[s]=g!==0?c:0,r[s]=g,e(s,g)},this.#R=s=>{o[s]=r[s]!==0?this.#s.now():0,e(s,r[s])};let e=this.ttlAutopurge?(s,g)=>{if(i?.[s]&&(clearTimeout(i[s]),i[s]=void 0),g&&g!==0&&i){let c=setTimeout(()=>{this.#N(s)?(this.#H(this.#g[s],"expire"),i[s]=void 0):e(s,t(s))},g+1);c.unref&&c.unref(),i[s]=c}}:()=>{};this.#O=(s,g)=>{if(r[g]){let c=r[g],I=o[g];if(!c||!I)return;s.ttl=c,s.start=I,s.now=a||A();let d=s.now-I;s.remainingTTL=c-d}};let a=0,A=()=>{let s=this.#s.now();if(this.ttlResolution>0){a=s;let g=setTimeout(()=>a=0,this.ttlResolution);g.unref&&g.unref()}return s};this.getRemainingTTL=s=>{let g=this.#n.get(s);return g===void 0?0:t(g)};let t=s=>{let g=r[s],c=o[s];if(!g||!c)return 1/0;let I=(a||A())-c;return g-I};this.#N=s=>{let g=o[s],c=r[s];return!!c&&!!g&&(a||A())-g>c}}#R=()=>{};#O=()=>{};#b=()=>{};#N=()=>!1;#G(){let r=new iS(this.#e);this.#a=0,this.#B=r,this.#T=o=>{this.#a-=r[o],r[o]=0},this.#k=(o,i,e,a)=>{if(!qg(e)){if(this.#v(i))return this.backgroundFetchSize;if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(e=a(i,o),!qg(e))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return e},this.#P=(o,i,e)=>{if(r[o]=i,this.#A){let a=this.#A-r[o];for(;this.#a>a;)this.#j(!0)}this.#a+=r[o],e&&(e.entrySize=i,e.totalCalculatedSize=this.#a)}}#T=r=>{};#P=(r,o,i)=>{};#k=(r,o,i,e)=>{if(i||e)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#L({allowStale:r=this.allowStale}={}){if(this.#l)for(let o=this.#d;this.#K(o)&&((r||!this.#N(o))&&(yield o),o!==this.#E);)o=this.#h[o]}*#F({allowStale:r=this.allowStale}={}){if(this.#l)for(let o=this.#E;this.#K(o)&&((r||!this.#N(o))&&(yield o),o!==this.#d);)o=this.#p[o]}#K(r){return r!==void 0&&this.#n.get(this.#g[r])===r}*entries(){for(let r of this.#L())this.#c[r]!==void 0&&this.#g[r]!==void 0&&!this.#v(this.#c[r])&&(yield[this.#g[r],this.#c[r]])}*rentries(){for(let r of this.#F())this.#c[r]!==void 0&&this.#g[r]!==void 0&&!this.#v(this.#c[r])&&(yield[this.#g[r],this.#c[r]])}*keys(){for(let r of this.#L()){let o=this.#g[r];o!==void 0&&!this.#v(this.#c[r])&&(yield o)}}*rkeys(){for(let r of this.#F()){let o=this.#g[r];o!==void 0&&!this.#v(this.#c[r])&&(yield o)}}*values(){for(let r of this.#L())this.#c[r]!==void 0&&!this.#v(this.#c[r])&&(yield this.#c[r])}*rvalues(){for(let r of this.#F())this.#c[r]!==void 0&&!this.#v(this.#c[r])&&(yield this.#c[r])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(r,o={}){for(let i of this.#L()){let e=this.#c[i],a=this.#v(e)?e.__staleWhileFetching:e;if(a!==void 0&&r(a,this.#g[i],this))return this.#W(this.#g[i],o)}}forEach(r,o=this){for(let i of this.#L()){let e=this.#c[i],a=this.#v(e)?e.__staleWhileFetching:e;a!==void 0&&r.call(o,a,this.#g[i],this)}}rforEach(r,o=this){for(let i of this.#F()){let e=this.#c[i],a=this.#v(e)?e.__staleWhileFetching:e;a!==void 0&&r.call(o,a,this.#g[i],this)}}purgeStale(){let r=!1;for(let o of this.#F({allowStale:!0}))this.#N(o)&&(this.#H(this.#g[o],"expire"),r=!0);return r}info(r){let o=this.#n.get(r);if(o===void 0)return;let i=this.#c[o],e=this.#v(i)?i.__staleWhileFetching:i;if(e===void 0)return;let a={value:e};if(this.#m&&this.#Q){let A=this.#m[o],t=this.#Q[o];if(A&&t){let s=A-(this.#s.now()-t);a.ttl=s,a.start=Date.now()}}return this.#B&&(a.size=this.#B[o]),a}dump(){let r=[];for(let o of this.#L({allowStale:!0})){let i=this.#g[o],e=this.#c[o],a=this.#v(e)?e.__staleWhileFetching:e;if(a===void 0||i===void 0)continue;let A={value:a};if(this.#m&&this.#Q){A.ttl=this.#m[o];let t=this.#s.now()-this.#Q[o];A.start=Math.floor(Date.now()-t)}this.#B&&(A.size=this.#B[o]),r.unshift([i,A])}return r}load(r){this.clear();for(let[o,i]of r){if(i.start){let e=Date.now()-i.start;i.start=this.#s.now()-e}this.#U(o,i.value,i)}}set(r,o,i={}){let{status:e=aa.hasSubscribers?{}:void 0}=i;i.status=e,e&&(e.op="set",e.key=r,o!==void 0&&(e.value=o),e.cache=this);let a=this.#U(r,o,i);return e&&aa.hasSubscribers&&aa.publish(e),a}#U(r,o,i,e){let{ttl:a=this.ttl,start:A,noDisposeOnSet:t=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:g}=i,c=this.#v(o);if(o===void 0)return g&&(g.set="deleted"),this.delete(r),this;let{noUpdateTTL:I=this.noUpdateTTL}=i;g&&!c&&(g.value=o);let d=this.#k(r,o,i.size||0,s,g);if(this.maxEntrySize&&d>this.maxEntrySize)return this.#H(r,"set"),g&&(g.set="miss",g.maxEntrySizeExceeded=!0),this;let B=this.#l===0?void 0:this.#n.get(r);if(B===void 0)B=this.#l===0?this.#d:this.#C.length!==0?this.#C.pop():this.#l===this.#e?this.#j(!1):this.#l,this.#g[B]=r,this.#c[B]=o,this.#n.set(r,B),this.#p[this.#d]=B,this.#h[B]=this.#d,this.#d=B,this.#l++,this.#P(B,d,g),g&&(g.set="add"),I=!1,this.#_&&!c&&this.#r?.(o,r,"add");else{this.#q(B);let f=this.#c[B];if(o!==f){if(!t)if(this.#v(f)){f!==e&&f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Q}=f;Q!==void 0&&Q!==o&&(this.#y&&this.#t?.(Q,r,"set"),this.#w&&this.#u?.push([Q,r,"set"]))}else this.#y&&this.#t?.(f,r,"set"),this.#w&&this.#u?.push([f,r,"set"]);if(this.#T(B),this.#P(B,d,g),this.#c[B]=o,!c){let Q=f&&this.#v(f)?f.__staleWhileFetching:f,y=Q===void 0?"add":o!==Q?"replace":"update";g&&(g.set=y,Q!==void 0&&(g.oldValue=Q)),this.#_&&this.onInsert?.(o,r,y)}}else c||(g&&(g.set="update"),this.#_&&this.onInsert?.(o,r,"update"))}if(a!==0&&!this.#m&&this.#M(),this.#m&&(I||this.#b(B,a,A),g&&this.#O(g,B)),!t&&this.#w&&this.#u){let f=this.#u,Q;for(;Q=f?.shift();)this.#o?.(...Q)}return this}pop(){try{for(;this.#l;){let r=this.#c[this.#E];if(this.#j(!0),this.#v(r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(this.#w&&this.#u){let r=this.#u,o;for(;o=r?.shift();)this.#o?.(...o)}}}#j(r){let o=this.#E,i=this.#g[o],e=this.#c[o],a=this.#v(e);a&&e.__abortController.abort(new Error("evicted"));let A=a?e.__staleWhileFetching:e;return(this.#y||this.#w)&&A!==void 0&&(this.#y&&this.#t?.(A,i,"evict"),this.#w&&this.#u?.push([A,i,"evict"])),this.#T(o),this.#f?.[o]&&(clearTimeout(this.#f[o]),this.#f[o]=void 0),r&&(this.#g[o]=void 0,this.#c[o]=void 0,this.#C.push(o)),this.#l===1?(this.#E=this.#d=0,this.#C.length=0):this.#E=this.#p[o],this.#n.delete(i),this.#l--,o}has(r,o={}){let{status:i=aa.hasSubscribers?{}:void 0}=o;o.status=i,i&&(i.op="has",i.key=r,i.cache=this);let e=this.#x(r,o);return aa.hasSubscribers&&aa.publish(i),e}#x(r,o={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:e}=o,a=this.#n.get(r);if(a!==void 0){let A=this.#c[a];if(this.#v(A)&&A.__staleWhileFetching===void 0)return!1;if(this.#N(a))e&&(e.has="stale",this.#O(e,a));else return i&&this.#R(a),e&&(e.has="hit",this.#O(e,a)),!0}else e&&(e.has="miss");return!1}peek(r,o={}){let{status:i=aP()?{}:void 0}=o;i&&(i.op="peek",i.key=r,i.cache=this),o.status=i;let e=this.#ae(r,o);return aa.hasSubscribers&&aa.publish(i),e}#ae(r,o){let{status:i,allowStale:e=this.allowStale}=o,a=this.#n.get(r);if(a===void 0||!e&&this.#N(a)){i&&(i.peek=a===void 0?"miss":"stale");return}let A=this.#c[a],t=this.#v(A)?A.__staleWhileFetching:A;return i&&(t!==void 0?(i.peek="hit",i.value=t):i.peek="miss"),t}#z(r,o,i,e){let a=o===void 0?void 0:this.#c[o];if(this.#v(a))return a;let A=new AbortController,{signal:t}=i;t?.addEventListener("abort",()=>A.abort(t.reason),{signal:A.signal});let s={signal:A.signal,options:i,context:e},g=(Q,y=!1)=>{let{aborted:m}=A.signal,T=i.ignoreFetchAbort&&Q!==void 0,N=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&Q!==void 0);if(i.status&&(m&&!y?(i.status.fetchAborted=!0,i.status.fetchError=A.signal.reason,T&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),m&&!T&&!y)return I(A.signal.reason,N);let F=B,J=this.#c[o];return(J===B||J===void 0&&T&&y)&&(Q===void 0?F.__staleWhileFetching!==void 0?this.#c[o]=F.__staleWhileFetching:this.#H(r,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#U(r,Q,s.options,F))),Q},c=Q=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=Q),I(Q,!1)),I=(Q,y)=>{let{aborted:m}=A.signal,T=m&&i.allowStaleOnFetchAbort,N=T||i.allowStaleOnFetchRejection,F=N||i.noDeleteOnFetchRejection,J=B;if(this.#c[o]===B&&(!F||!y&&J.__staleWhileFetching===void 0?this.#H(r,"fetch"):T||(this.#c[o]=J.__staleWhileFetching)),N)return i.status&&J.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),J.__staleWhileFetching;if(J.__returned===J)throw Q},d=(Q,y)=>{let m=this.#i?.(r,a,s);A.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(Q(void 0),i.allowStaleOnFetchAbort&&(Q=T=>g(T,!0)))}),m&&m instanceof Promise?m.then(T=>Q(T===void 0?void 0:T),y):m!==void 0&&Q(m)};i.status&&(i.status.fetchDispatched=!0);let B=new Promise(d).then(g,c),f=Object.assign(B,{__abortController:A,__staleWhileFetching:a,__returned:void 0});return o===void 0?(this.#U(r,f,{...s.options,status:void 0}),o=this.#n.get(r)):this.#c[o]=f,f}#v(r){if(!this.#D)return!1;let o=r;return!!o&&o instanceof Promise&&o.hasOwnProperty("__staleWhileFetching")&&o.__abortController instanceof AbortController}fetch(r,o={}){let i=KC.hasSubscribers,{status:e=aP()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let a=this.#Y(r,o);return e&&i&&(e.trace=!0,KC.tracePromise(()=>a,e).catch(()=>{})),a}async#Y(r,o={}){let{allowStale:i=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:A=this.ttl,noDisposeOnSet:t=this.noDisposeOnSet,size:s=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:I=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:B=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:Q,forceRefresh:y=!1,status:m,signal:T}=o;if(m&&(m.op="fetch",m.key=r,y&&(m.forceRefresh=!0),m.cache=this),!this.#D)return m&&(m.fetch="get"),this.#W(r,{allowStale:i,updateAgeOnGet:e,noDeleteOnStaleGet:a,status:m});let N={allowStale:i,updateAgeOnGet:e,noDeleteOnStaleGet:a,ttl:A,noDisposeOnSet:t,size:s,sizeCalculation:g,noUpdateTTL:c,noDeleteOnFetchRejection:I,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:f,ignoreFetchAbort:B,status:m,signal:T},F=this.#n.get(r);if(F===void 0){m&&(m.fetch="miss");let J=this.#z(r,F,N,Q);return J.__returned=J}else{let J=this.#c[F];if(this.#v(J)){let Y=i&&J.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",Y&&(m.returnedStale=!0)),Y?J.__staleWhileFetching:J.__returned=J}let j=this.#N(F);if(!y&&!j)return m&&(m.fetch="hit"),this.#q(F),e&&this.#R(F),m&&this.#O(m,F),J;let x=this.#z(r,F,N,Q),q=x.__staleWhileFetching!==void 0&&i;return m&&(m.fetch=j?"stale":"refresh",q&&j&&(m.returnedStale=!0)),q?x.__staleWhileFetching:x.__returned=x}}forceFetch(r,o={}){let i=KC.hasSubscribers,{status:e=aP()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let a=this.#J(r,o);return e&&i&&(e.trace=!0,KC.tracePromise(()=>a,e).catch(()=>{})),a}async#J(r,o={}){let i=await this.#Y(r,o);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(r,o={}){let{status:i=aa.hasSubscribers?{}:void 0}=o;o.status=i,i&&(i.op="memo",i.key=r,o.context&&(i.context=o.context),i.cache=this);let e=this.#V(r,o);return i&&(i.value=e),aa.hasSubscribers&&aa.publish(i),e}#V(r,o={}){let i=this.#I;if(!i)throw new Error("no memoMethod provided to constructor");let{context:e,status:a,forceRefresh:A,...t}=o;a&&A&&(a.forceRefresh=!0);let s=this.#W(r,t),g=A||s===void 0;if(a&&(a.memo=g?"miss":"hit",g||(a.value=s)),!g)return s;let c=i(r,s,{options:t,context:e});return a&&(a.value=c),this.#U(r,c,t),c}get(r,o={}){let{status:i=aa.hasSubscribers?{}:void 0}=o;o.status=i,i&&(i.op="get",i.key=r,i.cache=this);let e=this.#W(r,o);return i&&(e!==void 0&&(i.value=e),aa.hasSubscribers&&aa.publish(i)),e}#W(r,o={}){let{allowStale:i=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:A}=o,t=this.#n.get(r);if(t===void 0){A&&(A.get="miss");return}let s=this.#c[t],g=this.#v(s);return A&&this.#O(A,t),this.#N(t)?g?(A&&(A.get="stale-fetching"),i&&s.__staleWhileFetching!==void 0?(A&&(A.returnedStale=!0),s.__staleWhileFetching):void 0):(a||this.#H(r,"expire"),A&&(A.get="stale"),i?(A&&(A.returnedStale=!0),s):void 0):(A&&(A.get=g?"fetching":"hit"),this.#q(t),e&&this.#R(t),g?s.__staleWhileFetching:s)}#Ae(r,o){this.#h[o]=r,this.#p[r]=o}#q(r){r!==this.#d&&(r===this.#E?this.#E=this.#p[r]:this.#Ae(this.#h[r],this.#p[r]),this.#Ae(this.#d,r),this.#d=r)}delete(r){return this.#H(r,"delete")}#H(r,o){aa.hasSubscribers&&aa.publish({op:"delete",delete:o,key:r,cache:this});let i=!1;if(this.#l!==0){let e=this.#n.get(r);if(e!==void 0)if(this.#f?.[e]&&(clearTimeout(this.#f[e]),this.#f[e]=void 0),i=!0,this.#l===1)this.#X(o);else{this.#T(e);let a=this.#c[e];if(this.#v(a)?a.__abortController.abort(new Error("deleted")):(this.#y||this.#w)&&(this.#y&&this.#t?.(a,r,o),this.#w&&this.#u?.push([a,r,o])),this.#n.delete(r),this.#g[e]=void 0,this.#c[e]=void 0,e===this.#d)this.#d=this.#h[e];else if(e===this.#E)this.#E=this.#p[e];else{let A=this.#h[e];this.#p[A]=this.#p[e];let t=this.#p[e];this.#h[t]=this.#h[e]}this.#l--,this.#C.push(e)}}if(this.#w&&this.#u?.length){let e=this.#u,a;for(;a=e?.shift();)this.#o?.(...a)}return i}clear(){return this.#X("delete")}#X(r){for(let o of this.#F({allowStale:!0})){let i=this.#c[o];if(this.#v(i))i.__abortController.abort(new Error("deleted"));else{let e=this.#g[o];this.#y&&this.#t?.(i,e,r),this.#w&&this.#u?.push([i,e,r])}}if(this.#n.clear(),this.#c.fill(void 0),this.#g.fill(void 0),this.#m&&this.#Q){this.#m.fill(0),this.#Q.fill(0);for(let o of this.#f??[])o!==void 0&&clearTimeout(o);this.#f?.fill(void 0)}if(this.#B&&this.#B.fill(0),this.#E=0,this.#d=0,this.#C.length=0,this.#a=0,this.#l=0,this.#w&&this.#u){let o=this.#u,i;for(;i=o?.shift();)this.#o?.(...i)}}};var mS=ze(Tr(),1);import{createHash as bve,randomBytes as Au}from"crypto";var s5=["critical_block","critical_unblock_low","regular_high","regular_low","regular"];var qcA=ze(Tr(),1),zr;(function(n){n[n.Connecting=0]="Connecting",n[n.AwaitingInitialSync=1]="AwaitingInitialSync",n[n.Syncing=2]="Syncing",n[n.Online=3]="Online"})(zr||(zr={}));var Vg;(function(n){n.BIZ_COMMERCE_VIOLATION_ALCOHOL="BIZ_COMMERCE_VIOLATION_ALCOHOL",n.BIZ_COMMERCE_VIOLATION_ADULT="BIZ_COMMERCE_VIOLATION_ADULT",n.BIZ_COMMERCE_VIOLATION_ANIMALS="BIZ_COMMERCE_VIOLATION_ANIMALS",n.BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS="BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS",n.BIZ_COMMERCE_VIOLATION_DATING="BIZ_COMMERCE_VIOLATION_DATING",n.BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS="BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS",n.BIZ_COMMERCE_VIOLATION_DRUGS="BIZ_COMMERCE_VIOLATION_DRUGS",n.BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC="BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC",n.BIZ_COMMERCE_VIOLATION_GAMBLING="BIZ_COMMERCE_VIOLATION_GAMBLING",n.BIZ_COMMERCE_VIOLATION_HEALTHCARE="BIZ_COMMERCE_VIOLATION_HEALTHCARE",n.BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY="BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY",n.BIZ_COMMERCE_VIOLATION_SUPPLEMENTS="BIZ_COMMERCE_VIOLATION_SUPPLEMENTS",n.BIZ_COMMERCE_VIOLATION_TOBACCO="BIZ_COMMERCE_VIOLATION_TOBACCO",n.BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT="BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT",n.BIZ_COMMERCE_VIOLATION_WEAPONS="BIZ_COMMERCE_VIOLATION_WEAPONS",n.BIZ_QUALITY="BIZ_QUALITY",n.DEFAULT="DEFAULT",n.WEB_COMPANION_ONLY="WEB_COMPANION_ONLY"})(Vg||(Vg={}));var g5;(function(n){n.NONE="NONE",n.FIRST_WARNING="FIRST_WARNING",n.SECOND_WARNING="SECOND_WARNING",n.CAPPED="CAPPED"})(g5||(g5={}));var c5;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.NOT_ACTIVE="NOT_ACTIVE",n.ACTIVE="ACTIVE",n.ACTIVE_UPGRADE_AVAILABLE="ACTIVE_UPGRADE_AVAILABLE"})(c5||(c5={}));var I5;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.ELIGIBLE="ELIGIBLE",n.ACTIVE_IN_CURRENT_CYCLE="ACTIVE_IN_CURRENT_CYCLE",n.EXHAUSTED="EXHAUSTED"})(I5||(I5={}));var TA=ae.WebMessageInfo.StubType,Vp=ae.WebMessageInfo.Status,jC;(function(n){n.PN="pn",n.LID="lid"})(jC||(jC={}));var ia;(function(n){n.xwa2_newsletter_create="xwa2_newsletter_create",n.xwa2_newsletter_subscribers="xwa2_newsletter_subscribers",n.xwa2_newsletter_view="xwa2_newsletter_view",n.xwa2_newsletter_metadata="xwa2_newsletter",n.xwa2_newsletter_admin_count="xwa2_newsletter_admin",n.xwa2_newsletter_mute_v2="xwa2_newsletter_mute_v2",n.xwa2_newsletter_unmute_v2="xwa2_newsletter_unmute_v2",n.xwa2_newsletter_follow="xwa2_newsletter_follow",n.xwa2_newsletter_unfollow="xwa2_newsletter_unfollow",n.xwa2_newsletter_join_v2="xwa2_newsletter_join_v2",n.xwa2_newsletter_leave_v2="xwa2_newsletter_leave_v2",n.xwa2_newsletter_change_owner="xwa2_newsletter_change_owner",n.xwa2_newsletter_demote="xwa2_newsletter_demote",n.xwa2_newsletter_delete_v2="xwa2_newsletter_delete_v2",n.xwa2_fetch_account_reachout_timelock="xwa2_fetch_account_reachout_timelock",n.xwa2_message_capping_info="xwa2_message_capping_info"})(ia||(ia={}));var Vr;(function(n){n.CREATE="8823471724422422",n.UPDATE_METADATA="24250201037901610",n.METADATA="6563316087068696",n.SUBSCRIBERS="9783111038412085",n.FOLLOW="24404358912487870",n.UNFOLLOW="9767147403369991",n.MUTE="29766401636284406",n.UNMUTE="9864994326891137",n.ADMIN_COUNT="7130823597031706",n.CHANGE_OWNER="7341777602580933",n.DEMOTE="6551828931592903",n.DELETE="30062808666639665",n.REACHOUT_TIMELOCK="23983697327930364",n.MESSAGE_CAPPING_INFO="24503548349331633"})(Vr||(Vr={}));var Yt;(function(n){n[n.connectionClosed=428]="connectionClosed",n[n.connectionLost=408]="connectionLost",n[n.connectionReplaced=440]="connectionReplaced",n[n.timedOut=408]="timedOut",n[n.loggedOut=401]="loggedOut",n[n.badSession=500]="badSession",n[n.restartRequired=515]="restartRequired",n[n.multideviceMismatch=411]="multideviceMismatch",n[n.forbidden=403]="forbidden",n[n.unavailableService=503]="unavailableService"})(Yt||(Yt={}));var JC={};Dr(JC,{DOUBLE_BYTE_TOKENS:()=>l5,SINGLE_BYTE_TOKENS:()=>p5,TAGS:()=>rve,TOKEN_MAP:()=>EP});var rve={LIST_EMPTY:0,DICTIONARY_0:236,DICTIONARY_1:237,DICTIONARY_2:238,DICTIONARY_3:239,INTEROP_JID:245,FB_JID:246,AD_JID:247,LIST_8:248,LIST_16:249,JID_PAIR:250,HEX_8:251,BINARY_8:252,BINARY_20:253,BINARY_32:254,NIBBLE_8:255,PACKED_MAX:127},l5=[["read-self","active","fbns","protocol","reaction","screen_width","heartbeat","deviceid","2:47DEQpj8","uploadfieldstat","voip_settings","retry","priority","longitude","conflict","false","ig_professional","replaced","preaccept","cover_photo","uncompressed","encopt","ppic","04","passive","status-revoke-drop","keygen","540","offer","rate","opus","latitude","w:gp2","ver","4","business_profile","medium","sender","prev_v_id","email","website","invited","sign_credential","05","transport","skey","reason","peer_abtest_bucket","America/Sao_Paulo","appid","refresh","100","06","404","101","104","107","102","109","103","member_add_mode","105","transaction-id","110","106","outgoing","108","111","tokens","followers","ig_handle","self_pid","tue","dec","thu","joinable","peer_pid","mon","features","wed","peer_device_presence","pn","delete","07","fri","audio_duration","admin","connected","delta","rcat","disable","collection","08","480","sat","phash","all","invite","accept","critical_unblock_low","group_update","signed_credential","blinded_credential","eph_setting","net","09","background_location","refresh_id","Asia/Kolkata","privacy_mode_ts","account_sync","voip_payload_type","service_areas","acs_public_key","v_id","0a","fallback_class","relay","actual_actors","metadata","w:biz","5","connected-limit","notice","0b","host_storage","fb_page","subject","privatestats","invis","groupadd","010","note.m4r","uuid","0c","8000","sun","372","1020","stage","1200","720","canonical","fb","011","video_duration","0d","1140","superadmin","012","Opening.m4r","keystore_attestation","dleq_proof","013","timestamp","ab_key","w:sync:app:state","0e","vertical","600","p_v_id","6","likes","014","500","1260","creator","0f","rte","destination","group","group_info","syncd_anti_tampering_fatal_exception_enabled","015","dl_bw","Asia/Jakarta","vp8/h.264","online","1320","fb:multiway","10","timeout","016","nse_retry","urn:xmpp:whatsapp:dirty","017","a_v_id","web_shops_chat_header_button_enabled","nse_call","inactive-upgrade","none","web","groups","2250","mms_hot_content_timespan_in_seconds","contact_blacklist","nse_read","suspended_group_deletion_notification","binary_version","018","https://www.whatsapp.com/otp/copy/","reg_push","shops_hide_catalog_attachment_entrypoint","server_sync",".","ephemeral_messages_allowed_values","019","mms_vcache_aggregation_enabled","iphone","America/Argentina/Buenos_Aires","01a","mms_vcard_autodownload_size_kb","nse_ver","shops_header_dropdown_menu_item","dhash","catalog_status","communities_mvp_new_iqs_serverprop","blocklist","default","11","ephemeral_messages_enabled","01b","original_dimensions","8","mms4_media_retry_notification_encryption_enabled","mms4_server_error_receipt_encryption_enabled","original_image_url","sync","multiway","420","companion_enc_static","shops_profile_drawer_entrypoint","01c","vcard_as_document_size_kb","status_video_max_duration","request_image_url","01d","regular_high","s_t","abt","share_ext_min_preliminary_image_quality","01e","32","syncd_key_rotation_enabled","data_namespace","md_downgrade_read_receipts2","patch","polltype","ephemeral_messages_setting","userrate","15","partial_pjpeg_bw_threshold","played-self","catalog_exists","01f","mute_v2"],["reject","dirty","announcement","020","13","9","status_video_max_bitrate","fb:thrift_iq","offline_batch","022","full","ctwa_first_business_reply_logging","h.264","smax_id","group_description_length","https://www.whatsapp.com/otp/code","status_image_max_edge","smb_upsell_business_profile_enabled","021","web_upgrade_to_md_modal","14","023","s_o","smaller_video_thumbs_status_enabled","media_max_autodownload","960","blocking_status","peer_msg","joinable_group_call_client_version","group_call_video_maximization_enabled","return_snapshot","high","America/Mexico_City","entry_point_block_logging_enabled","pop","024","1050","16","1380","one_tap_calling_in_group_chat_size","regular_low","inline_joinable_education_enabled","hq_image_max_edge","locked","America/Bogota","smb_biztools_deeplink_enabled","status_image_quality","1088","025","payments_upi_intent_transaction_limit","voip","w:g2","027","md_pin_chat_enabled","026","multi_scan_pjpeg_download_enabled","shops_product_grid","transaction_id","ctwa_context_enabled","20","fna","hq_image_quality","alt_jpeg_doc_detection_quality","group_call_max_participants","pkey","America/Belem","image_max_kbytes","web_cart_v1_1_order_message_changes_enabled","ctwa_context_enterprise_enabled","urn:xmpp:whatsapp:account","840","Asia/Kuala_Lumpur","max_participants","video_remux_after_repair_enabled","stella_addressbook_restriction_type","660","900","780","context_menu_ios13_enabled","mute-state","ref","payments_request_messages","029","frskmsg","vcard_max_size_kb","sample_buffer_gif_player_enabled","match_last_seen","510","4983","video_max_bitrate","028","w:comms:chat","17","frequently_forwarded_max","groups_privacy_blacklist","Asia/Karachi","02a","web_download_document_thumb_mms_enabled","02b","hist_sync","biz_block_reasons_version","1024","18","web_is_direct_connection_for_plm_transparent","view_once_write","file_max_size","paid_convo_id","online_privacy_setting","video_max_edge","view_once_read","enhanced_storage_management","multi_scan_pjpeg_encoding_enabled","ctwa_context_forward_enabled","video_transcode_downgrade_enable","template_doc_mime_types","hq_image_bw_threshold","30","body","u_aud_limit_sil_restarts_ctrl","other","participating","w:biz:directory","1110","vp8","4018","meta","doc_detection_image_max_edge","image_quality","1170","02c","smb_upsell_chat_banner_enabled","key_expiry_time_second","pid","stella_interop_enabled","19","linked_device_max_count","md_device_sync_enabled","02d","02e","360","enhanced_block_enabled","ephemeral_icon_in_forwarding","paid_convo_status","gif_provider","project_name","server-error","canonical_url_validation_enabled","wallpapers_v2","syncd_clear_chat_delete_chat_enabled","medianotify","02f","shops_required_tos_version","vote","reset_skey_on_id_change","030","image_max_edge","multicast_limit_global","ul_bw","21","25","5000","poll","570","22","031","1280","WhatsApp","032","bloks_shops_enabled","50","upload_host_switching_enabled","web_ctwa_context_compose_enabled","ptt_forwarded_features_enabled","unblocked","partial_pjpeg_enabled","fbid:devices","height","ephemeral_group_query_ts","group_join_permissions","order","033","alt_jpeg_status_quality","migrate","popular-bank","win_uwp_deprecation_killswitch_enabled","web_download_status_thumb_mms_enabled","blocking","url_text","035","web_forwarding_limit_to_groups","1600","val","1000","syncd_msg_date_enabled","bank-ref-id","max_subject","payments_web_enabled","web_upload_document_thumb_mms_enabled","size","request","ephemeral","24","receipt_agg","ptt_remember_play_position","sampling_weight","enc_rekey","mute_always","037","034","23","036","action","click_to_chat_qr_enabled","width","disabled","038","md_blocklist_v2","played_self_enabled","web_buttons_message_enabled","flow_id","clear","450","fbid:thread","bloks_session_state","America/Lima","attachment_picker_refresh","download_host_switching_enabled","1792","u_aud_limit_sil_restarts_test2","custom_urls","device_fanout","optimistic_upload","2000","key_cipher_suite","web_smb_upsell_in_biz_profile_enabled","e","039","siri_post_status_shortcut","pair-device","lg","lc","stream_attribution_url","model","mspjpeg_phash_gen","catalog_send_all","new_multi_vcards_ui","share_biz_vcard_enabled","-","clean","200","md_blocklist_v2_server","03b","03a","web_md_migration_experience","ptt_conversation_waveform","u_aud_limit_sil_restarts_test1"],["64","ptt_playback_speed_enabled","web_product_list_message_enabled","paid_convo_ts","27","manufacturer","psp-routing","grp_uii_cleanup","ptt_draft_enabled","03c","business_initiated","web_catalog_products_onoff","web_upload_link_thumb_mms_enabled","03e","mediaretry","35","hfm_string_changes","28","America/Fortaleza","max_keys","md_mhfs_days","streaming_upload_chunk_size","5541","040","03d","2675","03f","...","512","mute","48","041","alt_jpeg_quality","60","042","md_smb_quick_reply","5183","c","1343","40","1230","043","044","mms_cat_v1_forward_hot_override_enabled","user_notice","ptt_waveform_send","047","Asia/Calcutta","250","md_privacy_v2","31","29","128","md_messaging_enabled","046","crypto","690","045","enc_iv","75","failure","ptt_oot_playback","AIzaSyDR5yfaG7OG8sMTUj8kfQEb8T9pN8BM6Lk","w","048","2201","web_large_files_ui","Asia/Makassar","812","status_collapse_muted","1334","257","2HP4dm","049","patches","1290","43cY6T","America/Caracas","web_sticker_maker","campaign","ptt_pausable_enabled","33","42","attestation","biz","04b","query_linked","s","125","04a","810","availability","1411","responsiveness_v2_m1","catalog_not_created","34","America/Santiago","1465","enc_p","04d","status_info","04f","key_version","..","04c","04e","md_group_notification","1598","1215","web_cart_enabled","37","630","1920","2394","-1","vcard","38","elapsed","36","828","peer","pricing_category","1245","invalid","stella_ios_enabled","2687","45","1528","39","u_is_redial_audio_1104_ctrl","1025","1455","58","2524","2603","054","bsp_system_message_enabled","web_pip_redesign","051","verify_apps","1974","1272","1322","1755","052","70","050","1063","1135","1361","80","1096","1828","1851","1251","1921","key_config_id","1254","1566","1252","2525","critical_block","1669","max_available","w:auth:backup:token","product","2530","870","1022","participant_uuid","web_cart_on_off","1255","1432","1867","41","1415","1440","240","1204","1608","1690","1846","1483","1687","1749","69","url_number","053","1325","1040","365","59","Asia/Riyadh","1177","test_recommended","057","1612","43","1061","1518","1635","055","1034","1375","750","1430","event_code","1682","503","55","865","78","1309","1365","44","America/Guayaquil","535","LIMITED","1377","1613","1420","1599","1822","05a","1681","password","1111","1214","1376","1478","47","1082","4282","Europe/Istanbul","1307","46","058","1124","256","rate-overlimit","retail","u_a_socket_err_fix_succ_test","1292","1370","1388","520","861","psa","regular","1181","1766","05b","1183","1213","1304","1537"],["1724","profile_picture","1071","1314","1605","407","990","1710","746","pricing_model","056","059","061","1119","6027","65","877","1607","05d","917","seen","1516","49","470","973","1037","1350","1394","1480","1796","keys","794","1536","1594","2378","1333","1524","1825","116","309","52","808","827","909","495","1660","361","957","google","1357","1565","1967","996","1775","586","736","1052","1670","bank","177","1416","2194","2222","1454","1839","1275","53","997","1629","6028","smba","1378","1410","05c","1849","727","create","1559","536","1106","1310","1944","670","1297","1316","1762","en","1148","1295","1551","1853","1890","1208","1784","7200","05f","178","1283","1332","381","643","1056","1238","2024","2387","179","981","1547","1705","05e","290","903","1069","1285","2436","062","251","560","582","719","56","1700","2321","325","448","613","777","791","51","488","902","Asia/Almaty","is_hidden","1398","1527","1893","1999","2367","2642","237","busy","065","067","233","590","993","1511","54","723","860","363","487","522","605","995","1321","1691","1865","2447","2462","NON_TRANSACTIONAL","433","871","432","1004","1207","2032","2050","2379","2446","279","636","703","904","248","370","691","700","1068","1655","2334","060","063","364","533","534","567","1191","1210","1473","1827","069","701","2531","514","prev_dhash","064","496","790","1046","1139","1505","1521","1108","207","544","637","final","1173","1293","1694","1939","1951","1993","2353","2515","504","601","857","modify","spam_request","p_121_aa_1101_test4","866","1427","1502","1638","1744","2153","068","382","725","1704","1864","1990","2003","Asia/Dubai","508","531","1387","1474","1632","2307","2386","819","2014","066","387","1468","1706","2186","2261","471","728","1147","1372","1961"]],p5=["","xmlstreamstart","xmlstreamend","s.whatsapp.net","type","participant","from","receipt","id","notification","disappearing_mode","status","jid","broadcast","user","devices","device_hash","to","offline","message","result","class","xmlns","duration","notify","iq","t","ack","g.us","enc","urn:xmpp:whatsapp:push","presence","config_value","picture","verified_name","config_code","key-index-list","contact","mediatype","routing_info","edge_routing","get","read","urn:xmpp:ping","fallback_hostname","0","chatstate","business_hours_config","unavailable","download_buckets","skmsg","verified_level","composing","handshake","device-list","media","text","fallback_ip4","media_conn","device","creation","location","config","item","fallback_ip6","count","w:profile:picture","image","business","2","hostname","call-creator","display_name","relaylatency","platform","abprops","success","msg","offline_preview","prop","key-index","v","day_of_week","pkmsg","version","1","ping","w:p","download","video","set","specific_hours","props","primary","unknown","hash","commerce_experience","last","subscribe","max_buckets","call","profile","member_since_text","close_time","call-id","sticker","mode","participants","value","query","profile_options","open_time","code","list","host","ts","contacts","upload","lid","preview","update","usync","w:stats","delivery","auth_ttl","context","fail","cart_enabled","appdata","category","atn","direct_connection","decrypt-fail","relay_id","mmg-fallback.whatsapp.net","target","available","name","last_id","mmg.whatsapp.net","categories","401","is_new","index","tctoken","ip4","token_id","latency","recipient","edit","ip6","add","thumbnail-document","26","paused","true","identity","stream:error","key","sidelist","background","audio","3","thumbnail-image","biz-cover-photo","cat","gcm","thumbnail-video","error","auth","deny","serial","in","registration","thumbnail-link","remove","00","gif","thumbnail-gif","tag","capability","multicast","item-not-found","description","business_hours","config_expo_key","md-app-state","expiration","fallback","ttl","300","md-msg-hist","device_orientation","out","w:m","open_24h","side_list","token","inactive","01","document","te2","played","encrypt","msgr","hide","direct_path","12","state","not-authorized","url","terminate","signature","status-revoke-delay","02","te","linked_accounts","trusted_contact","timezone","ptt","kyc-id","privacy_token","readreceipts","appointment_only","address","expected_ts","privacy","7","android","interactive","device-identity","enabled","attribute_padding","1080","03","screen_height"],EP={};for(let[n,r]of p5.entries())EP[r]={index:n};for(let[n,r]of l5.entries())for(let[o,i]of r.entries())EP[i]={dict:n,index:o};var wA="@s.whatsapp.net";var d5="0@c.us";var Pt;(function(n){n[n.WHATSAPP=0]="WHATSAPP",n[n.LID=1]="LID",n[n.HOSTED=128]="HOSTED",n[n.HOSTED_LID=129]="HOSTED_LID"})(Pt||(Pt={}));var E5=(n,r)=>{switch(r){case Pt.LID:return"lid";case Pt.HOSTED:return"hosted";case Pt.HOSTED_LID:return"hosted.lid";case Pt.WHATSAPP:default:return n}},cr=(n,r,o,i)=>`${n||""}${i?`_${i}`:""}${o?`:${o}`:""}@${r}`,QA=n=>{let r=typeof n=="string"?n.indexOf("@"):-1;if(r<0)return;let o=n.slice(r+1),i=n.slice(0,r),[e,a]=i.split(":"),[A,t]=e.split("_"),s=Pt.WHATSAPP;return o==="lid"?s=Pt.LID:o==="hosted"?s=Pt.HOSTED:o==="hosted.lid"?s=Pt.HOSTED_LID:t&&(s=parseInt(t)),{server:o,user:A,domainType:s,device:a?+a:void 0}},mt=(n,r)=>QA(n)?.user===QA(r)?.user,Wp=n=>n?.endsWith("@bot"),Qt=n=>n?.endsWith("@s.whatsapp.net"),JA=n=>n?.endsWith("@lid"),qC=n=>n?.endsWith("@broadcast"),Nr=n=>n?.endsWith("@g.us"),Ks=n=>n==="status@broadcast",Wg=n=>n?.endsWith("@newsletter"),Ir=n=>n?.endsWith("@hosted"),Wr=n=>n?.endsWith("@hosted.lid"),ave=/^1313555\d{4}$|^131655500\d{2}$/,h5=n=>n&&ave.test(n.split("@")[0])&&n.endsWith("@c.us"),CA=n=>{let r=QA(n);if(!r)return"";let{user:o,server:i}=r;return cr(o,i==="c.us"?"s.whatsapp.net":i)},C5=(n,r)=>{let i=QA(n)?.device||0,{server:e,user:a}=QA(r);return cr(a,e,i)};var u5=(n,r=JC,o=[0])=>{let i=B5(n,r,o);return Buffer.from(i)},B5=({tag:n,attrs:r,content:o},i,e)=>{let{TAGS:a,TOKEN_MAP:A}=i,t=x=>e.push(x&255),s=(x,q,Y=!1)=>{for(let L=0;L>v*8&255)}},g=x=>{for(let q of x)e.push(q)},c=x=>{g([x>>8&255,x&255])},I=x=>g([x>>16&15,x>>8&255,x&255]),d=x=>{if(x>=4294967296)throw new Error("string too large to encode: "+x);x>=1<<20?(t(a.BINARY_32),s(x,4)):x>=256?(t(a.BINARY_20),I(x)):(t(a.BINARY_8),t(x))},B=x=>{let q=Buffer.from(x,"utf-8");d(q.length),g(q)},f=({domainType:x,device:q,user:Y,server:L})=>{typeof q<"u"?(t(a.AD_JID),t(x||0),t(q||0),F(Y)):(t(a.JID_PAIR),Y.length?F(Y):t(a.LIST_EMPTY),F(L))},Q=x=>{switch(x){case"-":return 10;case".":return 11;case"\0":return 15;default:if(x>="0"&&x<="9")return x.charCodeAt(0)-48;throw new Error(`invalid byte for nibble "${x}"`)}},y=x=>{if(x>="0"&&x<="9")return x.charCodeAt(0)-48;if(x>="A"&&x<="F")return 10+x.charCodeAt(0)-65;if(x>="a"&&x<="f")return 10+x.charCodeAt(0)-97;if(x==="\0")return 15;throw new Error(`Invalid hex char "${x}"`)},m=(x,q)=>{if(x.length>a.PACKED_MAX)throw new Error("Too many bytes to pack");t(q==="nibble"?a.NIBBLE_8:a.HEX_8);let Y=Math.ceil(x.length/2);x.length%2!==0&&(Y|=128),t(Y);let L=q==="nibble"?Q:y,v=(K,_)=>L(K)<<4|L(_),V=Math.floor(x.length/2);for(let K=0;K{if(!x||x.length>a.PACKED_MAX)return!1;for(let q of x)if(!(q>="0"&&q<="9")&&q!=="-"&&q!==".")return!1;return!0},N=x=>{if(!x||x.length>a.PACKED_MAX)return!1;for(let q of x)if(!(q>="0"&&q<="9")&&!(q>="A"&&q<="F"))return!1;return!0},F=x=>{if(x==null){t(a.LIST_EMPTY);return}if(x===""){B(x);return}let q=A[x];if(q)typeof q.dict=="number"&&t(a.DICTIONARY_0+q.dict),t(q.index);else if(T(x))m(x,"nibble");else if(N(x))m(x,"hex");else{let Y=QA(x);Y?f(Y):B(x)}},J=x=>{x===0?t(a.LIST_EMPTY):x<256?g([a.LIST_8,x]):(t(a.LIST_16),c(x))};if(!n)throw new Error("Invalid node: tag cannot be undefined");let j=Object.keys(r||{}).filter(x=>typeof r[x]<"u"&&r[x]!==null);J(2*j.length+1+(typeof o<"u"?1:0)),F(n);for(let x of j)typeof r[x]=="string"&&(F(x),F(r[x]));if(typeof o=="string")F(o);else if(Buffer.isBuffer(o)||o instanceof Uint8Array)d(o.length),g(o);else if(Array.isArray(o)){let x=o.filter(q=>q&&(q.tag||Buffer.isBuffer(q)||q instanceof Uint8Array||typeof q=="string"));J(x.length);for(let q of x)B5(q,i,e)}else if(!(typeof o>"u"))throw new Error(`invalid children for header "${n}": ${o} (${typeof o})`);return e};import{promisify as ive}from"util";import{inflate as ove}from"zlib";var nve=ive(ove),sve=async n=>(2&n.readUInt8()?n=await nve(n.slice(1)):n=n.slice(1),n),f5=(n,r,o={index:0})=>{let{DOUBLE_BYTE_TOKENS:i,SINGLE_BYTE_TOKENS:e,TAGS:a}=r,A=P=>{if(o.index+P>n.length)throw new Error("end of stream")},t=()=>{let P=n[o.index];return o.index+=1,P},s=()=>(A(1),t()),g=P=>{A(P);let Z=n.slice(o.index,o.index+P);return o.index+=P,Z},c=P=>g(P).toString("utf-8"),I=(P,Z=!1)=>{A(P);let ge=0;for(let ye=0;ye(A(3),((t()&15)<<16)+(t()<<8)+t()),B=P=>{if(P>=0&&P<16)return P<10?48+P:65+P-10;throw new Error("invalid hex: "+P)},f=P=>{if(P>=0&&P<=9)return 48+P;switch(P){case 10:return 45;case 11:return 46;case 15:return 0;default:throw new Error("invalid nibble: "+P)}},Q=(P,Z)=>{if(P===a.NIBBLE_8)return f(Z);if(P===a.HEX_8)return B(Z);throw new Error("unknown tag: "+P)},y=P=>{let Z=s(),ge="";for(let ye=0;ye<(Z&127);ye++){let Me=s();ge+=String.fromCharCode(Q(P,(Me&240)>>4)),ge+=String.fromCharCode(Q(P,Me&15))}return Z>>7!==0&&(ge=ge.slice(0,-1)),ge},m=P=>P===a.LIST_EMPTY||P===a.LIST_8||P===a.LIST_16,T=P=>{switch(P){case a.LIST_EMPTY:return 0;case a.LIST_8:return s();case a.LIST_16:return I(2);default:throw new Error("invalid tag for list size: "+P)}},N=()=>{let P=x(s()),Z=x(s());if(Z)return(P||"")+"@"+Z;throw new Error("invalid jid pair: "+P+", "+Z)},F=()=>{let P=s(),Z=Number(P),ge=s(),ye=x(s()),Me="s.whatsapp.net";return Z===Pt.LID?Me="lid":Z===Pt.HOSTED?Me="hosted":Z===Pt.HOSTED_LID&&(Me="hosted.lid"),cr(ye,Me,ge)},J=()=>{let P=x(s()),Z=I(2),ge=x(s());return`${P}:${Z}@${ge}`},j=()=>{let P=x(s()),Z=I(2),ge=I(2),ye="interop",Me=o.index;try{ye=x(s())}catch{o.index=Me}return`${ge}-${P}:${Z}@${ye}`},x=P=>{if(P>=1&&P{let Z=[],ge=T(P);for(let ye=0;ye{let ge=i[P];if(!ge)throw new Error(`Invalid double token dict (${P})`);let ye=ge[Z];if(typeof ye>"u")throw new Error(`Invalid double token (${Z})`);return ye},L=T(s()),v=x(s());if(!L||!v.length)throw new Error("invalid node");let V={},K;if(L===0||!v)throw new Error("invalid node");let _=L-1>>1;for(let P=0;P<_;P++){let Z=x(s()),ge=x(s());V[Z]=ge}if(L%2===0){let P=s();if(m(P))K=q(P);else{let Z;switch(P){case a.BINARY_8:Z=g(s());break;case a.BINARY_20:Z=g(d());break;case a.BINARY_32:Z=g(I(4));break;default:Z=x(P);break}K=Z}}return{tag:v,attrs:V,content:K}},Q5=async n=>{let r=await sve(n);return f5(r,JC)};var m5=ze(Tr(),1);var y5=new WeakMap,vA=(n,r)=>{if(!n||!Array.isArray(n.content))return[];let o=y5.get(n);if(!o){o=new Map;for(let i of n.content){let e=o.get(i.tag);e||o.set(i.tag,e=[]),e.push(i)}y5.set(n,o)}return o.get(r)||[]},se=(n,r)=>vA(n,r)[0],Pn=({content:n})=>Array.isArray(n)?n:[],oa=(n,r)=>{let o=se(n,r)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return o},YA=(n,r)=>{let o=se(n,r)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return Buffer.from(o).toString("utf-8");if(typeof o=="string")return o},Zg=(n,r,o)=>{let i=oa(n,r);if(i)return gve(i,o)},li=n=>{let r=se(n,"error");if(r)throw new m5.Boom(r.attrs.text||"Unknown error",{data:+r.attrs.code})},hP=(n,r)=>vA(n,r).reduce((e,{attrs:a})=>(typeof a.name=="string"?e[a.name]=a.value||a.config_value:e[a.config_code]=a.value||a.config_value,e),{});function gve(n,r){let o=0;for(let i=0;i" ".repeat(n);function Xo(n,r=0){if(!n)return n;if(typeof n=="string")return lS(r)+n;if(n instanceof Uint8Array)return lS(r)+Buffer.from(n).toString("hex");if(Array.isArray(n))return n.map(a=>lS(r+1)+Xo(a,r+1)).join(` `);let o=Xo(n.content,r+1),i=`<${n.tag} ${Object.entries(n.attrs||{}).filter(([,a])=>a!==void 0).map(([a,A])=>`${a}='${A}'`).join(" ")}`,e=o?`> ${o} diff --git a/src/channels/weixin/weixin-bridge.mjs b/src/channels/weixin/weixin-bridge.mjs index 185cb78..a7431e6 100644 --- a/src/channels/weixin/weixin-bridge.mjs +++ b/src/channels/weixin/weixin-bridge.mjs @@ -184,7 +184,7 @@ export class WeixinHarnessBridge { status = createWeixinBridgeStatus(), logger = console, replyTimeoutMs = 600_000, - maxMessageChars = 4_000, + maxMessageChars = 1_800, signal, }) { if (!api || typeof api.sendText !== 'function') throw new TypeError('Weixin API is required'); diff --git a/test/channels/weixin/weixin-bridge.test.mjs b/test/channels/weixin/weixin-bridge.test.mjs index 7e98a7a..266826e 100644 --- a/test/channels/weixin/weixin-bridge.test.mjs +++ b/test/channels/weixin/weixin-bridge.test.mjs @@ -150,6 +150,38 @@ test('Weixin bridge hands a native file source to the current Harness turn', asy assert.deepEqual(sent, ['文件已收到']); }); +test('Weixin splits long replies below the iLink text limit', async () => { + const fixture = stateFixture(); + fixture.sessions.set('p2p:owner-user', 'session-long-reply'); + const chunks = []; + const answer = '答案'.repeat(1_000); + const bridge = new WeixinHarnessBridge({ + api: { + sendText: async ({ text }) => { + chunks.push(text); + return { messageId: `weixin-long-${chunks.length}` }; + }, + }, + baseUrl: 'https://ilinkai.weixin.qq.com', + token: 'token', + ownerUserId: 'owner-user', + harness: { + sessionExists: async () => true, + ask: async () => answer, + }, + state: fixture.state, + }); + + const receipt = await bridge.accept(message('weixin-long-reply', '生成一段长回答')); + + assert.ok(chunks.length > 1); + assert.ok(chunks.every((chunk) => chunk.length <= 1_800)); + assert.equal(chunks.join(''), answer); + assert.equal(receipt.providerMessageIds.length, chunks.length); + assert.equal(bridge.status.messagesReplied, 1); + assert.equal(bridge.status.lastMessageError, null); +}); + test('Weixin starts a native-file download before an earlier queued turn finishes', async () => { const fixture = stateFixture(); fixture.sessions.set('p2p:owner-user', 'session-prefetch-file');